using ROLAC.API.Entities.Base;
namespace ROLAC.API.Entities;

public class Expense : SoftDeleteEntity, IAuditable
{
    public int      Id              { get; set; }
    public int      MinistryId      { get; set; }
    public string   Type            { get; set; } = "StaffReimbursement"; // VendorPayment | StaffReimbursement
    public string   Status          { get; set; } = "Draft";             // see state machine
    public decimal  Amount          { get; set; }   // denormalized total = SUM(Lines.Amount), recomputed server-side
    public string   Description     { get; set; } = null!;
    public string?  VendorName      { get; set; }
    public int?     MemberId        { get; set; }
    public int?     PayeeId         { get; set; }   // 1099 recipient attribution (header-level)
    public string?  CheckNumber     { get; set; }
    public DateOnly ExpenseDate     { get; set; }
    public string?  ReceiptBlobPath { get; set; }
    public string?  Notes           { get; set; }
    public string?        SubmittedBy { get; set; }
    public DateTimeOffset? SubmittedAt { get; set; }
    public string?        ReviewedBy  { get; set; }
    public DateTimeOffset? ReviewedAt  { get; set; }
    public string?        ReviewNotes { get; set; }
    public DateTimeOffset? PaidAt      { get; set; }
    public string?        PaidBy      { get; set; }

    public Ministry?         Ministry { get; set; }
    public Member?           Member   { get; set; }
    public Payee1099?        Payee    { get; set; }
    public List<ExpenseLine> Lines    { get; set; } = new();
}
