Refactor leave limit logic to use IsProbation property instead of govAge check
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m17s

This commit is contained in:
Suphonchai Phoonsawat 2026-02-11 12:14:44 +07:00
parent c81220a049
commit 14fd9d5262

View file

@ -897,12 +897,12 @@ namespace BMA.EHR.Leave.Service.Controllers
if (leaveType.Code.Trim().ToUpper() == "LV-005")
{
if (govAge < 180)
if (profile.IsProbation! == true)
leaveLimit = 0;
else
{
leaveLimit = leaveData == null ?
govAge < 180 ? 0 : 10
10
: leaveData.LeaveDays;
}
}
@ -911,7 +911,7 @@ namespace BMA.EHR.Leave.Service.Controllers
var restOldDay = leaveData == null ? 0 : leaveData.LeaveDays - 10;
var restCurrentDay = 10.0;
if (govAge < 180)
if (profile.IsProbation! == true)
{
restOldDay = 0;
restCurrentDay = 0;