using CashLineERP.Domain.Common;

namespace CashLineERP.Domain.Finance;

public sealed class GeneralLedgerJournalLine : Entity
{
    public long Id { get; private set; }

    public long GeneralLedgerJournalId { get; private set; }

    public int LineNumber { get; private set; }

    public long GeneralLedgerAccountId { get; private set; }

    public long? BranchId { get; private set; }

    public long? DepartmentId { get; private set; }

    public long? PartyId { get; private set; }

    public long? ItemId { get; private set; }

    public decimal DebitAmount { get; private set; }

    public decimal CreditAmount { get; private set; }

    public string? CurrencyCode { get; private set; }

    public decimal FxRate { get; private set; } = 1m;

    public string? LineDescription { get; private set; }

    public GeneralLedgerJournalLine(
        long generalLedgerJournalId,
        int lineNumber,
        long generalLedgerAccountId,
        long? branchId,
        long? departmentId,
        long? partyId,
        long? itemId,
        decimal debitAmount,
        decimal creditAmount,
        string? currencyCode,
        decimal fxRate,
        string? lineDescription)
    {
        GeneralLedgerJournalId = generalLedgerJournalId;
        LineNumber = lineNumber;
        GeneralLedgerAccountId = generalLedgerAccountId;
        BranchId = branchId;
        DepartmentId = departmentId;
        PartyId = partyId;
        ItemId = itemId;
        DebitAmount = debitAmount;
        CreditAmount = creditAmount;
        CurrencyCode = currencyCode;
        FxRate = fxRate;
        LineDescription = lineDescription;
    }

    private GeneralLedgerJournalLine()
    {
    }
}
