using FastEndpoints; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.Framework.ResponseStandard; using GB5Shared.FastEndPoint; using IDMSBLL.Interfaces; using static GB5Shared.GB5Constant.Constant; namespace IDMSSL.Endpoints.SignOff; public class GetSignOffRegister : BaseEndpoint> { private readonly ISignOffBLL _SignOffBLL; public GetSignOffRegister(ISignOffBLL signOffBLL) => _SignOffBLL = signOffBLL; public override void Configure() { Get("/IDMS/SignOff/GetSignOffRegister"); AllowAnonymous(); } public record Params( [property: FromHeader] string Login, [property: QueryParam] int EngagementId ); protected override string? GetCacheKey(Params req, LoginDTO loginDTO) => KeyGenerator.KeyGeneration(req.EngagementId, EntityConstant.OBJECTIDMSSIGNOFF, CacheKeyLevel.NOT_REQUIRED, loginDTO); protected override async Task> ExecuteAsync(Params req, LoginDTO loginDTO, CancellationToken ct) { var result = await _SignOffBLL.GetSignOffsByEngagementAsync(req.EngagementId, loginDTO, ct); return await GB5Shared.ResponseStandard.Response.CreateSuccessResponse(result, CacheKeyLevel.NOT_REQUIRED, loginDTO); } }