From f50fdd7f916210644267a54be5f70d589d75ed71 Mon Sep 17 00:00:00 2001 From: SamSys Date: Mon, 6 Oct 2025 14:45:54 +0330 Subject: [PATCH] createLive bug fixed --- .../LeaveApplication.cs | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/CompanyManagment.Application/LeaveApplication.cs b/CompanyManagment.Application/LeaveApplication.cs index a532608e..0145402e 100644 --- a/CompanyManagment.Application/LeaveApplication.cs +++ b/CompanyManagment.Application/LeaveApplication.cs @@ -182,29 +182,30 @@ public class LeaveApplication : ILeaveApplication shiftDuration = shiftEndDateTime - shiftStartDateTime; hasShiftDuration = true; } - } - else if (employeeSettings is { WorkshopShiftStatus: WorkshopShiftStatus.Irregular }) - { - if ((end - start).TotalDays > 1) + else if (employeeSettings is { WorkshopShiftStatus: WorkshopShiftStatus.Irregular }) { - return op.Failed("شما نمیتوانید بیشتر از یک روز مرخصی روزانه ثبت کنید"); - } - - var isActive = _rollCallEmployeeStatusApplication.IsActiveInPeriod(command.EmployeeId, command.WorkshopId, start, start); - if (isActive) - { - shiftDuration = employeeSettings.IrregularShift.WorkshopIrregularShifts switch + if ((end - start).TotalDays > 1) { - WorkshopIrregularShifts.TwelveThirtySix => TimeSpan.FromHours(12), - WorkshopIrregularShifts.TwelveTwentyFour => TimeSpan.FromHours(12), - WorkshopIrregularShifts.TwentyFourFortyEight => TimeSpan.FromHours(24), - WorkshopIrregularShifts.TwentyFourTwentyFour => TimeSpan.FromHours(24), - _ => new TimeSpan() - }; - hasShiftDuration = true; - } + return op.Failed("شما نمیتوانید بیشتر از یک روز مرخصی روزانه ثبت کنید"); + } + var isActive = _rollCallEmployeeStatusApplication.IsActiveInPeriod(command.EmployeeId, command.WorkshopId, start, start); + if (isActive) + { + shiftDuration = employeeSettings.IrregularShift.WorkshopIrregularShifts switch + { + WorkshopIrregularShifts.TwelveThirtySix => TimeSpan.FromHours(12), + WorkshopIrregularShifts.TwelveTwentyFour => TimeSpan.FromHours(12), + WorkshopIrregularShifts.TwentyFourFortyEight => TimeSpan.FromHours(24), + WorkshopIrregularShifts.TwentyFourTwentyFour => TimeSpan.FromHours(24), + _ => new TimeSpan() + }; + hasShiftDuration = true; + } + + } } + }