Skip to content

Commit

Permalink
on_cancel schema val added
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavv245 committed Feb 16, 2024
1 parent db91c36 commit 7ab3759
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,8 @@ module.exports = {
},
collected_by:{
type:"string",
enum:["BAP","BPP"]
enum:["BAP","BPP"],
const: { $data: "/on_select/0/message/order/payments/0/collected_by" },
}
},
required: ["type","collected_by"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,8 @@ module.exports = Object.freeze({
"RTO-Disposed",
"Cancelled",
],
<<<<<<< HEAD
CANCELLATION_TAGS_LIST:["retry_count","rto_id","cancellation_reason_id","sub_reason_id","cancelled_by"],
=======
CANCELLATION_TAGS_CODES:["rto_event","precancel_state"],
CANCELLATION_TAGS_LIST:["retry_count","rto_id","cancellation_reason_id","sub_reason_id","cancelled_by","fulfillment_state","updated_at"],
>>>>>>> patch-reference-implementations-remote/main
FASHION_ATTRIBUTES : ["brand","colour","size","gender","material"],
ELECTRONICS_ATTRIBUTES: ["brand","model"],
MANDATORY_ATTRIBUTES: ["brand"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ const checkOnCancel = (data, msgIdSet) => {
let version = on_cancel.context.core_version;
let messageId = on_cancel.context.message_id;
const providerId = on_cancel.message?.provider?.id;
<<<<<<< HEAD

=======
let selectedItem;
>>>>>>> patch-reference-implementations-remote/main
on_cancel = on_cancel.message.order;
let onSearchItemsArr = dao.getValue(`${on_cancel?.provider?.id}itemsArr`);
let ffState;
Expand Down Expand Up @@ -48,16 +44,10 @@ const checkOnCancel = (data, msgIdSet) => {
} catch (error) {
console.log(error);
}
<<<<<<< HEAD
if (onSearchItemsArr) {
let selectedItem = onSearchItemsArr.filter(
(element) => element.parent_item_id === dao.getValue("selectedItem")
=======

if (onSearchItemsArr) {
selectedItem = onSearchItemsArr.filter(
(element) => element?.parent_item_id === dao.getValue("selectedItem")
>>>>>>> patch-reference-implementations-remote/main
);
selectedItem = selectedItem[0];
}
Expand All @@ -84,14 +74,10 @@ const checkOnCancel = (data, msgIdSet) => {
}
}

<<<<<<< HEAD
if (fulfillment.start.time.timestamp && dao.getValue("pickupTime")) {
=======
if (
fulfillment?.start?.time?.timestamp &&
dao.getValue("pickupTime")
) {
>>>>>>> patch-reference-implementations-remote/main
if (
!_.isEqual(
dao.getValue("pickupTime"),
Expand All @@ -106,30 +92,7 @@ const checkOnCancel = (data, msgIdSet) => {
if (version === "1.2.0") {
if (dao.getValue("rts") === "yes") {
if (!fulfillment?.start?.time) {
<<<<<<< HEAD
onCancelObj.msngStrtTime = `Pickup time range (fulfillments/start/time) is missing`;
}
if (!fulfillment?.end?.time) {
onCancelObj.msngDlvryTime = `Delivery time range (fulfillments/end/time) is missing`;
}
}
let fulTags = fulfillment?.tags;
let rtoID;
fulTags.forEach((tag) => {
if (tag.code === "rto_event") {
const lists = tag.list;
lists.forEach((list) => {
if (list.code === "rto_id") {
rtoID = list.value;

if (rtoID !== selectedItem.fulfillment_id) {
onCancelObj.rtoIdTagsErr = `rto_id '${rtoID}' in fulfillments/tags does not match with the one provided in on_search '${selectedItem.fulfillment_id}' in /fulfillments`;
}
}
});
=======
onCancelObj.msngStrtTime = `Pickup time range (fulfillments/start/time) is missing for fulfillment type - '${fulfillment.type}'`;
>>>>>>> patch-reference-implementations-remote/main
}
if (!fulfillment?.end?.time) {
onCancelObj.msngDlvryTime = `Delivery time range (fulfillments/end/time) is missing for fulfillment type - '${fulfillment.type}'`;
Expand Down

0 comments on commit 7ab3759

Please sign in to comment.