minor formatting
This commit is contained in:
parent
e8c5e61d24
commit
d4656b12ac
8 changed files with 18 additions and 1 deletions
|
@ -31,7 +31,10 @@ namespace Contracts;
|
|||
public interface IEmployeeRepository
|
||||
{
|
||||
IEnumerable<Employee> GetEmployees(Guid companyId, bool trackChanges);
|
||||
|
||||
Employee? GetEmployee(Guid companyId, Guid employeeId, bool trackChanges);
|
||||
|
||||
void CreateEmployeeForCompany(Guid companyId, Employee employee);
|
||||
|
||||
void DeleteEmployee(Employee employee);
|
||||
}
|
|
@ -29,7 +29,10 @@ namespace Contracts;
|
|||
public interface ILoggerManager
|
||||
{
|
||||
void LogInfo(string message);
|
||||
|
||||
void LogWarn(string message);
|
||||
|
||||
void LogDebug(string message);
|
||||
|
||||
void LogError(string message);
|
||||
}
|
|
@ -38,7 +38,10 @@ public class LoggerManager :ILoggerManager
|
|||
}
|
||||
|
||||
public void LogDebug(string message) => logger.Debug(message);
|
||||
|
||||
public void LogError(string message) => logger.Error(message);
|
||||
|
||||
public void LogInfo(string message) => logger.Info(message);
|
||||
|
||||
public void LogWarn(string message) => logger.Warn(message);
|
||||
}
|
|
@ -44,6 +44,7 @@ public class RepositoryContext : DbContext
|
|||
}
|
||||
|
||||
public DbSet<Company>? Companies { get; set; }
|
||||
|
||||
public DbSet<Employee>? Employees { get; set; }
|
||||
|
||||
}
|
|
@ -32,8 +32,11 @@ namespace Service.Contracts;
|
|||
public interface IEmployeeService
|
||||
{
|
||||
IEnumerable<EmployeeDto> GetEmployees(Guid companyId, bool trackChanges);
|
||||
|
||||
EmployeeDto GetEmployee(Guid companyId, Guid employeeId, bool trackChanges);
|
||||
|
||||
EmployeeDto CreateEmployeeForCompany(Guid companyId, EmployeeCreateDto? employeeCreateDto, bool trackChanges);
|
||||
|
||||
void DeleteEmployeeForCompany(Guid companyId, Guid employeeId, bool trackChanges);
|
||||
|
||||
void UpdateEmployeeForCompany(Guid companyId, Guid employeeId, EmployeeUpdateDto employeeUpdate,
|
||||
|
|
|
@ -29,5 +29,6 @@ namespace Service.Contracts;
|
|||
public interface IServiceManager
|
||||
{
|
||||
ICompanyService CompanyService { get; }
|
||||
|
||||
IEmployeeService EmployeeService { get; }
|
||||
}
|
|
@ -47,7 +47,6 @@ internal sealed class EmployeeService : IEmployeeService
|
|||
}
|
||||
|
||||
|
||||
|
||||
public IEnumerable<EmployeeDto> GetEmployees(Guid companyId, bool trackChanges)
|
||||
{
|
||||
var company = _repository.Company.GetCompany(companyId, trackChanges);
|
||||
|
@ -163,6 +162,7 @@ internal sealed class EmployeeService : IEmployeeService
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public (EmployeeUpdateDto employeeToPatch, Employee employeeEntity) GetEmployeeForPatch(Guid companyId,
|
||||
Guid employeeId, bool companyTrackChanges, bool employeeTrackChanges)
|
||||
{
|
||||
|
@ -182,6 +182,7 @@ internal sealed class EmployeeService : IEmployeeService
|
|||
return (employeeToPatch, employeeEntity);
|
||||
}
|
||||
|
||||
|
||||
public void SaveChangesForPatch(EmployeeUpdateDto employeeToPatch, Employee employeeEntity)
|
||||
{
|
||||
_mapper.Map(employeeToPatch, employeeEntity);
|
||||
|
|
|
@ -33,6 +33,7 @@ namespace Service;
|
|||
public sealed class ServiceManager : IServiceManager
|
||||
{
|
||||
private readonly Lazy<ICompanyService> _companyService;
|
||||
|
||||
private readonly Lazy<IEmployeeService> _employeeService;
|
||||
|
||||
public ServiceManager(IRepositoryManager repositoryManager, ILoggerManager logger, IMapper mapper)
|
||||
|
@ -42,5 +43,6 @@ public sealed class ServiceManager : IServiceManager
|
|||
}
|
||||
|
||||
public ICompanyService CompanyService => _companyService.Value;
|
||||
|
||||
public IEmployeeService EmployeeService => _employeeService.Value;
|
||||
}
|
Loading…
Reference in a new issue