27 lines
1.1 KiB
C#
27 lines
1.1 KiB
C#
using Company.Domain.RollCallAgg;
|
|
using CompanyManagment.App.Contracts.Contract;
|
|
using CompanyManagment.App.Contracts.RollCall;
|
|
using CompanyManagment.App.Contracts.WorkingHoursTemp;
|
|
using System;
|
|
|
|
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)
|
|
{
|
|
return _rollCallMandatoryRepository.MandatoryCompute(employeeId,workshopId, contractStart, contractEnd, command, holidayWorking);
|
|
}
|
|
} |