Files
Backend-Api/CompanyManagment.Application/EmployeeClientTempApplication.cs
2025-03-08 21:49:34 +03:30

32 lines
1.2 KiB
C#

using _0_Framework_b.Application;
using Company.Domain.EmployeeClientTempAgg;
using CompanyManagment.App.Contracts.EmployeeClientTemp;
namespace CompanyManagment.Application;
public class EmployeeClientTempApplication : IEmployeeClientTempApplication
{
private readonly IEmployeeClientTempRepository _employeeClientTempRepository;
public EmployeeClientTempApplication(IEmployeeClientTempRepository employeeClientTempRepository)
{
_employeeClientTempRepository = employeeClientTempRepository;
}
public OperationResult Create(CreateEmployeeClientTemp command)
{
var op = new OperationResult();
var fullName = $"{command.FName} {command.LName}";
var employeeClientTemp = new EmployeeClientTemp(command.WorkshopId, command.StartWorkTime, command.EmployeeId, command.MaritalStatus, fullName);
_employeeClientTempRepository.Create(employeeClientTemp);
_employeeClientTempRepository.SaveChanges();
return op.Succcedded();
}
public EmployeeClientTempGetDetailsViewModel GetDetails(long employeeId, long workshopId)
{
return _employeeClientTempRepository.GetDetails(employeeId, workshopId);
}
}