Refactor LeaveProcessJobStatusRepository to filter employee records by status and ensure proper task processing
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m48s

This commit is contained in:
Suphonchai Phoonsawat 2026-03-31 11:45:48 +07:00
parent 47c0cfc62a
commit 8fa105606b

View file

@ -445,7 +445,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
var apiKey = _configuration["API_KEY"];
var body = new
{
records = employees
records = employees.Where(x => x.status == "ABSENT" || x.status == "LATE").ToList()
};
var apiResult = await PostExternalAPIAsync(apiPath, AccessToken ?? "", body, apiKey);
@ -729,7 +729,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
var apiKey = _configuration["API_KEY"];
var body = new
{
records = employees
records = employees.Where(x => x.status == "ABSENT" || x.status == "LATE").ToList()
};
var apiResult = await PostExternalAPIAsync(apiPath, AccessToken ?? "", body, apiKey);
@ -754,7 +754,7 @@ namespace BMA.EHR.Application.Repositories.Leaves.TimeAttendants
// ทำงานที่ต้องการที่นี่ (เช่น เรียก API, ประมวลผลข้อมูล ฯลฯ)
await ProcessTaskAsync(job.RootDnaId,job.StartDate, job.EndDate);
//await ProcessEmpTaskAsync(job.RootDnaId,job.StartDate, job.EndDate);
await ProcessEmpTaskAsync(job.RootDnaId,job.StartDate, job.EndDate);
// อัปเดตสถานะเป็น Completed
await UpdateToCompletedAsync(job.Id);