using System.Threading.Tasks; using AccountsDAL.DTO.AccountsReports; using GB5Shared.DTO.Framework.Login; namespace AccountsBLL.AccountReports { public interface IAccountReportAccessControlBLL { // Validates the parsed criteria and requested page size against: // - a mandatory PeriodFromDate/PeriodToDate presence check (no implicit "since forever"), // - MROLEVSMENU.DaysLimit/RecordsLimit for (LoginDTO.RoleId, menuId), when a row exists, // - MUSERACCESSRIGHTS.NOOFREADPERIOD for the current user, when set. // Throws with an ErrorResponse.* message on violation. Menu/period lookups that find no row // are treated as "no limit configured" (fail-open) rather than blocking the report outright — // see AccountReportAccessControlBLL for the reasoning. Task EnforceAsync(AccountReportCriteria criteria, int maxResult, int menuId, LoginDTO loginDTO); // Sibling check for as-of-date reports (Outstanding/Ageing) that have no PeriodFromDate/ToDate // range at all — only AccountReportCriteria.AsOnDate. Skips the range-presence/inversion checks // (meaningless here), still enforces MROLEVSMENU.RecordsLimit and, when NOOFREADPERIOD=1, // that AsOnDate isn't before the user's work-period start. DaysLimit is not applicable (no // range to measure) and is intentionally not enforced by this method. Task EnforceForAsOnDateAsync(AccountReportCriteria criteria, int maxResult, int menuId, LoginDTO loginDTO); } }