36 lines
1.7 KiB
C#
36 lines
1.7 KiB
C#
using Company.Domain.RollCallAgg;
|
|
using CompanyManagment.App.Contracts.Contract;
|
|
using CompanyManagment.App.Contracts.RollCall;
|
|
using CompanyManagment.App.Contracts.WorkingHoursTemp;
|
|
using System;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace CompanyManagment.Application;
|
|
|
|
public class RollCallMandatoryApplication : IRollCallMandatoryApplication
|
|
{
|
|
private readonly IRollCallMandatoryRepository _rollCallMandatoryRepository;
|
|
|
|
public RollCallMandatoryApplication(IRollCallMandatoryRepository rollCallMandatoryRepository)
|
|
{
|
|
_rollCallMandatoryRepository = rollCallMandatoryRepository;
|
|
}
|
|
|
|
public bool HasRollCallRecord(long employeeId, long workshopId, DateTime contractStart)
|
|
{
|
|
return _rollCallMandatoryRepository.Exists(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate.Value.Date >= contractStart.Date);
|
|
}
|
|
|
|
public ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout, bool rotatingShiftCompute, double dailyWageUnAffected, bool totalLeaveCompute)
|
|
|
|
{
|
|
return _rollCallMandatoryRepository.MandatoryCompute(employeeId,workshopId, contractStart, contractEnd, command, holidayWorking, isStaticCheckout, rotatingShiftCompute, dailyWageUnAffected, totalLeaveCompute).GetAwaiter().GetResult();
|
|
|
|
}
|
|
|
|
public async Task<ComputingViewModel> RotatingShiftReport(long workshopId, long employeeId, DateTime contractStart, DateTime contractEnd,
|
|
string shiftwork, bool hasRollCall, CreateWorkingHoursTemp command, bool holidayWorking)
|
|
{
|
|
return await _rollCallMandatoryRepository.RotatingShiftReport(workshopId, employeeId, contractStart, contractEnd, shiftwork,hasRollCall, command, holidayWorking);
|
|
}
|
|
} |