add client checkout list controller

This commit is contained in:
2026-01-18 12:51:58 +03:30
parent 8ec13ffae1
commit 63a3027a17
5 changed files with 539 additions and 413 deletions

View File

@@ -80,4 +80,6 @@ public interface ICheckoutRepository : IRepository<long, Checkout>
#endregion #endregion
Task<Checkout> GetByWorkshopIdEmployeeIdInDate(long workshopId, long employeeId, DateTime inDate); Task<Checkout> GetByWorkshopIdEmployeeIdInDate(long workshopId, long employeeId, DateTime inDate);
Task<PagedResult<CheckoutListClientDto>> GetListForClient(long workshopId,
CheckoutListClientSearchModel searchModel);
} }

View File

@@ -62,4 +62,40 @@ public interface ICheckoutApplication
long workshopId, DateTime start, DateTime end); long workshopId, DateTime start, DateTime end);
#endregion #endregion
Task<PagedResult<CheckoutListClientDto>> GetListForClient(long workshopId,
CheckoutListClientSearchModel searchModel);
}
public class CheckoutListClientSearchModel:PaginationRequest
{
public long? EmployeeId { get; set; }
public string Year { get; set; }
public string Month { get; set; }
public string StartDate { get; set; }
public string EndDate { get; set; }
public CheckoutClientListOrderType? OrderType { get; set; }
}
public class CheckoutListClientDto
{
public long Id { get; set; }
public string Year { get; set; }
public string Month { get; set; }
public string EmployeeName { get; set; }
public string ContractNo { get; set; }
public string ContractStart { get; set; }
public string ContractEnd { get; set; }
public bool Signature { get; set; }
}
public enum CheckoutClientListOrderType
{
ByCheckoutCreationDate,
BySignedCheckout,
ByUnSignedCheckout,
ByPersonnelCode,
ByPersonnelCodeDescending,
ByCheckoutStartDate,
ByCheckoutStartDateDescending
} }

View File

@@ -706,5 +706,10 @@ public class CheckoutApplication : ICheckoutApplication
return _checkoutRepository.GetLastCheckoutsByWorkshopIdForWorkFlow(workshopId, start, end); return _checkoutRepository.GetLastCheckoutsByWorkshopIdForWorkFlow(workshopId, start, end);
} }
public async Task<PagedResult<CheckoutListClientDto>> GetListForClient(long workshopId,CheckoutListClientSearchModel searchModel)
{
return await _checkoutRepository.GetListForClient(workshopId, searchModel);
}
#endregion #endregion
} }

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,25 @@
using _0_Framework.Application;
using CompanyManagment.App.Contracts.Checkout;
using Microsoft.AspNetCore.Mvc;
using ServiceHost.BaseControllers;
namespace ServiceHost.Areas.Client.Controllers;
public class CheckoutController:ClientBaseController
{
private readonly ICheckoutApplication _checkoutApplication;
private readonly long _workshopId;
public CheckoutController(ICheckoutApplication checkoutApplication,IAuthHelper authHelper)
{
_checkoutApplication = checkoutApplication;
_workshopId = authHelper.GetWorkshopId();
}
[HttpGet]
public async Task<ActionResult<PagedResult<CheckoutListClientDto>>> GetList(CheckoutListClientSearchModel searchModel)
{
var res =await _checkoutApplication.GetListForClient(_workshopId, searchModel);
return res;
}
}