using FastEndpoints; using GB5Shared.DTO.Framework.Criteria; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.Framework.ResponseStandard; using GB5Shared.FastEndPoint; using MMBLL.Register; using static GB5Shared.GB5Constant.Constant; namespace MMSL.EndPoints.Register { // Route matches the legacy GB4 Register.svc/OUWiseMonthlyGSTDashboard endpoint — // MWEBSERVICE -1399991971 is repointed at this route (see the MM migration script). public class GetOUWiseMonthlyGSTDashboard : BaseEndpoint> { private readonly IRegisterBLL _RegisterBLL; public GetOUWiseMonthlyGSTDashboard(IRegisterBLL registerBLL) { _RegisterBLL = registerBLL; } public override void Configure() { Post("/Register/OUWiseMonthlyGSTDashboard"); AllowAnonymous(); } public record GetOUWiseMonthlyGSTDashboardParameters( [property: FromHeader] string Login, [property: FromBody] CriteriaDTO CriteriaDTO ); protected override string? GetCacheKey(GetOUWiseMonthlyGSTDashboardParameters req, LoginDTO login) => null; protected override async Task> ExecuteAsync(GetOUWiseMonthlyGSTDashboardParameters req, LoginDTO LoginDTO, CancellationToken ct) { try { var dashboard = await _RegisterBLL.GetOUWiseMonthlyGSTDashboard(req.CriteriaDTO, LoginDTO!, ct); return await GB5Shared.ResponseStandard.Response.CreateSuccessResponse(dashboard, CacheKeyLevel.NOT_REQUIRED, LoginDTO); } catch (Exception ex) { return await GB5Shared.ResponseStandard.Response .CreateExceptionError(ex, CacheKeyLevel.NOT_REQUIRED, LoginDTO, ex.Message, 500); } } } }