namespace CashLineERP.Domain.IslamicFinance.Requests;

public sealed class IslamicFinanceRequestAmount
{
    public string TransactionCurrencyCode { get; }
    public decimal RequestedAmount { get; }

    public IslamicFinanceRequestAmount(string transactionCurrencyCode, decimal requestedAmount)
    {
        var normalizedCurrencyCode = transactionCurrencyCode?.Trim().ToUpperInvariant();
        if (string.IsNullOrWhiteSpace(normalizedCurrencyCode))
        {
            throw new InvalidOperationException("Islamic Finance request transaction currency code is required.");
        }

        if (requestedAmount <= 0m)
        {
            throw new InvalidOperationException("Islamic Finance request amount must be greater than zero.");
        }

        TransactionCurrencyCode = normalizedCurrencyCode;
        RequestedAmount = requestedAmount;
    }
}
