using AccountsBLL.AccountReports.AccountRegister; using AccountsBLL.Instrument; using AccountsDAL.DTO.AccountsReports; using AccountsDAL.DTO.Instrument; using AccountsSL.EndPoints.Instrument; using FastEndpoints; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.Framework.ResponseStandard; using GB5Shared.DTO.Report; using GB5Shared.FastEndPoint; using static GB5Shared.GB5Constant.Constant; namespace AccountsSL.EndPoints.AccountReports { public class AccountRegisterReport: BaseReportEndpoint { private readonly IAccountRegisterReportBLL _accountRegisterReportBLL; public AccountRegisterReport(IAccountRegisterReportBLL accountRegisterReportBLL) { _accountRegisterReportBLL = accountRegisterReportBLL; } public override void Configure() { Post("/AccountReports/AccountRegisterDetailReport"); AllowAnonymous(); } public record AccountRegisterDetailReportParameter( [property: FromHeader] string Login, [property: FromBody] ReportCallingDTO ReportCallingDTO, [property: QueryParam]int FirstNumber, [property: QueryParam]int MaxResult, [property: QueryParam]int MenuId ); // Report export path // Report export protected override IAsyncEnumerable< AccountRegisterDetailReportDTO> ExecuteReportAsync( AccountRegisterDetailReportParameter req, LoginDTO login, CancellationToken ct) { return _accountRegisterReportBLL .GetAccountRegisterDetailReportStream( req.FirstNumber, req.MaxResult, req.ReportCallingDTO.CriteriaDTO, null, req.MenuId, login, ct); } // UI grid protected override async Task< ResponseStandardDTO> ExecutePagedAsync( AccountRegisterDetailReportParameter req, LoginDTO login, CancellationToken ct) { var result = await _accountRegisterReportBLL .GetAccountRegisterDetailReport( req.FirstNumber, req.MaxResult, req.ReportCallingDTO.CriteriaDTO, null, req.MenuId, login, ct) .ConfigureAwait(false); return await GB5Shared.ResponseStandard .Response .CreateSuccessResponse( result, CacheKeyLevel.NOT_REQUIRED, login); } } }