правки

This commit is contained in:
2025-02-27 09:12:07 +04:00
parent 18df50575b
commit c12efe7f92
4 changed files with 8 additions and 8 deletions

View File

@@ -27,7 +27,7 @@ internal class EmployeeStorageContract : IEmployeeStorageContract
_mapper = new Mapper(config);
}
public List<EmployeeDataModel> GetList(bool onlyActive = true, string? postId = null, DateTime? fromBirthDate = null, DateTime? toBirthDate = null,
public List<EmployeeDataModel> GetList(bool onlyActive = true, string? email = null, DateTime? fromBirthDate = null, DateTime? toBirthDate = null,
DateTime? fromEmploymentDate = null, DateTime? toEmploymentDate = null)
{
try
@@ -37,9 +37,9 @@ internal class EmployeeStorageContract : IEmployeeStorageContract
{
query = query.Where(x => !x.IsDeleted);
}
if (postId is not null)
if (email is not null)
{
query = query.Where(x => x.PostId == postId);
query = query.Where(x => x.PostId == email);
}
if (fromBirthDate is not null && toBirthDate is not null)
{

View File

@@ -13,9 +13,9 @@ internal class Employee
public required string FIO { get; set; }
public string Email { get; set; }
public required string PostId { get; set; }
public required string PostId { get; set; }
public string? Email { get; set; }
public DateTime BirthDate { get; set; }

View File

@@ -8,7 +8,7 @@ namespace MagicCarpetDatabase.Models;
internal class Salary
{
public required string Id { get; set; } = Guid.NewGuid().ToString();
public string Id { get; set; } = Guid.NewGuid().ToString();
public required string EmployeeId { get; set; }
public DateTime SalaryDate { get; set; }
public double EmployeeSalary { get; set; }

View File

@@ -11,14 +11,14 @@ namespace MagicCarpetDatabase.Models;
internal class Sale
{
public required string Id { get; set; }
public string Id { get; set; } = Guid.NewGuid().ToString();
public required string EmployeeId { get; set; }
public string? ClientId { get; set; }
public DateTime SaleDate { get; set; }
public double Sum { get; private set; }
public double Sum { get; set; }
public DiscountType DiscountType { get; set; }