This commit is contained in:
Chris Chen
2026-06-20 17:51:33 -07:00
parent f55807fa7d
commit 3558c67fd7
55 changed files with 3140 additions and 85 deletions
+43
View File
@@ -0,0 +1,43 @@
using ROLAC.API.Entities.Base;
namespace ROLAC.API.Entities;
/// <summary>
/// A disbursement check issued to a single payee, bundling one or more approved
/// expenses (its <see cref="Lines"/>). The payee name/address are snapshotted at
/// issue time so the printed check is reproducible even if member data later changes.
/// </summary>
public class Check : SoftDeleteEntity
{
public int Id { get; set; }
public string CheckNumber { get; set; } = null!;
public DateOnly CheckDate { get; set; }
public decimal Amount { get; set; } // sum of line amounts
public string PayeeType { get; set; } = "Vendor"; // Vendor | Member
public int? MemberId { get; set; } // set when PayeeType == Member
public string PayeeName { get; set; } = null!; // snapshot
public string? PayeeAddress { get; set; } // snapshot
public string? PayeeCity { get; set; }
public string? PayeeState { get; set; }
public string? PayeeZip { get; set; }
public string Status { get; set; } = "Issued"; // Issued | Voided
public string? Memo { get; set; }
public string IssuedBy { get; set; } = null!;
public DateTimeOffset IssuedAt { get; set; }
public string? VoidReason { get; set; }
public DateTimeOffset? VoidedAt { get; set; }
public string? VoidedBy { get; set; }
// Receipt e-signature: payee signs in-app on hand-off. "Signed" is derived as
// ReceiptSignedAt != null.
public string? ReceiptSignatureBlobPath { get; set; }
public string? ReceiptSignedName { get; set; }
public DateTimeOffset? ReceiptSignedAt { get; set; }
public string? ReceiptCapturedBy { get; set; }
public Member? Member { get; set; }
public ICollection<CheckLine> Lines { get; set; } = [];
}
+18
View File
@@ -0,0 +1,18 @@
using ROLAC.API.Entities.Base;
namespace ROLAC.API.Entities;
/// <summary>
/// One expense covered by a <see cref="Check"/>. Amount/Description are snapshotted
/// at issue time for the printed ledger stub; ExpenseId links back to the source expense.
/// </summary>
public class CheckLine : AuditableEntity
{
public int Id { get; set; }
public int CheckId { get; set; }
public int ExpenseId { get; set; }
public decimal Amount { get; set; } // snapshot of expense amount
public string Description { get; set; } = null!; // snapshot of expense description
public Check? Check { get; set; }
public Expense? Expense { get; set; }
}
+26
View File
@@ -0,0 +1,26 @@
using ROLAC.API.Entities.Base;
namespace ROLAC.API.Entities;
/// <summary>
/// Singleton (Id == 1) holding the issuing church's identity, bank details, and the
/// running check-number counter used when disbursing checks. Seeded on startup.
/// </summary>
public class ChurchProfile : AuditableEntity
{
public int Id { get; set; }
public string Name { get; set; } = null!;
public string? Address { get; set; }
public string? City { get; set; }
public string? State { get; set; }
public string? ZipCode { get; set; }
public string? BankName { get; set; }
public string? BankAccountNumber { get; set; }
public string? BankRoutingNumber { get; set; }
/// <summary>Next check number to allocate; consumed (++) when a check is issued.</summary>
public int NextCheckNumber { get; set; } = 1001;
// Npgsql system column used as an optimistic-concurrency token so two simultaneous
// disbursement runs can't allocate the same check number. Mapped via IsRowVersion().
public uint xmin { get; set; }
}