From 057b51390e9291565d5b2a112a9fca0126cdeade Mon Sep 17 00:00:00 2001 From: Suphonchai Phoonsawat Date: Thu, 9 Apr 2026 12:07:11 +0700 Subject: [PATCH] add some code --- .../Leaves/LeaveRequests/LeaveRequestRepository.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveRequestRepository.cs b/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveRequestRepository.cs index f465191e..8416af4e 100644 --- a/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveRequestRepository.cs +++ b/BMA.EHR.Application/Repositories/Leaves/LeaveRequests/LeaveRequestRepository.cs @@ -676,6 +676,9 @@ namespace BMA.EHR.Application.Repositories.Leaves.LeaveRequests thisYear = thisYear + 1; } await _leaveBeginningRepository.UpdateLeaveUsageAsync(thisYear, data.Type.Id, data.KeycloakUserId, -1 * data.LeaveTotal); + // update leave count ลดลง 1 ครั้ง + await _leaveBeginningRepository.UpdateLeaveCountAsync(thisYear, data.Type.Id, data.KeycloakUserId, -1); + var _baseAPI = _configuration["API"]; var apiUrlSalary = $"{_baseAPI}/org/profile/leave/cancel/{data.Id}";