From ecb32c3459d85f91aa39a48c6868b29c45ca7f0e Mon Sep 17 00:00:00 2001 From: Yash Maheshwari Date: Wed, 17 Jan 2024 15:47:25 +0530 Subject: [PATCH] Implemented: service for fetching routeFilters, defined type for routeFilters, defined env entry to map filter with id and its code and added support to dynamically fetch the filters value(#24) --- .env.example | 3 ++- src/services/RoutingService.ts | 9 +++++++++ src/types/index.ts | 13 +++++++++++++ src/views/BrokeringQuery.vue | 19 ++++++++++++------- 4 files changed, 36 insertions(+), 8 deletions(-) diff --git a/.env.example b/.env.example index 0bdf027..3adbc88 100644 --- a/.env.example +++ b/.env.example @@ -3,4 +3,5 @@ VUE_APP_I18N_FALLBACK_LOCALE=en VUE_APP_CACHE_MAX_AGE=3600 VUE_APP_VIEW_SIZE=10 VUE_APP_PERMISSION_ID= -VUE_APP_DEFAULT_LOG_LEVEL="error" \ No newline at end of file +VUE_APP_DEFAULT_LOG_LEVEL="error" +VUE_APP_RULE_ENUMS={"FILTER":"ENTCT_FILTER","SORT":"ENTCT_SORT_BY","QUEUE":{"id":"OIP_QUEUE","code":"facilityId"},"SHIPPING_METHOD":{"id":"OIP_SHIP_METH_TYPE","code":"shipmentMethodTypeId"},"PRIORITY":{"id":"OIP_PRIORITY","code":"priority"},"PROMISE_DATE":{"id":"OIP_PROMISE_DATE","code":"promiseDaysCutoff"},"SALES_CHANNEL":{"id":"OIP_SALES_CHANNEL","code":"salesChannelEnumId"},"SHIP_BY":{"id":"OSP_SHIP_BY","code":"shipBeforeDate"},"SHIP_AFTER":{"id":"OSP_SHIP_AFTER","code":"shipAfterDate"},"ORDER_DATE":{"id":"OSP_ORDER_DATE","code":"orderDate"},"SHIPPING_METHOD_SORT":{"id":"OSP_SHIP_METH","code":"deliveryDays"}} \ No newline at end of file diff --git a/src/services/RoutingService.ts b/src/services/RoutingService.ts index 6336d77..cb670f4 100644 --- a/src/services/RoutingService.ts +++ b/src/services/RoutingService.ts @@ -32,9 +32,18 @@ const fetchRoutingRules = async (payload: any): Promise => { }); } +const fetchRoutingFilters = async (payload: any): Promise => { + return api({ + url: `routings/${payload.orderRoutingId}/filter-conditions`, + method: "GET", + query: payload + }); +} + export const OrderRoutingService = { createRoutingGroup, fetchOrderRoutings, + fetchRoutingFilters, fetchRoutingGroups, fetchRoutingRules } \ No newline at end of file diff --git a/src/types/index.ts b/src/types/index.ts index b314955..a216dee 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -50,10 +50,23 @@ type Rule = { lastUpdatedStamp: string } +type RouteFilter = { + orderRoutingId: string, + conditionSeqId: string, + conditionTypeEnumId: string, + fieldName: string, + operator: string, + fieldValue: string, + sequenceNum: number, + createdDate: string, + lastUpdatedStamp: string +} + export { Enumeration, EnumerationAndType, Group, Route, + RouteFilter, Rule } \ No newline at end of file diff --git a/src/views/BrokeringQuery.vue b/src/views/BrokeringQuery.vue index 1d1c18a..2be677d 100644 --- a/src/views/BrokeringQuery.vue +++ b/src/views/BrokeringQuery.vue @@ -5,7 +5,7 @@