Merge branch 'master' into WorskhopClassifiedPlan

This commit is contained in:
SamSys
2025-10-06 23:54:50 +03:30

View File

@@ -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;
}
}
}
}