using GB5Shared.DTO.Framework.Login; namespace AccountsBLL.Warehouse { public interface IWarehouseFactPostingBLL { // Posts the given fact table (any FACTID sharing FFINANCE's family — OU+Day grain, // TVOUCHER/MACCOUNT/MACCOUNTGROUP source, nature-bucket aggregation) for [dateFrom, dateTo] // across ouIds (defaults to every active OU when null/empty). Returns per-OU success/ // failure so a caller (e.g. the JobEngine webhook endpoint) can report partial failure // without losing the OUs that succeeded. Task PostFactAsync( int factId, DateTime dateFrom, DateTime dateTo, List? ouIds, LoginDTO loginDTO, CancellationToken ct); // Posts ALL registered fact tables (any POSTINGMODE) for [dateFrom, dateTo], across all // active OUs. Intended for the nightly batch run. Facts execute sequentially to avoid // flooding the DB; OUs within each fact run concurrently (same as PostFactAsync). // Returns one entry per FactId so partial failure is visible per fact. Task> PostAllFactsAsync( DateTime dateFrom, DateTime dateTo, LoginDTO loginDTO, CancellationToken ct); } public class WarehouseFactPostingResultDTO { public List SucceededOuIds { get; set; } = new(); public Dictionary FailedOuIds { get; set; } = new(); // OUID -> error message } }