mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 05:54:26 +01:00
30 lines
865 B
C#
30 lines
865 B
C#
using System;
|
|
|
|
namespace BTCPayServer.Plugins.Subscriptions;
|
|
|
|
public class BalanceTransaction
|
|
{
|
|
public long SubscriberId { get; }
|
|
public decimal Credit { get; }
|
|
public decimal Debit { get; }
|
|
public string Description { get; }
|
|
public string Currency { get; set; }
|
|
public decimal Diff { get; }
|
|
|
|
public BalanceTransaction(long subscriberId, string currency, decimal credit, decimal debit, string description)
|
|
{
|
|
if (credit < 0)
|
|
throw new ArgumentOutOfRangeException(nameof(credit), "Credit must be positive.");
|
|
|
|
if (debit < 0)
|
|
throw new ArgumentOutOfRangeException(nameof(debit), "Debit must be positive.");
|
|
|
|
SubscriberId = subscriberId;
|
|
Credit = credit;
|
|
Debit = debit;
|
|
Description = description;
|
|
Diff = Credit - Debit;
|
|
Currency = currency;
|
|
}
|
|
}
|