namespace Distribution.Models
{
public enum GlPostingStatus { Pending, Posted, Failed }
///
/// One row per journal entry Distribution sends to the General Ledger service. (Event, SourceId) is unique,
/// so a business event can never be posted twice; Failed rows keep their payload and can be retried.
///
public class GlPostingLog : Template
{
public string Event { get; set; } = string.Empty;
public Guid SourceId { get; set; }
public string Reference { get; set; } = string.Empty;
public GlPostingStatus Status { get; set; } = GlPostingStatus.Pending;
/// The journal entry body (without periodId, which is resolved from EntryDate at send time).
public string PayloadJson { get; set; } = string.Empty;
public string? GlJournalNo { get; set; }
public string? Error { get; set; }
public int Attempts { get; set; }
public DateTime? LastAttemptAt { get; set; }
}
}