From f1de8d7ab786cb8aa67eec0e4ade9a7bd1b47ef5 Mon Sep 17 00:00:00 2001 From: Chris Chen Date: Thu, 25 Jun 2026 14:58:53 -0700 Subject: [PATCH] feat(expense-snapshot): add snapshot DTOs --- .../DTOs/Expense/ExpenseSnapshotDtos.cs | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 API/ROLAC.API/DTOs/Expense/ExpenseSnapshotDtos.cs diff --git a/API/ROLAC.API/DTOs/Expense/ExpenseSnapshotDtos.cs b/API/ROLAC.API/DTOs/Expense/ExpenseSnapshotDtos.cs new file mode 100644 index 0000000..fc64f5c --- /dev/null +++ b/API/ROLAC.API/DTOs/Expense/ExpenseSnapshotDtos.cs @@ -0,0 +1,42 @@ +using System.ComponentModel.DataAnnotations; +namespace ROLAC.API.DTOs.Expense; + +public class ExpenseSnapshotLineDto +{ + public int CategoryGroupId { get; set; } + public string CategoryGroupName { get; set; } = ""; + public int SubCategoryId { get; set; } + public string SubCategoryName { get; set; } = ""; + public string? FunctionalClass { get; set; } + public decimal Amount { get; set; } + public string? Description { get; set; } +} + +public class ExpenseSnapshotDto +{ + public int Id { get; set; } + public string Name { get; set; } = ""; + public int MinistryId { get; set; } + public string MinistryName { get; set; } = ""; + public string Description { get; set; } = ""; + public string? VendorName { get; set; } + public string? CheckNumber { get; set; } + public string? Notes { get; set; } + public decimal TotalAmount { get; set; } // sum of line amounts (list hint) + public int LineCount { get; set; } + public string? CreatedByName { get; set; } // resolved Member full name, email fallback + public DateTimeOffset CreatedAt { get; set; } + public List Lines { get; set; } = new(); +} + +public class CreateExpenseSnapshotRequest +{ + [Required, MaxLength(150)] public string Name { get; set; } = ""; + [Required] public int MinistryId { get; set; } + [Required, MinLength(1)] public List Lines { get; set; } = new(); + [Required, MaxLength(500)] public string Description { get; set; } = ""; + [MaxLength(200)] public string? VendorName { get; set; } + [MaxLength(50)] public string? CheckNumber { get; set; } + public string? Notes { get; set; } +} +public class UpdateExpenseSnapshotRequest : CreateExpenseSnapshotRequest { }