import { formatCurrency } from "../utils/utils";
export var PaymentBalanceTxnType;
(function (PaymentBalanceTxnType) {
    PaymentBalanceTxnType["payment"] = "payment";
    PaymentBalanceTxnType["paymentFee"] = "payment_fee";
    PaymentBalanceTxnType["payout"] = "payout";
    PaymentBalanceTxnType["refund"] = "refund";
    PaymentBalanceTxnType["feeRefund"] = "fee_refund";
    PaymentBalanceTxnType["dispute"] = "dispute";
    PaymentBalanceTxnType["disputeFee"] = "dispute_fee";
    PaymentBalanceTxnType["disputeFeeRefund"] = "dispute_fee_refund";
    PaymentBalanceTxnType["disputeRefund"] = "dispute_refund";
    PaymentBalanceTxnType["applicationFeeReturned"] = "application_fee_returned";
})(PaymentBalanceTxnType || (PaymentBalanceTxnType = {}));
export class PaymentBalanceTransaction {
    constructor(balanceTransaction) {
        this.id = balanceTransaction.id;
        this.amount = balanceTransaction.amount;
        this.balance = balanceTransaction.balance;
        this.currency = balanceTransaction.currency;
        this.financial_transaction_id = balanceTransaction.financial_transaction_id;
        this.payment_id = balanceTransaction.payment_id;
        this.payment_balance_txn_type = balanceTransaction.payment_balance_txn_type;
        this.source_id = balanceTransaction.source_id;
        this.source_type = balanceTransaction.source_type;
        this.created_at = balanceTransaction.created_at;
        this.updated_at = balanceTransaction.updated_at;
    }
    get displayTransactionId() {
        if (this.payment_balance_txn_type === PaymentBalanceTxnType.paymentFee) {
            return '--';
        }
        else if (this.payment_balance_txn_type === PaymentBalanceTxnType.applicationFeeReturned) {
            return '--';
        }
        else {
            return this.source_id;
        }
        ;
    }
    formattedPaymentAmount(amount) {
        return formatCurrency(amount, this.currency);
    }
}
;
