using CashLineERP.SharedKernel.IslamicFinance;

namespace CashLineERP.Domain.IslamicFinance.Shariah;

public sealed class IslamicFinanceShariahReviewRecommendation
{
    public IslamicFinanceShariahOutcomeCode Outcome { get; }
    public string? Notes { get; }
    public DateTime ReviewedAtUtc { get; }
    public long ReviewedByUserId { get; }

    public IslamicFinanceShariahReviewRecommendation(
        IslamicFinanceShariahOutcomeCode outcome,
        string? notes,
        DateTime reviewedAtUtc,
        long reviewedByUserId)
    {
        if (reviewedByUserId <= 0)
        {
            throw new InvalidOperationException("Islamic Finance Shariah review recommendation requires a valid reviewer identifier.");
        }

        Outcome = outcome;
        Notes = string.IsNullOrWhiteSpace(notes) ? null : notes.Trim();
        ReviewedAtUtc = reviewedAtUtc;
        ReviewedByUserId = reviewedByUserId;
    }
}
