using GB5Shared.DTO.Framework.Criteria; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.Framework.ResponseStandard; using GB5Shared.FastEndPoint; using PayRollBLL.PayPeriod; using PayRollSL.EndPoints.Calendar; using static GB5Shared.GB5Constant.Constant; namespace PayRollSL.EndPoints.PayPeriod { public class PayPeriodSelectListApplicableOu : BaseEndpoint { private readonly IPayPeriodBLL _payPeriodBLL; public PayPeriodSelectListApplicableOu(IPayPeriodBLL IPayPeriodBLL) { _payPeriodBLL = IPayPeriodBLL; } public override void Configure() { Post("/PayPeriod/SelectListApplicableOu"); AllowAnonymous(); } protected override async Task> ExecuteAsync(PayPeriodSelectListApplicableOuParameters req, LoginDTO LoginDTO, CancellationToken ct) { try { var Result = await _payPeriodBLL.GetSelectListPayPeriodApplicableOu(req.FirstNumber , req.MaxResult , req.CriteriaDTO, LoginDTO!); return await GB5Shared.ResponseStandard.Response.CreateSuccessResponse(Result, CacheKeyLevel.NOT_REQUIRED, LoginDTO); } catch (Exception ex) { return await GB5Shared.ResponseStandard.Response.CreateExceptionError(ex, CacheKeyLevel.NOT_REQUIRED, LoginDTO, ex.Message, 500); } } public record PayPeriodSelectListApplicableOuParameters( [property: FastEndpoints.QueryParam] int FirstNumber, [property: FastEndpoints.QueryParam] int MaxResult, [property: FastEndpoints.FromBody] CriteriaDTO CriteriaDTO, [property: FastEndpoints.FromHeader] LoginDTO Login ); } }