using FastEndpoints; using GB5Shared.DTO.Framework.Criteria; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.Framework.ResponseStandard; using GB5Shared.FastEndPoint; using RecruitmentBLL.Interview; using static GB5Shared.GB5Constant.Constant; namespace RecruitmentSL.Endpoints.Interview { public class GetSelectListInterview : BaseEndpoint> { private readonly IInterviewBLL _InterviewBLL; public GetSelectListInterview(IInterviewBLL InterviewBLL) { _InterviewBLL = InterviewBLL; } public override void Configure() { Post("/Interview/GetSelectListInterview"); // Roles("User") throws 500 here — no host in this repo configures AddAuthentication, // so FastEndpoints has no scheme to challenge against (repo-wide gap, not specific to // this endpoint — see PayRollSL/EndPoints/Employee/GetHRMSDashboard.cs for the same // documented finding). AllowAnonymous matches every other endpoint in this SL module. AllowAnonymous(); } public record GetSelectListInterviewParameters( [property: FromHeader] string Login, [property: FromBody] CriteriaDTO CriteriaDTO ); protected override async Task> ExecuteAsync(GetSelectListInterviewParameters req, LoginDTO LoginDTO, CancellationToken ct) { try { var Result = await _InterviewBLL.GetSelectListInterview(req.CriteriaDTO, LoginDTO!, ct); return await GB5Shared.ResponseStandard.Response.CreateSuccessResponse(Result, CacheKeyLevel.NOT_REQUIRED, LoginDTO); } catch (Exception ex) { return await GB5Shared.ResponseStandard.Response.CreateExceptionError(ex, CacheKeyLevel.NOT_REQUIRED, LoginDTO, ex.Message, 500); } } } }