Loading backend/api/src/graphql/geo-locations/orders/geo-location-orders.resolver.ts +4 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,10 @@ export class GeoLocationOrdersResolver { geoLocation: IGeoLocation; skippedOrderIds: string[]; options: GeoLocationOrdersOptions; searchObj?: { byRegex: Array<{ key: string; value: string }> }; searchObj?: { isCancelled?: boolean; byRegex?: Array<{ key: string; value: string }>; }; } ) { const orders = await this.geoLocationsOrdersService.getOrdersForWork( Loading backend/api/src/graphql/geo-locations/orders/geo-locations-orders.graphql +1 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ type Query { } input SearchOrdersForWork { isCancelled: Boolean byRegex: [SearchByRegex] } Loading backend/api/src/services/geo-locations/GeoLocationsOrdersService.ts +18 −5 Original line number Diff line number Diff line Loading @@ -151,7 +151,10 @@ export class GeoLocationsOrdersService geoLocation: IGeoLocation, skippedOrderIds: string[] = [], options: GeoLocationOrdersOptions, searchObj?: { byRegex: Array<{ key: string; value: string }> } searchObj?: { isCancelled?: boolean; byRegex?: Array<{ key: string; value: string }>; } ): Promise<Order[]> { const merchants = await this.geoLocationsWarehousesService.getMerchants( geoLocation, Loading @@ -163,12 +166,22 @@ export class GeoLocationsOrdersService let searchByRegex = []; if (searchObj && searchObj.byRegex.length > 0) { searchByRegex = searchObj.byRegex.map((s) => { if (searchObj) { const byRegex = searchObj.byRegex; if (byRegex && byRegex.length > 0) { searchByRegex = byRegex.map((s) => { return { [s.key]: { $regex: s.value, $options: 'i' } }; }); } const isCancelled = searchObj.isCancelled; if (isCancelled != null) { searchByRegex.push({ isCancelled }); } } const orders = await this.ordersService.Model.aggregate([ { $match: _.assign( Loading carrier/mobile-ionic/src/pages/main/home/home.ts +2 −4 Original line number Diff line number Diff line Loading @@ -121,11 +121,9 @@ export class HomePage { .getOrderForWork( dbGeoInput, carrier.skippedOrderIds, null, { sort: 'asc' }, { byRegex: [ { key: 'isCancelled', value: 'false' } ] isCancelled: false } ) Loading carrier/mobile-ionic/src/services/geo-location-order.service.ts +4 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,10 @@ export class GeoLocationOrdersService { geoLocation: IGeoLocation, skippedOrderIds: string[] = [], options: { sort: string } = { sort: 'asc' }, searchObj?: { byRegex: Array<{ key: string; value: string }> } searchObj?: { isCancelled?: boolean; byRegex?: Array<{ key: string; value: string }>; } ) { return this.apollo .watchQuery<{ getOrderForWork: Order }>({ Loading Loading
backend/api/src/graphql/geo-locations/orders/geo-location-orders.resolver.ts +4 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,10 @@ export class GeoLocationOrdersResolver { geoLocation: IGeoLocation; skippedOrderIds: string[]; options: GeoLocationOrdersOptions; searchObj?: { byRegex: Array<{ key: string; value: string }> }; searchObj?: { isCancelled?: boolean; byRegex?: Array<{ key: string; value: string }>; }; } ) { const orders = await this.geoLocationsOrdersService.getOrdersForWork( Loading
backend/api/src/graphql/geo-locations/orders/geo-locations-orders.graphql +1 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ type Query { } input SearchOrdersForWork { isCancelled: Boolean byRegex: [SearchByRegex] } Loading
backend/api/src/services/geo-locations/GeoLocationsOrdersService.ts +18 −5 Original line number Diff line number Diff line Loading @@ -151,7 +151,10 @@ export class GeoLocationsOrdersService geoLocation: IGeoLocation, skippedOrderIds: string[] = [], options: GeoLocationOrdersOptions, searchObj?: { byRegex: Array<{ key: string; value: string }> } searchObj?: { isCancelled?: boolean; byRegex?: Array<{ key: string; value: string }>; } ): Promise<Order[]> { const merchants = await this.geoLocationsWarehousesService.getMerchants( geoLocation, Loading @@ -163,12 +166,22 @@ export class GeoLocationsOrdersService let searchByRegex = []; if (searchObj && searchObj.byRegex.length > 0) { searchByRegex = searchObj.byRegex.map((s) => { if (searchObj) { const byRegex = searchObj.byRegex; if (byRegex && byRegex.length > 0) { searchByRegex = byRegex.map((s) => { return { [s.key]: { $regex: s.value, $options: 'i' } }; }); } const isCancelled = searchObj.isCancelled; if (isCancelled != null) { searchByRegex.push({ isCancelled }); } } const orders = await this.ordersService.Model.aggregate([ { $match: _.assign( Loading
carrier/mobile-ionic/src/pages/main/home/home.ts +2 −4 Original line number Diff line number Diff line Loading @@ -121,11 +121,9 @@ export class HomePage { .getOrderForWork( dbGeoInput, carrier.skippedOrderIds, null, { sort: 'asc' }, { byRegex: [ { key: 'isCancelled', value: 'false' } ] isCancelled: false } ) Loading
carrier/mobile-ionic/src/services/geo-location-order.service.ts +4 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,10 @@ export class GeoLocationOrdersService { geoLocation: IGeoLocation, skippedOrderIds: string[] = [], options: { sort: string } = { sort: 'asc' }, searchObj?: { byRegex: Array<{ key: string; value: string }> } searchObj?: { isCancelled?: boolean; byRegex?: Array<{ key: string; value: string }>; } ) { return this.apollo .watchQuery<{ getOrderForWork: Order }>({ Loading