From c5405a95c396d5adecced1745b93b698dbd510b5 Mon Sep 17 00:00:00 2001 From: Chris Chen Date: Thu, 25 Jun 2026 14:55:50 -0700 Subject: [PATCH] feat(expense-snapshot): add ExpenseSnapshot + ExpenseSnapshotLine entities --- API/ROLAC.API/Entities/ExpenseSnapshot.cs | 22 +++++++++++++++++++ API/ROLAC.API/Entities/ExpenseSnapshotLine.cs | 18 +++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 API/ROLAC.API/Entities/ExpenseSnapshot.cs create mode 100644 API/ROLAC.API/Entities/ExpenseSnapshotLine.cs diff --git a/API/ROLAC.API/Entities/ExpenseSnapshot.cs b/API/ROLAC.API/Entities/ExpenseSnapshot.cs new file mode 100644 index 0000000..5d28cde --- /dev/null +++ b/API/ROLAC.API/Entities/ExpenseSnapshot.cs @@ -0,0 +1,22 @@ +using ROLAC.API.Entities.Base; +namespace ROLAC.API.Entities; + +/// +/// 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). +/// +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 Lines { get; set; } = new(); +} diff --git a/API/ROLAC.API/Entities/ExpenseSnapshotLine.cs b/API/ROLAC.API/Entities/ExpenseSnapshotLine.cs new file mode 100644 index 0000000..9724bae --- /dev/null +++ b/API/ROLAC.API/Entities/ExpenseSnapshotLine.cs @@ -0,0 +1,18 @@ +using ROLAC.API.Entities.Base; +namespace ROLAC.API.Entities; + +/// One category line of an , mirroring . +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; } +}