@@ -5,12 +5,9 @@ public class Expense : SoftDeleteEntity, IAuditable
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int MinistryId { get; set; }
|
||||
public int CategoryGroupId { get; set; }
|
||||
public int SubCategoryId { get; set; }
|
||||
public string Type { get; set; } = "StaffReimbursement"; // VendorPayment | StaffReimbursement
|
||||
public string Status { get; set; } = "Draft"; // see state machine
|
||||
public string? FunctionalClass { get; set; } // null = inherit Ministry.DefaultFunctionalClass
|
||||
public decimal Amount { get; set; }
|
||||
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; }
|
||||
@@ -26,8 +23,7 @@ public class Expense : SoftDeleteEntity, IAuditable
|
||||
public DateTimeOffset? PaidAt { get; set; }
|
||||
public string? PaidBy { get; set; }
|
||||
|
||||
public Ministry? Ministry { get; set; }
|
||||
public ExpenseCategoryGroup? CategoryGroup { get; set; }
|
||||
public ExpenseSubCategory? SubCategory { get; set; }
|
||||
public Member? Member { get; set; }
|
||||
public Ministry? Ministry { get; set; }
|
||||
public Member? Member { get; set; }
|
||||
public List<ExpenseLine> Lines { get; set; } = new();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
using ROLAC.API.Entities.Base;
|
||||
namespace ROLAC.API.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// One category line of an <see cref="Expense"/>. A single invoice/payment can span
|
||||
/// multiple expense categories, so the category / amount / functional-class axis lives
|
||||
/// here per line; the Expense header keeps payment-level info and a denormalized total.
|
||||
/// Lines are wholly owned by the header (replaced as a set on update, like CheckLine).
|
||||
/// </summary>
|
||||
public class ExpenseLine : AuditableEntity
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int ExpenseId { get; set; }
|
||||
public int CategoryGroupId { get; set; }
|
||||
public int SubCategoryId { get; set; }
|
||||
public string? FunctionalClass { get; set; } // null = inherit Ministry.DefaultFunctionalClass
|
||||
public decimal Amount { get; set; }
|
||||
public string? Description { get; set; } // optional per-line note (header description is authoritative for check printing)
|
||||
|
||||
public Expense? Expense { get; set; }
|
||||
public ExpenseCategoryGroup? CategoryGroup { get; set; }
|
||||
public ExpenseSubCategory? SubCategory { get; set; }
|
||||
}
|
||||
@@ -2,7 +2,7 @@ namespace ROLAC.API.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// The three IRS Form 990 Part IX functional-expense columns. Stored verbatim in
|
||||
/// Ministry.DefaultFunctionalClass and Expense.FunctionalClass.
|
||||
/// Ministry.DefaultFunctionalClass and ExpenseLine.FunctionalClass.
|
||||
/// </summary>
|
||||
public static class FunctionalClasses
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user