fix เมื่อพ้นการสอบ 15 วัน ไม่ให้คลิกดูข้อมูลได้ #2485

This commit is contained in:
harid 2026-05-12 16:24:39 +07:00
parent cba02a4f6e
commit 081c00b869
2 changed files with 16 additions and 1 deletions

View file

@ -9,5 +9,8 @@ namespace BMA.EHR.Recurit.Exam.Service.Response
public string? RejectDetail { get; set; }
public bool? IsShowExamInfo { get; set; }
public bool? IsShowResult { get; set; }
}
}

View file

@ -1978,7 +1978,19 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
if (candidate == null)
throw new Exception(GlobalMessages.CandidateNotFound);
return new CandidateStatusResponse { Status = candidate.Status, RejectDetail = candidate.RejectDetail, IsShowExamInfo = candidate.IsShowExamInfo };
bool IsShowResult = true;
if (exam.AnnouncementDate != null)
{
var showResultEndDate = exam.AnnouncementDate.Value.Date.AddDays(15);
IsShowResult = DateTime.Now.Date <= showResultEndDate;
}
return new CandidateStatusResponse {
Status = candidate.Status,
RejectDetail = candidate.RejectDetail,
IsShowExamInfo = candidate.IsShowExamInfo,
IsShowResult = IsShowResult,
};
}
public async Task UserCheckCandidateService(string examId, string positionId, string status)