GetCustomizeCheckoutList method init

This commit is contained in:
gozareshgir
2026-02-08 19:28:42 +03:30
parent aa507e482a
commit 0ca8095800
8 changed files with 24 additions and 8 deletions

View File

@@ -6,7 +6,7 @@ using CompanyManagment.App.Contracts.Leave;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using CompanyManagment.App.Contracts.Checkout.Dto.ClientDto;
using CompanyManagment.App.Contracts.Checkout.ClientDto;
namespace Company.Domain.CheckoutAgg;

View File

@@ -1,7 +1,7 @@
using _0_Framework.Application;
using System.Collections.Generic;
namespace CompanyManagment.App.Contracts.Checkout.Dto.ClientDto;
namespace CompanyManagment.App.Contracts.Checkout.ClientDto;
public class CheckoutListClientDto
{

View File

@@ -6,7 +6,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CompanyManagment.App.Contracts.Checkout.Dto.ClientDto;
using CompanyManagment.App.Contracts.Checkout.ClientDto;
namespace CompanyManagment.App.Contracts.Checkout;

View File

@@ -1,8 +1,9 @@
using System;
using _0_Framework.Application;
namespace CompanyManagment.App.Contracts.CustomizeCheckout.CustomizeCheckoutDto;
public class CustomizeCheckoutSearchModel
public class CustomizeCheckoutSearchModel : PaginationRequest
{
/// <summary>
/// سال

View File

@@ -39,7 +39,7 @@ using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Linq;
using System.Threading.Tasks;
using CompanyManagment.App.Contracts.Checkout.Dto.ClientDto;
using CompanyManagment.App.Contracts.Checkout.ClientDto;
namespace CompanyManagment.Application;

View File

@@ -9,7 +9,6 @@ using Company.Domain.WorkshopAgg;
using Company.Domain.WorkshopEmployerAgg;
using CompanyManagment.App.Contracts.Checkout;
using CompanyManagment.App.Contracts.Checkout.Dto;
using CompanyManagment.App.Contracts.Checkout.Dto.ClientDto;
using CompanyManagment.App.Contracts.Contract;
using CompanyManagment.App.Contracts.Employee;
using CompanyManagment.App.Contracts.EmployeeComputeOptions;
@@ -41,6 +40,7 @@ using System.Xml.XPath;
using _0_Framework.Exceptions;
using static CompanyManagment.EFCore.Repository.ContractRepository;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory;
using CompanyManagment.App.Contracts.Checkout.ClientDto;
namespace CompanyManagment.EFCore.Repository;

View File

@@ -502,9 +502,24 @@ namespace CompanyManagment.EFCore.Repository
#region ForApi
public Task<PagedResult<CustomizeCheckoutListDto>> GetCustomizeCheckoutList(long workshopId, CustomizeCheckoutSearchModel searchModel)
public async Task<PagedResult<CustomizeCheckoutListDto>> GetCustomizeCheckoutList(long workshopId, CustomizeCheckoutSearchModel searchModel)
{
var query = _companyContext.CustomizeCheckouts.Where(x => x.WorkshopId == workshopId).AsNoTracking();
if (!string.IsNullOrWhiteSpace(searchModel.SearchStartFa) && !string.IsNullOrWhiteSpace(searchModel.SearchEndFa) &&
searchModel.Year == 0 && searchModel.Month == 0)
{
if (!searchModel.SearchStartFa.TryToGeorgianDateTime(out DateTime queryStartDate) ||
!searchModel.SearchEndFa.TryToGeorgianDateTime(out DateTime queryEndDate))
return new();
query = query.Where(x => x.ContractEnd.Date >= queryStartDate && x.ContractStart.Date <= queryEndDate);
}
var list = await query.ApplyPagination(searchModel.PageIndex, searchModel.PageSize).ToListAsync();
throw new NotImplementedException();
}

View File

@@ -1,8 +1,8 @@
using _0_Framework.Application;
using Company.Domain.ContractAgg;
using CompanyManagment.App.Contracts.Checkout;
using CompanyManagment.App.Contracts.Checkout.ClientDto;
using CompanyManagment.App.Contracts.Checkout.Dto;
using CompanyManagment.App.Contracts.Checkout.Dto.ClientDto;
using CompanyManagment.App.Contracts.Contract;
using Microsoft.AspNetCore.Mvc;
using ServiceHost.BaseControllers;