From 8fa105606bb41862f1c378a4d5fec51fe98c3271 Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Tue, 31 Mar 2026 11:45:48 +0700 Subject: [PATCH] Refactor LeaveProcessJobStatusRepository to filter employee records by status and ensure proper task processing --- .../TimeAttendants/LeaveProcessJobStatusRepository.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BMA.EHR.Application/Repositories/Leaves/TimeAttendants/LeaveProcessJobStatusRepository.cs b/BMA.EHR.Application/Repositories/Leaves/TimeAttendants/LeaveProcessJobStatusRepository.cs index 1d45e49c..5e9944ad 100644 --- a/BMA.EHR.Application/Repositories/Leaves/TimeAttendants/LeaveProcessJobStatusRepository.cs +++ b/BMA.EHR.Application/Repositories/Leaves/TimeAttendants/LeaveProcessJobStatusRepository.cs @@ -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);