feat(expense-snapshot): add ExpenseSnapshot + ExpenseSnapshotLine entities
This commit is contained in:
@@ -0,0 +1,22 @@
|
|||||||
|
using ROLAC.API.Entities.Base;
|
||||||
|
namespace ROLAC.API.Entities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A reusable template of a vendor payment. Lets finance save a recurring fixed expense
|
||||||
|
/// (rent, internet, a fixed catered-meal cost) and re-apply it later, pre-filling everything
|
||||||
|
/// except the ExpenseDate. Shared church-wide; the creator is the auditable CreatedBy.
|
||||||
|
/// Lines are wholly owned by the header (replaced as a set on update, like ExpenseLine).
|
||||||
|
/// </summary>
|
||||||
|
public class ExpenseSnapshot : SoftDeleteEntity
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public string Name { get; set; } = null!; // user label, e.g. "Monthly Rent — Landlord X"
|
||||||
|
public int MinistryId { get; set; }
|
||||||
|
public string Description { get; set; } = null!;
|
||||||
|
public string? VendorName { get; set; }
|
||||||
|
public string? CheckNumber { get; set; }
|
||||||
|
public string? Notes { get; set; }
|
||||||
|
|
||||||
|
public Ministry? Ministry { get; set; }
|
||||||
|
public List<ExpenseSnapshotLine> Lines { get; set; } = new();
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using ROLAC.API.Entities.Base;
|
||||||
|
namespace ROLAC.API.Entities;
|
||||||
|
|
||||||
|
/// <summary>One category line of an <see cref="ExpenseSnapshot"/>, mirroring <see cref="ExpenseLine"/>.</summary>
|
||||||
|
public class ExpenseSnapshotLine : AuditableEntity
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public int SnapshotId { 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; }
|
||||||
|
|
||||||
|
public ExpenseSnapshot? Snapshot { get; set; }
|
||||||
|
public ExpenseCategoryGroup? CategoryGroup { get; set; }
|
||||||
|
public ExpenseSubCategory? SubCategory { get; set; }
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user