From 1353b5571f519ceff844aa2cbb084e41aaebfbc7 Mon Sep 17 00:00:00 2001 From: Chris Chen Date: Wed, 24 Jun 2026 19:23:05 -0700 Subject: [PATCH] feat(finance): add Form 990 report DTOs and permission module Co-Authored-By: Claude Sonnet 4.6 --- API/ROLAC.API/Authorization/Modules.cs | 2 ++ .../DTOs/Finance/Form990ReportDtos.cs | 25 +++++++++++++++++++ API/ROLAC.API/Data/DbSeeder.cs | 9 ++++--- 3 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 API/ROLAC.API/DTOs/Finance/Form990ReportDtos.cs diff --git a/API/ROLAC.API/Authorization/Modules.cs b/API/ROLAC.API/Authorization/Modules.cs index 0202979..fa0ce49 100644 --- a/API/ROLAC.API/Authorization/Modules.cs +++ b/API/ROLAC.API/Authorization/Modules.cs @@ -16,6 +16,7 @@ public static class Modules public const string OfferingSessions = "OfferingSessions"; public const string Ministries = "Ministries"; public const string FinanceDashboard = "FinanceDashboard"; + public const string Form990Report = "Form990Report"; public const string MonthlyStatements = "MonthlyStatements"; public const string ChurchProfile = "ChurchProfile"; public const string Disbursements = "Disbursements"; @@ -37,6 +38,7 @@ public static class Modules OfferingSessions, Ministries, FinanceDashboard, + Form990Report, MonthlyStatements, ChurchProfile, Disbursements, diff --git a/API/ROLAC.API/DTOs/Finance/Form990ReportDtos.cs b/API/ROLAC.API/DTOs/Finance/Form990ReportDtos.cs new file mode 100644 index 0000000..9a97769 --- /dev/null +++ b/API/ROLAC.API/DTOs/Finance/Form990ReportDtos.cs @@ -0,0 +1,25 @@ +namespace ROLAC.API.DTOs.Finance; + +/// One Part IX row: a 990 line split across the three functional columns. +public class FunctionalExpenseRowDto +{ + public string LineCode = ""; + public string Name_en = ""; + public string? Name_zh; + public decimal Program; + public decimal ManagementGeneral; + public decimal Fundraising; + public decimal Total; +} + +/// The full Part IX Statement of Functional Expenses for a date range. +public class FunctionalExpenseStatementDto +{ + public List Rows { get; set; } = []; + public decimal ProgramTotal { get; set; } + public decimal ManagementGeneralTotal { get; set; } + public decimal FundraisingTotal { get; set; } + public decimal GrandTotal { get; set; } + /// Expenses with no explicit 990 mapping (counted under line 24). Prompts mapping cleanup. + public int UnmappedExpenseCount { get; set; } +} diff --git a/API/ROLAC.API/Data/DbSeeder.cs b/API/ROLAC.API/Data/DbSeeder.cs index b1141d4..69b3897 100644 --- a/API/ROLAC.API/Data/DbSeeder.cs +++ b/API/ROLAC.API/Data/DbSeeder.cs @@ -158,13 +158,16 @@ public static class DbSeeder ("finance", Modules.MonthlyStatements, true, true, false, true), ("finance", Modules.ChurchProfile, true, true, false, false), ("finance", Modules.Disbursements, true, true, true, true), + ("finance", Modules.Form990Report, true, false, false, false), // Logs — read-only. System logs are technical (pastor only); audit logs have // governance value, so finance and board members can read them too. ("pastor", Modules.SystemLogs, true, false, false, false), - ("pastor", Modules.AuditLogs, true, false, false, false), - ("finance", Modules.AuditLogs, true, false, false, false), - ("board_member", Modules.AuditLogs, true, false, false, false), + ("pastor", Modules.AuditLogs, true, false, false, false), + ("finance", Modules.AuditLogs, true, false, false, false), + ("board_member", Modules.AuditLogs, true, false, false, false), + ("pastor", Modules.Form990Report, true, false, false, false), + ("board_member", Modules.Form990Report, true, false, false, false), // Ministries — secretary maintains the list; coworker_chair edits; ministry // leaders and pastor read.