feat(expense-snapshot): add snapshot DTOs

This commit is contained in:
Chris Chen
2026-06-25 14:58:53 -07:00
parent 5957d0f45e
commit f1de8d7ab7
@@ -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<ExpenseSnapshotLineDto> 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<ExpenseLineInput> 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 { }