using FastEndpoints; using FrameworkBLL.GOP; using GB5Shared.DTO.Framework.Criteria; using GB5Shared.DTO.Framework.Login; using GB5Shared.FastEndPoint; using static GB5Shared.GB5Constant.Constant; namespace FrameworkSL.Endpoints.GOP.Mapping { // Returns MappingDefinitionId / MapperCode / MapperName for all active mapping // definitions — the picker-search endpoint used by gb-newpicklist, distinct from // GetMappingDefinitionList's plain full list. public class GetSelectListMapping : BaseEndpoint> { private readonly IMappingBLL _Bll; public GetSelectListMapping(IMappingBLL bll) => _Bll = bll; public override void Configure() { Post("/Mapping/GetSelectListMapping"); AllowAnonymous(); } public record Params( [property: FromHeader] string Login, [property: FromBody] CriteriaDTO CriteriaDTO ); protected override string? GetCacheKey(Params req, LoginDTO loginDTO) => null; protected override async Task> ExecuteAsync( Params req, LoginDTO loginDTO, CancellationToken ct) { var result = await _Bll.GetSelectListMapping(req.CriteriaDTO, loginDTO, ct); return await GB5Shared.ResponseStandard.Response .CreateSuccessResponse(result, CacheKeyLevel.NOT_REQUIRED, loginDTO); } } }