using FrameworkDAL.DTO.GBPeriod; using GB5Shared.DTO.Framework.Criteria; using GB5Shared.DTO.Framework.Login; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace FrameworkDAL.CustomCode.GBPeriod { public interface IGBPeriodDAL { Task GetGBPeriod(int gbPeriodId, LoginDTO loginDTO); /// /// Inserts a new GBPeriod record into the database. /// Automatically sets created and modified metadata fields. /// /// The GBPeriod data to insert. /// The current user's login details. /// The number of rows affected (should be 1 if successful). Task SaveGBPeriod(GBPeriodDTO gbPeriodDTO, LoginDTO loginDTO); /// /// Updates an existing GBPeriod record in the database. /// Automatically updates modified metadata fields. /// /// The GBPeriod data to update. /// The current user's login details. /// The number of rows affected (should be 1 if successful). Task UpdateGBPeriod(GBPeriodDTO gbPeriodDTO, LoginDTO loginDTO); /// /// Deletes a GBPeriod record by its unique identifier. /// /// The ID of the GBPeriod to delete. /// The current user's login details. /// /// A message string indicating success or failure of the delete operation. /// Task DeleteGBPeriod(int gbPeriodId, LoginDTO loginDTO); /// /// Retrieves a paginated list of GBPeriod records based on specified filter criteria. /// Can optionally return the total count of records instead of the list. /// /// The starting index of records to fetch (for pagination). /// The maximum number of records to fetch. /// Filter criteria for selecting GBPeriod records. /// The current user's login details. /// If true, returns the total count of matching records instead of the list. /// A JSON string representing either the list of GBPeriod records or the total count. Task GetSelectListGBPeriod(int firstNumber, int maxResult, CriteriaDTO criteriaDTO, LoginDTO loginDTO, bool isCount = false); /// /// Retrieves a paginated list of GBPeriodDetail records (sub-periods) across all GBPeriods. /// Can optionally return the total count of records instead of the list. /// /// The starting index of records to fetch (for pagination). /// The maximum number of records to fetch. /// Filter criteria for selecting GBPeriodDetail records. /// The current user's login details. /// If true, returns the total count of matching records instead of the list. /// A JSON string representing either the list of GBPeriodDetail records or the total count. Task GetSelectListGBPeriodDetail(int firstNumber, int maxResult, CriteriaDTO criteriaDTO, LoginDTO loginDTO, bool isCount = false); /// /// Retrieves the full GBPeriod/GBPeriodDetail picklist (no paging) filtered by the supplied criteria. /// Mirrors the GB4 Gb4PeriodPicklist behavior used by legacy period-selection pickers. /// /// Filter criteria (e.g. PeriodType, SubPeriodName, PeiodFromDate, PeiodToDate). /// The current user's login details. /// A JSON string representing the list of matching GBPeriodDetail picklist records. Task Gb4PeriodPicklist(CriteriaDTO criteriaDTO, LoginDTO loginDTO); } }