Skip to content

Commit

Permalink
Implemented: support to make the rule action type to next rule by def…
Browse files Browse the repository at this point in the history
…ault
  • Loading branch information
ymaheshwari1 committed May 24, 2024
1 parent 8de99bb commit 9ee109e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
1 change: 0 additions & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
"No run history": "No run history",
"No runs scheduled": "No runs scheduled",
"No time zone found": "No time zone found",
"None": "None",
"OMS": "OMS",
"OMS instance": "OMS instance",
"Order batches": "Order batches",
Expand Down
25 changes: 15 additions & 10 deletions src/views/BrokeringQuery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,6 @@
{{ translate("Queue") }}
<ion-icon :icon="golfOutline"/>
</ion-select-option>
<ion-select-option value="">
{{ translate("None") }}
</ion-select-option>
</ion-select>
</ion-item>
<ion-item lines="none" v-show="ruleActionType === actionEnums['MOVE_TO_QUEUE'].id">
Expand Down Expand Up @@ -666,6 +663,16 @@ async function addInventoryRule() {
const routingRuleId = await store.dispatch("orderRouting/createRoutingRule", payload)
if(routingRuleId) {
// Updating the rule action to NEXT_RULE by default after creation
await store.dispatch("orderRouting/updateRule", {
routingRuleId,
orderRoutingId: props.orderRoutingId,
actions: [{
actionTypeEnumId: "ORA_NEXT_RULE",
actionValue: "",
createdDate: DateTime.now().toMillis()
}]
})
// TODO: Fix warning of duplicate keys when creating a new rule
inventoryRules.value = sortSequence(JSON.parse(JSON.stringify(currentRouting.value["rules"])))
fetchRuleInformation(routingRuleId)
Expand All @@ -691,13 +698,11 @@ function updateOrderRouting(value: string) {
function updateUnfillableActionType(value: string) {
const actionType = ruleActionType.value
ruleActionType.value = value
// Create the new action type only when we have not selected none option, otherwise just delete the previous selected action type
if(value) {
inventoryRuleActions.value[ruleActionType.value] = {
actionTypeEnumId: value,
actionValue: "", // after changing action type, as next_rule action does not need to have a value, so in all cases making intially the value as empty and will update if required from some other function
createdDate: DateTime.now().toMillis()
}
inventoryRuleActions.value[ruleActionType.value] = {
actionTypeEnumId: value,
actionValue: "", // after changing action type, as next_rule action does not need to have a value, so in all cases making intially the value as empty and will update if required from some other function
createdDate: DateTime.now().toMillis()
}
// deleting previous action type, but using the data of previous action
delete inventoryRuleActions.value[actionType]
Expand Down

0 comments on commit 9ee109e

Please sign in to comment.