namespace CashLineERP.Domain.IslamicFinance.Requests;

public sealed class IslamicFinanceRequestSourceReference
{
    public string SourceDocumentType { get; }
    public long SourceDocumentId { get; }

    public IslamicFinanceRequestSourceReference(string sourceDocumentType, long sourceDocumentId)
    {
        if (string.IsNullOrWhiteSpace(sourceDocumentType))
        {
            throw new InvalidOperationException("Islamic Finance request source document type is required.");
        }

        if (sourceDocumentId <= 0)
        {
            throw new InvalidOperationException("Islamic Finance request source document id must be a valid positive identifier.");
        }

        SourceDocumentType = sourceDocumentType.Trim().ToUpperInvariant();
        SourceDocumentId = sourceDocumentId;
    }
}
