From 7ab37590b27794543b340327def2a8ad06966d4e Mon Sep 17 00:00:00 2001 From: Abhinav Goyal Date: Fri, 16 Feb 2024 18:19:13 +0530 Subject: [PATCH] on_cancel schema val added --- .../schema/B2B_json_schema/v2/init.js | 3 +- .../utils/constants.js | 4 -- .../utils/logistics/logOnCancel.js | 37 ------------------- 3 files changed, 2 insertions(+), 42 deletions(-) diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/init.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/init.js index 9dbf3bd..dae8f08 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/init.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/init.js @@ -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"], diff --git a/utilities/logistics-b2b/log-verification-utility/utils/constants.js b/utilities/logistics-b2b/log-verification-utility/utils/constants.js index 284f2a0..7b3912a 100755 --- a/utilities/logistics-b2b/log-verification-utility/utils/constants.js +++ b/utilities/logistics-b2b/log-verification-utility/utils/constants.js @@ -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"], diff --git a/utilities/logistics-b2b/log-verification-utility/utils/logistics/logOnCancel.js b/utilities/logistics-b2b/log-verification-utility/utils/logistics/logOnCancel.js index b0f90a6..1d1624b 100644 --- a/utilities/logistics-b2b/log-verification-utility/utils/logistics/logOnCancel.js +++ b/utilities/logistics-b2b/log-verification-utility/utils/logistics/logOnCancel.js @@ -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; @@ -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]; } @@ -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"), @@ -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}'`;