using AccountsDAL.CustomCode.AccountReports.RatioAnalysis; using AccountsDAL.DTO.AccountsReports; using GB5Shared.DTO.Framework.Login; using GB5Shared.Telemetry; namespace AccountsBLL.AccountReports.RatioAnalysis { public class RatioAnalysisReportBLL : IRatioAnalysisReportBLL { private readonly IRatioAnalysisReportDAL _dal; public RatioAnalysisReportBLL(IRatioAnalysisReportDAL dal) { _dal = dal; } // Deliberately does not call AccountReportAccessControlBLL.EnforceAsync/ // EnforceForAsOnDateAsync — those are built around the TVOUCHER-report family's // DynamicFilter/OU-access-rights-join assumptions, which don't apply to a report sourced // from the already-posted FFINANCE fact table. OU access is instead enforced directly in // RatioAnalysisReportDAL (accessible-OU intersection, throws on an out-of-scope request). public async Task> GetRatioAnalysisDashboard( DateTime fromDate, DateTime toDate, List? ouIds, int ouGroupId, LoginDTO loginDTO, CancellationToken ct) { if (fromDate == default || toDate == default) throw new InvalidOperationException("A from date and to date are required for this report."); if (fromDate > toDate) throw new InvalidOperationException("A from date and to date are required for this report, and from date must not be after to date."); GB5Trace.Step("ratio-analysis-dashboard", new { fromDate, toDate, ouIds, ouGroupId }); return await _dal.GetRatioAnalysisDashboard(fromDate, toDate, ouIds, ouGroupId, loginDTO, ct).ConfigureAwait(false); } } }