using EntitlementBLL.Demo; using FastEndpoints; using GB5Shared.Authorization; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.Framework.ResponseStandard; using GB5Shared.FastEndPoint; using static GB5Shared.GB5Constant.Constant; namespace EntitlementSL.Endpoints.Demo; // Internal (ops/CS) catalog browse — every registered demo variant. Also the source list a // landing-page/registration flow's own variant-picker would resolve against. [MenuRights("entdemo", RightOperation.View)] public class GetDemoVariantList : BaseEndpoint> { private readonly IDemoCatalogBLL _DemoCatalogBLL; public GetDemoVariantList(IDemoCatalogBLL demoCatalogBLL) => _DemoCatalogBLL = demoCatalogBLL; public override void Configure() { Get("/Demo/GetDemoVariantList"); AllowAnonymous(); } public record Params([property: FromHeader] string Login); protected override string? GetCacheKey(Params req, LoginDTO loginDTO) => null; protected override async Task> ExecuteAsync(Params req, LoginDTO loginDTO, CancellationToken ct) { var result = await _DemoCatalogBLL.GetVariantListAsync(ct); return await GB5Shared.ResponseStandard.Response.CreateSuccessResponse(result, CacheKeyLevel.NOT_REQUIRED, loginDTO); } }