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.Domain; public class GetDomainProgress : BaseEndpoint> { private readonly IDomainItemBLL _DomainItemBLL; public GetDomainProgress(IDomainItemBLL domainItemBLL) => _DomainItemBLL = domainItemBLL; public override void Configure() { Get("/IDMS/Domain/GetDomainProgress"); 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.OBJECTIDMSDELIVERYITEM, CacheKeyLevel.NOT_REQUIRED, loginDTO); protected override async Task> ExecuteAsync(Params req, LoginDTO loginDTO, CancellationToken ct) { var result = await _DomainItemBLL.GetDomainProgressAsync(req.EngagementId, loginDTO, ct); return await GB5Shared.ResponseStandard.Response.CreateSuccessResponse(result, CacheKeyLevel.NOT_REQUIRED, loginDTO); } }