using FastEndpoints; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.Framework.ResponseStandard; using GB5Shared.DTO.Report; using GB5Shared.FastEndPoint; using RecruitmentBLL.Reports; using RecruitmentDAL.DTO.Reports; using static GB5Shared.GB5Constant.Constant; namespace RecruitmentSL.EndPoints.RecruitmentReports { // Recruiter workload/productivity dashboard (Phase 5 of the Recruitment build-out plan — see // /Users/venkatv/.claude/plans/can-you-check-the-precious-sunbeam.md). The operational "what's // on my plate" view — open requisitions, pending applications, and requisitions closed in a // date range, grouped by recruiter. public class GetRecruiterWorkloadReport : BaseReportEndpoint { private readonly IRecruiterWorkloadReportBLL _bll; public GetRecruiterWorkloadReport(IRecruiterWorkloadReportBLL bll) { _bll = bll; } public override void Configure() { Post("/RecruitmentReports/GetRecruiterWorkloadReport"); // Roles() throws 500 here — no host in this repo configures AddAuthentication (see // GetJobRequisition.cs's identical documented gap). AllowAnonymous matches every other // endpoint in this SL module today. AllowAnonymous(); } public record GetRecruiterWorkloadReportParameter( [property: FromHeader] string Login, [property: FromBody] ReportCallingDTO ReportCallingDTO, [property: QueryParam] int FirstNumber, [property: QueryParam] int MaxResult ); protected override IAsyncEnumerable ExecuteReportAsync( GetRecruiterWorkloadReportParameter req, LoginDTO login, CancellationToken ct) => _bll.GetRecruiterWorkloadStream( req.FirstNumber, req.MaxResult, req.ReportCallingDTO?.CriteriaDTO, login, ct); protected override async Task> ExecutePagedAsync( GetRecruiterWorkloadReportParameter req, LoginDTO login, CancellationToken ct) { var result = await _bll.GetRecruiterWorkload( req.FirstNumber, req.MaxResult, req.ReportCallingDTO?.CriteriaDTO, login, ct).ConfigureAwait(false); return await GB5Shared.ResponseStandard.Response.CreateSuccessResponse( result, CacheKeyLevel.NOT_REQUIRED, login); } } }