Skip to content

Commit

Permalink
Improved: added support for enum creation for force scan setting (#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
amansinghbais committed Jul 18, 2024
1 parent 534e12a commit 907e643
Showing 1 changed file with 24 additions and 10 deletions.
34 changes: 24 additions & 10 deletions src/store/modules/util/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const actions: ActionTree<UtilState, RootState> = {
const payload = {
"inputFields": {
"productStoreId": eComStoreId,
"settingTypeEnumId": "FULFILL_FORCE_SCAN"
"settingTypeEnumId": "RECEIVE_FORCE_SCAN"
},
"filterByDate": 'Y',
"entityName": "ProductStoreSetting",
Expand All @@ -80,14 +80,28 @@ const actions: ActionTree<UtilState, RootState> = {
const ecomStore = store.getters['user/getCurrentEComStore'];
const fromDate = Date.now()

const params = {
fromDate,
"productStoreId": ecomStore.productStoreId,
"settingTypeEnumId": "FULFILL_FORCE_SCAN",
"settingValue": "false"
}

try {
if(!await UtilService.isEnumExists("RECEIVE_FORCE_SCAN")) {
const resp = await UtilService.createEnumeration({
"enumId": "RECEIVE_FORCE_SCAN",
"enumTypeId": "PROD_STR_STNG",
"description": " Impose force scanning of items while packing from receiving app",
"enumName": "Receiving Force Scan",
"enumCode": "RECEIVE_FORCE_SCAN"
})

if(hasError(resp)) {
throw resp.data;
}
}

const params = {
fromDate,
"productStoreId": ecomStore.productStoreId,
"settingTypeEnumId": "RECEIVE_FORCE_SCAN",
"settingValue": "false"
}

await UtilService.createForceScanSetting(params) as any
} catch(err) {
console.error(err)
Expand All @@ -109,7 +123,7 @@ const actions: ActionTree<UtilState, RootState> = {
const resp = await UtilService.getProductStoreSetting({
"inputFields": {
"productStoreId": eComStoreId,
"settingTypeEnumId": "FULFILL_FORCE_SCAN"
"settingTypeEnumId": "RECEIVE_FORCE_SCAN"
},
"filterByDate": 'Y',
"entityName": "ProductStoreSetting",
Expand Down Expand Up @@ -137,7 +151,7 @@ const actions: ActionTree<UtilState, RootState> = {
const params = {
"fromDate": fromDate,
"productStoreId": eComStoreId,
"settingTypeEnumId": "FULFILL_FORCE_SCAN",
"settingTypeEnumId": "RECEIVE_FORCE_SCAN",
"settingValue": `${value}`
}

Expand Down

0 comments on commit 907e643

Please sign in to comment.