Esempio n. 1
0
 public Task <PackedList <T> > GetWorkOrders <T>(IAgencyOwner agencyOwner, WorkOrderFilters filters) where T : ProviderWorkOrderOutput
 {
     return(Repository.Queryable()
            .ApplyWhereFilters(filters)
            .Where(x => agencyOwner.OrganizationId == x.AccountManagerOrganizationId &&
                   x.Status != OrderStatus.Draft)
            .PaginateProjection <WorkOrder, T>(filters, ProjectionMapping));
 }
Esempio n. 2
0
        public async Task <IActionResult> GetWorkOrders([FromRoute] Guid organizationId, [FromQuery] WorkOrderFilters filters)
        {
            var orders = await _workOrderService.GetWorkOrders <ProviderWorkOrderOutput>(_accountManager, filters);

            AddPagination(filters, orders.Total);
            return(Ok(orders.Data));
        }
Esempio n. 3
0
 public Task <PackedList <T> > GetWorkOrders <T>(IOrganizationCustomer customer, WorkOrderFilters filters) where T : BuyerWorkOrderOutput
 {
     return(Repository.Queryable()
            .ApplyWhereFilters(filters)
            .Where(x => x.CustomerId == customer.CustomerId &&
                   x.CustomerOrganizationId == customer.OrganizationId)
            .PaginateProjection <WorkOrder, T>(filters, ProjectionMapping));
 }