add client checkout list controller
This commit is contained in:
@@ -80,4 +80,6 @@ public interface ICheckoutRepository : IRepository<long, Checkout>
|
||||
#endregion
|
||||
|
||||
Task<Checkout> GetByWorkshopIdEmployeeIdInDate(long workshopId, long employeeId, DateTime inDate);
|
||||
Task<PagedResult<CheckoutListClientDto>> GetListForClient(long workshopId,
|
||||
CheckoutListClientSearchModel searchModel);
|
||||
}
|
||||
@@ -62,4 +62,40 @@ public interface ICheckoutApplication
|
||||
long workshopId, DateTime start, DateTime end);
|
||||
|
||||
#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
|
||||
}
|
||||
@@ -706,5 +706,10 @@ public class CheckoutApplication : ICheckoutApplication
|
||||
return _checkoutRepository.GetLastCheckoutsByWorkshopIdForWorkFlow(workshopId, start, end);
|
||||
}
|
||||
|
||||
public async Task<PagedResult<CheckoutListClientDto>> GetListForClient(long workshopId,CheckoutListClientSearchModel searchModel)
|
||||
{
|
||||
return await _checkoutRepository.GetListForClient(workshopId, searchModel);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
25
ServiceHost/Areas/Client/Controllers/CheckoutController.cs
Normal file
25
ServiceHost/Areas/Client/Controllers/CheckoutController.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user