From 724fe7fa9f4efb9dba9abc1f597ffa6f642f7ba5 Mon Sep 17 00:00:00 2001 From: Abhinav Goyal Date: Wed, 20 Dec 2023 11:10:22 +0530 Subject: [PATCH 1/7] minor bug fixes --- .../347301e3-ea1d-48d1-9ca5-283b7c18d586/merged.json | 1 + .../6802cbf8-dbb2-4562-abda-3fc2ebef2b75/merged.json | 1 + .../schema/B2B_json_schema/on_confirm.js | 2 -- .../schema/B2B_json_schema/on_init.js | 3 +-- .../schema/B2B_json_schema/on_select.js | 3 +-- .../schema/B2B_json_schema/on_status.js | 3 +-- .../schema/B2B_json_schema/select.js | 6 ++++-- .../logistics_api_json_schema/v1.1/initSchema.js | 1 - .../logistics_api_json_schema/v1.1/onStatusSchema.js | 3 +-- .../logistics_api_json_schema/v1.1/searchSchema.js | 1 - .../v1.2/common/commonSchema.js | 1 - .../logistics_api_json_schema/v1.2/confirmSchema.js | 3 +-- .../logistics_api_json_schema/v1.2/initSchema.js | 5 ++--- .../logistics_api_json_schema/v1.2/onCancelSchema.js | 11 ++++------- .../logistics_api_json_schema/v1.2/onInitSchema.js | 3 +-- .../logistics_api_json_schema/v1.2/onStatusSchema.js | 9 +++------ .../logistics_api_json_schema/v1.2/searchSchema.js | 2 -- 17 files changed, 21 insertions(+), 37 deletions(-) create mode 100644 utilities/logistics-b2b/log-verification-utility/public/server/logistics/347301e3-ea1d-48d1-9ca5-283b7c18d586/merged.json create mode 100644 utilities/logistics-b2b/log-verification-utility/public/server/logistics/6802cbf8-dbb2-4562-abda-3fc2ebef2b75/merged.json diff --git a/utilities/logistics-b2b/log-verification-utility/public/server/logistics/347301e3-ea1d-48d1-9ca5-283b7c18d586/merged.json b/utilities/logistics-b2b/log-verification-utility/public/server/logistics/347301e3-ea1d-48d1-9ca5-283b7c18d586/merged.json new file mode 100644 index 0000000..3e428f9 --- /dev/null +++ b/utilities/logistics-b2b/log-verification-utility/public/server/logistics/347301e3-ea1d-48d1-9ca5-283b7c18d586/merged.json @@ -0,0 +1 @@ +{"search":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"search","core_version":"1.2.0","bap_id":"stage-ondc.ecomexpress.in","bap_uri":"https://1b75-49-249-159-126.ngrok-free.app","transaction_id":"347301e3-ea1d-48d1-9ca5-283b7c18d586","message_id":"b9913991-a295-4d22-ad19-82472d884117","timestamp":"2023-12-18T13:38:32.568Z","ttl":"PT30S"},"message":{"intent":{"category":{"id":"Express Delivery"},"fulfillment":{"type":"Delivery","end":{"location":{"gps":"28.5080098, 77.0909696","address":{"area_code":"122016"}}},"start":{"location":{"gps":"12.9298689, 77.6848366","address":{"area_code":"560103"}}}},"provider":{"time":{"range":{"start":"0000","end":"2359"},"days":"1,2,3,4,5,6,7","schedule":{"holidays":[]}}},"payment":{"type":"POST-FULFILLMENT"},"@ondc/org/payload_details":{"dimensions":{"length":{"unit":"centimeter","value":2},"breadth":{"unit":"centimeter","value":3},"height":{"unit":"centimeter","value":4}},"value":{"currency":"INR","value":"2000.0"},"category":"Grocery","weight":{"unit":"gram","value":10}}}}}],"on_search":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"on_search","core_version":"1.2.0","bap_id":"stage-ondc.ecomexpress.in","bap_uri":"https://1b75-49-249-159-126.ngrok-free.app","bpp_id":"stage-ondc.ecomexpress.in","bpp_uri":"https://stage-ondc.ecomexpress.in","transaction_id":"347301e3-ea1d-48d1-9ca5-283b7c18d586","message_id":"b9913991-a295-4d22-ad19-82472d884117","timestamp":"2023-12-18T13:38:33.338Z","ttl":"PT30S"},"message":{"catalog":{"bpp/descriptor":{"name":"Ecom Express Private Limited"},"bpp/providers":[{"id":"I1","descriptor":{"name":"Ecom Express Private Limited","short_desc":"Ecom Express Private Limited","long_desc":"Ecom Express Private Limited"},"categories":[{"id":"Express Delivery","time":{"label":"TAT","timestamp":"2023-12-18","duration":"P5D"}}],"fulfillments":[{"id":"1","type":"Delivery"},{"id":"2","type":"RTO"}],"items":[{"id":"1","parent_item_id":"EXPP","descriptor":{"name":"Express Plus Delivery","code":"P2H2P","short_desc":"Fast Delivery For Items","long_desc":"Fast Delivery for Items"},"category_id":"Express Delivery","fulfillment_id":"1","price":{"currency":"INR","value":"618.38"},"time":{"label":"TAT","timestamp":"2023-12-18","duration":"P5D"}},{"id":"2","parent_item_id":"EXPP","descriptor":{"name":"Express Plus Delivery","code":"P2H2P","short_desc":"Fast Delivery For Items","long_desc":"Fast Delivery for Items"},"category_id":"Express Delivery","fulfillment_id":"2","price":{"currency":"INR","value":"618.38"},"time":{"label":"TAT","timestamp":"2023-12-18","duration":"P5D"}}]}]}}}],"init":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"init","core_version":"1.2.0","bap_id":"stage-ondc.ecomexpress.in","bap_uri":"https://1b75-49-249-159-126.ngrok-free.app","bpp_id":"stage-ondc.ecomexpress.in","bpp_uri":"https://stage-ondc.ecomexpress.in","transaction_id":"347301e3-ea1d-48d1-9ca5-283b7c18d586","message_id":"11bdd314-e0d7-4f23-8cea-2d89b730342a","timestamp":"2023-12-18T13:38:36.110Z","ttl":"PT30S"},"message":{"order":{"payment":{"type":"POST-FULFILLMENT","collected_by":"BAP"},"provider":{"id":"I1"},"items":[{"id":"1","fulfillment_id":"1","category_id":"Express Delivery","descriptor":{"code":"P2H2P"}}],"fulfillments":[{"id":"1","type":"Delivery","end":{"contact":{"phone":"9999988888","email":"Baba@Elaichi.com"},"location":{"gps":"28.5080098, 77.0909696","address":{"name":"Mithun Chakraborty 420","building":"IHQ ecom express","locality":"Unnamed Road","city":"Gurugram","state":"Haryana","area_code":"122016","country":"India"}}},"start":{"contact":{"phone":"09898767675","email":"abii@gmail.com"},"location":{"gps":"12.9298689, 77.6848366","address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","area_code":"560103","country":"India"}}}}],"billing":{"name":"Gofrugal Technologies Pvt Ltd","tax_number":"33AACCG2423J1ZZ","email":"accounts@gofrugal.com","phone":"9999988888","address":{"name":"KRISP IT Park","building":"942, Kelambakkam - Vandalur Rd","locality":"Kizhakottayur","city":"Chennai","state":"Tamil Nadu","area_code":"600127","country":"India"},"created_at":"2023-12-18T13:38:36.110Z","updated_at":"2023-12-18T13:38:36.110Z"}}}}],"on_init":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"on_init","core_version":"1.2.0","bap_id":"stage-ondc.ecomexpress.in","bap_uri":"https://1b75-49-249-159-126.ngrok-free.app","bpp_id":"stage-ondc.ecomexpress.in","bpp_uri":"https://stage-ondc.ecomexpress.in","transaction_id":"347301e3-ea1d-48d1-9ca5-283b7c18d586","message_id":"11bdd314-e0d7-4f23-8cea-2d89b730342a","timestamp":"2023-12-18T13:38:36.906Z","ttl":"PT30S"},"message":{"order":{"payment":{"type":"POST-FULFILLMENT","collected_by":"BAP"},"provider":{"id":"I1"},"quote":{"price":{"currency":"INR","value":"618.38"},"breakup":[{"price":{"currency":"INR","value":"618.38"},"@ondc/org/item_id":"1","@ondc/org/title_type":"delivery"}]},"items":[{"id":"1","fulfillment_id":"1","category_id":"Express Delivery"}],"fulfillments":[{"id":"1","type":"Delivery","end":{"contact":{"phone":"9999988888","email":"Baba@Elaichi.com"},"location":{"gps":"28.5080098, 77.0909696","address":{"name":"Mithun Chakraborty 420","building":"IHQ ecom express","locality":"Unnamed Road","city":"Gurugram","state":"Haryana","country":"India","area_code":"122016"}}},"start":{"contact":{"phone":"09898767675","email":"abii@gmail.com"},"location":{"gps":"12.9298689, 77.6848366","address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","country":"India","area_code":"560103"}}}}]}}}],"confirm":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"confirm","core_version":"1.2.0","bap_id":"stage-ondc.ecomexpress.in","bap_uri":"https://1b75-49-249-159-126.ngrok-free.app","bpp_id":"stage-ondc.ecomexpress.in","bpp_uri":"https://stage-ondc.ecomexpress.in","transaction_id":"347301e3-ea1d-48d1-9ca5-283b7c18d586","message_id":"f6991386-0c8b-4ef6-ba06-9946297c8bde","timestamp":"2023-12-18T13:38:39.642Z","ttl":"PT30S"},"message":{"order":{"id":"3Q1QNP3PGX","state":"Created","payment":{"type":"POST-FULFILLMENT","collected_by":"BAP"},"provider":{"id":"I1"},"quote":{"price":{"currency":"INR","value":"618.38"},"breakup":[{"price":{"currency":"INR","value":"618.38"},"@ondc/org/item_id":"1","@ondc/org/title_type":"delivery"}]},"items":[{"id":"1","quantity":{"count":1},"fulfillment_id":"1","category_id":"Express Delivery","descriptor":{"code":"P2H2P"}}],"fulfillments":[{"id":"1","type":"Delivery","tags":[{"code":"state","list":[{"code":"ready_to_ship","value":"no"}]},{"code":"rto_action","list":[{"code":"return_to_origin","value":"yes"}]}],"end":{"person":{"name":"Mithun Chakraborty 420"},"contact":{"phone":"9999988888","email":"Baba@Elaichi.com"},"location":{"gps":"28.5080098, 77.0909696","address":{"name":"Mithun Chakraborty 420","building":"IHQ ecom express","locality":"Unnamed Road","city":"Gurugram","state":"Haryana","area_code":"122016","country":"India"}}},"start":{"person":{"name":"Abinaya"},"contact":{"phone":"09898767675","email":"abii@gmail.com"},"instructions":{"code":"4","short_desc":"1368","long_desc":"QR code will be attached to package"},"location":{"id":"19753-ONDC-1-3523_location","gps":"12.9298689, 77.6848366","address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","area_code":"560103","country":"India"}}}}],"billing":{"name":"Gofrugal Technologies Pvt Ltd","tax_number":"33AACCG2423J1ZZ","email":"accounts@gofrugal.com","phone":"9999988888","address":{"name":"KRISP IT Park","building":"942, Kelambakkam - Vandalur Rd","locality":"Kizhakottayur","city":"Chennai","state":"Tamil Nadu","area_code":"600127","country":"India"},"created_at":"2023-12-18T13:38:36.110Z","updated_at":"2023-12-18T13:38:36.110Z"},"@ondc/org/linked_order":{"items":[{"quantity":{"count":1,"measure":{"unit":"gram","value":10}},"price":{"currency":"INR","value":"2000.00"},"category_id":"Grocery","descriptor":{"name":"PLAIN ATTA"}}],"provider":{"descriptor":{"name":"Subbu Zoho ONDC"},"address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","area_code":"560103"}},"order":{"id":"2023-12-07-225813","weight":{"unit":"gram","value":10},"dimensions":{"length":{"unit":"centimeter","value":2},"breadth":{"unit":"centimeter","value":3},"height":{"unit":"centimeter","value":4}}}},"updated_at":"2023-12-07T14:20:59.374Z","created_at":"2023-12-07T14:20:59.374Z"}}}],"on_confirm":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"on_confirm","core_version":"1.2.0","bap_id":"stage-ondc.ecomexpress.in","bap_uri":"https://1b75-49-249-159-126.ngrok-free.app","bpp_id":"stage-ondc.ecomexpress.in","bpp_uri":"https://stage-ondc.ecomexpress.in","transaction_id":"347301e3-ea1d-48d1-9ca5-283b7c18d586","message_id":"f6991386-0c8b-4ef6-ba06-9946297c8bde","timestamp":"2023-12-18T13:38:39.973Z","ttl":"PT30S"},"message":{"order":{"id":"3Q1QNP3PGX","state":"Created","payment":{"type":"POST-FULFILLMENT","collected_by":"BAP"},"provider":{"id":"I1"},"quote":{"price":{"currency":"INR","value":"618.38"},"breakup":[{"price":{"currency":"INR","value":"618.38"},"@ondc/org/item_id":"1","@ondc/org/title_type":"delivery"}]},"items":[{"id":"1","quantity":{"count":1},"fulfillment_id":"1","category_id":"Express Delivery","descriptor":{"code":"P2H2P"}}],"fulfillments":[{"id":"1","type":"Delivery","tags":[{"code":"state","list":[{"code":"ready_to_ship","value":"no"}]},{"code":"rto_action","list":[{"code":"return_to_origin","value":"yes"}]}],"end":{"person":{"name":"Mithun Chakraborty 420"},"contact":{"phone":"9999988888","email":"Baba@Elaichi.com"},"location":{"gps":"28.5080098, 77.0909696","address":{"name":"Mithun Chakraborty 420","building":"IHQ ecom express","locality":"Unnamed Road","city":"Gurugram","state":"Haryana","country":"India","area_code":"122016"}}},"start":{"person":{"name":"Abinaya"},"contact":{"phone":"09898767675","email":"abii@gmail.com"},"instructions":{"short_desc":"1368","long_desc":"QR code will be attached to package","code":"4"},"location":{"id":"19753-ONDC-1-3523_location","gps":"12.9298689, 77.6848366","address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","country":"India","area_code":"560103"}}},"state":{"descriptor":{"code":"Pending"}},"tracking":false,"@ondc/org/awb_no":"112844922778"}],"billing":{"name":"Gofrugal Technologies Pvt Ltd","tax_number":"33AACCG2423J1ZZ","email":"accounts@gofrugal.com","phone":"9999988888","address":{"name":"KRISP IT Park","building":"942, Kelambakkam - Vandalur Rd","locality":"Kizhakottayur","city":"Chennai","state":"Tamil Nadu","country":"India","area_code":"600127"},"created_at":"2023-12-18T13:38:36.110Z","updated_at":"2023-12-18T13:38:36.110Z"},"@ondc/org/linked_order":{"items":[{"quantity":{"count":1,"measure":{"unit":"gram","value":10}},"price":{"currency":"INR","value":"2000.00"},"category_id":"Grocery","descriptor":{"name":"PLAIN ATTA"}}],"provider":{"descriptor":{"name":"Subbu Zoho ONDC"},"address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","area_code":"560103"}},"order":{"id":"2023-12-07-225813","weight":{"unit":"gram","value":10},"dimensions":{"length":{"unit":"centimeter","value":2},"breadth":{"unit":"centimeter","value":3},"height":{"unit":"centimeter","value":4}}}},"updated_at":"2023-12-18T13:38:39.973Z","created_at":"2023-12-07T14:20:59.374Z"}}}],"update":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"update","core_version":"1.2.0","bap_id":"stage-ondc.ecomexpress.in","bap_uri":"https://1b75-49-249-159-126.ngrok-free.app","bpp_id":"stage-ondc.ecomexpress.in","bpp_uri":"https://stage-ondc.ecomexpress.in","transaction_id":"347301e3-ea1d-48d1-9ca5-283b7c18d586","message_id":"889d3a90-9a20-4289-bb83-b05809918520","timestamp":"2023-12-18T13:38:54.815Z","ttl":"PT30S"},"message":{"order":{"id":"3Q1QNP3PGX","items":[{"id":"1","descriptor":{"code":"P2H2P"},"category_id":"Express Delivery"}],"fulfillments":[{"id":"1","type":"Delivery","tags":[{"code":"state","list":[{"code":"ready_to_ship","value":"yes"}]}],"@ondc/org/awb_no":"110919056165"}],"@ondc/org/linked_order":{"items":[{"quantity":{"count":1,"measure":{"unit":"gram","value":10}},"price":{"currency":"INR","value":"2000.00"},"category_id":"Grocery","descriptor":{"name":"PLAIN ATTA"}}],"provider":{"descriptor":{"name":"Subbu Zoho ONDC"},"address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","area_code":"560103"}},"order":{"id":"2023-12-07-225813","weight":{"unit":"gram","value":10},"dimensions":{"length":{"unit":"centimeter","value":2},"breadth":{"unit":"centimeter","value":3},"height":{"unit":"centimeter","value":4}}}},"updated_at":"2023-12-07T14:32:39.165Z"},"update_target":"fulfillment"}}],"on_update":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"on_update","core_version":"1.2.0","bap_id":"stage-ondc.ecomexpress.in","bap_uri":"https://1b75-49-249-159-126.ngrok-free.app","bpp_id":"stage-ondc.ecomexpress.in","bpp_uri":"https://stage-ondc.ecomexpress.in","transaction_id":"347301e3-ea1d-48d1-9ca5-283b7c18d586","message_id":"246cb466-8ac5-40b6-a586-08c8bdc1c72b","timestamp":"2023-12-18T13:38:55.288Z","ttl":"PT30S"},"message":{"order":{"id":"3Q1QNP3PGX","state":"Accepted","payment":{"type":"POST-FULFILLMENT","collected_by":"BAP"},"provider":{"id":"I1"},"quote":{"price":{"currency":"INR","value":"618.38"},"breakup":[{"price":{"currency":"INR","value":"618.38"},"@ondc/org/item_id":"1","@ondc/org/title_type":"delivery"}]},"items":[{"id":"1","quantity":{"count":1},"fulfillment_id":"1","category_id":"Express Delivery","descriptor":{"code":"P2H2P"}}],"fulfillments":[{"id":"1","type":"Delivery","tags":[{"code":"state","list":[{"code":"ready_to_ship","value":"yes"}]}],"end":{"person":{"name":"Mithun Chakraborty 420"},"time":{"range":{"start":"2023-12-23T00:00:00.000Z","end":"2023-12-23T23:59:00.000Z"}},"contact":{"phone":"9999988888","email":"Baba@Elaichi.com"},"location":{"gps":"28.5080098, 77.0909696","address":{"name":"Mithun Chakraborty 420","building":"IHQ ecom express","locality":"Unnamed Road","city":"Gurugram","state":"Haryana","country":"India","area_code":"122016"}}},"start":{"person":{"name":"Abinaya"},"time":{"range":{"start":"2023-12-19T00:00:00.000Z","end":"2023-12-19T23:59:00.000Z"}},"contact":{"phone":"09898767675","email":"abii@gmail.com"},"instructions":{"images":["https://stage-ondc.ecomexpress.in/shippingLabel/110919056165"]},"location":{"id":"19753-ONDC-1-3523_location","gps":"12.9298689, 77.6848366","address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","country":"India","area_code":"560103"}}},"state":{"descriptor":{"code":"Pending"}},"tracking":false,"@ondc/org/awb_no":"112844922778"}],"billing":{"name":"Gofrugal Technologies Pvt Ltd","tax_number":"33AACCG2423J1ZZ","email":"accounts@gofrugal.com","phone":"9999988888","address":{"name":"KRISP IT Park","building":"942, Kelambakkam - Vandalur Rd","locality":"Kizhakottayur","city":"Chennai","state":"Tamil Nadu","country":"India","area_code":"600127"},"created_at":"2023-12-18T13:38:36.110Z","updated_at":"2023-12-18T13:38:36.110Z"},"@ondc/org/linked_order":{"items":[{"quantity":{"count":1,"measure":{"unit":"gram","value":10}},"price":{"currency":"INR","value":"2000.00"},"category_id":"Grocery","descriptor":{"name":"PLAIN ATTA"}}],"provider":{"descriptor":{"name":"Subbu Zoho ONDC"},"address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","area_code":"560103"}},"order":{"id":"2023-12-07-225813","weight":{"unit":"gram","value":10},"dimensions":{"length":{"unit":"centimeter","value":2},"breadth":{"unit":"centimeter","value":3},"height":{"unit":"centimeter","value":4}}}},"updated_at":"2023-12-18T13:38:55.288Z","created_at":"2023-12-07T14:20:59.374Z"}}}],"on_cancel":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"on_cancel","core_version":"1.2.0","bap_id":"stage-ondc.ecomexpress.in","bap_uri":"https://1b75-49-249-159-126.ngrok-free.app","bpp_id":"stage-ondc.ecomexpress.in","bpp_uri":"https://stage-ondc.ecomexpress.in","transaction_id":"347301e3-ea1d-48d1-9ca5-283b7c18d586","message_id":"11457434-00a2-434d-bc7f-16eff98e3737","timestamp":"2023-12-18T13:39:37.639Z","ttl":"PT30S"},"message":{"order":{"id":"3Q1QNP3PGX","state":"Cancelled","payment":{"type":"POST-FULFILLMENT","collected_by":"BAP"},"cancellation":{"reason":{"id":"004"},"cancelled_by":"stage-ondc.ecomexpress.in"},"provider":{"id":"I1"},"quote":{"price":{"currency":"INR","value":"618.38"},"breakup":[{"price":{"currency":"INR","value":"618.38"},"@ondc/org/item_id":"1","@ondc/org/title_type":"delivery"}]},"items":[{"id":"1","quantity":{"count":1},"fulfillment_id":"1","category_id":"Express Delivery","descriptor":{"code":"P2H2P"}}],"fulfillments":[{"id":"2","type":"RTO","tags":[{"code":"rto_event","list":[{"code":"retry_count","value":"3"},{"code":"rto_id","value":"2"},{"code":"cancellation_reason_id","value":"004"},{"code":"cancelled_by","value":"stage-ondc.ecomexpress.in"}]}],"end":{"person":{"name":"Mithun Chakraborty 420"},"time":{"range":{"start":"2023-12-23T00:00:00.000Z","end":"2023-12-23T23:59:00.000Z"}},"contact":{"phone":"9999988888","email":"Baba@Elaichi.com"},"location":{"gps":"28.5080098, 77.0909696","address":{"name":"Mithun Chakraborty 420","building":"IHQ ecom express","locality":"Unnamed Road","city":"Gurugram","state":"Haryana","country":"India","area_code":"122016"}}},"start":{"person":{"name":"Abinaya"},"time":{"timestamp":"2023-12-15T08:50:53.670Z","range":{"start":"2023-12-19T00:00:00.000Z","end":"2023-12-19T23:59:00.000Z"}},"contact":{"phone":"09898767675","email":"abii@gmail.com"},"instructions":{"images":["https://stage-ondc.ecomexpress.in/shippingLabel/110919056165"]},"location":{"id":"19753-ONDC-1-3523_location","gps":"12.9298689, 77.6848366","address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","country":"India","area_code":"560103"}}},"state":{"descriptor":{"code":"Cancelled"}},"tracking":false,"@ondc/org/awb_no":"112844922778"}],"billing":{"name":"Gofrugal Technologies Pvt Ltd","tax_number":"33AACCG2423J1ZZ","email":"accounts@gofrugal.com","phone":"9999988888","address":{"name":"KRISP IT Park","building":"942, Kelambakkam - Vandalur Rd","locality":"Kizhakottayur","city":"Chennai","state":"Tamil Nadu","country":"India","area_code":"600127"},"created_at":"2023-12-18T13:38:36.110Z","updated_at":"2023-12-18T13:38:36.110Z"},"@ondc/org/linked_order":{"items":[{"quantity":{"count":1,"measure":{"unit":"gram","value":10}},"price":{"currency":"INR","value":"2000.00"},"category_id":"Grocery","descriptor":{"name":"PLAIN ATTA"}}],"provider":{"descriptor":{"name":"Subbu Zoho ONDC"},"address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","area_code":"560103"}},"order":{"id":"2023-12-07-225813","weight":{"unit":"gram","value":10},"dimensions":{"length":{"unit":"centimeter","value":2},"breadth":{"unit":"centimeter","value":3},"height":{"unit":"centimeter","value":4}}}},"updated_at":"2023-12-18T13:39:37.639Z","created_at":"2023-12-07T14:20:59.374Z"}}}],"on_status":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"on_status","core_version":"1.2.0","bap_id":"stage-ondc.ecomexpress.in","bap_uri":"https://1b75-49-249-159-126.ngrok-free.app","bpp_id":"stage-ondc.ecomexpress.in","bpp_uri":"https://stage-ondc.ecomexpress.in","transaction_id":"347301e3-ea1d-48d1-9ca5-283b7c18d586","message_id":"0bf1fd6a-8e8f-4fc1-aad2-79152c0237b4","timestamp":"2023-12-18T13:40:21.368Z","ttl":"PT30S"},"message":{"order":{"id":"3Q1QNP3PGX","state":"Cancelled","payment":{"type":"POST-FULFILLMENT","collected_by":"BAP","status":"PAID"},"cancellation":{"reason":{"id":"004"},"cancelled_by":"stage-ondc.ecomexpress.in"},"provider":{"id":"I1"},"quote":{"price":{"currency":"INR","value":"618.38"},"breakup":[{"price":{"currency":"INR","value":"618.38"},"@ondc/org/item_id":"1","@ondc/org/title_type":"delivery"}]},"items":[{"id":"1","quantity":{"count":1},"fulfillment_id":"1","category_id":"Express Delivery","descriptor":{"code":"P2H2P"}}],"fulfillments":[{"id":"2","type":"RTO","tags":[{"code":"rto_event","list":[{"code":"retry_count","value":"3"},{"code":"rto_id","value":"2"},{"code":"cancellation_reason_id","value":"004"},{"code":"cancelled_by","value":"stage-ondc.ecomexpress.in"}]}],"end":{"person":{"name":"Mithun Chakraborty 420"},"time":{"range":{"start":"2023-12-23T00:00:00.000Z","end":"2023-12-23T23:59:00.000Z"}},"contact":{"phone":"9999988888","email":"Baba@Elaichi.com"},"location":{"gps":"28.5080098, 77.0909696","address":{"name":"Mithun Chakraborty 420","building":"IHQ ecom express","locality":"Unnamed Road","city":"Gurugram","state":"Haryana","country":"India","area_code":"122016"}}},"start":{"person":{"name":"Abinaya"},"time":{"timestamp":"2023-12-15T08:50:53.670Z","range":{"start":"2023-12-19T00:00:00.000Z","end":"2023-12-19T23:59:00.000Z"}},"contact":{"phone":"09898767675","email":"abii@gmail.com"},"instructions":{"images":["https://stage-ondc.ecomexpress.in/shippingLabel/110919056165"]},"location":{"id":"19753-ONDC-1-3523_location","gps":"12.9298689, 77.6848366","address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","country":"India","area_code":"560103"}}},"state":{"descriptor":{"code":"RTO-Initiated"}},"tracking":false,"@ondc/org/awb_no":"112844922778"}],"billing":{"name":"Gofrugal Technologies Pvt Ltd","tax_number":"33AACCG2423J1ZZ","email":"accounts@gofrugal.com","phone":"9999988888","address":{"name":"KRISP IT Park","building":"942, Kelambakkam - Vandalur Rd","locality":"Kizhakottayur","city":"Chennai","state":"Tamil Nadu","country":"India","area_code":"600127"},"created_at":"2023-12-18T13:38:36.110Z","updated_at":"2023-12-18T13:38:36.110Z"},"@ondc/org/linked_order":{"items":[{"quantity":{"count":1,"measure":{"unit":"gram","value":10}},"price":{"currency":"INR","value":"2000.00"},"category_id":"Grocery","descriptor":{"name":"PLAIN ATTA"}}],"provider":{"descriptor":{"name":"Subbu Zoho ONDC"},"address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","area_code":"560103"}},"order":{"id":"2023-12-07-225813","weight":{"unit":"gram","value":10},"dimensions":{"length":{"unit":"centimeter","value":2},"breadth":{"unit":"centimeter","value":3},"height":{"unit":"centimeter","value":4}}}},"updated_at":"2023-12-18T13:40:21.368Z","created_at":"2023-12-07T14:20:59.374Z"}}},{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"on_status","core_version":"1.2.0","bap_id":"stage-ondc.ecomexpress.in","bap_uri":"https://1b75-49-249-159-126.ngrok-free.app","bpp_id":"stage-ondc.ecomexpress.in","bpp_uri":"https://stage-ondc.ecomexpress.in","transaction_id":"347301e3-ea1d-48d1-9ca5-283b7c18d586","message_id":"2119685b-9816-4571-b6bd-4f428ee12812","timestamp":"2023-12-18T13:41:34.451Z","ttl":"PT30S"},"message":{"order":{"id":"3Q1QNP3PGX","state":"Cancelled","payment":{"type":"POST-FULFILLMENT","collected_by":"BAP","status":"PAID"},"cancellation":{"reason":{"id":"004"},"cancelled_by":"stage-ondc.ecomexpress.in"},"provider":{"id":"I1"},"quote":{"price":{"currency":"INR","value":"618.38"},"breakup":[{"price":{"currency":"INR","value":"618.38"},"@ondc/org/item_id":"1","@ondc/org/title_type":"delivery"}]},"items":[{"id":"1","quantity":{"count":1},"fulfillment_id":"1","category_id":"Express Delivery","descriptor":{"code":"P2H2P"}}],"fulfillments":[{"id":"2","type":"RTO","tags":[{"code":"rto_event","list":[{"code":"retry_count","value":"3"},{"code":"rto_id","value":"2"},{"code":"cancellation_reason_id","value":"004"},{"code":"cancelled_by","value":"stage-ondc.ecomexpress.in"}]}],"end":{"person":{"name":"Mithun Chakraborty 420"},"time":{"timestamp":"2023-12-15T08:50:53.670Z","range":{"start":"2023-12-23T00:00:00.000Z","end":"2023-12-23T23:59:00.000Z"}},"contact":{"phone":"9999988888","email":"Baba@Elaichi.com"},"location":{"gps":"28.5080098, 77.0909696","address":{"name":"Mithun Chakraborty 420","building":"IHQ ecom express","locality":"Unnamed Road","city":"Gurugram","state":"Haryana","country":"India","area_code":"122016"}}},"start":{"person":{"name":"Abinaya"},"time":{"timestamp":"2023-12-15T08:50:53.670Z","range":{"start":"2023-12-19T00:00:00.000Z","end":"2023-12-19T23:59:00.000Z"}},"contact":{"phone":"09898767675","email":"abii@gmail.com"},"instructions":{"images":["https://stage-ondc.ecomexpress.in/shippingLabel/110919056165"]},"location":{"id":"19753-ONDC-1-3523_location","gps":"12.9298689, 77.6848366","address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","country":"India","area_code":"560103"}}},"state":{"descriptor":{"code":"RTO-Delivered"}},"tracking":false,"@ondc/org/awb_no":"112844922778"}],"billing":{"name":"Gofrugal Technologies Pvt Ltd","tax_number":"33AACCG2423J1ZZ","email":"accounts@gofrugal.com","phone":"9999988888","address":{"name":"KRISP IT Park","building":"942, Kelambakkam - Vandalur Rd","locality":"Kizhakottayur","city":"Chennai","state":"Tamil Nadu","country":"India","area_code":"600127"},"created_at":"2023-12-18T13:38:36.110Z","updated_at":"2023-12-18T13:38:36.110Z"},"@ondc/org/linked_order":{"items":[{"quantity":{"count":1,"measure":{"unit":"gram","value":10}},"price":{"currency":"INR","value":"2000.00"},"category_id":"Grocery","descriptor":{"name":"PLAIN ATTA"}}],"provider":{"descriptor":{"name":"Subbu Zoho ONDC"},"address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","area_code":"560103"}},"order":{"id":"2023-12-07-225813","weight":{"unit":"gram","value":10},"dimensions":{"length":{"unit":"centimeter","value":2},"breadth":{"unit":"centimeter","value":3},"height":{"unit":"centimeter","value":4}}}},"updated_at":"2023-12-18T13:41:34.451Z","created_at":"2023-12-07T14:20:59.374Z"}}}]} \ No newline at end of file diff --git a/utilities/logistics-b2b/log-verification-utility/public/server/logistics/6802cbf8-dbb2-4562-abda-3fc2ebef2b75/merged.json b/utilities/logistics-b2b/log-verification-utility/public/server/logistics/6802cbf8-dbb2-4562-abda-3fc2ebef2b75/merged.json new file mode 100644 index 0000000..bc99584 --- /dev/null +++ b/utilities/logistics-b2b/log-verification-utility/public/server/logistics/6802cbf8-dbb2-4562-abda-3fc2ebef2b75/merged.json @@ -0,0 +1 @@ +{"search":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"search","core_version":"1.2.0","bap_id":"extweb.oyeti.com/ecommerce/ondc","bap_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","transaction_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","message_id":"2f7b0c90-edf2-485f-ae15-665229687122","timestamp":"2023-12-08T09:07:59.783Z","ttl":"PT30S"},"message":{"intent":{"category":{"id":"Immediate Delivery"},"provider":{"time":{"days":"1,2,3,4,5,6","schedule":{"holidays":[]},"duration":"PT30M","range":{"start":"0630","end":"2359"}}},"fulfillment":{"type":"Delivery","start":{"location":{"gps":"12.9029804, 77.6241936","address":{"area_code":"560068"}}},"end":{"location":{"gps":"12.903803216971028, 77.62518882751466","address":{"area_code":"560068"}}}},"payment":{"type":"ON-ORDER","@ondc/org/collection_amount":"0"},"@ondc/org/payload_details":{"weight":{"unit":"kilogram","value":3},"dimensions":{"length":{"unit":"centimeter","value":15},"breadth":{"unit":"centimeter","value":10},"height":{"unit":"centimeter","value":10}},"category":"F&B","value":{"currency":"INR","value":"238.0"}}}}}],"on_search":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"on_search","core_version":"1.2.0","bap_id":"extweb.oyeti.com/ecommerce/ondc","bap_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","transaction_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","message_id":"2f7b0c90-edf2-485f-ae15-665229687122","timestamp":"2023-12-08T09:07:59.909Z","bpp_id":"ref-logistics-app-preprod.ondc.org","bpp_uri":"https://ref-logistics-app-preprod.ondc.org"},"message":{"catalog":{"bpp/descriptor":{"name":"WITS Project Ref Logistic"},"bpp/providers":[{"id":"275b09c9-d0d9-42bb-98f1-2c4153a9d320","descriptor":{"name":"WITS Project Ref Logistic","long_desc":"WITS Project Ref Logistic","short_desc":"WITS Project Ref Logistic"},"categories":[{"id":"Immediate Delivery","time":{"label":"TAT","duration":"PT60M","timestamp":"2023-12-08"}}],"fulfillments":[{"id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","type":"Delivery","start":{"time":{"duration":"PT15M"}},"tags":[{"code":"distance","list":[{"code":"motorable_distance_type","value":"kilometer"},{"code":"motorable_distance","value":"0.15"}]}]},{"id":"9ad1e641-0ba2-4689-a25a-82f8c74671e1","type":"RTO"}],"items":[{"id":"Standard","parent_item_id":"","category_id":"Immediate Delivery","fulfillment_id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","descriptor":{"code":"P2P","name":"Immediate Delivery","long_desc":"Upto 60 mins for Delivery","short_desc":"Upto 60 mins for Delivery"},"price":{"currency":"INR","value":"122.38"},"time":{"label":"TAT","duration":"PT60M","timestamp":"2023-12-08"}},{"id":"rto","parent_item_id":"Standard","category_id":"Immediate Delivery","fulfillment_id":"9ad1e641-0ba2-4689-a25a-82f8c74671e1","descriptor":{"code":"P2P","name":"RTO quote","short_desc":"RTO quote","long_desc":"RTO quote"},"price":{"currency":"INR","value":"34.82"},"time":{"label":"TAT","duration":"P1D","timestamp":"2023-12-09"}}]}]}}}],"cancel":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"cancel","core_version":"1.2.0","bap_id":"extweb.oyeti.com/ecommerce/ondc","bap_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","bpp_id":"extweb.oyeti.com/ecommerce/ondc","bpp_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","transaction_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","message_id":"e292631e-2f47-4af4-b767-3f03bf44ef94","timestamp":"2023-12-08T09:08:09.356Z","ttl":"PT30S"},"message":{"order_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","cancellation_reason_id":"010"}}],"init":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"init","core_version":"1.2.0","bap_id":"extweb.oyeti.com/ecommerce/ondc","bap_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","bpp_id":"extweb.oyeti.com/ecommerce/ondc","bpp_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","transaction_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","message_id":"e292631e-2f47-4af4-b767-3f03bf44ef94","timestamp":"2023-12-08T09:08:09.356Z","ttl":"PT30S"},"message":{"order":{"provider":{"id":"275b09c9-d0d9-42bb-98f1-2c4153a9d320"},"items":[{"id":"Standard","fulfillment_id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","category_id":"Immediate Delivery","descriptor":{"code":"P2P"}}],"fulfillments":[{"id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","type":"Delivery","start":{"location":{"gps":"12.9029804, 77.6241936","address":{"name":"Nandyal Chefs","building":"Bommanahalli","locality":"Bengaluru, Bangalore Division, Karnataka, India","city":"Bengaluru","state":"Karnataka","country":"India","area_code":"560068"}},"contact":{"phone":"7893847511","email":"venkateshmurapureddy@gmail.com"}},"end":{"location":{"gps":"12.903803216971028, 77.62518882751466","address":{"name":"Venkateswara Reddy","building":"Venky House","locality":"9th A Cross Road","city":"Bengaluru","state":"Karnataka","country":"IND","area_code":"560068"}},"contact":{"phone":"7893847511","email":"venkateshmurapureddy@gmail.com"}}}],"billing":{"name":"Kumar Abhishek","email":"accounts@tonetag.com","phone":"8197153537","address":{"city":"Bengaluru","name":"Naffa Innovations Pvt Ltd","state":"Karnataka","country":"IND","building":"117, The Arcade, Brigade Metropolis, Garudachar Palya","locality":"Mahadevapura","area_code":"560048"},"created_at":"2023-12-08T09:08:09.356Z","updated_at":"2023-12-08T09:08:09.356Z","tax_number":"29AAECN5025F1ZK"},"payment":{"type":"ON-ORDER","collected_by":"BPP","@ondc/org/settlement_details":[]}}}}],"on_init":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"on_init","core_version":"1.2.0","bap_id":"extweb.oyeti.com/ecommerce/ondc","bap_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","bpp_id":"extweb.oyeti.com/ecommerce/ondc","bpp_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","transaction_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","message_id":"e292631e-2f47-4af4-b767-3f03bf44ef94","timestamp":"2023-12-08T09:08:09.525Z"},"message":{"order":{"provider":{"id":"275b09c9-d0d9-42bb-98f1-2c4153a9d320"},"items":[{"id":"Standard","fulfillment_id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","descriptor":{"code":"P2P"},"category_id":"Immediate Delivery"}],"fulfillments":[{"id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","type":"Delivery","start":{"location":{"gps":"12.9029804, 77.6241936","address":{"name":"Nandyal Chefs","building":"Bommanahalli","locality":"Bengaluru, Bangalore Division, Karnataka, India","city":"Bengaluru","state":"Karnataka","country":"India","area_code":"560068"}},"contact":{"phone":"7893847511","email":"venkateshmurapureddy@gmail.com"},"instructions":{"images":[]}},"end":{"location":{"gps":"12.903803216971028, 77.62518882751466","address":{"name":"Venkateswara Reddy","building":"Venky House","locality":"9th A Cross Road","city":"Bengaluru","state":"Karnataka","country":"IND","area_code":"560068"}},"contact":{"phone":"7893847511","email":"venkateshmurapureddy@gmail.com"},"instructions":{"images":[]}},"tags":[{"code":"rider_check","list":[{"code":"inline_check_for_rider","value":"yes"}]}]}],"quote":{"price":{"currency":"INR","value":"122.38"},"breakup":[{"@ondc/org/item_id":"Standard","@ondc/org/title_type":"delivery","price":{"currency":"INR","value":"116.00"}},{"@ondc/org/item_id":"Standard","@ondc/org/title_type":"tax","price":{"currency":"INR","value":"6.38"}}],"ttl":"PT15M"},"payment":{"type":"ON-ORDER","collected_by":"BAP","@ondc/org/settlement_details":[]},"cancellation_terms":[{"fulfillment_state":{"descriptor":{"code":"Pending","short_desc":""}},"refund_eligible":true,"reason_required":false,"cancellation_fee":{"amount":{"currency":"INR","value":"0.0"}}},{"fulfillment_state":{"descriptor":{"code":"Agent-assigned","short_desc":"001,003"}},"refund_eligible":true,"reason_required":true,"cancellation_fee":{"amount":{"currency":"INR","value":"50"}}},{"fulfillment_state":{"descriptor":{"code":"Order-picked-up","short_desc":"001,003"}},"refund_eligible":true,"reason_required":true,"cancellation_fee":{"amount":{"currency":"INR","value":"100"}}},{"fulfillment_state":{"descriptor":{"code":"Out-for-delivery","short_desc":"011,012,013,014,015"}},"refund_eligible":true,"reason_required":true,"cancellation_fee":{"amount":{"currency":"INR","value":"100.0"}}}],"tags":[{"code":"bpp_terms","list":[{"code":"max_liability","value":"2"},{"code":"max_liability_cap","value":"10000"},{"code":"mandatory_arbitration","value":"false"},{"code":"court_jurisdiction","value":"Bengaluru"},{"code":"delay_interest","value":"1000"},{"code":"static_terms","value":"https://github.com/ONDC-Official/protocol-network-extension/discussions/79"}]}]}}}],"confirm":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"confirm","core_version":"1.2.0","bap_id":"extweb.oyeti.com/ecommerce/ondc","bap_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","bpp_id":"extweb.oyeti.com/ecommerce/ondc","bpp_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","transaction_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","message_id":"47f3f650-4661-425b-b68d-031efaba239b","timestamp":"2023-12-08T09:08:11.306Z","ttl":"PT30S"},"message":{"order":{"id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","state":"Created","provider":{"id":"275b09c9-d0d9-42bb-98f1-2c4153a9d320"},"items":[{"id":"Standard","fulfillment_id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","descriptor":{"code":"P2P"},"category_id":"Immediate Delivery","time":{"label":"TAT","duration":"PT30M","timestamp":"2023-12-08"}}],"quote":{"price":{"value":"122.38","currency":"INR"},"breakup":[{"@ondc/org/item_id":"Standard","price":{"value":"116.00","currency":"INR"},"@ondc/org/title_type":"delivery"},{"@ondc/org/item_id":"Standard","price":{"value":"6.38","currency":"INR"},"@ondc/org/title_type":"tax"}]},"fulfillments":[{"id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","type":"Delivery","tracking":true,"start":{"time":{"duration":"P1D"},"person":{"name":"Nandyal Chefs"},"location":{"gps":"12.9029804, 77.6241936","address":{"name":"Nandyal Chefs","building":"Bommanahalli","locality":"Bengaluru, Bangalore Division, Karnataka, India","city":"Bengaluru","state":"Karnataka","country":"India","area_code":"560068"}},"contact":{"phone":"7893847511","email":"venkateshmurapureddy@gmail.com"},"instructions":{"code":"2","short_desc":"650909","long_desc":"Order Numer Last 6 Digits"}},"end":{"person":{"name":"Venkateswara Reddy"},"location":{"gps":"12.903803216971028, 77.62518882751466","address":{"name":"Venkateswara Reddy","building":"Venky House","locality":"9th A Cross Road","city":"Bengaluru","state":"Karnataka","country":"IND","area_code":"560068"}},"contact":{"phone":"7893847511","email":"venkateshmurapureddy@gmail.com"},"instructions":{"code":"2","short_desc":"650909","long_desc":"Order Numer Last 6 Digits"}},"tags":[{"code":"state","list":[{"code":"ready_to_ship","value":"no"}]},{"code":"rto_action","list":[{"code":"return_to_origin","value":"yes"}]}]}],"billing":{"name":"Kumar Abhishek","email":"accounts@tonetag.com","phone":"8197153537","address":{"city":"Bengaluru","name":"Naffa Innovations Pvt Ltd","state":"Karnataka","country":"IND","building":"117, The Arcade, Brigade Metropolis, Garudachar Palya","locality":"Mahadevapura","area_code":"560048"},"created_at":"2023-12-08T09:08:11.306Z","updated_at":"2023-12-08T09:08:11.306Z","tax_number":"29AAECN5025F1ZK"},"payment":{"type":"ON-ORDER","collected_by":"BPP"},"@ondc/org/linked_order":{"items":[{"category_id":"F&B","descriptor":{"name":"Almond Filter Coffee"},"quantity":{"count":2,"measure":{"unit":"kilogram","value":3}},"price":{"currency":"INR","value":"119.0"}}],"provider":{"descriptor":{"name":"Nandyal Chefs"},"address":{"name":"Nandyal Chefs","building":"Bommanahalli","locality":"Bengaluru, Bangalore Division, Karnataka, India","city":"Bengaluru","state":"Karnataka","country":"India","area_code":"560068"}},"order":{"id":"2023-12-08-650909","weight":{"unit":"kilogram","value":3},"dimensions":{"length":{"unit":"centimeter","value":15},"breadth":{"unit":"centimeter","value":10},"height":{"unit":"centimeter","value":10}}},"tags":[{"code":"bpp_terms","list":[{"code":"max_liability","value":"2"},{"code":"max_liability_cap","value":"10000"},{"code":"mandatory_arbitration","value":"false"},{"code":"court_jurisdiction","value":"Bengaluru"},{"code":"delay_interest","value":"1000"},{"code":"static_terms","value":"https://github.com/ONDC-Official/protocol-network-extension/discussions/79"}]}]},"created_at":"2023-12-08T09:08:11.306Z","updated_at":"2023-12-08T09:08:11.306Z"}}}],"on_confirm":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"on_confirm","core_version":"1.2.0","bap_id":"extweb.oyeti.com/ecommerce/ondc","bap_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","bpp_id":"ref-logistics-app-preprod.ondc.org","bpp_uri":"https://ref-logistics-app-preprod.ondc.org","transaction_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","message_id":"47f3f650-4661-425b-b68d-031efaba239b","timestamp":"2023-12-08T09:08:11.489Z"},"message":{"order":{"id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","state":"Accepted","provider":{"id":"275b09c9-d0d9-42bb-98f1-2c4153a9d320"},"items":[{"descriptor":{"code":"P2P"},"time":{"label":"TAT","duration":"PT30M","timestamp":"2023-12-08"},"id":"Standard","fulfillment_id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","category_id":"Immediate Delivery"}],"quote":{"price":{"value":"122.38","currency":"INR"},"breakup":[{"price":{"currency":"INR","value":"116.00"},"@ondc/org/item_id":"Standard","@ondc/org/title_type":"delivery"},{"price":{"currency":"INR","value":"6.38"},"@ondc/org/item_id":"Standard","@ondc/org/title_type":"tax"}]},"fulfillments":[{"state":{"descriptor":{"code":"Pending"}},"id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","type":"Delivery","start":{"time":{"duration":"P1D"},"person":{"name":"Nandyal Chefs"},"location":{"gps":"12.9029804, 77.6241936","address":{"name":"Nandyal Chefs","building":"Bommanahalli","locality":"Bengaluru, Bangalore Division, Karnataka, India","city":"Bengaluru","state":"Karnataka","country":"India","area_code":"560068"}},"contact":{"phone":"7893847511","email":"venkateshmurapureddy@gmail.com"},"instructions":{"code":"2","short_desc":"650909","images":[]}},"end":{"person":{"name":"Venkateswara Reddy"},"location":{"gps":"12.903803216971028, 77.62518882751466","address":{"name":"Venkateswara Reddy","building":"Venky House","locality":"9th A Cross Road","city":"Bengaluru","state":"Karnataka","country":"IND","area_code":"560068"}},"contact":{"phone":"7893847511","email":"venkateshmurapureddy@gmail.com"},"instructions":{"code":"2","short_desc":"650909","images":[]}},"tags":[{"code":"state","list":[{"code":"ready_to_ship","value":"no"}]},{"code":"rto_action","list":[{"code":"return_to_origin","value":"yes"}]}],"tracking":false}],"billing":{"name":"Kumar Abhishek","email":"accounts@tonetag.com","phone":"8197153537","address":{"name":"Naffa Innovations Pvt Ltd","building":"117, The Arcade, Brigade Metropolis, Garudachar Palya","locality":"Mahadevapura","city":"Bengaluru","state":"Karnataka","country":"IND","area_code":"560048"},"created_at":"2023-12-08T09:08:11.306Z","updated_at":"2023-12-08T09:08:11.306Z","tax_number":"29AAECN5025F1ZK"},"payment":{"type":"ON-ORDER","collected_by":"BPP","status":"PAID","@ondc/org/settlement_details":[]},"@ondc/org/linked_order":{"provider":{"descriptor":{"name":"Nandyal Chefs"},"address":{"name":"Nandyal Chefs","building":"Bommanahalli","locality":"Bengaluru, Bangalore Division, Karnataka, India","city":"Bengaluru","state":"Karnataka","country":"India","area_code":"560068"}},"order":{"weight":{"unit":"kilogram","value":3},"id":"2023-12-08-650909","dimensions":{"length":{"unit":"centimeter","value":15},"breadth":{"unit":"centimeter","value":10},"height":{"unit":"centimeter","value":10}}},"items":[{"descriptor":{"name":"Almond Filter Coffee"},"quantity":{"measure":{"value":3,"unit":"kilogram"},"count":2},"price":{"currency":"INR","value":"119.0"},"category_id":"F&B"}]},"cancellation_terms":[{"fulfillment_state":{"descriptor":{"code":"Pending","short_desc":""}},"cancellation_fee":{"amount":{"currency":"INR","value":"0.0"}},"refund_eligible":true,"reason_required":false},{"fulfillment_state":{"descriptor":{"code":"Agent-assigned","short_desc":"001,003"}},"cancellation_fee":{"amount":{"currency":"INR","value":"50"}},"refund_eligible":true,"reason_required":true},{"fulfillment_state":{"descriptor":{"code":"Order-picked-up","short_desc":"001,003"}},"cancellation_fee":{"amount":{"currency":"INR","value":"100"}},"refund_eligible":true,"reason_required":true},{"fulfillment_state":{"descriptor":{"code":"Out-for-delivery","short_desc":"011,012,013,014,015"}},"cancellation_fee":{"amount":{"currency":"INR","value":"100.0"}},"refund_eligible":true,"reason_required":true}],"tags":[{"code":"bpp_terms","list":[{"code":"max_liability","value":"2"},{"code":"max_liability_cap","value":"10000"},{"code":"mandatory_arbitration","value":"false"},{"code":"court_jurisdiction","value":"Bengaluru"},{"code":"delay_interest","value":"1000"},{"code":"static_terms","value":"https://github.com/ONDC-Official/protocol-network-extension/discussions/79"}]}],"created_at":"2023-12-08T09:08:11.306Z","updated_at":"2023-12-08T09:08:11.489Z"}}}],"status":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"status","core_version":"1.2.0","bap_id":"extweb.oyeti.com/ecommerce/ondc","bap_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","bpp_id":"ref-logistics-app-preprod.ondc.org","bpp_uri":"https://ref-logistics-app-preprod.ondc.org","transaction_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","message_id":"47f3f650-4661-425b-b68d-031efaba239b","timestamp":"2023-12-08T09:08:11.489Z","ttl":"PT30S"},"message":{"order_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75"}}],"support":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"support","core_version":"1.2.0","bap_id":"extweb.oyeti.com/ecommerce/ondc","bap_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","bpp_id":"ref-logistics-app-preprod.ondc.org","bpp_uri":"https://ref-logistics-app-preprod.ondc.org","transaction_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","message_id":"47f3f650-4661-425b-b68d-031efaba239b","timestamp":"2023-12-08T09:08:11.489Z","ttl":"PT30S"},"message":{"ref_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75"}}],"track":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"track","core_version":"1.2.0","bap_id":"extweb.oyeti.com/ecommerce/ondc","bap_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","bpp_id":"ref-logistics-app-preprod.ondc.org","bpp_uri":"https://ref-logistics-app-preprod.ondc.org","transaction_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","message_id":"47f3f650-4661-425b-b68d-031efaba239b","timestamp":"2023-12-08T09:08:11.489Z","ttl":"PT30S"},"message":{"order_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75"}}],"on_track":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"on_track","core_version":"1.2.0","bap_id":"extweb.oyeti.com/ecommerce/ondc","bap_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","bpp_id":"ref-logistics-app-preprod.ondc.org","bpp_uri":"https://ref-logistics-app-preprod.ondc.org","transaction_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","message_id":"47f3f650-4661-425b-b68d-031efaba239b","timestamp":"2023-12-08T09:08:11.763Z"},"message":{"tracking":{"id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","location":{"gps":"12.958766,77.625282","time":{"timestamp":"2023-12-08T09:08:11.489Z"},"updated_at":"1970-01-01T00:00:00.000Z"},"status":"active"}}}],"on_support":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"on_support","core_version":"1.2.0","bap_id":"extweb.oyeti.com/ecommerce/ondc","bap_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","bpp_id":"ref-logistics-app-preprod.ondc.org","bpp_uri":"https://ref-logistics-app-preprod.ondc.org","transaction_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","message_id":"47f3f650-4661-425b-b68d-031efaba239b","timestamp":"2023-12-08T09:08:11.785Z"},"message":{"phone":"8755555551","email":"accounts@thewitslab.com","uri":"http://t.me/supportBot"}}],"on_status":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"on_status","core_version":"1.2.0","bap_id":"extweb.oyeti.com/ecommerce/ondc","bap_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","bpp_id":"ref-logistics-app-preprod.ondc.org","bpp_uri":"https://ref-logistics-app-preprod.ondc.org","transaction_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","message_id":"47f3f650-4661-425b-b68d-031efaba239b","timestamp":"2023-12-08T09:08:39.272Z"},"message":{"order":{"id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","state":"In-progress","provider":{"id":"275b09c9-d0d9-42bb-98f1-2c4153a9d320"},"items":[{"descriptor":{"code":"P2P"},"time":{"label":"TAT","duration":"PT30M","timestamp":"2023-12-08"},"id":"Standard","fulfillment_id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","category_id":"Immediate Delivery"}],"quote":{"price":{"value":"122.38","currency":"INR"},"breakup":[{"price":{"currency":"INR","value":"116.00"},"@ondc/org/item_id":"Standard","@ondc/org/title_type":"delivery"},{"price":{"currency":"INR","value":"6.38"},"@ondc/org/item_id":"Standard","@ondc/org/title_type":"tax"}]},"fulfillments":[{"state":{"descriptor":{"code":"Pending"}},"id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","type":"Delivery","start":{"time":{"duration":"P1D"},"person":{"name":"Nandyal Chefs"},"location":{"gps":"12.9029804, 77.6241936","address":{"name":"Nandyal Chefs","building":"Bommanahalli","locality":"Bengaluru, Bangalore Division, Karnataka, India","city":"Bengaluru","state":"Karnataka","country":"India","area_code":"560068"}},"contact":{"phone":"7893847511","email":"venkateshmurapureddy@gmail.com"},"instructions":{"code":"2","short_desc":"650909","images":[]}},"end":{"person":{"name":"Venkateswara Reddy"},"location":{"gps":"12.903803216971028, 77.62518882751466","address":{"name":"Venkateswara Reddy","building":"Venky House","locality":"9th A Cross Road","city":"Bengaluru","state":"Karnataka","country":"IND","area_code":"560068"}},"contact":{"phone":"7893847511","email":"venkateshmurapureddy@gmail.com"},"instructions":{"code":"2","short_desc":"650909","images":[]}},"tracking":false}],"payment":{"type":"ON-ORDER","collected_by":"BPP","@ondc/org/collection_amount":"0","status":"PAID","@ondc/org/settlement_details":[]},"billing":{"name":"Kumar Abhishek","email":"accounts@tonetag.com","phone":"8197153537","address":{"name":"Naffa Innovations Pvt Ltd","building":"117, The Arcade, Brigade Metropolis, Garudachar Palya","locality":"Mahadevapura","city":"Bengaluru","state":"Karnataka","country":"IND","area_code":"560048"},"created_at":"2023-12-08T09:08:11.306Z","updated_at":"2023-12-08T09:08:11.306Z","tax_number":"29AAECN5025F1ZK"},"@ondc/org/linked_order":{"provider":{"descriptor":{"name":"Nandyal Chefs"},"address":{"name":"Nandyal Chefs","building":"Bommanahalli","locality":"Bengaluru, Bangalore Division, Karnataka, India","city":"Bengaluru","state":"Karnataka","country":"India","area_code":"560068"}},"order":{"weight":{"unit":"kilogram","value":3},"id":"2023-12-08-650909","dimensions":{"length":{"unit":"centimeter","value":15},"breadth":{"unit":"centimeter","value":10},"height":{"unit":"centimeter","value":10}}},"items":[{"descriptor":{"name":"Almond Filter Coffee"},"quantity":{"measure":{"value":3,"unit":"kilogram"},"count":2},"price":{"currency":"INR","value":"119.0"},"category_id":"F&B"}]}}}}],"on_cancel":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"on_cancel","core_version":"1.2.0","bap_id":"extweb.oyeti.com/ecommerce/ondc","bap_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","bpp_id":"ref-logistics-app-preprod.ondc.org","bpp_uri":"https://ref-logistics-app-preprod.ondc.org","transaction_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","message_id":"e292631e-2f47-4af4-b767-3f03bf44ef94","timestamp":"2023-12-08T09:34:28.223Z"},"message":{"order":{"id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","state":"Cancelled","cancellation":{"cancelled_by":"extweb.oyeti.com/ecommerce/ondc","reason":{"id":"010"}},"provider":{"id":"275b09c9-d0d9-42bb-98f1-2c4153a9d320"},"items":[{"id":"Standard","fulfillment_id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","descriptor":{"code":"P2P"},"category_id":"Immediate Delivery","time":{"label":"TAT","duration":"PT30M","timestamp":"2023-12-08"}},{"id":"rto","fulfillment_id":"9ad1e641-0ba2-4689-a25a-82f8c74671e1","descriptor":{"code":"P2P"},"category_id":"Immediate Delivery","time":{"label":"TAT","duration":"PT60M","timestamp":"2023-12-08"}}],"quote":{"price":{"value":"159.09","currency":"INR"},"breakup":[{"@ondc/org/item_id":"Standard","@ondc/org/title_type":"delivery","price":{"currency":"INR","value":"116.00"}},{"@ondc/org/item_id":"Standard","@ondc/org/title_type":"tax","price":{"currency":"INR","value":"6.38"}},{"@ondc/org/item_id":"rto","@ondc/org/title_type":"rto","price":{"currency":"INR","value":"36.71"}},{"@ondc/org/item_id":"rto","@ondc/org/title_type":"tax","price":{"currency":"INR","value":"3.67"}}]},"fulfillments":[{"id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","type":"Delivery","state":{"descriptor":{"code":"Cancelled"}},"tracking":false,"start":{"time":{"duration":"P1D","timestamp":"2023-12-08T09:18:06.524Z"},"person":{"name":"Nandyal Chefs"},"location":{"gps":"12.9029804, 77.6241936","address":{"name":"Nandyal Chefs","building":"Bommanahalli","locality":"Bengaluru, Bangalore Division, Karnataka, India","city":"Bengaluru","state":"Karnataka","country":"India","area_code":"560068"}},"contact":{"phone":"7893847511","email":"venkateshmurapureddy@gmail.com"},"instructions":{"code":"2","short_desc":"650909","images":[]}},"end":{"person":{"name":"Venkateswara Reddy"},"location":{"gps":"12.903803216971028, 77.62518882751466","address":{"name":"Venkateswara Reddy","building":"Venky House","locality":"9th A Cross Road","city":"Bengaluru","state":"Karnataka","country":"IND","area_code":"560068"}},"contact":{"phone":"7893847511","email":"venkateshmurapureddy@gmail.com"},"instructions":{"code":"2","short_desc":"650909","images":[]},"time":{"timestamp":"2023-12-08T09:19:27.742Z"}}}],"billing":{"name":"Kumar Abhishek","email":"accounts@tonetag.com","phone":"8197153537","address":{"name":"Naffa Innovations Pvt Ltd","building":"117, The Arcade, Brigade Metropolis, Garudachar Palya","locality":"Mahadevapura","city":"Bengaluru","state":"Karnataka","country":"IND","area_code":"560048"},"created_at":"2023-12-08T09:08:11.306Z","updated_at":"2023-12-08T09:08:11.306Z","tax_number":"29AAECN5025F1ZK"},"payment":{"type":"ON-ORDER","collected_by":"BPP","@ondc/org/collection_amount":"0","status":"PAID","time":{"timestamp":"2023-12-08T09:19:27.742Z"}},"@ondc/org/linked_order":{"items":[{"category_id":"F&B","descriptor":{"name":"Almond Filter Coffee"},"quantity":{"count":2,"measure":{"value":3,"unit":"kilogram"}},"price":{"currency":"INR","value":"119.0"}}],"provider":{"descriptor":{"name":"Nandyal Chefs"},"address":{"name":"Nandyal Chefs","building":"Bommanahalli","locality":"Bengaluru, Bangalore Division, Karnataka, India","city":"Bengaluru","state":"Karnataka","country":"India","area_code":"560068"}},"order":{"id":"2023-12-08-650909","weight":{"unit":"kilogram","value":3},"dimensions":{"length":{"unit":"centimeter","value":15},"breadth":{"unit":"centimeter","value":10},"height":{"unit":"centimeter","value":10}}}},"updated_at":"2023-12-08T09:34:28.223Z"}}}]} \ No newline at end of file diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_confirm.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_confirm.js index 201216f..d6fef76 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_confirm.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_confirm.js @@ -628,8 +628,6 @@ module.exports = { }, }, isQuoteMatching: true, - errorMessage: - "price is not matching with the total breakup price", required: ["price", "breakup", "ttl"], }, payments: { diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_init.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_init.js index 5de61bb..c145f38 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_init.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_init.js @@ -549,8 +549,7 @@ module.exports = { }, }, isQuoteMatching: true, - errorMessage: - "price is not matching with the total breakup price", + required: ["price", "breakup", "ttl"], }, payments: { diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_select.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_select.js index 3a97ae2..f137e4b 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_select.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_select.js @@ -321,8 +321,7 @@ module.exports = { }, }, isQuoteMatching: true, - errorMessage: - "price is not matching with the total breakup price", + required: ["price", "breakup", "ttl"], }, }, diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_status.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_status.js index c687d03..4d202a2 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_status.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_status.js @@ -568,8 +568,7 @@ module.exports = { }, }, isQuoteMatching: true, - errorMessage: - "price is not matching with the total breakup price", + required: ["price", "breakup", "ttl"], }, payments: { diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/select.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/select.js index 9a4649c..8e18120 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/select.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/select.js @@ -177,7 +177,8 @@ module.exports = { type: "object", properties: { code: { - type: "string" + type: "string", + enum: ["BUYER_TERMS"], }, }, required: ["code"], @@ -191,7 +192,8 @@ module.exports = { type: "object", properties: { code: { - type: "string" + type: "string", + enum: ["ITEM_REQ", "PACKAGING_REQ"], }, }, required: ["code"], diff --git a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/initSchema.js b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/initSchema.js index 51e46f8..6844f48 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/initSchema.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/initSchema.js @@ -335,7 +335,6 @@ module.exports = { }, additionalProperties: false, isLengthValid:true, - errorMessage:"name + building + locality < 190 chars", required: [ "name", "building", diff --git a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/onStatusSchema.js b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/onStatusSchema.js index fb38da1..91a0436 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/onStatusSchema.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/onStatusSchema.js @@ -202,8 +202,7 @@ module.exports = { }, }, isQuoteMatching: true, - errorMessage: - "price is not matching with the total breakup price", + required: ["price", "breakup"], }, fulfillments: { diff --git a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/searchSchema.js b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/searchSchema.js index fd47ce2..e583451 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/searchSchema.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/searchSchema.js @@ -139,7 +139,6 @@ module.exports = { }, }, isEndTimeGreater: true, - errorMessage: 'The "end" time must be greater than the "start" time. Ref footnote 12 of v1.1 .', required: ["start", "end"], }, }, diff --git a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/common/commonSchema.js b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/common/commonSchema.js index 9a9ed5a..2d0b76e 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/common/commonSchema.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/common/commonSchema.js @@ -55,7 +55,6 @@ module.exports = { }, }, isLengthValid: true, - errorMessage: "name + building + locality < 190 chars", }, }, required: ["gps", "address"], diff --git a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/confirmSchema.js b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/confirmSchema.js index 5f77fae..9b96e2e 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/confirmSchema.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/confirmSchema.js @@ -1042,7 +1042,6 @@ module.exports = { }, }, // isFutureDated: true, - // errorMessage: - // "order/created_at or order/updated_at cannot be future dated w.r.t context/timestamp", + required: ["context", "message"], }; diff --git a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/initSchema.js b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/initSchema.js index 7ac6ff0..f63135d 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/initSchema.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/initSchema.js @@ -197,7 +197,7 @@ module.exports = { }, }, isLengthValid:true, - errorMessage:"name + building + locality < 190 chars", + required: [ "name", "building", @@ -275,7 +275,7 @@ module.exports = { }, }, isLengthValid:true, - errorMessage:"name + building + locality < 190 chars", + required: [ "name", "building", @@ -346,7 +346,6 @@ module.exports = { }, }, isLengthValid: true, - errorMessage: "name + building + locality < 190 chars", additionalProperties: false, required: [ "name", diff --git a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/onCancelSchema.js b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/onCancelSchema.js index 860fa2d..256cbe1 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/onCancelSchema.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/onCancelSchema.js @@ -195,8 +195,7 @@ module.exports = { }, required: ["price", "breakup"], isQuoteMatching: true, - errorMessage: - "price is not matching with the total breakup price", + }, fulfillments: { @@ -340,8 +339,7 @@ module.exports = { }, }, isLengthValid: true, - errorMessage: - "name + building + locality < 190 chars", + }, }, required: ["gps", "address"], @@ -462,8 +460,7 @@ module.exports = { }, }, isLengthValid: true, - errorMessage: - "name + building + locality < 190 chars", + }, }, required: ["gps", "address"], @@ -717,6 +714,6 @@ module.exports = { }, }, // isFutureDated: true, - // errorMessage: "order/created_at or order/updated_at cannot be future dated w.r.t context/timestamp", + required: ["context", "message"], }; diff --git a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/onInitSchema.js b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/onInitSchema.js index a372264..82bc4e4 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/onInitSchema.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/onInitSchema.js @@ -187,8 +187,7 @@ module.exports = { }, required: ["price", "breakup", "ttl"], isQuoteMatching: true, - errorMessage: - "price is not matching with the total breakup price", + }, fulfillments: { type: "array", diff --git a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/onStatusSchema.js b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/onStatusSchema.js index 348df28..0b7fbf5 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/onStatusSchema.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/onStatusSchema.js @@ -199,8 +199,7 @@ module.exports = { }, required: ["price", "breakup"], isQuoteMatching: true, - errorMessage: - "price is not matching with the total breakup price", + }, fulfillments: { type: "array", @@ -340,8 +339,7 @@ module.exports = { }, }, isLengthValid: true, - errorMessage: - "name + building + locality < 190 chars", + }, }, required: ["gps", "address"], @@ -467,8 +465,7 @@ module.exports = { }, }, isLengthValid: true, - errorMessage: - "name + building + locality < 190 chars", + }, }, required: ["gps", "address"], diff --git a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/searchSchema.js b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/searchSchema.js index 3c7def9..a750922 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/searchSchema.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/searchSchema.js @@ -122,8 +122,6 @@ module.exports = { }, }, isEndTimeGreater: true, - errorMessage: - 'The "end" time must be greater than the "start" time', required: ["start", "end"], }, }, From d162983144571a4849f5f622e90a6662a6d6ce8f Mon Sep 17 00:00:00 2001 From: Abhinav Goyal Date: Wed, 20 Dec 2023 11:45:10 +0530 Subject: [PATCH 2/7] bug fixes --- .../v1.1/confirmSchema.js | 5 +++++ .../v1.1/onStatusSchema.js | 2 +- .../v1.2/confirmSchema.js | 5 +++++ .../logistics_api_json_schema/v1.2/initSchema.js | 1 + .../v1.2/onUpdateSchema.js | 2 +- .../log-verification-utility/utils/ContextVal.js | 16 +++++++++++++--- .../utils/logistics/logConfirm.js | 2 +- .../utils/logistics/logOnStatus.js | 14 +++++++++----- 8 files changed, 36 insertions(+), 11 deletions(-) diff --git a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/confirmSchema.js b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/confirmSchema.js index 55f5a4c..bfe077e 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/confirmSchema.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/confirmSchema.js @@ -87,6 +87,11 @@ module.exports = { properties: { id: { type: "string", + not: { + const: { $data: "1/context/transaction_id" }, + }, + errorMessage: + "should be unique (cannot be equal to transaction_id)", }, state: { type: "string", diff --git a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/onStatusSchema.js b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/onStatusSchema.js index 91a0436..d9c2783 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/onStatusSchema.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/onStatusSchema.js @@ -393,7 +393,7 @@ module.exports = { }, }, if: { properties: { type: { const: "Prepaid" } } }, - then: { required: ["type", "state", "tracking"] }, + then: { required: ["type", "state", "tracking","start","end"] }, else: { required: ["type", "state"], }, diff --git a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/confirmSchema.js b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/confirmSchema.js index 9b96e2e..88416f6 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/confirmSchema.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/confirmSchema.js @@ -88,6 +88,11 @@ module.exports = { properties: { id: { type: "string", + not: { + const: { $data: "1/context/transaction_id" }, + }, + errorMessage: + "should be unique (cannot be equal to transaction_id)", }, state: { type: "string", diff --git a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/initSchema.js b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/initSchema.js index f63135d..0721b13 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/initSchema.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/initSchema.js @@ -459,6 +459,7 @@ module.exports = { errorMessage:"should be same as in /search - ${/search/0/message/intent/payment/type}" }, }, + additionalProperties:false, required: ["type"], }, }, diff --git a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/onUpdateSchema.js b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/onUpdateSchema.js index aad1d92..ab0a17a 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/onUpdateSchema.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/onUpdateSchema.js @@ -259,7 +259,7 @@ module.exports = { }, }, - required: ["code", "short_desc"], + required: [], allOf: [ { if: { properties: { code: { const: "1" } } }, diff --git a/utilities/logistics-b2b/log-verification-utility/utils/ContextVal.js b/utilities/logistics-b2b/log-verification-utility/utils/ContextVal.js index 7d0ceb7..11175d7 100644 --- a/utilities/logistics-b2b/log-verification-utility/utils/ContextVal.js +++ b/utilities/logistics-b2b/log-verification-utility/utils/ContextVal.js @@ -14,9 +14,8 @@ const checkContextVal = (payload, msgIdSet, i) => { let Obj = {}; let data = payload.context; let domain = payload.context.domain; - let maxTimeDiff = 0; - if (domain === "ONDC:RET10") { - maxTimeDiff = 5000; + let maxTimeDiff = 5000; + if (domain === "ONDC:RET10" && payload?.context?.version === "2.0.1") { if (action === "init") { maxTimeDiff = utils.iso8601DurationToSeconds(payload.context.ttl); dao.setValue("maxTimeDiff", maxTimeDiff); @@ -25,6 +24,16 @@ const checkContextVal = (payload, msgIdSet, i) => { } } else if (domain === "nic2004:60232") { maxTimeDiff = 1000; + } else if ( + domain === "ONDC:RET10" && + payload?.context?.version === "2.0.2" + ) { + if (action === "select") { + maxTimeDiff = utils.iso8601DurationToSeconds(payload.context.ttl); + dao.setValue("maxTimeDiff", maxTimeDiff); + } else if (action === "on_select") { + maxTimeDiff = dao.getValue("maxTimeDiff"); + } } console.log("time difference", maxTimeDiff); @@ -88,6 +97,7 @@ const checkContextVal = (payload, msgIdSet, i) => { } else { if ( action === "on_search" || + action === "on_select" || action === "on_init" || action === "on_confirm" || action === "on_update" diff --git a/utilities/logistics-b2b/log-verification-utility/utils/logistics/logConfirm.js b/utilities/logistics-b2b/log-verification-utility/utils/logistics/logConfirm.js index 72d9b7f..8760879 100644 --- a/utilities/logistics-b2b/log-verification-utility/utils/logistics/logConfirm.js +++ b/utilities/logistics-b2b/log-verification-utility/utils/logistics/logConfirm.js @@ -75,7 +75,7 @@ const checkConfirm = (data, msgIdSet) => { let avgPickupTime= fulfillment.start.time.duration; if(avgPickupTime!==dao.getValue("avgPickupTime")){ - cnfrmObj.avgPckupErr=`Average Pickup Time mismatches from the one provided in /on_search` + cnfrmObj.avgPckupErr=`Average Pickup Time (fulfillments/start/time/duration) mismatches from the one provided in /on_search` } if (fulfillment["@ondc/org/awb_no"] && p2h2p) awbNo = true; if (rts === "yes" && !fulfillment?.start?.instructions?.short_desc) { diff --git a/utilities/logistics-b2b/log-verification-utility/utils/logistics/logOnStatus.js b/utilities/logistics-b2b/log-verification-utility/utils/logistics/logOnStatus.js index abda338..a7a9fa1 100644 --- a/utilities/logistics-b2b/log-verification-utility/utils/logistics/logOnStatus.js +++ b/utilities/logistics-b2b/log-verification-utility/utils/logistics/logOnStatus.js @@ -74,6 +74,12 @@ const checkOnStatus = (data, msgIdSet) => { onStatusObj.deliveryTimeErr = `Delivery timestamp (fulfillments/end/time/timestamp) cannot be provided for fulfillment state - ${ffState}`; } } + + if (ffState === "Agent-assigned" || ffState === "Searching-for-Agent") { + if (orderState !== "In-progress") { + onStatusObj.ordrStatErr = `Order state should be 'In-progress' for fulfillment state - ${ffState}`; + } + } if (ffState === "Order-picked-up") { if (orderState !== "In-progress") { onStatusObj.ordrStatErr = `Order state should be 'In-progress' for fulfillment state - ${ffState}`; @@ -142,14 +148,12 @@ const checkOnStatus = (data, msgIdSet) => { onStatusObj.ordrStatErr = `Order state should be 'Cancelled' for fulfillment state - ${ffState}`; } if (fulfillments.length > 1) { - if (!dao.getValue("pickupTime")) { - onStatusObj.msngPickupState = `/on_status call for Fulfillment state - 'Order-picked-up' missing`; - } else if (!fulfillment.start.time.timestamp) { + if (!fulfillment.start.time.timestamp) { onStatusObj.msngPickupTimeErr = `Pickup timestamp (fulfillments/start/time/timestamp) is missing for fulfillment state - ${ffState}`; } } - if(fulfillment.tracking===true){ - onStatusObj.trackErr=`fulfillment tracking can be disabled (false) after the fulfillment is 'Cancelled` + if (fulfillment.tracking === true) { + onStatusObj.trackErr = `fulfillment tracking can be disabled (false) after the fulfillment is 'Cancelled`; } if (fulfillment.start.time.timestamp && dao.getValue("pickupTime")) { if ( From b7b29c3ee608a79734ea849c36208864eaa593a7 Mon Sep 17 00:00:00 2001 From: Abhinav Goyal Date: Wed, 20 Dec 2023 18:05:32 +0530 Subject: [PATCH 3/7] minor fixes --- .../v1.1/confirmSchema.js | 14 +++++--- .../v1.2/confirmSchema.js | 14 +++++--- .../utils/b2b/b2bOnSearch.js | 33 +++++++++++++++++++ .../utils/constants.js | 4 ++- 4 files changed, 54 insertions(+), 11 deletions(-) diff --git a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/confirmSchema.js b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/confirmSchema.js index bfe077e..ad2ac64 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/confirmSchema.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/confirmSchema.js @@ -87,11 +87,15 @@ module.exports = { properties: { id: { type: "string", - not: { - const: { $data: "1/context/transaction_id" }, - }, - errorMessage: - "should be unique (cannot be equal to transaction_id)", + allOf: [ + { + not: { + const: { $data: "3/context/transaction_id" }, + }, + errorMessage: + "Message ID should not be equal to transaction_id: ${3/context/transaction_id}", + }, + ], }, state: { type: "string", diff --git a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/confirmSchema.js b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/confirmSchema.js index 88416f6..9311e1f 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/confirmSchema.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/confirmSchema.js @@ -88,11 +88,15 @@ module.exports = { properties: { id: { type: "string", - not: { - const: { $data: "1/context/transaction_id" }, - }, - errorMessage: - "should be unique (cannot be equal to transaction_id)", + allOf: [ + { + not: { + const: { $data: "3/context/transaction_id" }, + }, + errorMessage: + "Message ID should not be equal to transaction_id: ${3/context/transaction_id}", + }, + ], }, state: { type: "string", diff --git a/utilities/logistics-b2b/log-verification-utility/utils/b2b/b2bOnSearch.js b/utilities/logistics-b2b/log-verification-utility/utils/b2b/b2bOnSearch.js index a4dd00b..af21a6f 100644 --- a/utilities/logistics-b2b/log-verification-utility/utils/b2b/b2bOnSearch.js +++ b/utilities/logistics-b2b/log-verification-utility/utils/b2b/b2bOnSearch.js @@ -7,6 +7,7 @@ const { reverseGeoCodingCheck } = require("../reverseGeoCoding"); const checkOnSearch = async (data, msgIdSet) => { const onSrchObj = {}; let onSearch = data; + let domain = onSearch.context.domain; onSearch = onSearch.message.catalog; try { @@ -49,6 +50,38 @@ const checkOnSearch = async (data, msgIdSet) => { } } } + + //checking mandatory attributes for fashion and electronics + + provider.items.forEach((item) => { + let itemTags = item?.tags; + let mandatoryAttr; + + if (domain === "ONDC:RET12") { + mandatoryAttr = constants.FASHION_ATTRIBUTES; + } + if (domain === "ONDC:RET14") { + mandatoryAttr = constants.ELECTRONICS_ATTRIBUTES; + } + itemTags.map(({ descriptor, list }, index) => { + switch (descriptor.code) { + case "attribute": + const encounteredAttr = []; + list.map(({ descriptor, value }) => { + encounteredAttr.push(descriptor.code); + }); + + // Check if all allowedCodes are encountered + const missingAttr = mandatoryAttr.filter( + (code) => !encounteredAttr.includes(code) + ); + if (missingAttr.length > 0) { + onSrchObj.mssngAttrErr = `'${missingAttr}' attribute/s required in items/tags for ${domain} domain`; + } + break; + } + }); + }); } } diff --git a/utilities/logistics-b2b/log-verification-utility/utils/constants.js b/utilities/logistics-b2b/log-verification-utility/utils/constants.js index 5e039d0..8b44c9f 100755 --- a/utilities/logistics-b2b/log-verification-utility/utils/constants.js +++ b/utilities/logistics-b2b/log-verification-utility/utils/constants.js @@ -167,5 +167,7 @@ module.exports = Object.freeze({ "RTO-Disposed", "Cancelled", ], - CANCELLATION_TAGS_LIST:["retry_count","rto_id","cancellation_reason_id","sub_reason_id","cancelled_by"] + CANCELLATION_TAGS_LIST:["retry_count","rto_id","cancellation_reason_id","sub_reason_id","cancelled_by"], + FASHION_ATTRIBUTES : ["brand","colour","size","gender","material"], + ELECTRONICS_ATTRIBUTES: ["brand","model"] }); From f6856eb7366c8fece0685c22fb935bd2a31a6d5d Mon Sep 17 00:00:00 2001 From: Abhinav Goyal Date: Thu, 28 Dec 2023 11:51:05 +0530 Subject: [PATCH 4/7] b2b and logistics fixes --- .../log-verification-utility/.gitignore | 2 +- .../log_report.json | 8 + .../log_report.json | 62 ++ .../schema/B2B_json_schema/keywords/onInit.js | 5 +- .../B2B_json_schema/schemaValidator copy1.js | 107 ++ .../schema/B2B_json_schema/schemaValidator.js | 47 +- .../B2B_json_schema/{ => v1}/confirm.js | 0 .../schema/B2B_json_schema/{ => v1}/init.js | 0 .../schema/B2B_json_schema/{ => v1}/master.js | 0 .../B2B_json_schema/{ => v1}/on_confirm.js | 0 .../B2B_json_schema/{ => v1}/on_init.js | 0 .../B2B_json_schema/{ => v1}/on_search.js | 0 .../B2B_json_schema/{ => v1}/on_select.js | 2 +- .../B2B_json_schema/{ => v1}/on_status.js | 0 .../B2B_json_schema/{ => v1}/on_update.js | 1 - .../schema/B2B_json_schema/{ => v1}/search.js | 1 - .../schema/B2B_json_schema/{ => v1}/select.js | 0 .../schema/B2B_json_schema/{ => v1}/status.js | 1 - .../schema/B2B_json_schema/{ => v1}/update.js | 1 - .../schema/B2B_json_schema/v2/confirm.js | 769 ++++++++++++++ .../schema/B2B_json_schema/v2/init.js | 531 ++++++++++ .../schema/B2B_json_schema/v2/master.js | 78 ++ .../schema/B2B_json_schema/v2/on_confirm.js | 833 +++++++++++++++ .../schema/B2B_json_schema/v2/on_init.js | 694 +++++++++++++ .../schema/B2B_json_schema/v2/on_search.js | 966 ++++++++++++++++++ .../schema/B2B_json_schema/v2/on_select.js | 335 ++++++ .../schema/B2B_json_schema/v2/on_status.js | 758 ++++++++++++++ .../schema/B2B_json_schema/v2/on_update.js | 530 ++++++++++ .../schema/B2B_json_schema/v2/search.js | 262 +++++ .../schema/B2B_json_schema/v2/select.js | 432 ++++++++ .../schema/B2B_json_schema/v2/status.js | 107 ++ .../schema/B2B_json_schema/v2/update.js | 333 ++++++ .../v1.1/confirmSchema.js | 2 +- .../v1.1/searchSchema.js | 2 +- .../v1.2/confirmSchema.js | 40 +- .../v1.2/keywords/onInit.js | 2 + .../v1.2/onCancelSchema.js | 4 +- .../v1.2/onInitSchema.js | 2 + .../v1.2/onSearchSchema.js | 47 + .../v1.2/updateSchema.js | 3 +- .../log-verification-utility/schema/main.js | 6 +- .../utils/b2b/b2bInit.js | 21 +- .../utils/b2b/b2bOnSearch.js | 2 +- .../utils/b2b/b2bOnStatus.js | 7 +- .../utils/constants.js | 4 +- .../utils/logistics/logConfirm.js | 4 +- .../utils/logistics/logInit.js | 4 +- .../utils/logistics/logOnCancel.js | 34 +- .../utils/logistics/logOnStatus.js | 6 +- .../utils/logistics/logUpdate.js | 4 + .../log-verification-utility/utils/utils.js | 11 +- 51 files changed, 7003 insertions(+), 67 deletions(-) create mode 100644 utilities/logistics-b2b/log-verification-utility/public/server/logistics/347301e3-ea1d-48d1-9ca5-283b7c18d586/log_report.json create mode 100644 utilities/logistics-b2b/log-verification-utility/public/server/logistics/6802cbf8-dbb2-4562-abda-3fc2ebef2b75/log_report.json create mode 100644 utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/schemaValidator copy1.js rename utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/{ => v1}/confirm.js (100%) rename utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/{ => v1}/init.js (100%) rename utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/{ => v1}/master.js (100%) rename utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/{ => v1}/on_confirm.js (100%) rename utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/{ => v1}/on_init.js (100%) rename utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/{ => v1}/on_search.js (100%) rename utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/{ => v1}/on_select.js (99%) rename utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/{ => v1}/on_status.js (100%) rename utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/{ => v1}/on_update.js (99%) rename utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/{ => v1}/search.js (99%) rename utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/{ => v1}/select.js (100%) rename utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/{ => v1}/status.js (98%) rename utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/{ => v1}/update.js (99%) create mode 100644 utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/confirm.js create mode 100644 utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/init.js create mode 100644 utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/master.js create mode 100644 utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_confirm.js create mode 100644 utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_init.js create mode 100644 utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_search.js create mode 100644 utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_select.js create mode 100644 utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_status.js create mode 100644 utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_update.js create mode 100644 utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/search.js create mode 100644 utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/select.js create mode 100644 utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/status.js create mode 100644 utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/update.js diff --git a/utilities/logistics-b2b/log-verification-utility/.gitignore b/utilities/logistics-b2b/log-verification-utility/.gitignore index 5b4e0ec..8c29104 100644 --- a/utilities/logistics-b2b/log-verification-utility/.gitignore +++ b/utilities/logistics-b2b/log-verification-utility/.gitignore @@ -12,4 +12,4 @@ test.js !LICENSE.md logFlow*.json .DS_Store -log_report.json \ No newline at end of file +log_report.md \ No newline at end of file diff --git a/utilities/logistics-b2b/log-verification-utility/public/server/logistics/347301e3-ea1d-48d1-9ca5-283b7c18d586/log_report.json b/utilities/logistics-b2b/log-verification-utility/public/server/logistics/347301e3-ea1d-48d1-9ca5-283b7c18d586/log_report.json new file mode 100644 index 0000000..f33ebf7 --- /dev/null +++ b/utilities/logistics-b2b/log-verification-utility/public/server/logistics/347301e3-ea1d-48d1-9ca5-283b7c18d586/log_report.json @@ -0,0 +1,8 @@ +{ + "Schema": { + "schemaErr0": "/on_init/0/message/order/quote price is not matching with the total breakup price", + "schemaErr1": "/on_update/0/message/order/fulfillments/0/start/instructions must have required property 'code'", + "schemaErr2": "/on_update/0/message/order/fulfillments/0/start/instructions must have required property 'short_desc'", + "schemaErr3": "/on_update/0/message/order/fulfillments/0/start must pass \"$merge\" keyword validation" + } +} \ No newline at end of file diff --git a/utilities/logistics-b2b/log-verification-utility/public/server/logistics/6802cbf8-dbb2-4562-abda-3fc2ebef2b75/log_report.json b/utilities/logistics-b2b/log-verification-utility/public/server/logistics/6802cbf8-dbb2-4562-abda-3fc2ebef2b75/log_report.json new file mode 100644 index 0000000..fb6d4bf --- /dev/null +++ b/utilities/logistics-b2b/log-verification-utility/public/server/logistics/6802cbf8-dbb2-4562-abda-3fc2ebef2b75/log_report.json @@ -0,0 +1,62 @@ +{ + "Flow Error": { + "0": "Incorrect Flow as per context/timestamps - (search,on_search,cancel,init,on_init,confirm,on_confirm,status,support,track,on_track,on_support,on_status,on_cancel)" + }, + "Schema": { + "schemaErr0": "/search/0/message/intent/payment @ondc/org/collection_amount is required only for payment/type 'ON-FULFILLMENT'", + "schemaErr1": "/search/0/message/intent/payment must match \"then\" schema", + "schemaErr2": "/confirm/0/message/order/billing/created_at mismatches in /billing in /init and /confirm", + "schemaErr3": "/confirm/0/message/order/billing/updated_at mismatches in /billing in /init and /confirm", + "schemaErr4": "/confirm/0/message/order/payment/collected_by mismatches in /payment in /on_init and /confirm", + "schemaErr5": "/on_confirm/0/message/order/payment/collected_by mismatches in /payment in /on_init and /confirm", + "schemaErr6": "/on_status/0/message/order/fulfillments/0/start/time must have required property 'range'", + "schemaErr7": "/on_status/0/message/order/fulfillments/0/end must have required property 'time'", + "schemaErr8": "/on_status/0/message/order/fulfillments/0 must match \"then\" schema", + "schemaErr9": "/on_cancel/0/message/order must have required property 'created_at'", + "schemaErr10": "/on_cancel/0/message/order/quote price is not matching with the total breakup price", + "schemaErr11": "/on_cancel/0/message/order/fulfillments/0/start/time must have required property 'range'", + "schemaErr12": "/on_cancel/0/message/order/fulfillments/0/end/time must have required property 'range'", + "schemaErr13": "/on_cancel/0/message/order/fulfillments/0 must match \"then\" schema" + }, + "Context": { + "init_0": { + "tmpstmpErr": "Timestamp mismatch for /init " + }, + "status_0": { + "tmpstmpErr": "Timestamp mismatch for /status " + }, + "support_0": { + "tmpstmpErr": "Timestamp mismatch for /support " + }, + "track_0": { + "tmpstmpErr": "Timestamp mismatch for /track " + }, + "on_track_0": { + "msgIdErr": "Message Id cannot be same for different sets of APIs" + }, + "on_support_0": { + "msgIdErr": "Message Id cannot be same for different sets of APIs" + }, + "on_status_0": { + "msgIdErr": "Message Id cannot be same for different sets of APIs" + }, + "on_cancel_0": { + "msgIdErr": "Message Id cannot be same for different sets of APIs" + } + }, + "Message": { + "on_search_0": { + "itemTAT": "For Same Day Delivery/Immediate Delivery, TAT date should be the same date i.e. 2023-12-08" + }, + "confirm_0": { + "itemDurationErr": "item duration does not match with the one provided in /on_search (LSP can send NACK)", + "avgPckupErr": "Average Pickup Time mismatches from the one provided in /on_search" + }, + "on_confirm_0": { + "trckErr": "tracking should be enabled (true) for hyperlocal (Immediate Delivery)" + }, + "on_status_0": { + "trckErr": "tracking should be enabled (true) for hyperlocal (Immediate Delivery)" + } + } +} \ No newline at end of file diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/keywords/onInit.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/keywords/onInit.js index d9a2b1d..b31f2e2 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/keywords/onInit.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/keywords/onInit.js @@ -1,11 +1,14 @@ module.exports = { isQuoteMatching: (data) => { - const quotePrice = parseFloat(data?.price?.value); + let quotePrice = parseFloat(data?.price?.value); const breakupArr = data.breakup; let totalBreakup = 0; breakupArr.forEach((breakup) => { totalBreakup += parseFloat(breakup?.price?.value); + }); + totalBreakup= parseFloat(totalBreakup).toFixed(2) + quotePrice=quotePrice.toFixed(2) if (quotePrice != totalBreakup) return false; else return true; }, diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/schemaValidator copy1.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/schemaValidator copy1.js new file mode 100644 index 0000000..51f97d6 --- /dev/null +++ b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/schemaValidator copy1.js @@ -0,0 +1,107 @@ +const onConfirmSchema = require("./on_confirm"); +const onInitSchema = require("./on_init"); +const onSearchSchema = require("./on_search"); +const selectSchema = require("./select"); +const onSelectSchema = require("./on_select"); +const onUpdateSchema = require("./on_update"); +const searchSchema = require("./search"); +const initSchema = require("./init"); +const masterSchema = require("./master"); +const confirmSchema = require("./confirm"); +const statusSchema = require("./status"); +const updateSchema = require("./update"); +const onStatusSchema = require("./on_status"); +const { isLengthValid } = require("./keywords/init"); +const { isQuoteMatching } = require("./keywords/onInit"); +const { isFutureDated } = require("./keywords/confirm"); +const { isEndTimeGreater } = require("./keywords/search"); + +const fs = require("fs"); +//const async = require("async"); +const path = require("path"); + +const formatted_error = (errors) => { + error_list = []; + let status = ""; + errors.forEach((error) => { + error_dict = { + message: `${error.message}${ + error.params.allowedValues ? ` (${error.params.allowedValues})` : "" + }${error.params.allowedValue ? ` (${error.params.allowedValue})` : ""}${ + error.params.additionalProperty + ? ` (${error.params.additionalProperty})` + : "" + }`, + details: error.instancePath, + }; + error_list.push(error_dict); + }); + if (error_list.length === 0) status = "pass"; + else status = "fail"; + error_json = { errors: error_list, status: status }; + return error_json; +}; + + +const validate_schema = (data, schema) => { + const Ajv = require("ajv"); + const ajv = new Ajv({ + allErrors: true, + strict: false, + strictRequired: false, + strictTypes: false, + $data: true, + }); + const addFormats = require("ajv-formats"); + + addFormats(ajv); + require("ajv-errors")(ajv); + let error_list = []; + try { + validate = ajv + .addSchema(searchSchema) + .addSchema(onSearchSchema) + .addSchema(selectSchema) + .addSchema(onSelectSchema) + .addSchema(initSchema) + .addSchema(onInitSchema) + .addSchema(confirmSchema) + .addSchema(onConfirmSchema) + .addSchema(updateSchema) + .addSchema(onUpdateSchema) + .addSchema(statusSchema) + .addSchema(onStatusSchema) + .addKeyword("isEndTimeGreater", { + validate: (schema, data) => isEndTimeGreater(data), + }) + .addKeyword("isQuoteMatching", { + validate: (schema, data) => isQuoteMatching(data), + }) + .addKeyword("isFutureDated", { + validate: (schema, data) => isFutureDated(data), + }) + .addKeyword("isLengthValid", { + validate: (schema, data) => isLengthValid(data), + }); + + validate = validate.compile(schema); + + const valid = validate(data); + if (!valid) { + error_list = validate.errors; + } + } catch (error) { + console.log("ERROR!! validating schema"); + console.trace(error); + } + return error_list; +}; + +const validate_schema_b2b_master = (data) => { + error_list = validate_schema(data, masterSchema); + return formatted_error(error_list); +}; + +module.exports = { + validate_schema_b2b_master, +}; diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/schemaValidator.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/schemaValidator.js index 43fb234..66aa4f1 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/schemaValidator.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/schemaValidator.js @@ -1,16 +1,4 @@ -const onConfirmSchema = require("./on_confirm"); -const onInitSchema = require("./on_init"); -const onSearchSchema = require("./on_search"); -const selectSchema = require("./select"); -const onSelectSchema = require("./on_select"); -const onUpdateSchema = require("./on_update"); -const searchSchema = require("./search"); -const initSchema = require("./init"); -const masterSchema = require("./master"); -const confirmSchema = require("./confirm"); -const statusSchema = require("./status"); -const updateSchema = require("./update"); -const onStatusSchema = require("./on_status"); + const { isLengthValid } = require("./keywords/init"); const { isQuoteMatching } = require("./keywords/onInit"); const { isFutureDated } = require("./keywords/confirm"); @@ -42,7 +30,33 @@ const formatted_error = (errors) => { return error_json; }; -const validate_schema = (data, schema) => { +const loadSchema = (schemaType, version) => { + try { + return require(`./${version}/${schemaType}.js`); + } catch (error) { + console.log("Error Occurred while importing", error); + } +}; + +const validate_schema = (data, schema,version) => { + const searchSchema = loadSchema("search", version); + const onSearchSchema = loadSchema("on_search", version); + + const selectSchema = loadSchema("select", version); + const onSelectSchema = loadSchema("on_select", version); + + const initSchema = loadSchema("init", version); + const onInitSchema = loadSchema("on_init", version); + + const confirmSchema = loadSchema("confirm", version); + const onConfirmSchema = loadSchema("on_confirm", version); + + const updateSchema = loadSchema("update", version); + const onUpdateSchema = loadSchema("on_update", version); + + const statusSchema = loadSchema("status", version); + const onStatusSchema = loadSchema("on_status", version); + const Ajv = require("ajv"); const ajv = new Ajv({ allErrors: true, @@ -96,8 +110,9 @@ const validate_schema = (data, schema) => { return error_list; }; -const validate_schema_b2b_master = (data) => { - error_list = validate_schema(data, masterSchema); +const validate_schema_b2b_master = (data,version) => { + const masterSchema = loadSchema("master", version); + error_list = validate_schema(data, masterSchema,version); return formatted_error(error_list); }; diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/confirm.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/confirm.js similarity index 100% rename from utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/confirm.js rename to utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/confirm.js diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/init.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/init.js similarity index 100% rename from utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/init.js rename to utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/init.js diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/master.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/master.js similarity index 100% rename from utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/master.js rename to utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/master.js diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_confirm.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/on_confirm.js similarity index 100% rename from utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_confirm.js rename to utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/on_confirm.js diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_init.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/on_init.js similarity index 100% rename from utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_init.js rename to utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/on_init.js diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_search.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/on_search.js similarity index 100% rename from utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_search.js rename to utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/on_search.js diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_select.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/on_select.js similarity index 99% rename from utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_select.js rename to utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/on_select.js index f137e4b..f2fe7b0 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_select.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/on_select.js @@ -220,7 +220,7 @@ module.exports = { }, "@ondc/org/title_type": { type: "string", - enum: ["item", "discount", "Packing charges", "delivery ", "tax", "misc"] + enum: ["item", "discount", "packing", "delivery ", "tax", "misc"] }, price: { type: "object", diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_status.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/on_status.js similarity index 100% rename from utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_status.js rename to utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/on_status.js diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_update.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/on_update.js similarity index 99% rename from utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_update.js rename to utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/on_update.js index d87b56d..8abb301 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/on_update.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/on_update.js @@ -7,7 +7,6 @@ module.exports = { properties: { domain: { type: "string", - const: "ONDC:RET10", }, location: { type: "object", diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/search.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/search.js similarity index 99% rename from utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/search.js rename to utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/search.js index 9c8f6af..5c45d70 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/search.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/search.js @@ -7,7 +7,6 @@ module.exports = { properties: { domain: { type: "string", - const: "ONDC:RET10", }, location: { type: "object", diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/select.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/select.js similarity index 100% rename from utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/select.js rename to utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/select.js diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/status.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/status.js similarity index 98% rename from utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/status.js rename to utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/status.js index 45afe99..c6bcf70 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/status.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/status.js @@ -7,7 +7,6 @@ module.exports = { properties: { domain: { type: "string", - const: "ONDC:RET10", }, location: { type: "object", diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/update.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/update.js similarity index 99% rename from utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/update.js rename to utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/update.js index 62e1bd1..24e08c0 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/update.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v1/update.js @@ -7,7 +7,6 @@ module.exports = { properties: { domain: { type: "string", - const: "ONDC:RET10", }, location: { type: "object", diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/confirm.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/confirm.js new file mode 100644 index 0000000..5adfe0d --- /dev/null +++ b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/confirm.js @@ -0,0 +1,769 @@ +module.exports = { + $id: "http://example.com/schema/confirmSchema", + type: "object", + properties: { + context: { + type: "object", + properties: { + domain: { + type: "string", + }, + location: { + type: "object", + properties: { + city: { + type: "object", + properties: { + code: { + type: "string", + const: { $data: "/search/0/context/location/city/code" }, + }, + }, + required: ["code"], + }, + country: { + type: "object", + properties: { + code: { + type: "string", + const: { $data: "/search/0/context/location/country/code" }, + }, + }, + required: ["code"], + }, + }, + required: ["city", "country"], + }, + action: { + type: "string", + const: "confirm", + }, + version: { + type: "string", + const: "2.0.2", + }, + bap_id: { + type: "string", + }, + bap_uri: { + type: "string", + }, + bpp_id: { + type: "string", + }, + bpp_uri: { + type: "string", + }, + transaction_id: { + type: "string", + const: { $data: "/select/0/context/transaction_id" }, + errorMessage: + "Transaction ID should be same across the transaction: ${/search/0/context/transaction_id}", + }, + message_id: { + type: "string", + allOf: [ + { + not: { + const: { $data: "1/transaction_id" }, + }, + errorMessage: + "Message ID should not be equal to transaction_id: ${1/transaction_id}", + }, + ] + }, + timestamp: { + type: "string", + format: "date-time", + }, + ttl: { + type: "string", + const: "PT30S", + }, + }, + required: [ + "domain", + "location", + "action", + "version", + "bap_id", + "bap_uri", + "bpp_id", + "bpp_uri", + "transaction_id", + "message_id", + "timestamp", + "ttl", + ], + }, + message: { + type: "object", + properties: { + order: { + type: "object", + properties: { + id: { + type: "string", + }, + state: { + type: "string", + enum: ["Created"], + }, + provider: { + type: "object", + properties: { + id: { + type: "string", + const: { $data: "/init/0/message/order/provider/id" }, + }, + locations: { + type: "array", + const: { $data: "/init/0/message/order/provider/locations" }, + errorMessage:"mismatch from /init", + items: { + type: "object", + properties: { + id: { + type: "string", + + }, + }, + required: ["id"], + }, + }, + }, + required: ["id", "locations"], + }, + items: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + fulfillment_ids: { + type: "array", + items: { + type: "string", + }, + }, + quantity: { + type: "object", + properties: { + selected: { + type: "object", + properties: { + count: { + type: "integer", + }, + }, + required: ["count"], + }, + }, + required: ["selected"], + }, + "add-ons": { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + }, + required: ["id"], + }, + }, + tags: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + type: "object", + properties: { + code: { + type: "string", + enum: ["BUYER_TERMS"], + }, + }, + required: ["code"], + }, + list: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + type: "object", + properties: { + code: { + type: "string", + enum: ["ITEM_REQ", "PACKAGING_REQ"], + }, + }, + required: ["code"], + }, + value: { + type: "string", + anyOf: [ + { + const: { $data: "/init/0/message/order/items/0/tags/0/list/0/value" }, + }, + { + const: { $data: "/init/0/message/order/items/0/tags/0/list/1/value" }, + } + ] + }, + }, + required: ["descriptor", "value"], + }, + }, + }, + required: ["descriptor", "list"], + }, + }, + }, + required: ["id", "fulfillment_ids", "quantity"], + }, + }, + billing: { + type: "object", + properties: { + name: { + type: "string", + const: { $data: "/init/0/message/order/billing/name" }, + }, + address: { + type: "string", + const: { $data: "/init/0/message/order/billing/address" }, + }, + state: { + type: "object", + properties: { + name: { + type: "string", + const: { + $data: "/init/0/message/order/billing/state/name", + }, + }, + }, + required: ["name"], + }, + city: { + type: "object", + properties: { + name: { + type: "string", + const: { + $data: "/init/0/message/order/billing/city/name", + }, + }, + }, + required: ["name"], + }, + tax_id: { + type: "string", + const: { $data: "/init/0/message/order/billing/tax_id" }, + }, + email: { + type: "string", + const: { $data: "/init/0/message/order/billing/email" }, + }, + phone: { + type: "string", + const: { $data: "/init/0/message/order/billing/phone" }, + }, + }, + + required: ["name", "address", "state", "city", "tax_id", "phone"], + }, + fulfillments: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + type: { + type: "string", + }, + tracking: { + type: "boolean", + }, + stops: { + type: "array", + items: { + type: "object", + properties: { + type: { + type: "string", + enum: ["start", "end"], + }, + location: { + type: "object", + properties: { + gps: { + type: "string", + pattern: "^(-?[0-9]{1,3}(?:.[0-9]{6,15})?),( )*?(-?[0-9]{1,3}(?:.[0-9]{6,15})?)$", + errorMessage: "Incorrect gps value", + }, + address: { + type: "string", + }, + city: { + type: "object", + properties: { + name: { + type: "string", + }, + }, + required: ["name"], + }, + country: { + type: "object", + properties: { + code: { + type: "string", + }, + }, + required: ["code"], + }, + area_code: { + type: "string", + }, + state: { + type: "object", + properties: { + name: { + type: "string", + }, + }, + required: ["name"], + }, + }, + required: [ + "gps", + "address", + "city", + "country", + "area_code", + "state", + ], + }, + contact: { + type: "object", + properties: { + phone: { + type: "string", + }, + email: { + type: "string", + }, + }, + required: ["phone"], + }, + customer: { + type: "object", + properties: { + person: { + type: "object", + properties: { + name: { + type: "string", + }, + }, + required: ["name"], + }, + }, + required: ["person"], + }, + }, + required: ["type", "location", "contact"], + }, + }, + tags: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + type: "object", + properties: { + code: { + type: "string", + enum: ["DELIVERY_TERMS"], + }, + }, + required: ["code"], + }, + list: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + type: "object", + properties: { + code: { + type: "string", + enum: [ + "INCOTERMS", + "NAMED_PLACE_OF_DELIVERY", + ], + }, + }, + required: ["code"], + }, + value: { + type: "string", + anyOf: [ + { + const: { $data: "/init/0/message/order/fulfillments/0/tags/0/list/0/value" }, + }, + { + const: { $data: "/init/0/message/order/fulfillments/0/tags/0/list/1/value" }, + } + ] + }, + }, + if: { + properties: { + descriptor: { + properties: { code: { const: "INCOTERMS" } }, + }, + }, + }, + then: { + properties: { + value: { + enum: [ + "DPU", + "CIF", + "EXW", + "FOB", + "DAP", + "DDP", + ], + }, + }, + }, + required: ["descriptor", "value"], + }, + }, + }, + required: ["descriptor", "list"], + }, + }, + }, + required: ["id", "type", "stops"], + }, + }, + quote: { + type: "object", + properties: { + price: { + type: "object", + properties: { + currency: { + type: "string", + }, + value: { + type: "string", + const: { + $data: "/on_init/0/message/order/quote/price/value", + }, + }, + }, + required: ["currency", "value"], + }, + breakup: { + type: "array", + items: { + type: "object", + properties: { + "@ondc/org/item_id": { + type: "string", + }, + "@ondc/org/item_quantity": { + type: "object", + properties: { + count: { + type: "integer", + }, + }, + required: ["count"], + }, + title: { + type: "string", + }, + "@ondc/org/title_type": { + type: "string", + enum: ["item", "discount", "packing", "delivery", "tax", "misc"] + }, + price: { + type: "object", + properties: { + currency: { + type: "string", + }, + value: { + type: "string", + }, + }, + required: ["currency", "value"], + }, + item: { + type: "object", + properties: { + price: { + type: "object", + properties: { + currency: { + type: "string", + }, + value: { + type: "string", + }, + }, + required: ["currency", "value"], + }, + }, + required: ["price"], + }, + }, + if: { + properties: { + "@ondc/org/title_type": { + const: "item", + }, + }, + }, + then: { + required: [ + "@ondc/org/item_id", + "@ondc/org/item_quantity", + "title", + "@ondc/org/title_type", + "price", + "item", + ], + }, + else: { + properties: { + "@ondc/org/title_type": { + enum: [ + "delivery", + "packing", + "tax", + "discount", + "misc", + ], + }, + }, + required: [ + "@ondc/org/item_id", + "title", + "@ondc/org/title_type", + "price", + ], + }, + }, + }, + ttl: { + type: "string", + }, + }, + required: ["price", "breakup", "ttl"], + }, + payments: { + type: "array", + items: { + type: "object", + properties: { + params: { + type: "object", + properties: { + currency: { + type: "string", + }, + transaction_id: { + type: "string", + }, + amount: { + type: "string", + }, + }, + required: ["currency", "amount"], + }, + status: { + type: "string", + enum: ["PAID", "NOT-PAID"], + }, + type: { + type: "string", + enum: [ + "PRE-FULFILLMENT", + "ON-FULFILLMENT", + "POST-FULFILLMENT", + ], + }, + collected_by: { + type: "string", + }, + "@ondc/org/buyer_app_finder_fee_type": { + type: "string", + }, + "@ondc/org/buyer_app_finder_fee_amount": { + type: "string", + }, + "@ondc/org/settlement_details": { + type: "array", + items: { + type: "object", + properties: { + settlement_counterparty: { + type: "string", + enum: ["seller-app", "buyer-app"], + }, + settlement_phase: { + type: "string", + }, + settlement_type: { + type: "string", + enum: ["upi", "neft", "rtgs"], + }, + upi_address: { + type: "string", + }, + settlement_bank_account_no: { + type: "string", + }, + settlement_ifsc_code: { + type: "string", + }, + beneficiary_name: { + type: "string", + }, + bank_name: { + type: "string", + }, + branch_name: { + type: "string", + }, + }, + allOf: [ + { + if: { + properties: { + settlement_type: { + const: "upi", + }, + }, + }, + then: { + required: ["upi_address"], + }, + }, + { + if: { + properties: { + settlement_type: { + const: ["neft", "rtgs"], + }, + }, + }, + then: { + required: [ + "settlement_ifsc_code", + "settlement_bank_account_no", + ], + }, + }, + ], + required: ["settlement_counterparty", "settlement_type"], + }, + }, + }, + required: [ + "params", + "status", + "type", + "collected_by", + "@ondc/org/buyer_app_finder_fee_type", + "@ondc/org/buyer_app_finder_fee_amount", + ], + }, + }, + tags: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + properties: { + code: { + type: "string", + enum: ["buyer_id"], + }, + }, + }, + list: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + properties: { + code: { + type: "string", + enum: ["buyer_id_code", "buyer_id_no"], + }, + }, + }, + value: { + type: "string", + }, + }, + required: ["descriptor", "value"], + }, + }, + }, + required: ["descriptor", "list"], + }, + }, + created_at: { + type: "string", + const: { $data: "3/context/timestamp" }, + errorMessage: + "created_at does not match context timestamp - ${3/context/timestamp}", + }, + updated_at: { + type: "string", + const: { $data: "3/context/timestamp" }, + errorMessage: + "updated_at does not match context timestamp - ${3/context/timestamp}", + }, + }, + additionalProperties:false, + required: [ + "id", + "state", + "provider", + "items", + "billing", + "fulfillments", + "quote", + "payments", + "created_at", + "updated_at", + ], + }, + }, + required: ["order"], + }, + }, + required: ["context", "message"], +}; 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 new file mode 100644 index 0000000..9b9db05 --- /dev/null +++ b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/init.js @@ -0,0 +1,531 @@ +module.exports = { + $id: "http://example.com/schema/initSchema", + type: "object", + properties: { + context: { + type: "object", + properties: { + domain: { + type: "string", + }, + location: { + type: "object", + properties: { + city: { + type: "object", + properties: { + code: { + type: "string", + const: { $data: "/search/0/context/location/city/code" }, + }, + }, + required: ["code"], + }, + country: { + type: "object", + properties: { + code: { + type: "string", + const: { $data: "/search/0/context/location/country/code" }, + }, + }, + required: ["code"], + }, + }, + required: ["city", "country"], + }, + action: { + type: "string", + const: "init", + }, + version: { + type: "string", + const: "2.0.2", + }, + bap_id: { + type: "string", + }, + bap_uri: { + type: "string", + }, + bpp_id: { + type: "string", + }, + bpp_uri: { + type: "string", + }, + transaction_id: { + type: "string", + const: { $data: "/select/0/context/transaction_id" }, + errorMessage: + "Transaction ID should be same across the transaction: ${/search/0/context/transaction_id}", + }, + message_id: { + type: "string", + allOf: [ + { + not: { + const: { $data: "1/transaction_id" }, + }, + errorMessage: + "Message ID should not be equal to transaction_id: ${1/transaction_id}", + }, + ], + }, + timestamp: { + type: "string", + format: "date-time", + }, + ttl: { + type: "string", + const: "PT30S" + }, + }, + required: [ + "domain", + "location", + "action", + "version", + "bap_id", + "bap_uri", + "bpp_id", + "bpp_uri", + "transaction_id", + "message_id", + "timestamp", + "ttl", + ], + }, + message: { + type: "object", + properties: { + order: { + type: "object", + properties: { + provider: { + type: "object", + properties: { + id: { + type: "string", + const: { $data: "/select/0/message/order/provider/id" }, + }, + locations: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + const: { + $data: + "/select/0/message/order/provider/locations/0/id", + }, + }, + }, + required: ["id"], + }, + } + }, + required: ["id", "locations"], + }, + items: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + fulfillment_ids: { + type: "array", + items: { + type: "string", + }, + }, + quantity: { + type: "object", + properties: { + selected: { + type: "object", + properties: { + count: { + type: "integer", + }, + }, + required: ["count"], + }, + }, + required: ["selected"], + }, + "add-ons": { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + }, + required: ["id"], + }, + }, + tags: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + type: "object", + properties: { + code: { + type: "string", + enum: ["BUYER_TERMS"], + }, + }, + required: ["code"], + }, + list: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + type: "object", + properties: { + code: { + type: "string", + enum: ["ITEM_REQ", "PACKAGING_REQ"], + }, + }, + required: ["code"], + }, + value: { + type: "string", + }, + }, + required: ["descriptor", "value"], + }, + }, + }, + required: ["descriptor", "list"], + }, + }, + }, + required: ["id", "quantity"], + }, + }, + billing: { + type: "object", + properties: { + name: { + type: "string", + minLength: 3, + }, + address: { + type: "string", + }, + state: { + type: "object", + properties: { + name: { + type: "string", + }, + }, + required: ["name"], + }, + city: { + type: "object", + properties: { + name: { + type: "string", + }, + }, + required: ["name"], + }, + tax_id: { + type: "string", + }, + email: { + type: "string", + }, + phone: { + type: "string", + }, + created_at: { + type: "string", + }, + updated_at: { + type: "string", + }, + }, + additionalProperties: false, + required: ["name", "address", "state", "city", "tax_id", "phone"], + }, + fulfillments: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + type: { + type: "string", + }, + stops: { + type: "array", + items: { + type: "object", + properties: { + type: { + type: "string", + }, + location: { + type: "object", + properties: { + gps: { + type: "string", + pattern: + "^(-?[0-9]{1,3}(?:.[0-9]{6,15})?),( )*?(-?[0-9]{1,3}(?:.[0-9]{6,15})?)$", + errorMessage: "Incorrect gps value", + }, + address: { + type: "string", + }, + city: { + type: "object", + properties: { + name: { + type: "string", + }, + }, + required: ["name"], + }, + country: { + type: "object", + properties: { + code: { + type: "string", + }, + }, + required: ["code"], + }, + area_code: { + type: "string", + }, + state: { + type: "object", + properties: { + name: { + type: "string", + }, + }, + required: ["name"], + }, + }, + required: [ + "gps", + "address", + "city", + "country", + "area_code", + "state", + ], + }, + contact: { + type: "object", + properties: { + phone: { + type: "string", + }, + }, + required: ["phone"], + }, + }, + required: ["type", "location", "contact"], + }, + }, + customer: { + type: "object", + properties: { + person: { + type: "object", + properties: { + creds: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + type: { + type: "string", + enum: [ + "License", + "Badge", + "Permit", + "Certificate", + ], + }, + desc: { + type: "string", + }, + icon: { + type: "string", + }, + url: { + type: "string", + pattern: + "^https://[\\w.-]+(\\.[a-zA-Z]{2,})?(:[0-9]+)?(/\\S*)?$", + }, + }, + required: ["id", "type", "desc", "icon", "url"], + }, + }, + }, + required: ["creds"], + }, + }, + required: ["person"], + }, + tags: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + type: "object", + properties: { + code: { + type: "string", + enum: ["DELIVERY_TERMS"], + }, + }, + required: ["code"], + }, + list: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + type: "object", + properties: { + code: { + type: "string", + enum: [ + "INCOTERMS", + "NAMED_PLACE_OF_DELIVERY", + ], + }, + }, + required: ["code"], + }, + value: { + type: "string", + }, + }, + if: { + properties: { + descriptor: { + properties: { code: { const: "INCOTERMS" } }, + }, + }, + }, + then: { + properties: { + value: { + enum: [ + "DPU", + "CIF", + "EXW", + "FOB", + "DAP", + "DDP", + ], + }, + }, + }, + required: ["descriptor", "value"], + }, + }, + }, + required: ["descriptor", "list"], + }, + }, + }, + required: ["id", "type", "stops"], + }, + }, + payments: { + type: "array", + items: { + type: "object", + properties: { + type: { + type: "string", + enum: [ + "PRE-FULFILLMENT", + "ON-FULFILLMENT", + "POST-FULFILLMENT", + ], + }, + }, + required: ["type"], + }, + }, + tags: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + properties: { + code: { + type: "string", + enum: ["buyer_id"], + }, + }, + }, + list: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + properties: { + code: { + type: "string", + enum: ["buyer_id_code", "buyer_id_no"], + }, + }, + }, + value: { + type: "string", + }, + }, + required: ["descriptor", "value"], + }, + }, + }, + required: ["descriptor", "list"], + }, + }, + }, + additionalProperties: false, + required: [ + "provider", + "items", + "billing", + "fulfillments", + "payments", + "tags", + ], + }, + }, + required: ["order"], + }, + }, + required: ["context", "message"], +}; diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/master.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/master.js new file mode 100644 index 0000000..d01fe98 --- /dev/null +++ b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/master.js @@ -0,0 +1,78 @@ +module.exports = { + $id: "http://example.com/schema/masterSchema", + type: "object", + properties: { + search: { + type: "array", + items: { + $ref: "searchSchema#", + }, + }, + on_search: { + type: "array", + items: { + $ref: "onSearchSchema#", + }, + }, + select: { + type: "array", + items: { + $ref: "selectSchema#", + }, + }, + on_select: { + type: "array", + items: { + $ref: "onSelectSchema#", + }, + }, + init: { + type: "array", + items: { + $ref: "initSchema#", + }, + }, + on_init: { + type: "array", + items: { + $ref: "onInitSchema#", + }, + }, + confirm: { + type: "array", + items: { + $ref: "confirmSchema#", + }, + }, + on_confirm: { + type: "array", + items: { + $ref: "onConfirmSchema#", + }, + }, + update: { + type: "array", + items: { + $ref: "updateSchema#", + }, + }, + on_update: { + type: "array", + items: { + $ref: "onUpdateSchema#", + }, + }, + status: { + type: "array", + items: { + $ref: "statusSchema#", + }, + }, + on_status: { + type: "array", + items: { + $ref: "onStatusSchema#", + }, + } + }, +}; diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_confirm.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_confirm.js new file mode 100644 index 0000000..3e87a93 --- /dev/null +++ b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_confirm.js @@ -0,0 +1,833 @@ +module.exports = { + $id: "http://example.com/schema/onConfirmSchema", + type: "object", + properties: { + context: { + type: "object", + properties: { + domain: { + type: "string", + }, + location: { + type: "object", + properties: { + city: { + type: "object", + properties: { + code: { + type: "string", + const: { $data: "/search/0/context/location/city/code" }, + }, + }, + required: ["code"], + }, + country: { + type: "object", + properties: { + code: { + type: "string", + const: { $data: "/search/0/context/location/country/code" }, + }, + }, + required: ["code"], + }, + }, + required: ["city", "country"], + }, + action: { + type: "string", + const: "on_confirm", + }, + version: { + type: "string", + const: "2.0.2", + }, + bap_id: { + type: "string", + }, + bap_uri: { + type: "string", + }, + bpp_id: { + type: "string", + }, + bpp_uri: { + type: "string", + }, + transaction_id: { + type: "string", + const: { $data: "/select/0/context/transaction_id" }, + errorMessage: + "Transaction ID should be same across the transaction: ${/select/0/context/transaction_id}", + }, + message_id: { + type: "string", + allOf: [ + { + const: { $data: "/confirm/0/context/message_id" }, + errorMessage: + "Message ID for on_action API should be same as action API: ${/init/0/context/message_id}", + }, + { + not: { + const: { $data: "1/transaction_id" }, + }, + errorMessage: + "Message ID should not be equal to transaction_id: ${1/transaction_id}", + }, + ] + }, + timestamp: { + type: "string", + format: "date-time", + }, + ttl: { + type: "string", + }, + }, + required: [ + "domain", + "location", + "action", + "version", + "bap_id", + "bap_uri", + "bpp_id", + "bpp_uri", + "transaction_id", + "message_id", + "timestamp", + "ttl", + ], + }, + message: { + type: "object", + properties: { + order: { + type: "object", + properties: { + id: { + type: "string", + const: { $data: "/confirm/0/message/order/id" }, + }, + state: { + type: "string", + enum: ["Created", "Accepted", "Cancelled"], + }, + provider: { + type: "object", + properties: { + id: { + type: "string", + const: { $data: "/confirm/0/message/order/provider/id" }, + }, + locations: { + type: "array", + const: { $data: "/confirm/0/message/order/provider/locations" }, + items: { + type: "object", + properties: { + id: { + type: "string", + }, + }, + required: ["id"], + }, + }, + rateable: { + type: "boolean", + }, + }, + required: ["id", "locations"], + }, + items: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + fulfillment_ids: { + type: "array", + items: { + type: "string", + }, + }, + quantity: { + type: "object", + properties: { + selected: { + type: "object", + properties: { + count: { + type: "integer", + }, + }, + required: ["count"], + }, + }, + required: ["selected"], + }, + "add-ons": { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + }, + required: ["id"], + }, + }, + tags: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + type: "object", + properties: { + code: { + type: "string", + enum: ["BUYER_TERMS"], + }, + }, + required: ["code"], + }, + list: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + type: "object", + properties: { + code: { + type: "string", + enum: ["ITEM_REQ", "PACKAGING_REQ"], + }, + }, + required: ["code"], + }, + value: { + type: "string", + anyOf: [ + { + const: { $data: "/init/0/message/order/items/0/tags/0/list/0/value" }, + }, + { + const: { $data: "/init/0/message/order/items/0/tags/0/list/1/value" }, + } + ] + }, + }, + required: ["descriptor", "value"], + }, + }, + }, + required: ["descriptor", "list"], + }, + }, + }, + required: ["id", "fulfillment_ids", "quantity"], + }, + }, + billing: { + type: "object", + properties: { + name: { + type: "string", + const: { $data: "/init/0/message/order/billing/name" }, + }, + address: { + type: "string", + const: { $data: "/init/0/message/order/billing/address" }, + }, + state: { + type: "object", + properties: { + name: { + type: "string", + const: { + $data: "/init/0/message/order/billing/state/name", + }, + }, + }, + required: ["name"], + }, + city: { + type: "object", + properties: { + name: { + type: "string", + const: { + $data: "/init/0/message/order/billing/city/name", + }, + }, + }, + required: ["name"], + }, + tax_id: { + type: "string", + const: { $data: "/init/0/message/order/billing/tax_id" }, + }, + email: { + type: "string", + const: { $data: "/init/0/message/order/billing/email" }, + }, + phone: { + type: "string", + const: { $data: "/init/0/message/order/billing/phone" }, + }, + }, + + required: ["name", "address", "state", "city", "tax_id", "phone"], + }, + fulfillments: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + "@ondc/org/provider_name": { + type: "string", + }, + state: { + type: "object", + properties: { + descriptor: { + type: "object", + properties: { + code: { + type: "string", + }, + }, + required: ["code"], + }, + }, + required: ["descriptor"], + }, + type: { + type: "string", + }, + tracking: { + type: "boolean", + }, + stops: { + type: "array", + items: { + type: "object", + properties: { + type: { + type: "string", + enum: ["start", "end"], + }, + location: { + type: "object", + properties: { + id: { + type: "string", + }, + descriptor: { + type: "object", + properties: { + name: { + type: "string", + }, + }, + required: ["name"], + }, + gps: { + type: "string", + pattern: "^(-?[0-9]{1,3}(?:.[0-9]{6,15})?),( )*?(-?[0-9]{1,3}(?:.[0-9]{6,15})?)$", + errorMessage: "Incorrect gps value", + }, + address: { + type: "string", + }, + city: { + type: "object", + properties: { + name: { + type: "string", + }, + }, + required: ["name"], + }, + country: { + type: "object", + properties: { + code: { + type: "string", + }, + }, + required: ["code"], + }, + area_code: { + type: "string", + }, + state: { + type: "object", + properties: { + name: { + type: "string", + }, + }, + required: ["name"], + }, + }, + }, + time: { + type: "object", + properties: { + range: { + type: "object", + properties: { + start: { + type: "string", + }, + end: { + type: "string", + }, + }, + required: ["start", "end"], + }, + }, + required: ["range"], + }, + instructions: { + type: "object", + properties: { + name: { + type: "string", + }, + short_desc: { + type: "string", + }, + }, + required: ["name", "short_desc"], + }, + contact: { + type: "object", + properties: { + phone: { + type: "string", + }, + email: { + type: "string", + }, + }, + required: ["phone"], + }, + }, + required: ["type", "location", "time", "contact"], + }, + }, + rateable: { + type: "boolean", + }, + tags: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + type: "object", + properties: { + code: { + type: "string", + enum: ["DELIVERY_TERMS"], + }, + }, + required: ["code"], + }, + list: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + type: "object", + properties: { + code: { + type: "string", + enum: [ + "INCOTERMS", + "NAMED_PLACE_OF_DELIVERY", + ], + }, + }, + required: ["code"], + }, + value: { + type: "string", + anyOf: [ + { + const: { $data: "/init/0/message/order/fulfillments/0/tags/0/list/0/value" }, + }, + { + const: { $data: "/init/0/message/order/fulfillments/0/tags/0/list/1/value" }, + } + ] + }, + }, + if: { + properties: { + descriptor: { + properties: { code: { const: "INCOTERMS" } }, + }, + }, + }, + then: { + properties: { + value: { + enum: [ + "DPU", + "CIF", + "EXW", + "FOB", + "DAP", + "DDP", + ], + }, + }, + }, + required: ["descriptor", "value"], + }, + }, + }, + required: ["descriptor", "list"], + }, + }, + }, + required: [ + "id", + "@ondc/org/provider_name", + "state", + "type", + "stops", + ], + }, + }, + quote: { + type: "object", + properties: { + price: { + type: "object", + properties: { + currency: { + type: "string", + }, + value: { + type: "string", + const: { + $data: "/on_init/0/message/order/quote/price/value", + }, + }, + }, + required: ["currency", "value"], + }, + breakup: { + type: "array", + items: { + type: "object", + properties: { + "@ondc/org/item_id": { + type: "string", + }, + "@ondc/org/item_quantity": { + type: "object", + properties: { + count: { + type: "integer", + }, + }, + required: ["count"], + }, + title: { + type: "string", + }, + "@ondc/org/title_type": { + type: "string", + }, + price: { + type: "object", + properties: { + currency: { + type: "string", + }, + value: { + type: "string", + }, + }, + required: ["currency", "value"], + }, + item: { + type: "object", + properties: { + price: { + type: "object", + properties: { + currency: { + type: "string", + }, + value: { + type: "string", + }, + }, + required: ["currency", "value"], + }, + }, + required: ["price"], + }, + }, + if: { + properties: { + "@ondc/org/title_type": { + const: "item", + }, + }, + }, + then: { + required: [ + "@ondc/org/item_id", + "@ondc/org/item_quantity", + "title", + "@ondc/org/title_type", + "price", + "item", + ], + }, + else: { + properties: { + "@ondc/org/title_type": { + enum: [ + "delivery", + "packing", + "tax", + "discount", + "misc", + ], + }, + }, + required: [ + "@ondc/org/item_id", + "title", + "@ondc/org/title_type", + "price", + ], + }, + }, + }, + ttl: { + type: "string", + }, + }, + isQuoteMatching: true, + required: ["price", "breakup", "ttl"], + }, + payments: { + type: "array", + items: { + type: "object", + properties: { + params: { + type: "object", + properties: { + currency: { + type: "string", + }, + transaction_id: { + type: "string", + }, + amount: { + type: "string", + }, + }, + required: ["currency", "amount"], + }, + status: { + type: "string", + enum: ["PAID", "NOT-PAID"], + }, + type: { + type: "string", + enum: [ + "PRE-FULFILLMENT", + "ON-FULFILLMENT", + "POST-FULFILLMENT", + ], + }, + collected_by: { + type: "string", + enum: ["BAP", "BPP"], + }, + "@ondc/org/buyer_app_finder_fee_type": { + type: "string", + }, + "@ondc/org/buyer_app_finder_fee_amount": { + type: "string", + }, + "@ondc/org/settlement_details": { + type: "array", + items: { + type: "object", + properties: { + settlement_counterparty: { + type: "string", + enum: ["seller-app", "buyer-app"], + }, + settlement_phase: { + type: "string", + }, + settlement_type: { + type: "string", + enum: ["upi", "neft", "rtgs"], + }, + beneficiary_name: { + type: "string", + }, + upi_address: { + type: "string", + }, + settlement_bank_account_no: { + type: "string", + }, + settlement_ifsc_code: { + type: "string", + }, + bank_name: { + type: "string", + }, + branch_name: { + type: "string", + }, + }, + allOf: [ + { + if: { + properties: { + settlement_type: { + const: "upi", + }, + }, + }, + then: { + required: ["upi_address"], + }, + }, + { + if: { + properties: { + settlement_type: { + const: ["neft", "rtgs"], + }, + }, + }, + then: { + required: [ + "settlement_ifsc_code", + "settlement_bank_account_no", + ], + }, + }, + ], + required: ["settlement_counterparty", "settlement_type"], + }, + }, + }, + if: { properties: { type: { const: "ON-FULFILLMENT" } } }, + then: { + properties: { + collected_by: { + const: "BPP", + }, + }, + }, + required: [ + "params", + "status", + "type", + "collected_by", + "@ondc/org/buyer_app_finder_fee_type", + "@ondc/org/buyer_app_finder_fee_amount", + ], + }, + }, + tags: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + properties: { + code: { + type: "string", + enum: ["buyer_id"], + }, + }, + }, + list: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + properties: { + code: { + type: "string", + enum: ["buyer_id_code", "buyer_id_no"], + }, + }, + }, + value: { + type: "string", + }, + }, + required: ["descriptor", "value"], + }, + }, + }, + required: ["descriptor", "list"], + }, + }, + created_at: { + type: "string", + format: "date-time", + const: { $data: "/confirm/0/message/order/created_at" }, + errorMessage: + "should remain same as in /confirm - ${/confirm/0/message/order/created_at}", + }, + updated_at: { + type: "string", + format: "date-time", + const: { $data: "3/context/timestamp" }, + errorMessage: + " should be updated as per context/timestamp - ${3/context/timestamp}", + }, + }, + additionalProperties: false, + required: [ + "id", + "state", + "provider", + "items", + "billing", + "fulfillments", + "quote", + "payments", + "tags", + "created_at", + "updated_at", + ], + }, + }, + required: ["order"], + }, + }, + required: ["context", "message"], +}; diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_init.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_init.js new file mode 100644 index 0000000..d47c1fe --- /dev/null +++ b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_init.js @@ -0,0 +1,694 @@ +module.exports = { + $id: "http://example.com/schema/onInitSchema", + type: "object", + properties: { + context: { + type: "object", + properties: { + domain: { + type: "string", + }, + location: { + type: "object", + properties: { + city: { + type: "object", + properties: { + code: { + type: "string", + const: { $data: "/search/0/context/location/city/code" }, + }, + }, + required: ["code"], + }, + country: { + type: "object", + properties: { + code: { + type: "string", + const: { $data: "/search/0/context/location/country/code" }, + }, + }, + required: ["code"], + }, + }, + required: ["city", "country"], + }, + action: { + type: "string", + const: "on_init", + }, + version: { + type: "string", + const: "2.0.2", + }, + bap_id: { + type: "string", + }, + bap_uri: { + type: "string", + }, + bpp_id: { + type: "string", + }, + bpp_uri: { + type: "string", + }, + transaction_id: { + type: "string", + const: { $data: "/select/0/context/transaction_id" }, + errorMessage: + "Transaction ID should be same across the transaction: ${/select/0/context/transaction_id}", + }, + message_id: { + type: "string", + allOf: [ + { + const: { $data: "/init/0/context/message_id" }, + errorMessage: + "Message ID for on_action API should be same as action API: ${/init/0/context/message_id}", + }, + { + not: { + const: { $data: "1/transaction_id" }, + }, + errorMessage: + "Message ID should not be equal to transaction_id: ${1/transaction_id}", + }, + ] + }, + timestamp: { + type: "string", + format: "date-time", + }, + ttl: { + type: "string", + format: "duration" + }, + }, + required: [ + "domain", + "location", + "action", + "version", + "bap_id", + "bap_uri", + "bpp_id", + "bpp_uri", + "transaction_id", + "message_id", + "timestamp", + "ttl", + ], + }, + message: { + type: "object", + properties: { + order: { + type: "object", + properties: { + provider: { + type: "object", + properties: { + id: { + type: "string", + const: { $data: "/init/0/message/order/provider/id" }, + }, + }, + required: ["id"], + }, + provider_location: { + type: "object", + properties: { + id: { + type: "string", + const: { $data: "/init/0/message/order/provider/locations/0/id"} + }, + }, + required: ["id"], + }, + items: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + fulfillment_ids: { + type: "array", + items: { + type: "string", + }, + }, + quantity: { + type: "object", + properties: { + selected: { + type: "object", + properties: { + count: { + type: "integer", + }, + }, + required: ["count"], + }, + }, + required: ["selected"], + }, + "add-ons": { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + }, + required: ["id"], + }, + }, + tags: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + type: "object", + properties: { + code: { + type: "string", + enum:["BUYER_TERMS"] + }, + }, + required: ["code"], + }, + list: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + type: "object", + properties: { + code: { + type: "string", + enum:["ITEM_REQ","PACKAGING_REQ"] + }, + }, + required: ["code"], + }, + value: { + type: "string", + anyOf: [ + { + const: { $data: "/init/0/message/order/items/0/tags/0/list/0/value" }, + }, + { + const: { $data: "/init/0/message/order/items/0/tags/0/list/1/value" }, + } + ] + }, + }, + required: ["descriptor", "value"], + }, + }, + }, + required: ["descriptor", "list"], + }, + }, + }, + required: ["id", "fulfillment_ids", "quantity"], + }, + }, + billing: { + type: "object", + properties: { + name: { + type: "string", + const: { $data: "/init/0/message/order/billing/name" }, + }, + address: { + type: "string", + const: { $data: "/init/0/message/order/billing/address" }, + }, + state: { + type: "object", + properties: { + name: { + type: "string", + const: { + $data: "/init/0/message/order/billing/state/name", + }, + }, + }, + required: ["name"], + }, + city: { + type: "object", + properties: { + name: { + type: "string", + const: { + $data: "/init/0/message/order/billing/city/name", + }, + }, + }, + required: ["name"], + }, + tax_id: { + type: "string", + const: { $data: "/init/0/message/order/billing/tax_id" }, + }, + email: { + type: "string", + const: { $data: "/init/0/message/order/billing/email" }, + }, + phone: { + type: "string", + const: { $data: "/init/0/message/order/billing/phone" }, + }, + }, + + required: ["name", "address", "state", "city", "tax_id", "phone"], + }, + fulfillments: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + type: { + type: "string", + }, + tracking: { + type: "boolean", + }, + stops: { + type: "array", + items: { + type: "object", + properties: { + type: { + type: "string", + enum: ["start", "end"], + }, + location: { + type: "object", + properties: { + gps: { + type: "string", + pattern: "^(-?[0-9]{1,3}(?:.[0-9]{6,15})?),( )*?(-?[0-9]{1,3}(?:.[0-9]{6,15})?)$", + errorMessage: "Incorrect gps value", + }, + address: { + type: "string", + }, + city: { + type: "object", + properties: { + name: { + type: "string", + }, + }, + required: ["name"], + }, + country: { + type: "object", + properties: { + code: { + type: "string", + }, + }, + required: ["code"], + }, + area_code: { + type: "string", + }, + state: { + type: "object", + properties: { + name: { + type: "string", + }, + }, + required: ["name"], + }, + }, + required: [ + "gps", + "address", + "city", + "country", + "area_code", + "state", + ], + }, + contact: { + type: "object", + properties: { + phone: { + type: "string", + }, + }, + required: ["phone"], + }, + }, + required: ["type", "location", "contact"], + }, + }, + tags: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + type: "object", + properties: { + code: { + type: "string", + enum: ["DELIVERY_TERMS"], + }, + }, + required: ["code"], + }, + list: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + type: "object", + properties: { + code: { + type: "string", + enum: [ + "INCOTERMS", + "NAMED_PLACE_OF_DELIVERY", + ], + }, + }, + required: ["code"], + }, + value: { + type: "string", + anyOf: [ + { + const: { $data: "/init/0/message/order/fulfillments/0/tags/0/list/0/value" }, + }, + { + const: { $data: "/init/0/message/order/fulfillments/0/tags/0/list/1/value" }, + } + ] + }, + }, + if: { + properties: { + descriptor: { + properties: { code: { const: "INCOTERMS" } }, + }, + }, + }, + then: { + properties: { + value: { + enum: [ + "DPU", + "CIF", + "EXW", + "FOB", + "DAP", + "DDP", + ], + }, + }, + }, + required: ["descriptor", "value"], + }, + }, + }, + required: ["descriptor", "list"], + }, + }, + }, + required: ["id", "type", "tracking", "stops"], + }, + }, + quote: { + type: "object", + properties: { + price: { + type: "object", + properties: { + currency: { + type: "string", + }, + value: { + type: "string", + }, + }, + required: ["currency", "value"], + }, + breakup: { + type: "array", + items: { + type: "object", + properties: { + "@ondc/org/item_id": { + type: "string", + }, + "@ondc/org/item_quantity": { + type: "object", + properties: { + count: { + type: "integer", + }, + }, + required: ["count"], + }, + title: { + type: "string", + }, + "@ondc/org/title_type": { + type: "string", + enum: ["item", "discount", "packing", "delivery", "tax", "misc"] + }, + price: { + type: "object", + properties: { + currency: { + type: "string", + }, + value: { + type: "string", + }, + }, + required: ["currency", "value"], + }, + item: { + type: "object", + properties: { + price: { + type: "object", + properties: { + currency: { + type: "string", + }, + value: { + type: "string", + }, + }, + required: ["currency", "value"], + }, + }, + required: ["price"], + }, + }, + if: { + properties: { + "@ondc/org/title_type": { + const: "item", + }, + }, + }, + then: { + required: [ + "@ondc/org/item_id", + "@ondc/org/item_quantity", + "title", + "@ondc/org/title_type", + "price", + "item", + ], + }, + else: { + properties: { + "@ondc/org/title_type": { + enum: [ + "delivery", + "packing", + "tax", + "discount", + "misc", + ], + }, + }, + required: [ + "@ondc/org/item_id", + "title", + "@ondc/org/title_type", + "price", + ], + }, + }, + }, + ttl: { + type: "string", + }, + }, + isQuoteMatching: true, + + required: ["price", "breakup", "ttl"], + }, + payments: { + type: "array", + items: { + type: "object", + properties: { + "@ondc/org/buyer_app_finder_fee_type": { + type: "string", + }, + "@ondc/org/buyer_app_finder_fee_amount": { + type: "string", + }, + "@ondc/org/settlement_details": { + type: "array", + items: { + type: "object", + properties: { + settlement_counterparty: { + type: "string", + enum: ["seller-app", "buyer-app"], + }, + settlement_phase: { + type: "string", + }, + settlement_type: { + type: "string", + enum: ["upi", "neft", "rtgs"], + }, + beneficiary_name: { + type: "string", + }, + upi_address: { + type: "string", + }, + settlement_bank_account_no: { + type: "string", + }, + settlement_ifsc_code: { + type: "string", + }, + bank_name: { + type: "string", + }, + branch_name: { + type: "string", + }, + }, + allOf: [ + { + if: { + properties: { + settlement_type: { + const: "upi", + }, + }, + }, + then: { + required: ["upi_address"], + }, + }, + { + if: { + properties: { + settlement_type: { + const: ["neft", "rtgs"], + }, + }, + }, + then: { + required: [ + "settlement_ifsc_code", + "settlement_bank_account_no", + ], + }, + }, + ], + required: ["settlement_counterparty", "settlement_type"], + }, + }, + }, + required: [ + "@ondc/org/buyer_app_finder_fee_type", + "@ondc/org/buyer_app_finder_fee_amount", + ], + }, + }, + tags: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + properties: { + code: { + type: "string", + enum: ["buyer_id"], + }, + }, + }, + list: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + properties: { + code: { + type: "string", + enum: ["buyer_id_code", "buyer_id_no"], + }, + }, + }, + value: { + type: "string", + }, + }, + required: ["descriptor", "value"], + }, + }, + }, + required: ["descriptor", "list"], + }, + }, + }, + additionalProperties:false, + required: [ + "provider", + "provider_location", + "items", + "billing", + "fulfillments", + "quote", + "payments", + ], + }, + }, + required: ["order"], + }, + }, + required: ["context", "message"], +}; diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_search.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_search.js new file mode 100644 index 0000000..13d05ca --- /dev/null +++ b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_search.js @@ -0,0 +1,966 @@ +module.exports = { + $id: "http://example.com/schema/onSearchSchema", + type: "object", + properties: { + context: { + type: "object", + properties: { + domain: { + type: "string", + }, + location: { + type: "object", + properties: { + city: { + type: "object", + properties: { + code: { + type: "string", + const: { $data: "/search/0/context/location/city/code" }, + }, + }, + required: ["code"], + }, + country: { + type: "object", + properties: { + code: { + type: "string", + const: { $data: "/search/0/context/location/country/code" }, + }, + }, + required: ["code"], + }, + }, + required: ["city", "country"], + }, + action: { + type: "string", + const: "on_search", + }, + version: { + type: "string", + const: "2.0.2", + }, + bap_id: { + type: "string", + }, + bap_uri: { + type: "string", + }, + bpp_id: { + type: "string", + }, + bpp_uri: { + type: "string", + }, + transaction_id: { + type: "string", + const: { $data: "/search/0/context/transaction_id" }, + errorMessage: + "Transaction ID should be same across the transaction: ${/search/0/context/transaction_id}", + }, + message_id: { + type: "string", + allOf: [ + { + const: { $data: "/search/0/context/message_id" }, + errorMessage: + "Message ID for on_action API should be same as action API: ${/search/0/context/message_id}", + }, + { + not: { + const: { $data: "1/transaction_id" }, + }, + errorMessage: + "Message ID should not be equal to transaction_id: ${1/transaction_id}", + }, + ], + }, + timestamp: { + type: "string", + format: "date-time", + }, + ttl: { + type: "string", + }, + }, + required: [ + "domain", + "location", + "action", + "version", + "bap_id", + "bap_uri", + "bpp_id", + "bpp_uri", + "transaction_id", + "message_id", + "timestamp", + "ttl", + ], + }, + message: { + type: "object", + properties: { + catalog: { + type: "object", + properties: { + fulfillments: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + type: { + type: "string", + enum: ["Delivery", "Self-Pickup"], + }, + }, + required: ["id", "type"], + }, + }, + payments: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + type: { + type: "string", + enum: [ + "PRE-FULFILLMENT", + "ON-FULFILLMENT", + "POST-FULFILLMENT", + ], + }, + }, + required: ["id", "type"], + }, + }, + descriptor: { + type: "object", + properties: { + name: { + type: "string", + }, + short_desc: { + type: "string", + }, + long_desc: { + type: "string", + }, + images: { + type: "array", + items: { + type: "object", + properties: { + url: { + type: "string", + }, + }, + required: ["url"], + }, + }, + }, + required: ["name", "short_desc", "long_desc", "images"], + }, + providers: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + descriptor: { + type: "object", + properties: { + name: { + type: "string", + }, + code: { + type: "string", + }, + short_desc: { + type: "string", + }, + long_desc: { + type: "string", + }, + additional_desc: { + type: "object", + properties: { + url: { + type: "string", + }, + content_type: { + type: "string", + }, + }, + required: ["url", "content_type"], + }, + images: { + type: "array", + items: { + type: "object", + properties: { + url: { + type: "string", + }, + }, + required: ["url"], + }, + }, + }, + required: ["name", "code"], + }, + rating: { + type: "string", + }, + ttl: { + type: "string", + format: "duration", + }, + locations: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + gps: { + type: "string", + pattern: + "^(-?[0-9]{1,3}(?:.[0-9]{6,15})?),( )*?(-?[0-9]{1,3}(?:.[0-9]{6,15})?)$", + errorMessage: "Incorrect gps value", + }, + address: { + type: "string", + }, + city: { + type: "object", + properties: { + code: { + type: "string", + }, + name: { + type: "string", + }, + }, + required: ["code", "name"], + }, + state: { + type: "object", + properties: { + code: { + type: "string", + }, + }, + required: ["code"], + }, + country: { + type: "object", + properties: { + code: { + type: "string", + }, + }, + required: ["code"], + }, + area_code: { + type: "string", + }, + }, + additionalProperties: false, + required: [ + "id", + "gps", + "address", + "city", + "state", + "country", + "area_code", + ], + }, + }, + creds: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + type: { + type: "string", + enum: ["License", "Badge", "Permit", "Certificate"], + }, + desc: { + type: "string", + }, + url: { + type: "string", + format: "uri", + }, + }, + required: ["id", "type", "desc", "url"], + }, + }, + tags: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + properties: { + code: { + type: "string", + }, + }, + }, + list: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + properties: { + code: { + type: "string", + }, + }, + }, + value: { + type: "string", + }, + }, + required: ["descriptor", "value"], + }, + }, + }, + required: ["descriptor", "list"], + }, + }, + items: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + parent_item_id: { + type: "string", + }, + descriptor: { + type: "object", + properties: { + name: { + type: "string", + }, + code: { + type: "string", + }, + short_desc: { + type: "string", + }, + long_desc: { + type: "string", + }, + images: { + type: "array", + items: { + type: "object", + properties: { + url: { + type: "string", + }, + }, + required: ["url"], + }, + }, + media: { + type: "array", + items: { + type: "object", + properties: { + mimetype: { + type: "string", + }, + url: { + type: "string", + }, + }, + required: ["mimetype", "url"], + }, + }, + }, + required: [ + "name", + "code", + "short_desc", + "long_desc", + "images", + ], + }, + creator: { + type: "object", + properties: { + descriptor: { + type: "object", + properties: { + name: { + type: "string", + }, + contact: { + type: "object", + properties: { + name: { + type: "string", + }, + address: { + type: "object", + properties: { + full: { + type: "string", + }, + }, + required: ["full"], + }, + phone: { + type: "string", + }, + email: { + type: "string", + }, + }, + required: ["address", "phone"], + }, + }, + required: ["name", "contact"], + }, + }, + required: ["descriptor"], + }, + price: { + type: "object", + properties: { + currency: { + type: "string", + }, + value: { + type: "string", + }, + offered_value: { + type: "string", + }, + maximum_value: { + type: "string", + }, + }, + required: ["currency", "value", "maximum_value"], + }, + quantity: { + type: "object", + properties: { + unitized: { + type: "object", + properties: { + measure: { + type: "object", + properties: { + unit: { + type: "string", + enum: [ + "unit", + "dozen", + "gram", + "kilogram", + "tonne", + "litre", + "millilitre", + ], + }, + value: { + type: "string", + }, + }, + required: ["unit", "value"], + }, + }, + required: ["measure"], + }, + available: { + type: "object", + properties: { + measure: { + type: "object", + properties: { + unit: { + type: "string", + enum: [ + "unit", + "dozen", + "gram", + "kilogram", + "tonne", + "litre", + "millilitre", + ], + }, + value: { + type: "string", + }, + }, + required: ["unit", "value"], + }, + count: { + type: "string", + }, + }, + required: ["measure", "count"], + }, + maximum: { + type: "object", + properties: { + measure: { + type: "object", + properties: { + unit: { + type: "string", + enum: [ + "unit", + "dozen", + "gram", + "kilogram", + "tonne", + "litre", + "millilitre", + ], + }, + value: { + type: "string", + }, + }, + required: ["unit", "value"], + }, + count: { + type: "string", + }, + }, + required: ["measure", "count"], + }, + }, + required: ["unitized", "available", "maximum"], + }, + category_ids: { + type: "array", + items: { + type: "string", + }, + }, + fulfillment_ids: { + type: "array", + items: { + type: "string", + }, + }, + location_ids: { + type: "array", + items: { + type: "string", + }, + }, + payment_ids: { + type: "array", + items: { + type: "string", + }, + }, + "add-ons": { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + descriptor: { + type: "object", + properties: { + name: { + type: "string", + }, + short_desc: { + type: "string", + }, + long_desc: { + type: "string", + }, + images: { + type: "array", + items: { + type: "object", + properties: { + url: { + type: "string", + }, + }, + required: ["url"], + }, + }, + }, + required: [ + "name", + "short_desc", + "long_desc", + "images", + ], + }, + price: { + type: "object", + properties: { + currency: { + type: "string", + }, + value: { + type: "string", + }, + offered_value: { + type: "string", + }, + maximum_value: { + type: "string", + }, + }, + required: [ + "currency", + "value", + "offered_value", + "maximum_value", + ], + }, + }, + required: ["id", "descriptor", "price"], + }, + }, + cancellation_terms: { + type: "array", + items: { + type: "object", + properties: { + fulfillment_state: { + type: "object", + properties: { + descriptor: { + type: "object", + properties: { + code: { + type: "string", + }, + }, + required: ["code"], + }, + }, + required: ["descriptor"], + }, + refund_eligible: { + type: "string", + }, + return_policy: { + type: "object", + properties: { + return_eligible: { + type: "string", + }, + return_within: { + type: "string", + }, + fulfillment_managed_by: { + type: "string", + }, + return_location: { + type: "object", + properties: { + address: { + type: "string", + }, + gps: { + type: "string", + }, + }, + required: ["address", "gps"], + }, + }, + required: [ + "return_eligible", + "return_within", + "fulfillment_managed_by", + "return_location", + ], + }, + }, + if: { + properties: { + fulfillment_state: { + properties: { + descriptor: { + properties: { + code: { + const: "Order-delivered", + }, + }, + }, + }, + }, + }, + }, + then: { + required: ["fulfillment_state", "return_policy"], + }, + else: { + required: [ + "fulfillment_state", + "refund_eligible", + ], + }, + }, + }, + replacement_terms: { + type: "array", + items: { + type: "object", + properties: { + replace_within: { + type: "string", + }, + }, + required: ["replace_within"], + }, + }, + time: { + type: "object", + properties: { + label: { + type: "string", + }, + range: { + type: "object", + properties: { + start: { + type: "string", + }, + end: { + type: "string", + }, + }, + required: ["start", "end"], + }, + }, + required: ["label", "range"], + }, + matched: { + type: "string", + }, + recommended: { + type: "string", + }, + tags: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + properties: { + code: { + type: "string", + }, + }, + }, + + list: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + properties: { + code: { + type: "string", + }, + }, + }, + value: { + type: "string", + }, + }, + required: ["descriptor", "value"], + }, + }, + }, + required: ["descriptor", "list"], + }, + }, + }, + required: [ + "id", + + "descriptor", + "creator", + "price", + "quantity", + "category_ids", + "fulfillment_ids", + "location_ids", + "payment_ids", + "cancellation_terms", + "replacement_terms", + + "matched", + "recommended", + ], + }, + }, + offers: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + descriptor: { + type: "object", + properties: { + name: { + type: "string", + }, + code: { + type: "string", + }, + short_desc: { + type: "string", + }, + long_desc: { + type: "string", + }, + images: { + type: "array", + items: { + type: "object", + properties: { + url: { + type: "string", + }, + }, + required: ["url"], + }, + }, + }, + required: [ + "name", + "code", + "short_desc", + "long_desc", + "images", + ], + }, + location_ids: { + type: "array", + items: {}, + }, + category_ids: { + type: "array", + items: {}, + }, + item_ids: { + type: "array", + items: {}, + }, + time: { + type: "object", + properties: { + label: { + type: "string", + }, + range: { + type: "object", + properties: { + start: { + type: "string", + }, + end: { + type: "string", + }, + }, + required: ["start", "end"], + }, + }, + required: ["label", "range"], + }, + }, + required: [ + "id", + "descriptor", + "location_ids", + "category_ids", + "item_ids", + "time", + ], + }, + }, + fulfillments: { + type: "array", + items: { + type: "object", + properties: { + contact: { + type: "object", + properties: { + phone: { + type: "string", + }, + email: { + type: "string", + }, + }, + required: ["phone", "email"], + }, + }, + required: ["contact"], + }, + }, + }, + required: [ + "id", + "descriptor", + "ttl", + "locations", + "tags", + "items", + "fulfillments", + ], + }, + }, + }, + additionalProperties: false, + required: ["fulfillments", "payments", "descriptor", "providers"], + }, + }, + required: ["catalog"], + }, + search: { + type: "array", + items: { + $ref: "searchSchema#", + }, + }, + }, + required: ["context", "message"], +}; diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_select.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_select.js new file mode 100644 index 0000000..8e8591b --- /dev/null +++ b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_select.js @@ -0,0 +1,335 @@ +module.exports = { + $id: "http://example.com/schema/onSelectSchema", + type: "object", + properties: { + context: { + type: "object", + properties: { + domain: { + type: "string", + }, + location: { + type: "object", + properties: { + city: { + type: "object", + properties: { + code: { + type: "string", + const: { $data: "/search/0/context/location/city/code" }, + }, + }, + required: ["code"], + }, + country: { + type: "object", + properties: { + code: { + type: "string", + const: { $data: "/search/0/context/location/country/code" }, + }, + }, + required: ["code"], + }, + }, + required: ["city", "country"], + }, + action: { + type: "string", + const: "on_select", + }, + version: { + type: "string", + const: "2.0.2", + }, + bap_id: { + type: "string", + }, + bap_uri: { + type: "string", + }, + bpp_id: { + type: "string", + }, + bpp_uri: { + type: "string", + }, + transaction_id: { + type: "string", + const: { $data: "/select/0/context/transaction_id" }, + errorMessage: + "Transaction ID should be same across the transaction: ${/select/0/context/transaction_id}", + }, + message_id: { + type: "string", + allOf: [ + { + const: { $data: "/select/0/context/message_id" }, + errorMessage: + "Message ID for on_action API should be same as action API: ${/select/0/context/message_id}", + }, + { + not: { + const: { $data: "1/transaction_id" }, + }, + errorMessage: + "Message ID should not be equal to transaction_id: ${1/transaction_id}", + }, + ] + }, + timestamp: { + type: "string", + format: "date-time", + }, + ttl: { + type: "string" + }, + }, + required: [ + "domain", + "location", + "action", + "version", + "bap_id", + "bap_uri", + "bpp_id", + "bpp_uri", + "transaction_id", + "message_id", + "timestamp", + "ttl", + ], + }, + message: { + type: "object", + properties: { + order: { + type: "object", + properties: { + provider: { + type: "object", + properties: { + id: { + type: "string", + const: { $data: "/select/0/message/order/provider/id" }, + + }, + }, + required: ["id"], + }, + items: { + type: "array", + items: { + type: "object", + properties: { + fulfillment_ids: { + type: "array", + items: { + type: "string", + }, + }, + id: { + type: "string", + }, + }, + required: ["id"], + }, + }, + fulfillments: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + "@ondc/org/provider_name": { + type: "string", + }, + tracking: { + type: "boolean", + }, + "@ondc/org/category": { + type: "string", + }, + "@ondc/org/TAT": { + type: "string", + format: "duration" + }, + state: { + type: "object", + properties: { + descriptor: { + type: "object", + properties: { + code: { + type: "string", + enum: ["Serviceable", "Non-Serviceable"], + }, + }, + required: ["code"], + }, + }, + required: ["descriptor"], + }, + }, + required: [ + "id", + "@ondc/org/provider_name", + "tracking", + "@ondc/org/category", + "@ondc/org/TAT", + "state", + ], + }, + }, + quote: { + type: "object", + properties: { + price: { + type: "object", + properties: { + currency: { + type: "string", + }, + value: { + type: "string", + }, + }, + required: ["currency", "value"], + }, + breakup: { + type: "array", + items: { + type: "object", + properties: { + "@ondc/org/item_id": { + type: "string", + }, + "@ondc/org/item_quantity": { + type: "object", + properties: { + count: { + type: "integer", + }, + }, + required: ["count"], + }, + title: { + type: "string", + }, + "@ondc/org/title_type": { + type: "string", + enum: ["item", "discount", "packing", "delivery ", "tax", "misc"] + }, + price: { + type: "object", + properties: { + currency: { + type: "string", + }, + value: { + type: "string", + }, + }, + required: ["currency", "value"], + }, + item: { + type: "object", + properties: { + quantity: { + type: "object", + properties: { + available: { + type: "object", + properties: { + count: { + type: "string", + }, + }, + required: ["count"], + }, + maximum: { + type: "object", + properties: { + count: { + type: "string", + }, + }, + required: ["count"], + }, + }, + required: ["available", "maximum"], + }, + price: { + type: "object", + properties: { + currency: { + type: "string", + }, + value: { + type: "string", + }, + }, + required: ["currency", "value"], + }, + }, + required: ["quantity", "price"], + }, + }, + if: { + properties: { + "@ondc/org/title_type": { + const: "item", + }, + }, + }, + then: { + required: [ + "@ondc/org/item_id", + "@ondc/org/item_quantity", + "title", + "@ondc/org/title_type", + "price", + "item", + ], + }, + else: { + properties: { + "@ondc/org/title_type": { + enum: [ + "delivery", + "packing", + "tax", + "discount", + "misc", + ], + }, + }, + required: [ + "@ondc/org/item_id", + "title", + "@ondc/org/title_type", + "price", + ], + }, + }, + }, + ttl: { + type: "string", + format: "duration" + }, + }, + isQuoteMatching: true, + + required: ["price", "breakup", "ttl"], + }, + }, + required: ["provider", "items", "quote"], + }, + }, + required: ["order"], + }, + }, + required: ["context", "message"], +}; diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_status.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_status.js new file mode 100644 index 0000000..487e02a --- /dev/null +++ b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_status.js @@ -0,0 +1,758 @@ +module.exports = { + $id: "http://example.com/schema/onStatusSchema", + type: "object", + properties: { + context: { + type: "object", + properties: { + domain: { + type: "string", + }, + location: { + type: "object", + properties: { + city: { + type: "object", + properties: { + code: { + type: "string", + const: { $data: "/search/0/context/location/city/code" }, + }, + }, + required: ["code"], + }, + country: { + type: "object", + properties: { + code: { + type: "string", + const: { $data: "/search/0/context/location/country/code" }, + }, + }, + required: ["code"], + }, + }, + required: ["city", "country"], + }, + action: { + type: "string", + const: "on_status", + }, + version: { + type: "string", + const: "2.0.2", + }, + bap_id: { + type: "string", + }, + bap_uri: { + type: "string", + }, + bpp_id: { + type: "string", + }, + bpp_uri: { + type: "string", + }, + transaction_id: { + type: "string", + const: { $data: "/select/0/context/transaction_id" }, + errorMessage: + "Transaction ID should be same across the transaction: ${/select/0/context/transaction_id}", + }, + message_id: { + type: "string", + }, + timestamp: { + type: "string", + format: "date-time", + }, + ttl: { + type: "string", + }, + }, + required: [ + "domain", + "location", + "action", + "version", + "bap_id", + "bap_uri", + "bpp_id", + "bpp_uri", + "transaction_id", + "message_id", + "timestamp", + "ttl", + ], + }, + message: { + type: "object", + properties: { + order: { + type: "object", + properties: { + id: { + type: "string", + const: { $data: "/confirm/0/message/order/id" }, + }, + state: { + type: "string", + enum: [ + "Created", + "Accepted", + "In-progress", + "Cancelled", + "Completed", + ], + }, + provider: { + type: "object", + properties: { + id: { + type: "string", + const: { $data: "/select/0/message/order/provider/id" }, + }, + locations: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + }, + required: ["id"], + }, + }, + }, + required: ["id", "locations"], + }, + items: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + fulfillment_ids: { + type: "array", + items: { + type: "string", + }, + }, + quantity: { + type: "object", + properties: { + selected: { + type: "object", + properties: { + count: { + type: "integer", + }, + }, + required: ["count"], + }, + }, + additionalProperties: false, + required: ["selected"], + }, + }, + required: ["id", "fulfillment_ids", "quantity"], + }, + }, + billing: { + type: "object", + properties: { + name: { + type: "string", + const: { $data: "/init/0/message/order/billing/name" }, + }, + address: { + type: "string", + const: { $data: "/init/0/message/order/billing/address" }, + }, + state: { + type: "object", + properties: { + name: { + type: "string", + const: { + $data: "/init/0/message/order/billing/state/name", + }, + }, + }, + required: ["name"], + }, + city: { + type: "object", + properties: { + name: { + type: "string", + }, + const: { + $data: "/init/0/message/order/billing/city/name", + }, + }, + required: ["name"], + }, + email: { + type: "string", + const: { $data: "/init/0/message/order/billing/email" }, + }, + phone: { + type: "string", + const: { $data: "/init/0/message/order/billing/phone" }, + }, + }, + required: ["name", "address", "state", "city", "phone"], + }, + fulfillments: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + "@ondc/org/provider_name": { + type: "string", + }, + type: { + type: "string", + }, + tracking: { + type: "boolean", + }, + state: { + type: "object", + properties: { + descriptor: { + type: "object", + properties: { + code: { + type: "string", + enum: [ + "Pending", + "Packed", + "Agent-assigned", + "Order-picked-up", + "Out-for-delivery", + "Order-delivered", + ], + }, + }, + required: ["code"], + }, + }, + required: ["descriptor"], + }, + stops: { + type: "array", + items: { + type: "object", + properties: { + type: { + type: "string", + enum: ["start", "end"], + }, + location: { + type: "object", + properties: { + id: { + type: "string", + }, + descriptor: { + type: "object", + properties: { + name: { + type: "string", + }, + images: { + type: "array", + items: { + type: "string", + }, + }, + }, + required: ["name"], + }, + gps: { + type: "string", + pattern: + "^(-?[0-9]{1,3}(?:.[0-9]{6,15})?),( )*?(-?[0-9]{1,3}(?:.[0-9]{6,15})?)$", + errorMessage: "Incorrect gps value", + }, + address: { + type: "string", + }, + city: { + type: "object", + properties: { + name: { + type: "string", + }, + }, + required: ["name"], + }, + country: { + type: "object", + properties: { + code: { + type: "string", + }, + }, + required: ["code"], + }, + area_code: { + type: "string", + }, + state: { + type: "object", + properties: { + name: { + type: "string", + }, + }, + required: ["name"], + }, + }, + }, + time: { + type: "object", + properties: { + range: { + type: "object", + properties: { + start: { + type: "string", + pattern: "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$", + errorMessage:"should be in RFC 3339 (YYYY-MM-DDTHH:MN:SS.MSSZ) Format" + }, + end: { + type: "string", + pattern: "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$", + errorMessage:"should be in RFC 3339 (YYYY-MM-DDTHH:MN:SS.MSSZ) Format" + }, + }, + required: ["start", "end"], + }, + timestamp: { + type: "string", + pattern: "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$", + errorMessage:"should be in RFC 3339 (YYYY-MM-DDTHH:MN:SS.MSSZ) Format" + }, + }, + required: ["range"], + }, + instructions: { + type: "object", + properties: { + name: { + type: "string", + }, + short_desc: { + type: "string", + }, + long_desc: { + type: "string", + }, + images: { + type: "array", + items: { + type: "string", + }, + }, + }, + required: [ + "name", + "short_desc", + "long_desc", + "images", + ], + }, + contact: { + type: "object", + properties: { + phone: { + type: "string", + }, + email: { + type: "string", + }, + }, + required: ["phone"], + }, + agent: { + type: "object", + properties: { + person: { + type: "object", + properties: { + name: { + type: "string", + }, + }, + required: ["name"], + }, + contact: { + type: "object", + properties: { + phone: { + type: "string", + }, + }, + required: ["phone"], + }, + }, + required: ["person", "contact"], + }, + }, + if: { properties: { type: { const: "start" } } }, + then: { + properties: { + location: { required: ["id", "descriptor", "gps"] }, + }, + }, + else: { + properties: { + location: { required: ["address", "gps"] }, + }, + }, + required: ["type", "location", "time", "contact"], + }, + }, + }, + required: [ + "id", + "@ondc/org/provider_name", + "type", + "tracking", + "state", + "stops", + ], + anyof: [ + { + properties: { + state: { + const: "Order-picked-up", + }, + stops: { + type: "array", + items: { + properties: { + type: { + const: "start", + }, + time: { + required: ["range", "timestamp"], + }, + }, + }, + }, + }, + }, + ], + }, + }, + quote: { + type: "object", + properties: { + price: { + type: "object", + properties: { + currency: { + type: "string", + }, + value: { + type: "string", + }, + }, + required: ["currency", "value"], + }, + breakup: { + type: "array", + items: { + type: "object", + properties: { + "@ondc/org/item_id": { + type: "string", + }, + "@ondc/org/item_quantity": { + type: "object", + properties: { + count: { + type: "integer", + }, + }, + required: ["count"], + }, + title: { + type: "string", + }, + "@ondc/org/title_type": { + type: "string", + }, + price: { + type: "object", + properties: { + currency: { + type: "string", + }, + value: { + type: "string", + }, + }, + required: ["currency", "value"], + }, + item: { + type: "object", + properties: { + price: { + type: "object", + properties: { + currency: { + type: "string", + }, + value: { + type: "string", + }, + }, + required: ["currency", "value"], + }, + }, + required: ["price"], + }, + }, + if: { + properties: { + "@ondc/org/title_type": { + const: "item", + }, + }, + }, + then: { + required: [ + "@ondc/org/item_id", + "@ondc/org/item_quantity", + "title", + "@ondc/org/title_type", + "price", + "item", + ], + }, + else: { + properties: { + "@ondc/org/title_type": { + enum: [ + "delivery", + "packing", + "tax", + "discount", + "misc", + ], + }, + }, + required: [ + "@ondc/org/item_id", + "title", + "@ondc/org/title_type", + "price", + ], + }, + }, + }, + ttl: { + type: "string", + }, + }, + isQuoteMatching: true, + + required: ["price", "breakup", "ttl"], + }, + payments: { + type: "array", + items: { + type: "object", + properties: { + params: { + type: "object", + properties: { + currency: { + type: "string", + }, + transaction_id: { + type: "string", + }, + amount: { + type: "string", + }, + }, + required: ["currency", "amount"], + }, + status: { + type: "string", + enum: ["PAID", "NOT-PAID"], + }, + type: { + type: "string", + const: { + $data: "/on_confirm/0/message/order/payments/0/type", + }, + enum: [ + "PRE-FULFILLMENT", + "ON-FULFILLMENT", + "POST-FULFILLMENT", + ], + }, + collected_by: { + type: "string", + const: { + $data: + "/on_confirm/0/message/order/payments/0/collected_by", + }, + enum: ["BAP", "BPP"], + }, + "@ondc/org/buyer_app_finder_fee_type": { + type: "string", + }, + "@ondc/org/buyer_app_finder_fee_amount": { + type: "string", + }, + "@ondc/org/settlement_details": { + type: "array", + items: { + type: "object", + properties: { + settlement_counterparty: { + type: "string", + enum: ["seller-app", "buyer-app"], + }, + settlement_phase: { + type: "string", + }, + settlement_type: { + type: "string", + enum: ["upi", "neft", "rtgs"], + }, + beneficiary_name: { + type: "string", + }, + upi_address: { + type: "string", + }, + settlement_bank_account_no: { + type: "string", + }, + settlement_ifsc_code: { + type: "string", + }, + bank_name: { + type: "string", + }, + branch_name: { + type: "string", + }, + }, + allOf: [ + { + if: { + properties: { + settlement_type: { + const: "upi", + }, + }, + }, + then: { + required: ["upi_address"], + }, + }, + { + if: { + properties: { + settlement_type: { + const: ["neft", "rtgs"], + }, + }, + }, + then: { + required: [ + "settlement_ifsc_code", + "settlement_bank_account_no", + ], + }, + }, + ], + required: ["settlement_counterparty", "settlement_type"], + }, + }, + }, + if: { properties: { type: { const: "ON-FULFILLMENT" } } }, + then: { + properties: { + collected_by: { + const: "BPP", + }, + }, + }, + required: [ + "params", + "status", + "type", + "collected_by", + "@ondc/org/buyer_app_finder_fee_type", + "@ondc/org/buyer_app_finder_fee_amount", + ], + }, + }, + + documents: { + type: "array", + items: { + type: "object", + properties: { + url: { + type: "string", + }, + label: { + type: "string", + }, + }, + required: ["url", "label"], + }, + }, + created_at: { + type: "string", + format: "date-time", + const: { $data: "/confirm/0/message/order/created_at" }, + errorMessage: + "order/created_at should remain same as in /confirm - ${/confirm/0/message/order/created_at}", + }, + updated_at: { + type: "string", + format: "date-time", + }, + }, + additionalProperties: false, + required: [ + "id", + "state", + "provider", + "items", + "billing", + "fulfillments", + "quote", + "payments", + "documents", + "created_at", + "updated_at", + ], + }, + }, + required: ["order"], + }, + }, + + required: ["context", "message"], +}; diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_update.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_update.js new file mode 100644 index 0000000..55c6645 --- /dev/null +++ b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_update.js @@ -0,0 +1,530 @@ +module.exports = { + $id: "http://example.com/schema/onUpdateSchema", + type: "object", + properties: { + context: { + type: "object", + properties: { + domain: { + type: "string", + }, + location: { + type: "object", + properties: { + city: { + type: "object", + properties: { + code: { + type: "string", + const: { $data: "/search/0/context/location/city/code" }, + }, + }, + required: ["code"], + }, + country: { + type: "object", + properties: { + code: { + type: "string", + const: { $data: "/search/0/context/location/country/code" }, + }, + }, + required: ["code"], + }, + }, + required: ["city", "country"], + }, + action: { + type: "string", + const: "on_update", + }, + version: { + type: "string", + const: "2.0.2", + }, + bap_id: { + type: "string", + }, + bap_uri: { + type: "string", + }, + bpp_id: { + type: "string", + }, + bpp_uri: { + type: "string", + }, + transaction_id: { + type: "string", + const: { $data: "/select/0/context/transaction_id" }, + }, + message_id: { + type: "string", + const: { $data: "/update/0/context/message_id" }, + }, + timestamp: { + type: "string", + format: "date-time", + }, + ttl: { + type: "string" + }, + }, + required: [ + "domain", + "location", + "action", + "version", + "bap_id", + "bap_uri", + "bpp_id", + "bpp_uri", + "transaction_id", + "message_id", + "timestamp", + "ttl", + ], + }, + message: { + type: "object", + properties: { + order: { + type: "object", + properties: { + id: { + type: "string", + const: { $data: "/confirm/0/message/order/id" }, + }, + state: { + type: "string", + enum: [ + "Created", + "Accepted", + "In-progress" + ], + }, + provider: { + type: "object", + properties: { + id: { + type: "string", + const: { $data: "/select/0/message/order/provider/id" }, + }, + }, + required: ["id"], + }, + items: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + quantity: { + type: "object", + properties: { + count: { + type: "integer", + }, + }, + required: ["count"], + }, + fulfillment_ids: { + type: "array", + items: { + type: "string", + }, + }, + }, + required: ["id", "quantity", "fulfillment_ids"], + }, + }, + payment: { + type: "object", + properties: { + uri: { + type: "string", + }, + tl_method: { + type: "string", + }, + params: { + type: "object", + properties: { + currency: { + type: "string", + }, + transaction_id: { + type: "string", + }, + amount: { + type: "string", + }, + }, + required: ["currency", "amount"], + }, + status: { + type: "string", + enum: ["PAID", "NOT-PAID"], + }, + type: { + type: "string", + enum: [ + "PRE-FULFILLMENT", + "ON-FULFILLMENT", + "POST-FULFILLMENT", + ], + }, + collected_by: { + type: "string", + enum:["BAP","BPP"] + }, + "@ondc/org/buyer_app_finder_fee_type": { + type: "string", + }, + "@ondc/org/buyer_app_finder_fee_amount": { + type: "string", + }, + "@ondc/org/settlement_details": { + type: "array", + items: { + type: "object", + properties: { + settlement_counterparty: { + type: "string", + enum: ["seller-app", "buyer-app"], + }, + settlement_phase: { + type: "string", + }, + settlement_type: { + type: "string", + enum: ["upi", "neft", "rtgs"], + }, + beneficiary_name: { + type: "string", + }, + upi_address: { + type: "string", + }, + settlement_bank_account_no: { + type: "string", + }, + settlement_ifsc_code: { + type: "string", + }, + bank_name: { + type: "string", + }, + branch_name: { + type: "string", + }, + }, + allOf: [ + { + if: { + properties: { + settlement_type: { + const: "upi", + }, + }, + }, + then: { + required: ["upi_address"], + }, + }, + { + if: { + properties: { + settlement_type: { + const: ["neft", "rtgs"], + }, + }, + }, + then: { + required: [ + "settlement_ifsc_code", + "settlement_bank_account_no", + ], + }, + }, + ], + required: ["settlement_counterparty", "settlement_type"], + }, + }, + }, + if: { properties: { type: { const: "ON-FULFILLMENT" } } }, + then: { + properties: { + collected_by: { + const: "BPP", + }, + }, + }, + required: [ + "params", + "status", + "type", + "collected_by", + "@ondc/org/buyer_app_finder_fee_type", + "@ondc/org/buyer_app_finder_fee_amount", + ], + }, + fulfillments: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + "@ondc/org/provider_name": { + type: "string", + }, + state: { + type: "object", + properties: { + descriptor: { + type: "object", + properties: { + code: { + type: "string", + enum:["Pending","Agent-assigned","Order-picked-up","Out-for-delivery","Delivered"] + }, + }, + required: ["code"], + }, + }, + required: ["descriptor"], + }, + type: { + type: "string", + }, + tracking: { + type: "boolean", + }, + stops: { + type: "array", + items: { + type: "object", + properties: { + type: { + type: "string", + }, + location: { + type: "object", + properties: { + id: { + type: "string", + }, + descriptor: { + type: "object", + properties: { + name: { + type: "string", + }, + }, + required: ["name"], + }, + gps: { + type: "string", + }, + address: { + type: "string", + }, + city: { + type: "object", + properties: { + name: { + type: "string", + }, + }, + required: ["name"], + }, + country: { + type: "object", + properties: { + code: { + type: "string", + }, + }, + required: ["code"], + }, + area_code: { + type: "string", + }, + state: { + type: "object", + properties: { + name: { + type: "string", + }, + }, + required: ["name"], + }, + }, + required: [], + }, + time: { + type: "object", + properties: { + range: { + type: "object", + properties: { + start: { + type: "string", + pattern: "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$", + errorMessage:"should be in RFC 3339 (YYYY-MM-DDTHH:MN:SS.MSSZ) Format" + }, + end: { + type: "string", + pattern: "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$", + errorMessage:"should be in RFC 3339 (YYYY-MM-DDTHH:MN:SS.MSSZ) Format" + }, + }, + required: ["start", "end"], + }, + }, + required: ["range"], + }, + instructions: { + type: "object", + properties: { + name: { + type: "string", + }, + short_desc: { + type: "string", + }, + }, + required: ["name", "short_desc"], + }, + contact: { + type: "object", + properties: { + phone: { + type: "string", + }, + email: { + type: "string", + }, + }, + required: ["phone", "email"], + }, + }, + required: [ + "type", + "location", + "time", + "instructions", + "contact", + ], + }, + }, + rateable: { + type: "boolean", + }, + tags: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + type: "object", + properties: { + code: { + type: "string", + enum:["ITEM_DETAILS"] + }, + }, + required: ["code"], + }, + list: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + type: "object", + properties: { + code: { + type: "string", + enum:["ITEM_ID","COUNT","MEASURE_UNIT","MEASURE_VALUE"] + }, + }, + required: ["code"], + }, + value: { + type: "string", + }, + }, + required: ["descriptor", "value"], + }, + }, + }, + required: ["descriptor", "list"], + }, + }, + }, + required: [ + "id", + "@ondc/org/provider_name", + "state", + "type", + "stops" + ], + }, + }, + }, + + required: ["id", "state", "provider", "items"], + }, + }, + required: ["order"], + }, + search: { + type: "array", + items: { + $ref: "searchSchema#", + }, + }, + on_search: { + type: "array", + items: { + $ref: "onSearchSchema#", + }, + }, + init: { + type: "array", + items: { + $ref: "initSchema#", + }, + }, + on_init: { + type: "array", + items: { + $ref: "onInitSchema#", + }, + }, + confirm: { + type: "array", + items: { + $ref: "confirmSchema#", + }, + }, + on_confirm: { + type: "array", + items: { + $ref: "onConfirmSchema#", + }, + }, + update: { + type: "array", + items: { + $ref: "updateSchema#", + }, + }, + }, + required: ["context", "message"], +}; diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/search.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/search.js new file mode 100644 index 0000000..a10ad82 --- /dev/null +++ b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/search.js @@ -0,0 +1,262 @@ +module.exports = { + $id: "http://example.com/schema/searchSchema", + type: "object", + properties: { + context: { + type: "object", + properties: { + domain: { + type: "string", + }, + location: { + type: "object", + properties: { + city: { + type: "object", + properties: { + code: { + type: "string", + }, + }, + required: ["code"], + }, + country: { + type: "object", + properties: { + code: { + type: "string", + }, + }, + required: ["code"], + }, + }, + required: ["city", "country"], + }, + action: { + type: "string", + const: "search", + }, + version: { + type: "string", + const: "2.0.2", + }, + bap_id: { + type: "string", + }, + bap_uri: { + type: "string", + }, + transaction_id: { + type: "string", + }, + message_id: { + type: "string", + }, + timestamp: { + type: "string", + format: "date-time", + }, + ttl: { + type: "string", + const: "PT30S", + }, + }, + required: [ + "domain", + "location", + "action", + "version", + "bap_id", + "bap_uri", + "transaction_id", + "message_id", + "timestamp", + "ttl", + ], + }, + message: { + type: "object", + properties: { + intent: { + type: "object", + properties: { + item: { + type: "object", + properties: { + descriptor: { + type: "object", + properties: { + name: { + type: "string", + }, + }, + required: ["name"], + }, + category: { + type: "object", + properties: { + id: { + type: "string", + }, + }, + required: ["id"], + }, + }, + }, + fulfillment: { + type: "object", + properties: { + type: { + type: "string", + enum: ["Delivery", "Self-Pickup", "Delivery and Self-Pickup"], + }, + stops: { + type: "array", + items: { + type: "object", + properties: { + type: { + type: "string", + }, + location: { + type: "object", + properties: { + gps: { + type: "string", + }, + area_code: { + type: "string", + }, + }, + required: ["gps", "area_code"], + }, + }, + required: ["type", "location"], + }, + }, + }, + required: ["type", "stops"], + }, + payment: { + type: "object", + properties: { + type: { + type: "string", + enum: [ + "PRE-FULFILLMENT", + "ON-FULFILLMENT", + "POST-FULFILLMENT", + ], + }, + }, + required: ["type"], + }, + tags: { + type: "array", + minItems: 2, + uniqueItems: true, + items: { + type: "object", + properties: { + descriptor: { + properties: { + code: { + type: "string", + enum: ["bap_terms", "buyer_id"], + }, + }, + required:["code"] + }, + list: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + properties: { + code: { + type: "string", + }, + }, + required:["code"] + }, + value: { + type: "string", + }, + }, + required: ["descriptor", "value"], + }, + minItems: 2, + }, + }, + required: ["descriptor", "list"], + if: { + properties: { + descriptor: { + properties: { code: { const: "bap_terms" } }, + }, + }, + }, + then: { + properties: { + list: { + items: { + type: "object", + properties: { + descriptor: { + properties: { + code: { + enum: ["finder_fee_type", "finder_fee_amount"], + }, + }, + }, + }, + required: ["descriptor"], + }, + }, + }, + errorMessage: + "For 'bap_terms', the 'list' must contain either 'finder_fee_type' or 'finder_fee_amount'.", + }, + else: { + if: { + properties: { + descriptor: { + properties: { code: { const: "buyer_id" } }, + }, + }, + }, + then: { + properties: { + list: { + items: { + type: "object", + properties: { + descriptor: { + properties: { + code: { + enum: ["buyer_id_code", "buyer_id_no"], + }, + }, + }, + }, + required: ["descriptor"], + }, + }, + }, + errorMessage: + "For 'buyer_id', the 'list' must contain either 'buyer_id_code' or 'buyer_id_no'.", + }, + }, + }, + }, + }, + additionalProperties:false, + required: ["item", "fulfillment", "payment", "tags"], + }, + }, + required: ["intent"], + }, + }, + required: ["context", "message"], +}; diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/select.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/select.js new file mode 100644 index 0000000..444749f --- /dev/null +++ b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/select.js @@ -0,0 +1,432 @@ +module.exports = { + $id: "http://example.com/schema/selectSchema", + type: "object", + properties: { + context: { + type: "object", + properties: { + domain: { + type: "string", + }, + location: { + type: "object", + properties: { + city: { + type: "object", + properties: { + code: { + type: "string", + const: { $data: "/search/0/context/location/city/code" }, + }, + }, + required: ["code"], + }, + country: { + type: "object", + properties: { + code: { + type: "string", + const: { $data: "/search/0/context/location/country/code" }, + }, + }, + required: ["code"], + }, + }, + required: ["city", "country"], + }, + action: { + type: "string", + const: "select", + }, + version: { + type: "string", + const: "2.0.2", + }, + bap_id: { + type: "string", + }, + bap_uri: { + type: "string", + }, + bpp_id: { + type: "string", + }, + bpp_uri: { + type: "string", + }, + transaction_id: { + type: "string", + const: { $data: "/search/0/context/transaction_id" }, + errorMessage: + "Transaction ID should be same across the transaction: ${/search/0/context/transaction_id}", + }, + message_id: { + type: "string", + allOf: [ + { + not: { + const: { $data: "1/transaction_id" }, + }, + errorMessage: + "Message ID should not be equal to transaction_id: ${1/transaction_id}", + }, + ], + }, + timestamp: { + type: "string", + format: "date-time", + }, + ttl: { + type: "string", + const: { $data: "2/message/order/provider/ttl" }, + errorMessage: + "should match provider ttl - ${2/message/order/provider/ttl}", + }, + }, + required: [ + "domain", + "location", + "action", + "version", + "bap_id", + "bap_uri", + "bpp_id", + "bpp_uri", + "transaction_id", + "message_id", + "timestamp", + "ttl", + ], + }, + message: { + type: "object", + properties: { + order: { + type: "object", + properties: { + provider: { + type: "object", + properties: { + id: { + type: "string", + }, + locations: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + }, + required: ["id"], + }, + }, + ttl: { + type: "string", + format: "duration", + }, + }, + required: ["id", "locations"], + }, + items: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + location_ids: { + type: "array", + items: { + type: "string", + }, + }, + quantity: { + type: "object", + properties: { + selected: { + type: "object", + properties: { + count: { + type: "integer", + }, + }, + required: ["count"], + }, + }, + required: ["selected"], + }, + "add-ons": { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + }, + required: ["id"], + }, + }, + tags: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + type: "object", + properties: { + code: { + type: "string", + enum: ["BUYER_TERMS"], + }, + }, + required: ["code"], + }, + list: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + type: "object", + properties: { + code: { + type: "string", + enum: ["ITEM_REQ", "PACKAGING_REQ"], + }, + }, + required: ["code"], + }, + value: { + type: "string", + }, + }, + required: ["descriptor", "value"], + }, + }, + }, + required: ["descriptor", "list"], + }, + }, + }, + required: ["id", "location_ids", "quantity"], + }, + }, + fulfillments: { + type: "array", + items: { + type: "object", + properties: { + stops: { + type: "array", + items: { + type: "object", + properties: { + type: { + type: "string", + }, + location: { + type: "object", + properties: { + gps: { + type: "string", + pattern: + "^(-?[0-9]{1,3}(?:.[0-9]{6,15})?),( )*?(-?[0-9]{1,3}(?:.[0-9]{6,15})?)$", + errorMessage: "Incorrect gps value", + }, + area_code: { + type: "string", + }, + }, + required: ["gps", "area_code"], + }, + }, + required: ["type", "location"], + }, + }, + customer: { + type: "object", + properties: { + person: { + type: "object", + properties: { + creds: { + type: "array", + items: { + type: "object", + properties: { + id: { + type: "string", + }, + type: { + type: "string", + enum: [ + "License", + "Badge", + "Permit", + "Certificate", + ], + }, + desc: { + type: "string", + }, + icon: { + type: "string", + }, + url: { + type: "string", + pattern: + "^https://[\\w.-]+(\\.[a-zA-Z]{2,})?(:[0-9]+)?(/\\S*)?$", + }, + }, + required: ["id", "type", "desc", "url"], + }, + }, + }, + required: ["creds"], + }, + }, + required: ["person"], + }, + tags: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + type: "object", + properties: { + code: { + type: "string", + enum: ["DELIVERY_TERMS"], + }, + }, + required: ["code"], + }, + list: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + type: "object", + properties: { + code: { + type: "string", + enum: [ + "INCOTERMS", + "NAMED_PLACE_OF_DELIVERY", + ], + }, + }, + required: ["code"], + }, + value: { + type: "string", + }, + }, + if: { + properties: { + descriptor: { + properties: { code: { const: "INCOTERMS" } }, + }, + }, + }, + then: { + properties: { + value: { + enum: [ + "DPU", + "CIF", + "EXW", + "FOB", + "DAP", + "DDP", + ], + }, + }, + }, + required: ["descriptor", "value"], + }, + }, + }, + required: ["descriptor", "list"], + }, + }, + }, + required: ["stops"], + }, + }, + payments: { + type: "array", + items: { + type: "object", + properties: { + type: { + type: "string", + enum: [ + "PRE-FULFILLMENT", + "ON-FULFILLMENT", + "POST-FULFILLMENT", + ], + }, + }, + required: ["type"], + }, + }, + tags: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + properties: { + code: { + type: "string", + enum: ["buyer_id", "COMM_CHANNEL"], + }, + }, + }, + list: { + type: "array", + items: { + type: "object", + properties: { + descriptor: { + properties: { + code: { + type: "string", + enum: [ + "buyer_id_code", + "buyer_id_no", + "chat_url", + ], + }, + }, + }, + value: { + type: "string", + }, + }, + required: ["descriptor", "value"], + }, + }, + }, + required: ["descriptor", "list"], + }, + }, + }, + additionalProperties: false, + required: ["provider", "items", "fulfillments", "payments", "tags"], + }, + }, + required: ["order"], + additionalProperties: false, + }, + }, + required: ["context", "message"], + additionalProperties: false, +}; diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/status.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/status.js new file mode 100644 index 0000000..387a6fe --- /dev/null +++ b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/status.js @@ -0,0 +1,107 @@ +module.exports = { + $id: "http://example.com/schema/statusSchema", + type: "object", + properties: { + context: { + type: "object", + properties: { + domain: { + type: "string", + }, + location: { + type: "object", + properties: { + city: { + type: "object", + properties: { + code: { + type: "string", + const: { $data: "/on_confirm/0/context/location/city/code" }, + }, + }, + required: ["code"], + }, + country: { + type: "object", + properties: { + code: { + type: "string", + const: { $data: "/on_confirm/0/context/location/country/code" }, + }, + }, + required: ["code"], + }, + }, + required: ["city", "country"], + }, + action: { + type: "string", + const: "status", + }, + version: { + type: "string", + const: "2.0.2", + }, + bap_id: { + type: "string", + }, + bap_uri: { + type: "string", + }, + bpp_id: { + type: "string", + }, + bpp_uri: { + type: "string", + }, + transaction_id: { + type: "string", + const: { $data: "/on_confirm/0/context/transaction_id" }, + }, + message_id: { + type: "string", + }, + timestamp: { + type: "string", + format: "date-time", + }, + ttl: { + type: "string", + const: "PT30S", + }, + }, + required: [ + "domain", + "location", + "action", + "version", + "bap_id", + "bap_uri", + "bpp_id", + "bpp_uri", + "transaction_id", + "message_id", + "timestamp", + "ttl", + ], + }, + message: { + type: "object", + properties: { + order_id: { + type: "string", + const: { $data: "/on_confirm/0/message/order/id" }, + }, + }, + additionalProperties:false, + required: ["order_id"], + }, + on_confirm: { + type: "array", + items: { + $ref: "onConfirmSchema#", + }, + }, + }, + required: ["context", "message"], +}; diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/update.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/update.js new file mode 100644 index 0000000..2067cf4 --- /dev/null +++ b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/update.js @@ -0,0 +1,333 @@ +module.exports = { + $id: "http://example.com/schema/updateSchema", + type: "object", + properties: { + context: { + type: "object", + properties: { + domain: { + type: "string", + }, + location: { + type: "object", + properties: { + city: { + type: "object", + properties: { + code: { + type: "string", + const: { $data: "/search/0/context/location/city/code" }, + }, + }, + required: ["code"], + }, + country: { + type: "object", + properties: { + code: { + type: "string", + const: { $data: "/search/0/context/location/country/code" }, + }, + }, + required: ["code"], + }, + }, + required: ["city", "country"], + }, + action: { + type: "string", + const: "update", + }, + version: { + type: "string", + const: "2.0.2", + }, + bap_id: { + type: "string", + }, + bap_uri: { + type: "string", + }, + bpp_id: { + type: "string", + }, + bpp_uri: { + type: "string", + }, + transaction_id: { + type: "string", + const: { $data: "/select/0/context/transaction_id" }, + }, + message_id: { + type: "string", + }, + timestamp: { + type: "string", + format: "date-time", + }, + ttl: { + type: "string", + const: "PT30S", + }, + }, + required: [ + "domain", + "location", + "action", + "version", + "bap_id", + "bap_uri", + "bpp_id", + "bpp_uri", + "transaction_id", + "message_id", + "timestamp", + "ttl", + ], + }, + message: { + type: "object", + properties: { + update_target: { + type: "string", + enum:["fulfillment","item"] + }, + order: { + type: "object", + properties: { + id: { + type: "string", + const: { $data: "/confirm/0/message/order/id" }, + }, + state: { + type: "string", + }, + provider: { + type: "object", + properties: { + id: { + type: "string", + const: { $data: "/select/0/message/order/provider/id" }, + }, + }, + required: ["id"], + }, + items: { + type: "array", + items: + { + type: "object", + properties: { + id: { + type: "string", + }, + quantity: { + type: "object", + properties: { + selected: { + type: "object", + properties: { + count: { + type: "integer", + }, + }, + required: ["count"], + }, + }, + required: ["selected"], + }, + }, + required: ["id", "quantity"], + }, + + }, + payments: { + type: "array", + items: + { + type: "object", + properties: { + uri: { + type: "string", + }, + tl_method: { + type: "string", + }, + params: { + type: "object", + properties: { + currency: { + type: "string", + }, + transaction_id: { + type: "string", + }, + amount: { + type: "string", + }, + }, + required: ["currency", "amount"], + }, + status: { + type: "string", + enum: ["PAID", "NOT-PAID"], + }, + type: { + type: "string", + enum: [ + "PRE-FULFILLMENT", + "ON-FULFILLMENT", + "POST-FULFILLMENT", + ], + }, + collected_by: { + type: "string", + }, + "@ondc/org/buyer_app_finder_fee_type": { + type: "string", + }, + "@ondc/org/buyer_app_finder_fee_amount": { + type: "string", + }, + "@ondc/org/settlement_details": { + type: "array", + items: + { + type: "object", + properties: { + settlement_counterparty: { + type: "string", + }, + settlement_phase: { + type: "string", + }, + settlement_type: { + type: "string", + }, + upi_address: { + type: "string", + }, + settlement_bank_account_no: { + type: "string", + }, + settlement_ifsc_code: { + type: "string", + }, + beneficiary_name: { + type: "string", + }, + bank_name: { + type: "string", + }, + branch_name: { + type: "string", + }, + }, + allOf: [ + { + if: { + properties: { + settlement_type: { + const: "upi", + }, + }, + }, + then: { + required: ["upi_address"], + }, + }, + { + if: { + properties: { + settlement_type: { + const: ["neft", "rtgs"], + }, + }, + }, + then: { + required: [ + "settlement_ifsc_code", + "settlement_bank_account_no", + ], + }, + }, + ], + required: [ + "settlement_counterparty", + "settlement_type", + ], + }, + + }, + }, + required: [ + "uri", + "tl_method", + "params", + "status", + "type", + "collected_by", + "@ondc/org/buyer_app_finder_fee_type", + "@ondc/org/buyer_app_finder_fee_amount", + ], + }, + + }, + }, + additionalProperties:false, + required: ["id", "state", "provider", "items", "payments"], + }, + }, + required: ["update_target", "order"], + }, + search: { + type: "array", + items: { + $ref: "searchSchema#", + }, + }, + on_search: { + type: "array", + items: { + $ref: "onSearchSchema#", + }, + }, + select: { + type: "array", + items: { + $ref: "selectSchema#", + }, + }, + on_select: { + type: "array", + items: { + $ref: "onSelectSchema#", + }, + }, + init: { + type: "array", + items: { + $ref: "initSchema#", + }, + }, + on_init: { + type: "array", + items: { + $ref: "onInitSchema#", + }, + }, + confirm: { + type: "array", + items: { + $ref: "confirmSchema#", + }, + }, + on_confirm: { + type: "array", + items: { + $ref: "onConfirmSchema#", + }, + }, + }, + required: ["context", "message"], +}; diff --git a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/confirmSchema.js b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/confirmSchema.js index ad2ac64..5700fdc 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/confirmSchema.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/confirmSchema.js @@ -93,7 +93,7 @@ module.exports = { const: { $data: "3/context/transaction_id" }, }, errorMessage: - "Message ID should not be equal to transaction_id: ${3/context/transaction_id}", + "should be unique and not be equal to transaction_id: ${3/context/transaction_id}", }, ], }, diff --git a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/searchSchema.js b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/searchSchema.js index e583451..e1a8a1b 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/searchSchema.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.1/searchSchema.js @@ -242,7 +242,7 @@ module.exports = { type: "string", }, }, - required: ["@ondc/org/collection_amount"], + required: [], }, "@ondc/org/payload_details": { type: "object", diff --git a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/confirmSchema.js b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/confirmSchema.js index 9311e1f..c2ac4e6 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/confirmSchema.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/confirmSchema.js @@ -94,7 +94,7 @@ module.exports = { const: { $data: "3/context/transaction_id" }, }, errorMessage: - "Message ID should not be equal to transaction_id: ${3/context/transaction_id}", + "should be unique and not be equal to transaction_id: ${3/context/transaction_id}", }, ], }, @@ -312,7 +312,7 @@ module.exports = { }, duration: { type: "string", - format: "duration" + format: "duration", }, location: { type: "object", @@ -592,7 +592,7 @@ module.exports = { "both 'state' and 'rto_action' tags are required", }, }, - + additionalProperties: false, required: ["id", "type", "start", "end", "tags"], }, }, @@ -1030,8 +1030,40 @@ module.exports = { type: "string", format: "date-time", }, - }, + tags: { + type: "array", + items: { + type: "object", + properties: { + code: { + type: "string", + enum: constants.TERMS, + + }, + list: { + type: "array", + items: { + type: "object", + properties: { + code: { + type: "string", + }, + value: { + type: "string", + }, + }, + required: ["code", "value"], + }, + }, + }, + required: ["code", "list"], + }, + minItems: 2, + errorMessage: "both 'bpp_terms' and 'bap_terms' tags are required (logistics buyer NP must accept LSP terms. If not accepted, LSP can NACK /confirm with error code 65002)", + }, + }, + additionalProperties: false, required: [ "id", "state", diff --git a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/keywords/onInit.js b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/keywords/onInit.js index 172c10e..5dcead5 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/keywords/onInit.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/keywords/onInit.js @@ -7,6 +7,8 @@ module.exports = { totalBreakup += parseFloat(breakup?.price?.value); }); // console.log(quotePrice,totalBreakup); + totalBreakup= parseFloat(totalBreakup).toFixed(2) + quotePrice=quotePrice.toFixed(2) if (quotePrice != totalBreakup) return false; else return true; }, diff --git a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/onCancelSchema.js b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/onCancelSchema.js index 256cbe1..79705df 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/onCancelSchema.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/onCancelSchema.js @@ -538,14 +538,14 @@ module.exports = { properties: { time: { required: ["range"] }, }, - required: ["time", "person", "location", "contact"], + required: [ "person", "location", "contact"], }, end: { properties: { time: { required: ["range"] }, }, - required: ["time", "person", "location", "contact"], + required: ["person", "location", "contact"], }, }, required: ["id", "type", "state", "start", "end", "tracking"], diff --git a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/onInitSchema.js b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/onInitSchema.js index 82bc4e4..7b1e2fc 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/onInitSchema.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/onInitSchema.js @@ -355,6 +355,8 @@ module.exports = { type: { type: "string", enum: constants.PAYMENT_TYPE, + const: { $data: "/search/0/message/intent/payment/type" }, + errorMessage:"does not match the intended payment type by the logistics buyer" }, collected_by: { type: "string", diff --git a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/onSearchSchema.js b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/onSearchSchema.js index 203bb8c..71dd9a7 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/onSearchSchema.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/onSearchSchema.js @@ -301,6 +301,7 @@ module.exports = { required: ["label", "duration", "timestamp"], }, }, + additionalProperties:false, required: [ "id", "category_id", @@ -322,7 +323,53 @@ module.exports = { type: "string", enum: constants.FULFILLMENT_TYPE, }, + start: { + type: "object", + properties: { + time: { + type: "object", + properties: { + duration: { + type: "string", + }, + }, + required: ["duration"], + }, + }, + required: ["time"], + }, + tags: { + type: "array", + items: { + type: "object", + properties: { + code: { + type: "string", + enum: ["distance"] + }, + list: { + type: "array", + items: { + type: "object", + properties: { + code: { + type: "string", + enum: ["motorable_distance_type","motorable_distance"] + }, + value: { + type: "string", + }, + }, + required: ["code", "value"], + }, + }, + }, + + required: ["code", "list"], + }, + }, }, + additionalProperties:false, required: ["id", "type"], }, }, diff --git a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/updateSchema.js b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/updateSchema.js index 34098a6..209fc5f 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/updateSchema.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/updateSchema.js @@ -326,13 +326,12 @@ module.exports = { format: "date-time", }, }, - + additionalProperties:false, required: ["id", "items", "fulfillments", "updated_at"], }, }, required: ["update_target", "order"], }, }, - required: ["context", "message"], }; diff --git a/utilities/logistics-b2b/log-verification-utility/schema/main.js b/utilities/logistics-b2b/log-verification-utility/schema/main.js index 3abb175..cc7470e 100755 --- a/utilities/logistics-b2b/log-verification-utility/schema/main.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/main.js @@ -9,13 +9,15 @@ const { const fs = require("fs"); const validate_schema_for_domain_json = (vertical, data, version) => { - version = getVersion(data); + version = getVersion(data,vertical); switch (vertical) { case "logistics": + res = validate_schema_master(data, version); return res; case "b2b": - res = validate_schema_b2b_master(data); + + res = validate_schema_b2b_master(data,version); return res; default: console.log("Invalid Domain!!"); diff --git a/utilities/logistics-b2b/log-verification-utility/utils/b2b/b2bInit.js b/utilities/logistics-b2b/log-verification-utility/utils/b2b/b2bInit.js index d63e0cb..b7cc0ce 100644 --- a/utilities/logistics-b2b/log-verification-utility/utils/b2b/b2bInit.js +++ b/utilities/logistics-b2b/log-verification-utility/utils/b2b/b2bInit.js @@ -36,11 +36,14 @@ const checkInit = (data, msgIdSet) => { if (providerLocArr) { providerLocArr.forEach((location, i) => { - providerObj[0]?.locations?.forEach((element) => { - console.log(location.id, element.id); + if (providerObj) { + providerObj[0]?.locations?.forEach((element) => { + console.log(location.id, element.id); + + if (location.id === element.id) providerLocExists = true; + }); + } - if (location.id === element.id) providerLocExists = true; - }); if (!providerLocExists) { let itemkey = `providerLocErr${i}`; initObj[ @@ -66,10 +69,12 @@ const checkInit = (data, msgIdSet) => { let itemExists = false; itemsArr.forEach((item, i) => { - onSearchitemsArr.forEach((element) => { - if (item.id === element.id) itemExists = true; - console.log(item.id, element.id); - }); + if (onSearchitemsArr) { + onSearchitemsArr.forEach((element) => { + if (item.id === element.id) itemExists = true; + }); + } + if (!itemExists) { let itemkey = `itemErr${i}`; initObj[itemkey] = `Item Id '${item.id}' does not exist in /on_search`; diff --git a/utilities/logistics-b2b/log-verification-utility/utils/b2b/b2bOnSearch.js b/utilities/logistics-b2b/log-verification-utility/utils/b2b/b2bOnSearch.js index af21a6f..32ee952 100644 --- a/utilities/logistics-b2b/log-verification-utility/utils/b2b/b2bOnSearch.js +++ b/utilities/logistics-b2b/log-verification-utility/utils/b2b/b2bOnSearch.js @@ -71,7 +71,7 @@ const checkOnSearch = async (data, msgIdSet) => { encounteredAttr.push(descriptor.code); }); - // Check if all allowedCodes are encountered + // Check if all mandatory attributes are encountered const missingAttr = mandatoryAttr.filter( (code) => !encounteredAttr.includes(code) ); diff --git a/utilities/logistics-b2b/log-verification-utility/utils/b2b/b2bOnStatus.js b/utilities/logistics-b2b/log-verification-utility/utils/b2b/b2bOnStatus.js index 6facef2..30585b6 100644 --- a/utilities/logistics-b2b/log-verification-utility/utils/b2b/b2bOnStatus.js +++ b/utilities/logistics-b2b/log-verification-utility/utils/b2b/b2bOnStatus.js @@ -107,12 +107,12 @@ const checkOnStatus = (data, msgIdSet) => { fulfillment.stops.forEach((stop) => { if (stop.type === "start") { pickupTime = stop?.time?.timestamp; - dao.setValue("pickupTime", pickupTime); + if (!pickupTime) { onStatusObj.pickupTimeErr = `Pickup timestamp (fulfillments/start/time/timestamp) is required for fulfillment state - ${ffState}`; } else if ( dao.getValue("pickupTime") && - fulfillment?.start?.time?.timestamp !== + pickupTime !== dao.getValue("pickupTime") ) { onStatusObj.pickupTimeErr = `Pickup timestamp (fulfillments/start/time/timestamp) cannot change for fulfillment state - ${ffState}`; @@ -135,12 +135,11 @@ const checkOnStatus = (data, msgIdSet) => { fulfillment.stops.forEach((stop) => { if (stop.type === "start") { pickupTime = stop?.time?.timestamp; - dao.setValue("pickupTime", pickupTime); if (!pickupTime) { onStatusObj.pickupTimeErr = `Pickup timestamp (fulfillments/start/time/timestamp) is required for fulfillment state - ${ffState}`; } else if ( dao.getValue("pickupTime") && - fulfillment?.start?.time?.timestamp !== + pickupTime !== dao.getValue("pickupTime") ) { onStatusObj.pickupTimeErr = `Pickup timestamp (fulfillments/start/time/timestamp) cannot change for fulfillment state - ${ffState}`; diff --git a/utilities/logistics-b2b/log-verification-utility/utils/constants.js b/utilities/logistics-b2b/log-verification-utility/utils/constants.js index 8b44c9f..56c887f 100755 --- a/utilities/logistics-b2b/log-verification-utility/utils/constants.js +++ b/utilities/logistics-b2b/log-verification-utility/utils/constants.js @@ -133,6 +133,7 @@ module.exports = Object.freeze({ "004", "005", "006", + "007", "008", "009", "010", @@ -169,5 +170,6 @@ module.exports = Object.freeze({ ], CANCELLATION_TAGS_LIST:["retry_count","rto_id","cancellation_reason_id","sub_reason_id","cancelled_by"], FASHION_ATTRIBUTES : ["brand","colour","size","gender","material"], - ELECTRONICS_ATTRIBUTES: ["brand","model"] + ELECTRONICS_ATTRIBUTES: ["brand","model"], + TERMS:["bap_terms","bpp_terms"] }); diff --git a/utilities/logistics-b2b/log-verification-utility/utils/logistics/logConfirm.js b/utilities/logistics-b2b/log-verification-utility/utils/logistics/logConfirm.js index 8760879..5b91a63 100644 --- a/utilities/logistics-b2b/log-verification-utility/utils/logistics/logConfirm.js +++ b/utilities/logistics-b2b/log-verification-utility/utils/logistics/logConfirm.js @@ -72,9 +72,9 @@ const checkConfirm = (data, msgIdSet) => { let p2h2p = dao.getValue("p2h2p"); fulfillments.forEach((fulfillment) => { - let avgPickupTime= fulfillment.start.time.duration; + let avgPickupTime= fulfillment?.start?.time?.duration; - if(avgPickupTime!==dao.getValue("avgPickupTime")){ + if(avgPickupTime && avgPickupTime!==dao.getValue("avgPickupTime")){ cnfrmObj.avgPckupErr=`Average Pickup Time (fulfillments/start/time/duration) mismatches from the one provided in /on_search` } if (fulfillment["@ondc/org/awb_no"] && p2h2p) awbNo = true; diff --git a/utilities/logistics-b2b/log-verification-utility/utils/logistics/logInit.js b/utilities/logistics-b2b/log-verification-utility/utils/logistics/logInit.js index 4907554..93cdc26 100644 --- a/utilities/logistics-b2b/log-verification-utility/utils/logistics/logInit.js +++ b/utilities/logistics-b2b/log-verification-utility/utils/logistics/logInit.js @@ -77,7 +77,6 @@ const checkInit = (data, msgIdSet) => { } onSearchitemsArr?.forEach((element) => { if (item.id === element.id) itemExists = true; - console.log(item.id, element.id); }); if (!itemExists) { let itemkey = `itemErr${i}`; @@ -86,7 +85,10 @@ const checkInit = (data, msgIdSet) => { let itemObj = onSearchitemsArr.filter( (element) => item.id === element.id ); + itemObj = itemObj[0]; + dao.setValue("selectedItem",itemObj.id) + console.log(itemObj.id); if (item.category_id != itemObj.category_id) { let itemkey = `catIdErr${i}`; initObj[ 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 731db03..1dbeee1 100644 --- a/utilities/logistics-b2b/log-verification-utility/utils/logistics/logOnCancel.js +++ b/utilities/logistics-b2b/log-verification-utility/utils/logistics/logOnCancel.js @@ -9,8 +9,10 @@ const checkOnCancel = (data, msgIdSet) => { let contextTime = on_cancel.context.timestamp; let version = on_cancel.context.core_version; let messageId = on_cancel.context.message_id; + const providerId = on_cancel.message?.provider?.id; on_cancel = on_cancel.message.order; + let onSearchItemsArr = dao.getValue(`${on_cancel?.provider?.id}itemsArr`); let ffState; let orderState = on_cancel.state; let items = on_cancel.items; @@ -42,6 +44,13 @@ const checkOnCancel = (data, msgIdSet) => { } catch (error) { console.log(error); } + if (onSearchItemsArr) { + let selectedItem = onSearchItemsArr.filter( + (element) => element.parent_item_id === dao.getValue("selectedItem") + ); + selectedItem = selectedItem[0]; + } + try { fulfillments.forEach((fulfillment) => { ffState = fulfillment?.state?.descriptor?.code; @@ -63,9 +72,7 @@ const checkOnCancel = (data, msgIdSet) => { onCancelObj.msngPickupTimeErr = `Pickup timestamp (fulfillments/start/time/timestamp) is missing for fulfillment state - ${ffState}`; } } - if(fulfillment.tracking===true){ - onStatusObj.trackErr=`fulfillment tracking can be disabled (false) after the fulfillment is 'Cancelled` - } + if (fulfillment.start.time.timestamp && dao.getValue("pickupTime")) { if ( !_.isEqual( @@ -76,9 +83,17 @@ const checkOnCancel = (data, msgIdSet) => { onCancelObj.pickupTimeErr = `Pickup timestamp (fulfillments/start/time/timestamp) cannot change for fulfillment state - ${ffState}`; } } - console.log('comparing RTO fulfillment id with /on_search'); + console.log("comparing RTO fulfillment id with /on_search"); //checking RTO id matching with /on_search if (version === "1.2.0") { + if (dao.getValue("rts") === "yes") { + if (!fulfillment?.start?.time) { + 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) => { @@ -87,8 +102,9 @@ const checkOnCancel = (data, msgIdSet) => { lists.forEach((list) => { if (list.code === "rto_id") { rtoID = list.value; - if (rtoID !== dao.getValue("rtoID")) { - onCancelObj.rtoIdTagsErr = `rto_id '${rtoID}' in fulfillments/tags does not match with the one provided in on_search '${dao.getValue("rtoID")}' in /fulfillments`; + + 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`; } } }); @@ -100,9 +116,9 @@ const checkOnCancel = (data, msgIdSet) => { if (orderState !== "Cancelled") { onCancelObj.ordrStatErr = `Order state should be 'Cancelled' for fulfillment state - ${ffState}`; } - console.log(fulfillment.id,dao.getValue("rtoID")); - if(fulfillment.id!==dao.getValue("rtoID")){ - onCancelObj.rtoIdErr = `RTO id - '${fulfillment.id}' of fulfillment type 'RTO' does not match with the one provided in on_search '${dao.getValue("rtoID")}' in /fulfillments`; + console.log(fulfillment.id, selectedItem?.fulfillment_id); + if (fulfillment.id !== selectedItem.fulfillment_id) { + onCancelObj.rtoIdErr = `RTO id - '${fulfillment.id}' of fulfillment type 'RTO' does not match with the one provided in on_search '${selectedItem.fulfillment_id}' in /fulfillments`; } if (ffState === "RTO-Initiated") { RtoPickupTime = fulfillment?.start?.time?.timestamp; diff --git a/utilities/logistics-b2b/log-verification-utility/utils/logistics/logOnStatus.js b/utilities/logistics-b2b/log-verification-utility/utils/logistics/logOnStatus.js index a7a9fa1..7ec4271 100644 --- a/utilities/logistics-b2b/log-verification-utility/utils/logistics/logOnStatus.js +++ b/utilities/logistics-b2b/log-verification-utility/utils/logistics/logOnStatus.js @@ -62,7 +62,7 @@ const checkOnStatus = (data, msgIdSet) => { ) { if ( categoryId === "Immediate Delivery" && - fulfillment.tracking !== true + fulfillment.tracking !== true && ffState!=='Cancelled' ) { onStatusObj.trckErr = `tracking should be enabled (true) for hyperlocal (Immediate Delivery)`; } @@ -152,9 +152,7 @@ const checkOnStatus = (data, msgIdSet) => { onStatusObj.msngPickupTimeErr = `Pickup timestamp (fulfillments/start/time/timestamp) is missing for fulfillment state - ${ffState}`; } } - if (fulfillment.tracking === true) { - onStatusObj.trackErr = `fulfillment tracking can be disabled (false) after the fulfillment is 'Cancelled`; - } + if (fulfillment.start.time.timestamp && dao.getValue("pickupTime")) { if ( !_.isEqual( diff --git a/utilities/logistics-b2b/log-verification-utility/utils/logistics/logUpdate.js b/utilities/logistics-b2b/log-verification-utility/utils/logistics/logUpdate.js index a97eec7..d1edb5d 100644 --- a/utilities/logistics-b2b/log-verification-utility/utils/logistics/logUpdate.js +++ b/utilities/logistics-b2b/log-verification-utility/utils/logistics/logUpdate.js @@ -7,12 +7,16 @@ const checkUpdate = (data, msgIdSet) => { let updtObj = {}; let update = data; let version = update.context.core_version; + let contextTimestamp = update.context.timestamp; let p2h2p = dao.getValue("p2h2p"); let awbNo= dao.getValue("awbNo"); dao.setValue("updateApi",true) update = update.message.order; + if (update?.updated_at > contextTimestamp) { + updtObj.updatedAtErr = `order/updated_at cannot be future dated w.r.t context/timestamp`; + } if (version === "1.1.0") rts = update?.fulfillments[0]?.tags["@ondc/org/order_ready_to_ship"]; else { diff --git a/utilities/logistics-b2b/log-verification-utility/utils/utils.js b/utilities/logistics-b2b/log-verification-utility/utils/utils.js index 55e29ab..04fd841 100755 --- a/utilities/logistics-b2b/log-verification-utility/utils/utils.js +++ b/utilities/logistics-b2b/log-verification-utility/utils/utils.js @@ -197,9 +197,16 @@ const timestampCheck = (date) => { } }; -const getVersion = (data) => { - if (data?.search[0]?.context?.core_version === "1.1.0") return "v1.1"; +const getVersion = (data,vertical) => { + if(vertical==='logistics'){ + if (data?.search[0]?.context?.core_version === "1.1.0") return "v1.1"; else return "v1.2"; + } + if(vertical==='b2b'){ + if (data?.search[0]?.context?.version === "2.0.1") return "v1"; + else return "v2"; + } + }; function compareDates(dateString1, dateString2) { const date1 = new Date(dateString1); From 87fe16e9f8ac60883fa6e5f4c06bb6c968a6836f Mon Sep 17 00:00:00 2001 From: Abhinav Goyal Date: Thu, 28 Dec 2023 11:55:34 +0530 Subject: [PATCH 5/7] minor change --- .../schema/logistics_api_json_schema/v1.2/keywords/onInit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/keywords/onInit.js b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/keywords/onInit.js index 5dcead5..af5d333 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/keywords/onInit.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/logistics_api_json_schema/v1.2/keywords/onInit.js @@ -1,6 +1,6 @@ module.exports = { isQuoteMatching: (data) => { - const quotePrice = parseFloat(data?.price?.value); + let quotePrice = parseFloat(data?.price?.value); const breakupArr = data.breakup; let totalBreakup = 0; breakupArr.forEach((breakup) => { From 3207c0ca0c349f6e7cb85e87a66a86746e2888f4 Mon Sep 17 00:00:00 2001 From: Abhinav Goyal Date: Thu, 28 Dec 2023 11:56:37 +0530 Subject: [PATCH 6/7] updated --- .../B2B_json_schema/schemaValidator copy1.js | 107 ------------------ 1 file changed, 107 deletions(-) delete mode 100644 utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/schemaValidator copy1.js diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/schemaValidator copy1.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/schemaValidator copy1.js deleted file mode 100644 index 51f97d6..0000000 --- a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/schemaValidator copy1.js +++ /dev/null @@ -1,107 +0,0 @@ -const onConfirmSchema = require("./on_confirm"); -const onInitSchema = require("./on_init"); -const onSearchSchema = require("./on_search"); -const selectSchema = require("./select"); -const onSelectSchema = require("./on_select"); -const onUpdateSchema = require("./on_update"); -const searchSchema = require("./search"); -const initSchema = require("./init"); -const masterSchema = require("./master"); -const confirmSchema = require("./confirm"); -const statusSchema = require("./status"); -const updateSchema = require("./update"); -const onStatusSchema = require("./on_status"); -const { isLengthValid } = require("./keywords/init"); -const { isQuoteMatching } = require("./keywords/onInit"); -const { isFutureDated } = require("./keywords/confirm"); -const { isEndTimeGreater } = require("./keywords/search"); - -const fs = require("fs"); -//const async = require("async"); -const path = require("path"); - -const formatted_error = (errors) => { - error_list = []; - let status = ""; - errors.forEach((error) => { - error_dict = { - message: `${error.message}${ - error.params.allowedValues ? ` (${error.params.allowedValues})` : "" - }${error.params.allowedValue ? ` (${error.params.allowedValue})` : ""}${ - error.params.additionalProperty - ? ` (${error.params.additionalProperty})` - : "" - }`, - details: error.instancePath, - }; - error_list.push(error_dict); - }); - if (error_list.length === 0) status = "pass"; - else status = "fail"; - error_json = { errors: error_list, status: status }; - return error_json; -}; - - -const validate_schema = (data, schema) => { - const Ajv = require("ajv"); - const ajv = new Ajv({ - allErrors: true, - strict: false, - strictRequired: false, - strictTypes: false, - $data: true, - }); - const addFormats = require("ajv-formats"); - - addFormats(ajv); - require("ajv-errors")(ajv); - let error_list = []; - try { - validate = ajv - .addSchema(searchSchema) - .addSchema(onSearchSchema) - .addSchema(selectSchema) - .addSchema(onSelectSchema) - .addSchema(initSchema) - .addSchema(onInitSchema) - .addSchema(confirmSchema) - .addSchema(onConfirmSchema) - .addSchema(updateSchema) - .addSchema(onUpdateSchema) - .addSchema(statusSchema) - .addSchema(onStatusSchema) - .addKeyword("isEndTimeGreater", { - validate: (schema, data) => isEndTimeGreater(data), - }) - .addKeyword("isQuoteMatching", { - validate: (schema, data) => isQuoteMatching(data), - }) - .addKeyword("isFutureDated", { - validate: (schema, data) => isFutureDated(data), - }) - .addKeyword("isLengthValid", { - validate: (schema, data) => isLengthValid(data), - }); - - validate = validate.compile(schema); - - const valid = validate(data); - if (!valid) { - error_list = validate.errors; - } - } catch (error) { - console.log("ERROR!! validating schema"); - console.trace(error); - } - return error_list; -}; - -const validate_schema_b2b_master = (data) => { - error_list = validate_schema(data, masterSchema); - return formatted_error(error_list); -}; - -module.exports = { - validate_schema_b2b_master, -}; From c6dd73b57510a1818c7dd5d17cdc3489c6f810bd Mon Sep 17 00:00:00 2001 From: Abhinav Goyal Date: Fri, 29 Dec 2023 15:45:59 +0530 Subject: [PATCH 7/7] feedback updated --- .../log-verification-utility/.gitignore | 1 + .../log_report.json | 8 --- .../merged.json | 1 - .../log_report.json | 62 ------------------ .../merged.json | 1 - .../schema/B2B_json_schema/v2/on_status.js | 27 +++++--- .../schema/B2B_json_schema/v2/on_update.js | 63 +++++++++++-------- 7 files changed, 56 insertions(+), 107 deletions(-) delete mode 100644 utilities/logistics-b2b/log-verification-utility/public/server/logistics/347301e3-ea1d-48d1-9ca5-283b7c18d586/log_report.json delete mode 100644 utilities/logistics-b2b/log-verification-utility/public/server/logistics/347301e3-ea1d-48d1-9ca5-283b7c18d586/merged.json delete mode 100644 utilities/logistics-b2b/log-verification-utility/public/server/logistics/6802cbf8-dbb2-4562-abda-3fc2ebef2b75/log_report.json delete mode 100644 utilities/logistics-b2b/log-verification-utility/public/server/logistics/6802cbf8-dbb2-4562-abda-3fc2ebef2b75/merged.json diff --git a/utilities/logistics-b2b/log-verification-utility/.gitignore b/utilities/logistics-b2b/log-verification-utility/.gitignore index 8c29104..3a79b99 100644 --- a/utilities/logistics-b2b/log-verification-utility/.gitignore +++ b/utilities/logistics-b2b/log-verification-utility/.gitignore @@ -3,6 +3,7 @@ package-lock.json *.env .vscode /public/logs/* +/public/server/* verification-logs /utils/*.json /utils/*.txt diff --git a/utilities/logistics-b2b/log-verification-utility/public/server/logistics/347301e3-ea1d-48d1-9ca5-283b7c18d586/log_report.json b/utilities/logistics-b2b/log-verification-utility/public/server/logistics/347301e3-ea1d-48d1-9ca5-283b7c18d586/log_report.json deleted file mode 100644 index f33ebf7..0000000 --- a/utilities/logistics-b2b/log-verification-utility/public/server/logistics/347301e3-ea1d-48d1-9ca5-283b7c18d586/log_report.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Schema": { - "schemaErr0": "/on_init/0/message/order/quote price is not matching with the total breakup price", - "schemaErr1": "/on_update/0/message/order/fulfillments/0/start/instructions must have required property 'code'", - "schemaErr2": "/on_update/0/message/order/fulfillments/0/start/instructions must have required property 'short_desc'", - "schemaErr3": "/on_update/0/message/order/fulfillments/0/start must pass \"$merge\" keyword validation" - } -} \ No newline at end of file diff --git a/utilities/logistics-b2b/log-verification-utility/public/server/logistics/347301e3-ea1d-48d1-9ca5-283b7c18d586/merged.json b/utilities/logistics-b2b/log-verification-utility/public/server/logistics/347301e3-ea1d-48d1-9ca5-283b7c18d586/merged.json deleted file mode 100644 index 3e428f9..0000000 --- a/utilities/logistics-b2b/log-verification-utility/public/server/logistics/347301e3-ea1d-48d1-9ca5-283b7c18d586/merged.json +++ /dev/null @@ -1 +0,0 @@ -{"search":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"search","core_version":"1.2.0","bap_id":"stage-ondc.ecomexpress.in","bap_uri":"https://1b75-49-249-159-126.ngrok-free.app","transaction_id":"347301e3-ea1d-48d1-9ca5-283b7c18d586","message_id":"b9913991-a295-4d22-ad19-82472d884117","timestamp":"2023-12-18T13:38:32.568Z","ttl":"PT30S"},"message":{"intent":{"category":{"id":"Express Delivery"},"fulfillment":{"type":"Delivery","end":{"location":{"gps":"28.5080098, 77.0909696","address":{"area_code":"122016"}}},"start":{"location":{"gps":"12.9298689, 77.6848366","address":{"area_code":"560103"}}}},"provider":{"time":{"range":{"start":"0000","end":"2359"},"days":"1,2,3,4,5,6,7","schedule":{"holidays":[]}}},"payment":{"type":"POST-FULFILLMENT"},"@ondc/org/payload_details":{"dimensions":{"length":{"unit":"centimeter","value":2},"breadth":{"unit":"centimeter","value":3},"height":{"unit":"centimeter","value":4}},"value":{"currency":"INR","value":"2000.0"},"category":"Grocery","weight":{"unit":"gram","value":10}}}}}],"on_search":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"on_search","core_version":"1.2.0","bap_id":"stage-ondc.ecomexpress.in","bap_uri":"https://1b75-49-249-159-126.ngrok-free.app","bpp_id":"stage-ondc.ecomexpress.in","bpp_uri":"https://stage-ondc.ecomexpress.in","transaction_id":"347301e3-ea1d-48d1-9ca5-283b7c18d586","message_id":"b9913991-a295-4d22-ad19-82472d884117","timestamp":"2023-12-18T13:38:33.338Z","ttl":"PT30S"},"message":{"catalog":{"bpp/descriptor":{"name":"Ecom Express Private Limited"},"bpp/providers":[{"id":"I1","descriptor":{"name":"Ecom Express Private Limited","short_desc":"Ecom Express Private Limited","long_desc":"Ecom Express Private Limited"},"categories":[{"id":"Express Delivery","time":{"label":"TAT","timestamp":"2023-12-18","duration":"P5D"}}],"fulfillments":[{"id":"1","type":"Delivery"},{"id":"2","type":"RTO"}],"items":[{"id":"1","parent_item_id":"EXPP","descriptor":{"name":"Express Plus Delivery","code":"P2H2P","short_desc":"Fast Delivery For Items","long_desc":"Fast Delivery for Items"},"category_id":"Express Delivery","fulfillment_id":"1","price":{"currency":"INR","value":"618.38"},"time":{"label":"TAT","timestamp":"2023-12-18","duration":"P5D"}},{"id":"2","parent_item_id":"EXPP","descriptor":{"name":"Express Plus Delivery","code":"P2H2P","short_desc":"Fast Delivery For Items","long_desc":"Fast Delivery for Items"},"category_id":"Express Delivery","fulfillment_id":"2","price":{"currency":"INR","value":"618.38"},"time":{"label":"TAT","timestamp":"2023-12-18","duration":"P5D"}}]}]}}}],"init":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"init","core_version":"1.2.0","bap_id":"stage-ondc.ecomexpress.in","bap_uri":"https://1b75-49-249-159-126.ngrok-free.app","bpp_id":"stage-ondc.ecomexpress.in","bpp_uri":"https://stage-ondc.ecomexpress.in","transaction_id":"347301e3-ea1d-48d1-9ca5-283b7c18d586","message_id":"11bdd314-e0d7-4f23-8cea-2d89b730342a","timestamp":"2023-12-18T13:38:36.110Z","ttl":"PT30S"},"message":{"order":{"payment":{"type":"POST-FULFILLMENT","collected_by":"BAP"},"provider":{"id":"I1"},"items":[{"id":"1","fulfillment_id":"1","category_id":"Express Delivery","descriptor":{"code":"P2H2P"}}],"fulfillments":[{"id":"1","type":"Delivery","end":{"contact":{"phone":"9999988888","email":"Baba@Elaichi.com"},"location":{"gps":"28.5080098, 77.0909696","address":{"name":"Mithun Chakraborty 420","building":"IHQ ecom express","locality":"Unnamed Road","city":"Gurugram","state":"Haryana","area_code":"122016","country":"India"}}},"start":{"contact":{"phone":"09898767675","email":"abii@gmail.com"},"location":{"gps":"12.9298689, 77.6848366","address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","area_code":"560103","country":"India"}}}}],"billing":{"name":"Gofrugal Technologies Pvt Ltd","tax_number":"33AACCG2423J1ZZ","email":"accounts@gofrugal.com","phone":"9999988888","address":{"name":"KRISP IT Park","building":"942, Kelambakkam - Vandalur Rd","locality":"Kizhakottayur","city":"Chennai","state":"Tamil Nadu","area_code":"600127","country":"India"},"created_at":"2023-12-18T13:38:36.110Z","updated_at":"2023-12-18T13:38:36.110Z"}}}}],"on_init":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"on_init","core_version":"1.2.0","bap_id":"stage-ondc.ecomexpress.in","bap_uri":"https://1b75-49-249-159-126.ngrok-free.app","bpp_id":"stage-ondc.ecomexpress.in","bpp_uri":"https://stage-ondc.ecomexpress.in","transaction_id":"347301e3-ea1d-48d1-9ca5-283b7c18d586","message_id":"11bdd314-e0d7-4f23-8cea-2d89b730342a","timestamp":"2023-12-18T13:38:36.906Z","ttl":"PT30S"},"message":{"order":{"payment":{"type":"POST-FULFILLMENT","collected_by":"BAP"},"provider":{"id":"I1"},"quote":{"price":{"currency":"INR","value":"618.38"},"breakup":[{"price":{"currency":"INR","value":"618.38"},"@ondc/org/item_id":"1","@ondc/org/title_type":"delivery"}]},"items":[{"id":"1","fulfillment_id":"1","category_id":"Express Delivery"}],"fulfillments":[{"id":"1","type":"Delivery","end":{"contact":{"phone":"9999988888","email":"Baba@Elaichi.com"},"location":{"gps":"28.5080098, 77.0909696","address":{"name":"Mithun Chakraborty 420","building":"IHQ ecom express","locality":"Unnamed Road","city":"Gurugram","state":"Haryana","country":"India","area_code":"122016"}}},"start":{"contact":{"phone":"09898767675","email":"abii@gmail.com"},"location":{"gps":"12.9298689, 77.6848366","address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","country":"India","area_code":"560103"}}}}]}}}],"confirm":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"confirm","core_version":"1.2.0","bap_id":"stage-ondc.ecomexpress.in","bap_uri":"https://1b75-49-249-159-126.ngrok-free.app","bpp_id":"stage-ondc.ecomexpress.in","bpp_uri":"https://stage-ondc.ecomexpress.in","transaction_id":"347301e3-ea1d-48d1-9ca5-283b7c18d586","message_id":"f6991386-0c8b-4ef6-ba06-9946297c8bde","timestamp":"2023-12-18T13:38:39.642Z","ttl":"PT30S"},"message":{"order":{"id":"3Q1QNP3PGX","state":"Created","payment":{"type":"POST-FULFILLMENT","collected_by":"BAP"},"provider":{"id":"I1"},"quote":{"price":{"currency":"INR","value":"618.38"},"breakup":[{"price":{"currency":"INR","value":"618.38"},"@ondc/org/item_id":"1","@ondc/org/title_type":"delivery"}]},"items":[{"id":"1","quantity":{"count":1},"fulfillment_id":"1","category_id":"Express Delivery","descriptor":{"code":"P2H2P"}}],"fulfillments":[{"id":"1","type":"Delivery","tags":[{"code":"state","list":[{"code":"ready_to_ship","value":"no"}]},{"code":"rto_action","list":[{"code":"return_to_origin","value":"yes"}]}],"end":{"person":{"name":"Mithun Chakraborty 420"},"contact":{"phone":"9999988888","email":"Baba@Elaichi.com"},"location":{"gps":"28.5080098, 77.0909696","address":{"name":"Mithun Chakraborty 420","building":"IHQ ecom express","locality":"Unnamed Road","city":"Gurugram","state":"Haryana","area_code":"122016","country":"India"}}},"start":{"person":{"name":"Abinaya"},"contact":{"phone":"09898767675","email":"abii@gmail.com"},"instructions":{"code":"4","short_desc":"1368","long_desc":"QR code will be attached to package"},"location":{"id":"19753-ONDC-1-3523_location","gps":"12.9298689, 77.6848366","address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","area_code":"560103","country":"India"}}}}],"billing":{"name":"Gofrugal Technologies Pvt Ltd","tax_number":"33AACCG2423J1ZZ","email":"accounts@gofrugal.com","phone":"9999988888","address":{"name":"KRISP IT Park","building":"942, Kelambakkam - Vandalur Rd","locality":"Kizhakottayur","city":"Chennai","state":"Tamil Nadu","area_code":"600127","country":"India"},"created_at":"2023-12-18T13:38:36.110Z","updated_at":"2023-12-18T13:38:36.110Z"},"@ondc/org/linked_order":{"items":[{"quantity":{"count":1,"measure":{"unit":"gram","value":10}},"price":{"currency":"INR","value":"2000.00"},"category_id":"Grocery","descriptor":{"name":"PLAIN ATTA"}}],"provider":{"descriptor":{"name":"Subbu Zoho ONDC"},"address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","area_code":"560103"}},"order":{"id":"2023-12-07-225813","weight":{"unit":"gram","value":10},"dimensions":{"length":{"unit":"centimeter","value":2},"breadth":{"unit":"centimeter","value":3},"height":{"unit":"centimeter","value":4}}}},"updated_at":"2023-12-07T14:20:59.374Z","created_at":"2023-12-07T14:20:59.374Z"}}}],"on_confirm":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"on_confirm","core_version":"1.2.0","bap_id":"stage-ondc.ecomexpress.in","bap_uri":"https://1b75-49-249-159-126.ngrok-free.app","bpp_id":"stage-ondc.ecomexpress.in","bpp_uri":"https://stage-ondc.ecomexpress.in","transaction_id":"347301e3-ea1d-48d1-9ca5-283b7c18d586","message_id":"f6991386-0c8b-4ef6-ba06-9946297c8bde","timestamp":"2023-12-18T13:38:39.973Z","ttl":"PT30S"},"message":{"order":{"id":"3Q1QNP3PGX","state":"Created","payment":{"type":"POST-FULFILLMENT","collected_by":"BAP"},"provider":{"id":"I1"},"quote":{"price":{"currency":"INR","value":"618.38"},"breakup":[{"price":{"currency":"INR","value":"618.38"},"@ondc/org/item_id":"1","@ondc/org/title_type":"delivery"}]},"items":[{"id":"1","quantity":{"count":1},"fulfillment_id":"1","category_id":"Express Delivery","descriptor":{"code":"P2H2P"}}],"fulfillments":[{"id":"1","type":"Delivery","tags":[{"code":"state","list":[{"code":"ready_to_ship","value":"no"}]},{"code":"rto_action","list":[{"code":"return_to_origin","value":"yes"}]}],"end":{"person":{"name":"Mithun Chakraborty 420"},"contact":{"phone":"9999988888","email":"Baba@Elaichi.com"},"location":{"gps":"28.5080098, 77.0909696","address":{"name":"Mithun Chakraborty 420","building":"IHQ ecom express","locality":"Unnamed Road","city":"Gurugram","state":"Haryana","country":"India","area_code":"122016"}}},"start":{"person":{"name":"Abinaya"},"contact":{"phone":"09898767675","email":"abii@gmail.com"},"instructions":{"short_desc":"1368","long_desc":"QR code will be attached to package","code":"4"},"location":{"id":"19753-ONDC-1-3523_location","gps":"12.9298689, 77.6848366","address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","country":"India","area_code":"560103"}}},"state":{"descriptor":{"code":"Pending"}},"tracking":false,"@ondc/org/awb_no":"112844922778"}],"billing":{"name":"Gofrugal Technologies Pvt Ltd","tax_number":"33AACCG2423J1ZZ","email":"accounts@gofrugal.com","phone":"9999988888","address":{"name":"KRISP IT Park","building":"942, Kelambakkam - Vandalur Rd","locality":"Kizhakottayur","city":"Chennai","state":"Tamil Nadu","country":"India","area_code":"600127"},"created_at":"2023-12-18T13:38:36.110Z","updated_at":"2023-12-18T13:38:36.110Z"},"@ondc/org/linked_order":{"items":[{"quantity":{"count":1,"measure":{"unit":"gram","value":10}},"price":{"currency":"INR","value":"2000.00"},"category_id":"Grocery","descriptor":{"name":"PLAIN ATTA"}}],"provider":{"descriptor":{"name":"Subbu Zoho ONDC"},"address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","area_code":"560103"}},"order":{"id":"2023-12-07-225813","weight":{"unit":"gram","value":10},"dimensions":{"length":{"unit":"centimeter","value":2},"breadth":{"unit":"centimeter","value":3},"height":{"unit":"centimeter","value":4}}}},"updated_at":"2023-12-18T13:38:39.973Z","created_at":"2023-12-07T14:20:59.374Z"}}}],"update":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"update","core_version":"1.2.0","bap_id":"stage-ondc.ecomexpress.in","bap_uri":"https://1b75-49-249-159-126.ngrok-free.app","bpp_id":"stage-ondc.ecomexpress.in","bpp_uri":"https://stage-ondc.ecomexpress.in","transaction_id":"347301e3-ea1d-48d1-9ca5-283b7c18d586","message_id":"889d3a90-9a20-4289-bb83-b05809918520","timestamp":"2023-12-18T13:38:54.815Z","ttl":"PT30S"},"message":{"order":{"id":"3Q1QNP3PGX","items":[{"id":"1","descriptor":{"code":"P2H2P"},"category_id":"Express Delivery"}],"fulfillments":[{"id":"1","type":"Delivery","tags":[{"code":"state","list":[{"code":"ready_to_ship","value":"yes"}]}],"@ondc/org/awb_no":"110919056165"}],"@ondc/org/linked_order":{"items":[{"quantity":{"count":1,"measure":{"unit":"gram","value":10}},"price":{"currency":"INR","value":"2000.00"},"category_id":"Grocery","descriptor":{"name":"PLAIN ATTA"}}],"provider":{"descriptor":{"name":"Subbu Zoho ONDC"},"address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","area_code":"560103"}},"order":{"id":"2023-12-07-225813","weight":{"unit":"gram","value":10},"dimensions":{"length":{"unit":"centimeter","value":2},"breadth":{"unit":"centimeter","value":3},"height":{"unit":"centimeter","value":4}}}},"updated_at":"2023-12-07T14:32:39.165Z"},"update_target":"fulfillment"}}],"on_update":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"on_update","core_version":"1.2.0","bap_id":"stage-ondc.ecomexpress.in","bap_uri":"https://1b75-49-249-159-126.ngrok-free.app","bpp_id":"stage-ondc.ecomexpress.in","bpp_uri":"https://stage-ondc.ecomexpress.in","transaction_id":"347301e3-ea1d-48d1-9ca5-283b7c18d586","message_id":"246cb466-8ac5-40b6-a586-08c8bdc1c72b","timestamp":"2023-12-18T13:38:55.288Z","ttl":"PT30S"},"message":{"order":{"id":"3Q1QNP3PGX","state":"Accepted","payment":{"type":"POST-FULFILLMENT","collected_by":"BAP"},"provider":{"id":"I1"},"quote":{"price":{"currency":"INR","value":"618.38"},"breakup":[{"price":{"currency":"INR","value":"618.38"},"@ondc/org/item_id":"1","@ondc/org/title_type":"delivery"}]},"items":[{"id":"1","quantity":{"count":1},"fulfillment_id":"1","category_id":"Express Delivery","descriptor":{"code":"P2H2P"}}],"fulfillments":[{"id":"1","type":"Delivery","tags":[{"code":"state","list":[{"code":"ready_to_ship","value":"yes"}]}],"end":{"person":{"name":"Mithun Chakraborty 420"},"time":{"range":{"start":"2023-12-23T00:00:00.000Z","end":"2023-12-23T23:59:00.000Z"}},"contact":{"phone":"9999988888","email":"Baba@Elaichi.com"},"location":{"gps":"28.5080098, 77.0909696","address":{"name":"Mithun Chakraborty 420","building":"IHQ ecom express","locality":"Unnamed Road","city":"Gurugram","state":"Haryana","country":"India","area_code":"122016"}}},"start":{"person":{"name":"Abinaya"},"time":{"range":{"start":"2023-12-19T00:00:00.000Z","end":"2023-12-19T23:59:00.000Z"}},"contact":{"phone":"09898767675","email":"abii@gmail.com"},"instructions":{"images":["https://stage-ondc.ecomexpress.in/shippingLabel/110919056165"]},"location":{"id":"19753-ONDC-1-3523_location","gps":"12.9298689, 77.6848366","address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","country":"India","area_code":"560103"}}},"state":{"descriptor":{"code":"Pending"}},"tracking":false,"@ondc/org/awb_no":"112844922778"}],"billing":{"name":"Gofrugal Technologies Pvt Ltd","tax_number":"33AACCG2423J1ZZ","email":"accounts@gofrugal.com","phone":"9999988888","address":{"name":"KRISP IT Park","building":"942, Kelambakkam - Vandalur Rd","locality":"Kizhakottayur","city":"Chennai","state":"Tamil Nadu","country":"India","area_code":"600127"},"created_at":"2023-12-18T13:38:36.110Z","updated_at":"2023-12-18T13:38:36.110Z"},"@ondc/org/linked_order":{"items":[{"quantity":{"count":1,"measure":{"unit":"gram","value":10}},"price":{"currency":"INR","value":"2000.00"},"category_id":"Grocery","descriptor":{"name":"PLAIN ATTA"}}],"provider":{"descriptor":{"name":"Subbu Zoho ONDC"},"address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","area_code":"560103"}},"order":{"id":"2023-12-07-225813","weight":{"unit":"gram","value":10},"dimensions":{"length":{"unit":"centimeter","value":2},"breadth":{"unit":"centimeter","value":3},"height":{"unit":"centimeter","value":4}}}},"updated_at":"2023-12-18T13:38:55.288Z","created_at":"2023-12-07T14:20:59.374Z"}}}],"on_cancel":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"on_cancel","core_version":"1.2.0","bap_id":"stage-ondc.ecomexpress.in","bap_uri":"https://1b75-49-249-159-126.ngrok-free.app","bpp_id":"stage-ondc.ecomexpress.in","bpp_uri":"https://stage-ondc.ecomexpress.in","transaction_id":"347301e3-ea1d-48d1-9ca5-283b7c18d586","message_id":"11457434-00a2-434d-bc7f-16eff98e3737","timestamp":"2023-12-18T13:39:37.639Z","ttl":"PT30S"},"message":{"order":{"id":"3Q1QNP3PGX","state":"Cancelled","payment":{"type":"POST-FULFILLMENT","collected_by":"BAP"},"cancellation":{"reason":{"id":"004"},"cancelled_by":"stage-ondc.ecomexpress.in"},"provider":{"id":"I1"},"quote":{"price":{"currency":"INR","value":"618.38"},"breakup":[{"price":{"currency":"INR","value":"618.38"},"@ondc/org/item_id":"1","@ondc/org/title_type":"delivery"}]},"items":[{"id":"1","quantity":{"count":1},"fulfillment_id":"1","category_id":"Express Delivery","descriptor":{"code":"P2H2P"}}],"fulfillments":[{"id":"2","type":"RTO","tags":[{"code":"rto_event","list":[{"code":"retry_count","value":"3"},{"code":"rto_id","value":"2"},{"code":"cancellation_reason_id","value":"004"},{"code":"cancelled_by","value":"stage-ondc.ecomexpress.in"}]}],"end":{"person":{"name":"Mithun Chakraborty 420"},"time":{"range":{"start":"2023-12-23T00:00:00.000Z","end":"2023-12-23T23:59:00.000Z"}},"contact":{"phone":"9999988888","email":"Baba@Elaichi.com"},"location":{"gps":"28.5080098, 77.0909696","address":{"name":"Mithun Chakraborty 420","building":"IHQ ecom express","locality":"Unnamed Road","city":"Gurugram","state":"Haryana","country":"India","area_code":"122016"}}},"start":{"person":{"name":"Abinaya"},"time":{"timestamp":"2023-12-15T08:50:53.670Z","range":{"start":"2023-12-19T00:00:00.000Z","end":"2023-12-19T23:59:00.000Z"}},"contact":{"phone":"09898767675","email":"abii@gmail.com"},"instructions":{"images":["https://stage-ondc.ecomexpress.in/shippingLabel/110919056165"]},"location":{"id":"19753-ONDC-1-3523_location","gps":"12.9298689, 77.6848366","address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","country":"India","area_code":"560103"}}},"state":{"descriptor":{"code":"Cancelled"}},"tracking":false,"@ondc/org/awb_no":"112844922778"}],"billing":{"name":"Gofrugal Technologies Pvt Ltd","tax_number":"33AACCG2423J1ZZ","email":"accounts@gofrugal.com","phone":"9999988888","address":{"name":"KRISP IT Park","building":"942, Kelambakkam - Vandalur Rd","locality":"Kizhakottayur","city":"Chennai","state":"Tamil Nadu","country":"India","area_code":"600127"},"created_at":"2023-12-18T13:38:36.110Z","updated_at":"2023-12-18T13:38:36.110Z"},"@ondc/org/linked_order":{"items":[{"quantity":{"count":1,"measure":{"unit":"gram","value":10}},"price":{"currency":"INR","value":"2000.00"},"category_id":"Grocery","descriptor":{"name":"PLAIN ATTA"}}],"provider":{"descriptor":{"name":"Subbu Zoho ONDC"},"address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","area_code":"560103"}},"order":{"id":"2023-12-07-225813","weight":{"unit":"gram","value":10},"dimensions":{"length":{"unit":"centimeter","value":2},"breadth":{"unit":"centimeter","value":3},"height":{"unit":"centimeter","value":4}}}},"updated_at":"2023-12-18T13:39:37.639Z","created_at":"2023-12-07T14:20:59.374Z"}}}],"on_status":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"on_status","core_version":"1.2.0","bap_id":"stage-ondc.ecomexpress.in","bap_uri":"https://1b75-49-249-159-126.ngrok-free.app","bpp_id":"stage-ondc.ecomexpress.in","bpp_uri":"https://stage-ondc.ecomexpress.in","transaction_id":"347301e3-ea1d-48d1-9ca5-283b7c18d586","message_id":"0bf1fd6a-8e8f-4fc1-aad2-79152c0237b4","timestamp":"2023-12-18T13:40:21.368Z","ttl":"PT30S"},"message":{"order":{"id":"3Q1QNP3PGX","state":"Cancelled","payment":{"type":"POST-FULFILLMENT","collected_by":"BAP","status":"PAID"},"cancellation":{"reason":{"id":"004"},"cancelled_by":"stage-ondc.ecomexpress.in"},"provider":{"id":"I1"},"quote":{"price":{"currency":"INR","value":"618.38"},"breakup":[{"price":{"currency":"INR","value":"618.38"},"@ondc/org/item_id":"1","@ondc/org/title_type":"delivery"}]},"items":[{"id":"1","quantity":{"count":1},"fulfillment_id":"1","category_id":"Express Delivery","descriptor":{"code":"P2H2P"}}],"fulfillments":[{"id":"2","type":"RTO","tags":[{"code":"rto_event","list":[{"code":"retry_count","value":"3"},{"code":"rto_id","value":"2"},{"code":"cancellation_reason_id","value":"004"},{"code":"cancelled_by","value":"stage-ondc.ecomexpress.in"}]}],"end":{"person":{"name":"Mithun Chakraborty 420"},"time":{"range":{"start":"2023-12-23T00:00:00.000Z","end":"2023-12-23T23:59:00.000Z"}},"contact":{"phone":"9999988888","email":"Baba@Elaichi.com"},"location":{"gps":"28.5080098, 77.0909696","address":{"name":"Mithun Chakraborty 420","building":"IHQ ecom express","locality":"Unnamed Road","city":"Gurugram","state":"Haryana","country":"India","area_code":"122016"}}},"start":{"person":{"name":"Abinaya"},"time":{"timestamp":"2023-12-15T08:50:53.670Z","range":{"start":"2023-12-19T00:00:00.000Z","end":"2023-12-19T23:59:00.000Z"}},"contact":{"phone":"09898767675","email":"abii@gmail.com"},"instructions":{"images":["https://stage-ondc.ecomexpress.in/shippingLabel/110919056165"]},"location":{"id":"19753-ONDC-1-3523_location","gps":"12.9298689, 77.6848366","address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","country":"India","area_code":"560103"}}},"state":{"descriptor":{"code":"RTO-Initiated"}},"tracking":false,"@ondc/org/awb_no":"112844922778"}],"billing":{"name":"Gofrugal Technologies Pvt Ltd","tax_number":"33AACCG2423J1ZZ","email":"accounts@gofrugal.com","phone":"9999988888","address":{"name":"KRISP IT Park","building":"942, Kelambakkam - Vandalur Rd","locality":"Kizhakottayur","city":"Chennai","state":"Tamil Nadu","country":"India","area_code":"600127"},"created_at":"2023-12-18T13:38:36.110Z","updated_at":"2023-12-18T13:38:36.110Z"},"@ondc/org/linked_order":{"items":[{"quantity":{"count":1,"measure":{"unit":"gram","value":10}},"price":{"currency":"INR","value":"2000.00"},"category_id":"Grocery","descriptor":{"name":"PLAIN ATTA"}}],"provider":{"descriptor":{"name":"Subbu Zoho ONDC"},"address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","area_code":"560103"}},"order":{"id":"2023-12-07-225813","weight":{"unit":"gram","value":10},"dimensions":{"length":{"unit":"centimeter","value":2},"breadth":{"unit":"centimeter","value":3},"height":{"unit":"centimeter","value":4}}}},"updated_at":"2023-12-18T13:40:21.368Z","created_at":"2023-12-07T14:20:59.374Z"}}},{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"on_status","core_version":"1.2.0","bap_id":"stage-ondc.ecomexpress.in","bap_uri":"https://1b75-49-249-159-126.ngrok-free.app","bpp_id":"stage-ondc.ecomexpress.in","bpp_uri":"https://stage-ondc.ecomexpress.in","transaction_id":"347301e3-ea1d-48d1-9ca5-283b7c18d586","message_id":"2119685b-9816-4571-b6bd-4f428ee12812","timestamp":"2023-12-18T13:41:34.451Z","ttl":"PT30S"},"message":{"order":{"id":"3Q1QNP3PGX","state":"Cancelled","payment":{"type":"POST-FULFILLMENT","collected_by":"BAP","status":"PAID"},"cancellation":{"reason":{"id":"004"},"cancelled_by":"stage-ondc.ecomexpress.in"},"provider":{"id":"I1"},"quote":{"price":{"currency":"INR","value":"618.38"},"breakup":[{"price":{"currency":"INR","value":"618.38"},"@ondc/org/item_id":"1","@ondc/org/title_type":"delivery"}]},"items":[{"id":"1","quantity":{"count":1},"fulfillment_id":"1","category_id":"Express Delivery","descriptor":{"code":"P2H2P"}}],"fulfillments":[{"id":"2","type":"RTO","tags":[{"code":"rto_event","list":[{"code":"retry_count","value":"3"},{"code":"rto_id","value":"2"},{"code":"cancellation_reason_id","value":"004"},{"code":"cancelled_by","value":"stage-ondc.ecomexpress.in"}]}],"end":{"person":{"name":"Mithun Chakraborty 420"},"time":{"timestamp":"2023-12-15T08:50:53.670Z","range":{"start":"2023-12-23T00:00:00.000Z","end":"2023-12-23T23:59:00.000Z"}},"contact":{"phone":"9999988888","email":"Baba@Elaichi.com"},"location":{"gps":"28.5080098, 77.0909696","address":{"name":"Mithun Chakraborty 420","building":"IHQ ecom express","locality":"Unnamed Road","city":"Gurugram","state":"Haryana","country":"India","area_code":"122016"}}},"start":{"person":{"name":"Abinaya"},"time":{"timestamp":"2023-12-15T08:50:53.670Z","range":{"start":"2023-12-19T00:00:00.000Z","end":"2023-12-19T23:59:00.000Z"}},"contact":{"phone":"09898767675","email":"abii@gmail.com"},"instructions":{"images":["https://stage-ondc.ecomexpress.in/shippingLabel/110919056165"]},"location":{"id":"19753-ONDC-1-3523_location","gps":"12.9298689, 77.6848366","address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","country":"India","area_code":"560103"}}},"state":{"descriptor":{"code":"RTO-Delivered"}},"tracking":false,"@ondc/org/awb_no":"112844922778"}],"billing":{"name":"Gofrugal Technologies Pvt Ltd","tax_number":"33AACCG2423J1ZZ","email":"accounts@gofrugal.com","phone":"9999988888","address":{"name":"KRISP IT Park","building":"942, Kelambakkam - Vandalur Rd","locality":"Kizhakottayur","city":"Chennai","state":"Tamil Nadu","country":"India","area_code":"600127"},"created_at":"2023-12-18T13:38:36.110Z","updated_at":"2023-12-18T13:38:36.110Z"},"@ondc/org/linked_order":{"items":[{"quantity":{"count":1,"measure":{"unit":"gram","value":10}},"price":{"currency":"INR","value":"2000.00"},"category_id":"Grocery","descriptor":{"name":"PLAIN ATTA"}}],"provider":{"descriptor":{"name":"Subbu Zoho ONDC"},"address":{"name":"Subbu Zoho ONDC","building":"block v","locality":"Vannar Pettai","city":"Bangalore","state":"Tamil Nadu","area_code":"560103"}},"order":{"id":"2023-12-07-225813","weight":{"unit":"gram","value":10},"dimensions":{"length":{"unit":"centimeter","value":2},"breadth":{"unit":"centimeter","value":3},"height":{"unit":"centimeter","value":4}}}},"updated_at":"2023-12-18T13:41:34.451Z","created_at":"2023-12-07T14:20:59.374Z"}}}]} \ No newline at end of file diff --git a/utilities/logistics-b2b/log-verification-utility/public/server/logistics/6802cbf8-dbb2-4562-abda-3fc2ebef2b75/log_report.json b/utilities/logistics-b2b/log-verification-utility/public/server/logistics/6802cbf8-dbb2-4562-abda-3fc2ebef2b75/log_report.json deleted file mode 100644 index fb6d4bf..0000000 --- a/utilities/logistics-b2b/log-verification-utility/public/server/logistics/6802cbf8-dbb2-4562-abda-3fc2ebef2b75/log_report.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "Flow Error": { - "0": "Incorrect Flow as per context/timestamps - (search,on_search,cancel,init,on_init,confirm,on_confirm,status,support,track,on_track,on_support,on_status,on_cancel)" - }, - "Schema": { - "schemaErr0": "/search/0/message/intent/payment @ondc/org/collection_amount is required only for payment/type 'ON-FULFILLMENT'", - "schemaErr1": "/search/0/message/intent/payment must match \"then\" schema", - "schemaErr2": "/confirm/0/message/order/billing/created_at mismatches in /billing in /init and /confirm", - "schemaErr3": "/confirm/0/message/order/billing/updated_at mismatches in /billing in /init and /confirm", - "schemaErr4": "/confirm/0/message/order/payment/collected_by mismatches in /payment in /on_init and /confirm", - "schemaErr5": "/on_confirm/0/message/order/payment/collected_by mismatches in /payment in /on_init and /confirm", - "schemaErr6": "/on_status/0/message/order/fulfillments/0/start/time must have required property 'range'", - "schemaErr7": "/on_status/0/message/order/fulfillments/0/end must have required property 'time'", - "schemaErr8": "/on_status/0/message/order/fulfillments/0 must match \"then\" schema", - "schemaErr9": "/on_cancel/0/message/order must have required property 'created_at'", - "schemaErr10": "/on_cancel/0/message/order/quote price is not matching with the total breakup price", - "schemaErr11": "/on_cancel/0/message/order/fulfillments/0/start/time must have required property 'range'", - "schemaErr12": "/on_cancel/0/message/order/fulfillments/0/end/time must have required property 'range'", - "schemaErr13": "/on_cancel/0/message/order/fulfillments/0 must match \"then\" schema" - }, - "Context": { - "init_0": { - "tmpstmpErr": "Timestamp mismatch for /init " - }, - "status_0": { - "tmpstmpErr": "Timestamp mismatch for /status " - }, - "support_0": { - "tmpstmpErr": "Timestamp mismatch for /support " - }, - "track_0": { - "tmpstmpErr": "Timestamp mismatch for /track " - }, - "on_track_0": { - "msgIdErr": "Message Id cannot be same for different sets of APIs" - }, - "on_support_0": { - "msgIdErr": "Message Id cannot be same for different sets of APIs" - }, - "on_status_0": { - "msgIdErr": "Message Id cannot be same for different sets of APIs" - }, - "on_cancel_0": { - "msgIdErr": "Message Id cannot be same for different sets of APIs" - } - }, - "Message": { - "on_search_0": { - "itemTAT": "For Same Day Delivery/Immediate Delivery, TAT date should be the same date i.e. 2023-12-08" - }, - "confirm_0": { - "itemDurationErr": "item duration does not match with the one provided in /on_search (LSP can send NACK)", - "avgPckupErr": "Average Pickup Time mismatches from the one provided in /on_search" - }, - "on_confirm_0": { - "trckErr": "tracking should be enabled (true) for hyperlocal (Immediate Delivery)" - }, - "on_status_0": { - "trckErr": "tracking should be enabled (true) for hyperlocal (Immediate Delivery)" - } - } -} \ No newline at end of file diff --git a/utilities/logistics-b2b/log-verification-utility/public/server/logistics/6802cbf8-dbb2-4562-abda-3fc2ebef2b75/merged.json b/utilities/logistics-b2b/log-verification-utility/public/server/logistics/6802cbf8-dbb2-4562-abda-3fc2ebef2b75/merged.json deleted file mode 100644 index bc99584..0000000 --- a/utilities/logistics-b2b/log-verification-utility/public/server/logistics/6802cbf8-dbb2-4562-abda-3fc2ebef2b75/merged.json +++ /dev/null @@ -1 +0,0 @@ -{"search":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"search","core_version":"1.2.0","bap_id":"extweb.oyeti.com/ecommerce/ondc","bap_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","transaction_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","message_id":"2f7b0c90-edf2-485f-ae15-665229687122","timestamp":"2023-12-08T09:07:59.783Z","ttl":"PT30S"},"message":{"intent":{"category":{"id":"Immediate Delivery"},"provider":{"time":{"days":"1,2,3,4,5,6","schedule":{"holidays":[]},"duration":"PT30M","range":{"start":"0630","end":"2359"}}},"fulfillment":{"type":"Delivery","start":{"location":{"gps":"12.9029804, 77.6241936","address":{"area_code":"560068"}}},"end":{"location":{"gps":"12.903803216971028, 77.62518882751466","address":{"area_code":"560068"}}}},"payment":{"type":"ON-ORDER","@ondc/org/collection_amount":"0"},"@ondc/org/payload_details":{"weight":{"unit":"kilogram","value":3},"dimensions":{"length":{"unit":"centimeter","value":15},"breadth":{"unit":"centimeter","value":10},"height":{"unit":"centimeter","value":10}},"category":"F&B","value":{"currency":"INR","value":"238.0"}}}}}],"on_search":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"on_search","core_version":"1.2.0","bap_id":"extweb.oyeti.com/ecommerce/ondc","bap_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","transaction_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","message_id":"2f7b0c90-edf2-485f-ae15-665229687122","timestamp":"2023-12-08T09:07:59.909Z","bpp_id":"ref-logistics-app-preprod.ondc.org","bpp_uri":"https://ref-logistics-app-preprod.ondc.org"},"message":{"catalog":{"bpp/descriptor":{"name":"WITS Project Ref Logistic"},"bpp/providers":[{"id":"275b09c9-d0d9-42bb-98f1-2c4153a9d320","descriptor":{"name":"WITS Project Ref Logistic","long_desc":"WITS Project Ref Logistic","short_desc":"WITS Project Ref Logistic"},"categories":[{"id":"Immediate Delivery","time":{"label":"TAT","duration":"PT60M","timestamp":"2023-12-08"}}],"fulfillments":[{"id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","type":"Delivery","start":{"time":{"duration":"PT15M"}},"tags":[{"code":"distance","list":[{"code":"motorable_distance_type","value":"kilometer"},{"code":"motorable_distance","value":"0.15"}]}]},{"id":"9ad1e641-0ba2-4689-a25a-82f8c74671e1","type":"RTO"}],"items":[{"id":"Standard","parent_item_id":"","category_id":"Immediate Delivery","fulfillment_id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","descriptor":{"code":"P2P","name":"Immediate Delivery","long_desc":"Upto 60 mins for Delivery","short_desc":"Upto 60 mins for Delivery"},"price":{"currency":"INR","value":"122.38"},"time":{"label":"TAT","duration":"PT60M","timestamp":"2023-12-08"}},{"id":"rto","parent_item_id":"Standard","category_id":"Immediate Delivery","fulfillment_id":"9ad1e641-0ba2-4689-a25a-82f8c74671e1","descriptor":{"code":"P2P","name":"RTO quote","short_desc":"RTO quote","long_desc":"RTO quote"},"price":{"currency":"INR","value":"34.82"},"time":{"label":"TAT","duration":"P1D","timestamp":"2023-12-09"}}]}]}}}],"cancel":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"cancel","core_version":"1.2.0","bap_id":"extweb.oyeti.com/ecommerce/ondc","bap_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","bpp_id":"extweb.oyeti.com/ecommerce/ondc","bpp_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","transaction_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","message_id":"e292631e-2f47-4af4-b767-3f03bf44ef94","timestamp":"2023-12-08T09:08:09.356Z","ttl":"PT30S"},"message":{"order_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","cancellation_reason_id":"010"}}],"init":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"init","core_version":"1.2.0","bap_id":"extweb.oyeti.com/ecommerce/ondc","bap_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","bpp_id":"extweb.oyeti.com/ecommerce/ondc","bpp_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","transaction_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","message_id":"e292631e-2f47-4af4-b767-3f03bf44ef94","timestamp":"2023-12-08T09:08:09.356Z","ttl":"PT30S"},"message":{"order":{"provider":{"id":"275b09c9-d0d9-42bb-98f1-2c4153a9d320"},"items":[{"id":"Standard","fulfillment_id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","category_id":"Immediate Delivery","descriptor":{"code":"P2P"}}],"fulfillments":[{"id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","type":"Delivery","start":{"location":{"gps":"12.9029804, 77.6241936","address":{"name":"Nandyal Chefs","building":"Bommanahalli","locality":"Bengaluru, Bangalore Division, Karnataka, India","city":"Bengaluru","state":"Karnataka","country":"India","area_code":"560068"}},"contact":{"phone":"7893847511","email":"venkateshmurapureddy@gmail.com"}},"end":{"location":{"gps":"12.903803216971028, 77.62518882751466","address":{"name":"Venkateswara Reddy","building":"Venky House","locality":"9th A Cross Road","city":"Bengaluru","state":"Karnataka","country":"IND","area_code":"560068"}},"contact":{"phone":"7893847511","email":"venkateshmurapureddy@gmail.com"}}}],"billing":{"name":"Kumar Abhishek","email":"accounts@tonetag.com","phone":"8197153537","address":{"city":"Bengaluru","name":"Naffa Innovations Pvt Ltd","state":"Karnataka","country":"IND","building":"117, The Arcade, Brigade Metropolis, Garudachar Palya","locality":"Mahadevapura","area_code":"560048"},"created_at":"2023-12-08T09:08:09.356Z","updated_at":"2023-12-08T09:08:09.356Z","tax_number":"29AAECN5025F1ZK"},"payment":{"type":"ON-ORDER","collected_by":"BPP","@ondc/org/settlement_details":[]}}}}],"on_init":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"on_init","core_version":"1.2.0","bap_id":"extweb.oyeti.com/ecommerce/ondc","bap_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","bpp_id":"extweb.oyeti.com/ecommerce/ondc","bpp_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","transaction_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","message_id":"e292631e-2f47-4af4-b767-3f03bf44ef94","timestamp":"2023-12-08T09:08:09.525Z"},"message":{"order":{"provider":{"id":"275b09c9-d0d9-42bb-98f1-2c4153a9d320"},"items":[{"id":"Standard","fulfillment_id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","descriptor":{"code":"P2P"},"category_id":"Immediate Delivery"}],"fulfillments":[{"id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","type":"Delivery","start":{"location":{"gps":"12.9029804, 77.6241936","address":{"name":"Nandyal Chefs","building":"Bommanahalli","locality":"Bengaluru, Bangalore Division, Karnataka, India","city":"Bengaluru","state":"Karnataka","country":"India","area_code":"560068"}},"contact":{"phone":"7893847511","email":"venkateshmurapureddy@gmail.com"},"instructions":{"images":[]}},"end":{"location":{"gps":"12.903803216971028, 77.62518882751466","address":{"name":"Venkateswara Reddy","building":"Venky House","locality":"9th A Cross Road","city":"Bengaluru","state":"Karnataka","country":"IND","area_code":"560068"}},"contact":{"phone":"7893847511","email":"venkateshmurapureddy@gmail.com"},"instructions":{"images":[]}},"tags":[{"code":"rider_check","list":[{"code":"inline_check_for_rider","value":"yes"}]}]}],"quote":{"price":{"currency":"INR","value":"122.38"},"breakup":[{"@ondc/org/item_id":"Standard","@ondc/org/title_type":"delivery","price":{"currency":"INR","value":"116.00"}},{"@ondc/org/item_id":"Standard","@ondc/org/title_type":"tax","price":{"currency":"INR","value":"6.38"}}],"ttl":"PT15M"},"payment":{"type":"ON-ORDER","collected_by":"BAP","@ondc/org/settlement_details":[]},"cancellation_terms":[{"fulfillment_state":{"descriptor":{"code":"Pending","short_desc":""}},"refund_eligible":true,"reason_required":false,"cancellation_fee":{"amount":{"currency":"INR","value":"0.0"}}},{"fulfillment_state":{"descriptor":{"code":"Agent-assigned","short_desc":"001,003"}},"refund_eligible":true,"reason_required":true,"cancellation_fee":{"amount":{"currency":"INR","value":"50"}}},{"fulfillment_state":{"descriptor":{"code":"Order-picked-up","short_desc":"001,003"}},"refund_eligible":true,"reason_required":true,"cancellation_fee":{"amount":{"currency":"INR","value":"100"}}},{"fulfillment_state":{"descriptor":{"code":"Out-for-delivery","short_desc":"011,012,013,014,015"}},"refund_eligible":true,"reason_required":true,"cancellation_fee":{"amount":{"currency":"INR","value":"100.0"}}}],"tags":[{"code":"bpp_terms","list":[{"code":"max_liability","value":"2"},{"code":"max_liability_cap","value":"10000"},{"code":"mandatory_arbitration","value":"false"},{"code":"court_jurisdiction","value":"Bengaluru"},{"code":"delay_interest","value":"1000"},{"code":"static_terms","value":"https://github.com/ONDC-Official/protocol-network-extension/discussions/79"}]}]}}}],"confirm":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"confirm","core_version":"1.2.0","bap_id":"extweb.oyeti.com/ecommerce/ondc","bap_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","bpp_id":"extweb.oyeti.com/ecommerce/ondc","bpp_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","transaction_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","message_id":"47f3f650-4661-425b-b68d-031efaba239b","timestamp":"2023-12-08T09:08:11.306Z","ttl":"PT30S"},"message":{"order":{"id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","state":"Created","provider":{"id":"275b09c9-d0d9-42bb-98f1-2c4153a9d320"},"items":[{"id":"Standard","fulfillment_id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","descriptor":{"code":"P2P"},"category_id":"Immediate Delivery","time":{"label":"TAT","duration":"PT30M","timestamp":"2023-12-08"}}],"quote":{"price":{"value":"122.38","currency":"INR"},"breakup":[{"@ondc/org/item_id":"Standard","price":{"value":"116.00","currency":"INR"},"@ondc/org/title_type":"delivery"},{"@ondc/org/item_id":"Standard","price":{"value":"6.38","currency":"INR"},"@ondc/org/title_type":"tax"}]},"fulfillments":[{"id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","type":"Delivery","tracking":true,"start":{"time":{"duration":"P1D"},"person":{"name":"Nandyal Chefs"},"location":{"gps":"12.9029804, 77.6241936","address":{"name":"Nandyal Chefs","building":"Bommanahalli","locality":"Bengaluru, Bangalore Division, Karnataka, India","city":"Bengaluru","state":"Karnataka","country":"India","area_code":"560068"}},"contact":{"phone":"7893847511","email":"venkateshmurapureddy@gmail.com"},"instructions":{"code":"2","short_desc":"650909","long_desc":"Order Numer Last 6 Digits"}},"end":{"person":{"name":"Venkateswara Reddy"},"location":{"gps":"12.903803216971028, 77.62518882751466","address":{"name":"Venkateswara Reddy","building":"Venky House","locality":"9th A Cross Road","city":"Bengaluru","state":"Karnataka","country":"IND","area_code":"560068"}},"contact":{"phone":"7893847511","email":"venkateshmurapureddy@gmail.com"},"instructions":{"code":"2","short_desc":"650909","long_desc":"Order Numer Last 6 Digits"}},"tags":[{"code":"state","list":[{"code":"ready_to_ship","value":"no"}]},{"code":"rto_action","list":[{"code":"return_to_origin","value":"yes"}]}]}],"billing":{"name":"Kumar Abhishek","email":"accounts@tonetag.com","phone":"8197153537","address":{"city":"Bengaluru","name":"Naffa Innovations Pvt Ltd","state":"Karnataka","country":"IND","building":"117, The Arcade, Brigade Metropolis, Garudachar Palya","locality":"Mahadevapura","area_code":"560048"},"created_at":"2023-12-08T09:08:11.306Z","updated_at":"2023-12-08T09:08:11.306Z","tax_number":"29AAECN5025F1ZK"},"payment":{"type":"ON-ORDER","collected_by":"BPP"},"@ondc/org/linked_order":{"items":[{"category_id":"F&B","descriptor":{"name":"Almond Filter Coffee"},"quantity":{"count":2,"measure":{"unit":"kilogram","value":3}},"price":{"currency":"INR","value":"119.0"}}],"provider":{"descriptor":{"name":"Nandyal Chefs"},"address":{"name":"Nandyal Chefs","building":"Bommanahalli","locality":"Bengaluru, Bangalore Division, Karnataka, India","city":"Bengaluru","state":"Karnataka","country":"India","area_code":"560068"}},"order":{"id":"2023-12-08-650909","weight":{"unit":"kilogram","value":3},"dimensions":{"length":{"unit":"centimeter","value":15},"breadth":{"unit":"centimeter","value":10},"height":{"unit":"centimeter","value":10}}},"tags":[{"code":"bpp_terms","list":[{"code":"max_liability","value":"2"},{"code":"max_liability_cap","value":"10000"},{"code":"mandatory_arbitration","value":"false"},{"code":"court_jurisdiction","value":"Bengaluru"},{"code":"delay_interest","value":"1000"},{"code":"static_terms","value":"https://github.com/ONDC-Official/protocol-network-extension/discussions/79"}]}]},"created_at":"2023-12-08T09:08:11.306Z","updated_at":"2023-12-08T09:08:11.306Z"}}}],"on_confirm":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"on_confirm","core_version":"1.2.0","bap_id":"extweb.oyeti.com/ecommerce/ondc","bap_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","bpp_id":"ref-logistics-app-preprod.ondc.org","bpp_uri":"https://ref-logistics-app-preprod.ondc.org","transaction_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","message_id":"47f3f650-4661-425b-b68d-031efaba239b","timestamp":"2023-12-08T09:08:11.489Z"},"message":{"order":{"id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","state":"Accepted","provider":{"id":"275b09c9-d0d9-42bb-98f1-2c4153a9d320"},"items":[{"descriptor":{"code":"P2P"},"time":{"label":"TAT","duration":"PT30M","timestamp":"2023-12-08"},"id":"Standard","fulfillment_id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","category_id":"Immediate Delivery"}],"quote":{"price":{"value":"122.38","currency":"INR"},"breakup":[{"price":{"currency":"INR","value":"116.00"},"@ondc/org/item_id":"Standard","@ondc/org/title_type":"delivery"},{"price":{"currency":"INR","value":"6.38"},"@ondc/org/item_id":"Standard","@ondc/org/title_type":"tax"}]},"fulfillments":[{"state":{"descriptor":{"code":"Pending"}},"id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","type":"Delivery","start":{"time":{"duration":"P1D"},"person":{"name":"Nandyal Chefs"},"location":{"gps":"12.9029804, 77.6241936","address":{"name":"Nandyal Chefs","building":"Bommanahalli","locality":"Bengaluru, Bangalore Division, Karnataka, India","city":"Bengaluru","state":"Karnataka","country":"India","area_code":"560068"}},"contact":{"phone":"7893847511","email":"venkateshmurapureddy@gmail.com"},"instructions":{"code":"2","short_desc":"650909","images":[]}},"end":{"person":{"name":"Venkateswara Reddy"},"location":{"gps":"12.903803216971028, 77.62518882751466","address":{"name":"Venkateswara Reddy","building":"Venky House","locality":"9th A Cross Road","city":"Bengaluru","state":"Karnataka","country":"IND","area_code":"560068"}},"contact":{"phone":"7893847511","email":"venkateshmurapureddy@gmail.com"},"instructions":{"code":"2","short_desc":"650909","images":[]}},"tags":[{"code":"state","list":[{"code":"ready_to_ship","value":"no"}]},{"code":"rto_action","list":[{"code":"return_to_origin","value":"yes"}]}],"tracking":false}],"billing":{"name":"Kumar Abhishek","email":"accounts@tonetag.com","phone":"8197153537","address":{"name":"Naffa Innovations Pvt Ltd","building":"117, The Arcade, Brigade Metropolis, Garudachar Palya","locality":"Mahadevapura","city":"Bengaluru","state":"Karnataka","country":"IND","area_code":"560048"},"created_at":"2023-12-08T09:08:11.306Z","updated_at":"2023-12-08T09:08:11.306Z","tax_number":"29AAECN5025F1ZK"},"payment":{"type":"ON-ORDER","collected_by":"BPP","status":"PAID","@ondc/org/settlement_details":[]},"@ondc/org/linked_order":{"provider":{"descriptor":{"name":"Nandyal Chefs"},"address":{"name":"Nandyal Chefs","building":"Bommanahalli","locality":"Bengaluru, Bangalore Division, Karnataka, India","city":"Bengaluru","state":"Karnataka","country":"India","area_code":"560068"}},"order":{"weight":{"unit":"kilogram","value":3},"id":"2023-12-08-650909","dimensions":{"length":{"unit":"centimeter","value":15},"breadth":{"unit":"centimeter","value":10},"height":{"unit":"centimeter","value":10}}},"items":[{"descriptor":{"name":"Almond Filter Coffee"},"quantity":{"measure":{"value":3,"unit":"kilogram"},"count":2},"price":{"currency":"INR","value":"119.0"},"category_id":"F&B"}]},"cancellation_terms":[{"fulfillment_state":{"descriptor":{"code":"Pending","short_desc":""}},"cancellation_fee":{"amount":{"currency":"INR","value":"0.0"}},"refund_eligible":true,"reason_required":false},{"fulfillment_state":{"descriptor":{"code":"Agent-assigned","short_desc":"001,003"}},"cancellation_fee":{"amount":{"currency":"INR","value":"50"}},"refund_eligible":true,"reason_required":true},{"fulfillment_state":{"descriptor":{"code":"Order-picked-up","short_desc":"001,003"}},"cancellation_fee":{"amount":{"currency":"INR","value":"100"}},"refund_eligible":true,"reason_required":true},{"fulfillment_state":{"descriptor":{"code":"Out-for-delivery","short_desc":"011,012,013,014,015"}},"cancellation_fee":{"amount":{"currency":"INR","value":"100.0"}},"refund_eligible":true,"reason_required":true}],"tags":[{"code":"bpp_terms","list":[{"code":"max_liability","value":"2"},{"code":"max_liability_cap","value":"10000"},{"code":"mandatory_arbitration","value":"false"},{"code":"court_jurisdiction","value":"Bengaluru"},{"code":"delay_interest","value":"1000"},{"code":"static_terms","value":"https://github.com/ONDC-Official/protocol-network-extension/discussions/79"}]}],"created_at":"2023-12-08T09:08:11.306Z","updated_at":"2023-12-08T09:08:11.489Z"}}}],"status":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"status","core_version":"1.2.0","bap_id":"extweb.oyeti.com/ecommerce/ondc","bap_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","bpp_id":"ref-logistics-app-preprod.ondc.org","bpp_uri":"https://ref-logistics-app-preprod.ondc.org","transaction_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","message_id":"47f3f650-4661-425b-b68d-031efaba239b","timestamp":"2023-12-08T09:08:11.489Z","ttl":"PT30S"},"message":{"order_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75"}}],"support":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"support","core_version":"1.2.0","bap_id":"extweb.oyeti.com/ecommerce/ondc","bap_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","bpp_id":"ref-logistics-app-preprod.ondc.org","bpp_uri":"https://ref-logistics-app-preprod.ondc.org","transaction_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","message_id":"47f3f650-4661-425b-b68d-031efaba239b","timestamp":"2023-12-08T09:08:11.489Z","ttl":"PT30S"},"message":{"ref_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75"}}],"track":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"track","core_version":"1.2.0","bap_id":"extweb.oyeti.com/ecommerce/ondc","bap_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","bpp_id":"ref-logistics-app-preprod.ondc.org","bpp_uri":"https://ref-logistics-app-preprod.ondc.org","transaction_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","message_id":"47f3f650-4661-425b-b68d-031efaba239b","timestamp":"2023-12-08T09:08:11.489Z","ttl":"PT30S"},"message":{"order_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75"}}],"on_track":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"on_track","core_version":"1.2.0","bap_id":"extweb.oyeti.com/ecommerce/ondc","bap_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","bpp_id":"ref-logistics-app-preprod.ondc.org","bpp_uri":"https://ref-logistics-app-preprod.ondc.org","transaction_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","message_id":"47f3f650-4661-425b-b68d-031efaba239b","timestamp":"2023-12-08T09:08:11.763Z"},"message":{"tracking":{"id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","location":{"gps":"12.958766,77.625282","time":{"timestamp":"2023-12-08T09:08:11.489Z"},"updated_at":"1970-01-01T00:00:00.000Z"},"status":"active"}}}],"on_support":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"on_support","core_version":"1.2.0","bap_id":"extweb.oyeti.com/ecommerce/ondc","bap_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","bpp_id":"ref-logistics-app-preprod.ondc.org","bpp_uri":"https://ref-logistics-app-preprod.ondc.org","transaction_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","message_id":"47f3f650-4661-425b-b68d-031efaba239b","timestamp":"2023-12-08T09:08:11.785Z"},"message":{"phone":"8755555551","email":"accounts@thewitslab.com","uri":"http://t.me/supportBot"}}],"on_status":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"on_status","core_version":"1.2.0","bap_id":"extweb.oyeti.com/ecommerce/ondc","bap_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","bpp_id":"ref-logistics-app-preprod.ondc.org","bpp_uri":"https://ref-logistics-app-preprod.ondc.org","transaction_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","message_id":"47f3f650-4661-425b-b68d-031efaba239b","timestamp":"2023-12-08T09:08:39.272Z"},"message":{"order":{"id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","state":"In-progress","provider":{"id":"275b09c9-d0d9-42bb-98f1-2c4153a9d320"},"items":[{"descriptor":{"code":"P2P"},"time":{"label":"TAT","duration":"PT30M","timestamp":"2023-12-08"},"id":"Standard","fulfillment_id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","category_id":"Immediate Delivery"}],"quote":{"price":{"value":"122.38","currency":"INR"},"breakup":[{"price":{"currency":"INR","value":"116.00"},"@ondc/org/item_id":"Standard","@ondc/org/title_type":"delivery"},{"price":{"currency":"INR","value":"6.38"},"@ondc/org/item_id":"Standard","@ondc/org/title_type":"tax"}]},"fulfillments":[{"state":{"descriptor":{"code":"Pending"}},"id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","type":"Delivery","start":{"time":{"duration":"P1D"},"person":{"name":"Nandyal Chefs"},"location":{"gps":"12.9029804, 77.6241936","address":{"name":"Nandyal Chefs","building":"Bommanahalli","locality":"Bengaluru, Bangalore Division, Karnataka, India","city":"Bengaluru","state":"Karnataka","country":"India","area_code":"560068"}},"contact":{"phone":"7893847511","email":"venkateshmurapureddy@gmail.com"},"instructions":{"code":"2","short_desc":"650909","images":[]}},"end":{"person":{"name":"Venkateswara Reddy"},"location":{"gps":"12.903803216971028, 77.62518882751466","address":{"name":"Venkateswara Reddy","building":"Venky House","locality":"9th A Cross Road","city":"Bengaluru","state":"Karnataka","country":"IND","area_code":"560068"}},"contact":{"phone":"7893847511","email":"venkateshmurapureddy@gmail.com"},"instructions":{"code":"2","short_desc":"650909","images":[]}},"tracking":false}],"payment":{"type":"ON-ORDER","collected_by":"BPP","@ondc/org/collection_amount":"0","status":"PAID","@ondc/org/settlement_details":[]},"billing":{"name":"Kumar Abhishek","email":"accounts@tonetag.com","phone":"8197153537","address":{"name":"Naffa Innovations Pvt Ltd","building":"117, The Arcade, Brigade Metropolis, Garudachar Palya","locality":"Mahadevapura","city":"Bengaluru","state":"Karnataka","country":"IND","area_code":"560048"},"created_at":"2023-12-08T09:08:11.306Z","updated_at":"2023-12-08T09:08:11.306Z","tax_number":"29AAECN5025F1ZK"},"@ondc/org/linked_order":{"provider":{"descriptor":{"name":"Nandyal Chefs"},"address":{"name":"Nandyal Chefs","building":"Bommanahalli","locality":"Bengaluru, Bangalore Division, Karnataka, India","city":"Bengaluru","state":"Karnataka","country":"India","area_code":"560068"}},"order":{"weight":{"unit":"kilogram","value":3},"id":"2023-12-08-650909","dimensions":{"length":{"unit":"centimeter","value":15},"breadth":{"unit":"centimeter","value":10},"height":{"unit":"centimeter","value":10}}},"items":[{"descriptor":{"name":"Almond Filter Coffee"},"quantity":{"measure":{"value":3,"unit":"kilogram"},"count":2},"price":{"currency":"INR","value":"119.0"},"category_id":"F&B"}]}}}}],"on_cancel":[{"context":{"domain":"nic2004:60232","country":"IND","city":"std:080","action":"on_cancel","core_version":"1.2.0","bap_id":"extweb.oyeti.com/ecommerce/ondc","bap_uri":"https://extweb.oyeti.com/ecommerce/ondc/ecommerce/ondc","bpp_id":"ref-logistics-app-preprod.ondc.org","bpp_uri":"https://ref-logistics-app-preprod.ondc.org","transaction_id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","message_id":"e292631e-2f47-4af4-b767-3f03bf44ef94","timestamp":"2023-12-08T09:34:28.223Z"},"message":{"order":{"id":"6802cbf8-dbb2-4562-abda-3fc2ebef2b75","state":"Cancelled","cancellation":{"cancelled_by":"extweb.oyeti.com/ecommerce/ondc","reason":{"id":"010"}},"provider":{"id":"275b09c9-d0d9-42bb-98f1-2c4153a9d320"},"items":[{"id":"Standard","fulfillment_id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","descriptor":{"code":"P2P"},"category_id":"Immediate Delivery","time":{"label":"TAT","duration":"PT30M","timestamp":"2023-12-08"}},{"id":"rto","fulfillment_id":"9ad1e641-0ba2-4689-a25a-82f8c74671e1","descriptor":{"code":"P2P"},"category_id":"Immediate Delivery","time":{"label":"TAT","duration":"PT60M","timestamp":"2023-12-08"}}],"quote":{"price":{"value":"159.09","currency":"INR"},"breakup":[{"@ondc/org/item_id":"Standard","@ondc/org/title_type":"delivery","price":{"currency":"INR","value":"116.00"}},{"@ondc/org/item_id":"Standard","@ondc/org/title_type":"tax","price":{"currency":"INR","value":"6.38"}},{"@ondc/org/item_id":"rto","@ondc/org/title_type":"rto","price":{"currency":"INR","value":"36.71"}},{"@ondc/org/item_id":"rto","@ondc/org/title_type":"tax","price":{"currency":"INR","value":"3.67"}}]},"fulfillments":[{"id":"cc9f3061-29eb-4baf-80dd-4a4b3900c978","type":"Delivery","state":{"descriptor":{"code":"Cancelled"}},"tracking":false,"start":{"time":{"duration":"P1D","timestamp":"2023-12-08T09:18:06.524Z"},"person":{"name":"Nandyal Chefs"},"location":{"gps":"12.9029804, 77.6241936","address":{"name":"Nandyal Chefs","building":"Bommanahalli","locality":"Bengaluru, Bangalore Division, Karnataka, India","city":"Bengaluru","state":"Karnataka","country":"India","area_code":"560068"}},"contact":{"phone":"7893847511","email":"venkateshmurapureddy@gmail.com"},"instructions":{"code":"2","short_desc":"650909","images":[]}},"end":{"person":{"name":"Venkateswara Reddy"},"location":{"gps":"12.903803216971028, 77.62518882751466","address":{"name":"Venkateswara Reddy","building":"Venky House","locality":"9th A Cross Road","city":"Bengaluru","state":"Karnataka","country":"IND","area_code":"560068"}},"contact":{"phone":"7893847511","email":"venkateshmurapureddy@gmail.com"},"instructions":{"code":"2","short_desc":"650909","images":[]},"time":{"timestamp":"2023-12-08T09:19:27.742Z"}}}],"billing":{"name":"Kumar Abhishek","email":"accounts@tonetag.com","phone":"8197153537","address":{"name":"Naffa Innovations Pvt Ltd","building":"117, The Arcade, Brigade Metropolis, Garudachar Palya","locality":"Mahadevapura","city":"Bengaluru","state":"Karnataka","country":"IND","area_code":"560048"},"created_at":"2023-12-08T09:08:11.306Z","updated_at":"2023-12-08T09:08:11.306Z","tax_number":"29AAECN5025F1ZK"},"payment":{"type":"ON-ORDER","collected_by":"BPP","@ondc/org/collection_amount":"0","status":"PAID","time":{"timestamp":"2023-12-08T09:19:27.742Z"}},"@ondc/org/linked_order":{"items":[{"category_id":"F&B","descriptor":{"name":"Almond Filter Coffee"},"quantity":{"count":2,"measure":{"value":3,"unit":"kilogram"}},"price":{"currency":"INR","value":"119.0"}}],"provider":{"descriptor":{"name":"Nandyal Chefs"},"address":{"name":"Nandyal Chefs","building":"Bommanahalli","locality":"Bengaluru, Bangalore Division, Karnataka, India","city":"Bengaluru","state":"Karnataka","country":"India","area_code":"560068"}},"order":{"id":"2023-12-08-650909","weight":{"unit":"kilogram","value":3},"dimensions":{"length":{"unit":"centimeter","value":15},"breadth":{"unit":"centimeter","value":10},"height":{"unit":"centimeter","value":10}}}},"updated_at":"2023-12-08T09:34:28.223Z"}}}]} \ No newline at end of file diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_status.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_status.js index 487e02a..ecaf332 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_status.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_status.js @@ -235,9 +235,10 @@ module.exports = { type: "string", enum: [ "Pending", - "Packed", - "Agent-assigned", + "Out-for-pickup", "Order-picked-up", + "In-transit", + "At-destination-hub", "Out-for-delivery", "Order-delivered", ], @@ -327,21 +328,27 @@ module.exports = { properties: { start: { type: "string", - pattern: "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$", - errorMessage:"should be in RFC 3339 (YYYY-MM-DDTHH:MN:SS.MSSZ) Format" + pattern: + "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$", + errorMessage: + "should be in RFC 3339 (YYYY-MM-DDTHH:MN:SS.MSSZ) Format", }, end: { type: "string", - pattern: "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$", - errorMessage:"should be in RFC 3339 (YYYY-MM-DDTHH:MN:SS.MSSZ) Format" + pattern: + "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$", + errorMessage: + "should be in RFC 3339 (YYYY-MM-DDTHH:MN:SS.MSSZ) Format", }, }, required: ["start", "end"], }, timestamp: { type: "string", - pattern: "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$", - errorMessage:"should be in RFC 3339 (YYYY-MM-DDTHH:MN:SS.MSSZ) Format" + pattern: + "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$", + errorMessage: + "should be in RFC 3339 (YYYY-MM-DDTHH:MN:SS.MSSZ) Format", }, }, required: ["range"], @@ -568,7 +575,7 @@ module.exports = { }, }, isQuoteMatching: true, - + required: ["price", "breakup", "ttl"], }, payments: { @@ -753,6 +760,6 @@ module.exports = { required: ["order"], }, }, - + required: ["context", "message"], }; diff --git a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_update.js b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_update.js index 55c6645..1301497 100644 --- a/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_update.js +++ b/utilities/logistics-b2b/log-verification-utility/schema/B2B_json_schema/v2/on_update.js @@ -56,18 +56,18 @@ module.exports = { }, transaction_id: { type: "string", - const: { $data: "/select/0/context/transaction_id" }, + const: { $data: "/select/0/context/transaction_id" }, }, message_id: { type: "string", - const: { $data: "/update/0/context/message_id" }, + const: { $data: "/update/0/context/message_id" }, }, timestamp: { type: "string", format: "date-time", }, ttl: { - type: "string" + type: "string", }, }, required: [ @@ -93,22 +93,18 @@ module.exports = { properties: { id: { type: "string", - const: { $data: "/confirm/0/message/order/id" }, + const: { $data: "/confirm/0/message/order/id" }, }, state: { type: "string", - enum: [ - "Created", - "Accepted", - "In-progress" - ], + enum: ["Created", "Accepted", "In-progress"], }, provider: { type: "object", properties: { id: { type: "string", - const: { $data: "/select/0/message/order/provider/id" }, + const: { $data: "/init/0/message/order/provider/id" }, }, }, required: ["id"], @@ -178,7 +174,7 @@ module.exports = { }, collected_by: { type: "string", - enum:["BAP","BPP"] + enum: ["BAP", "BPP"], }, "@ondc/org/buyer_app_finder_fee_type": { type: "string", @@ -255,13 +251,13 @@ module.exports = { }, }, if: { properties: { type: { const: "ON-FULFILLMENT" } } }, - then: { - properties: { - collected_by: { - const: "BPP", - }, + then: { + properties: { + collected_by: { + const: "BPP", }, }, + }, required: [ "params", "status", @@ -290,7 +286,15 @@ module.exports = { properties: { code: { type: "string", - enum:["Pending","Agent-assigned","Order-picked-up","Out-for-delivery","Delivered"] + enum: [ + "Pending", + "Out-for-pickup", + "Order-picked-up", + "In-transit", + "At-destination-hub", + "Out-for-delivery", + "Order-delivered", + ], }, }, required: ["code"], @@ -374,13 +378,17 @@ module.exports = { properties: { start: { type: "string", - pattern: "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$", - errorMessage:"should be in RFC 3339 (YYYY-MM-DDTHH:MN:SS.MSSZ) Format" + pattern: + "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$", + errorMessage: + "should be in RFC 3339 (YYYY-MM-DDTHH:MN:SS.MSSZ) Format", }, end: { type: "string", - pattern: "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$", - errorMessage:"should be in RFC 3339 (YYYY-MM-DDTHH:MN:SS.MSSZ) Format" + pattern: + "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$", + errorMessage: + "should be in RFC 3339 (YYYY-MM-DDTHH:MN:SS.MSSZ) Format", }, }, required: ["start", "end"], @@ -435,7 +443,7 @@ module.exports = { properties: { code: { type: "string", - enum:["ITEM_DETAILS"] + enum: ["ITEM_DETAILS"], }, }, required: ["code"], @@ -450,7 +458,12 @@ module.exports = { properties: { code: { type: "string", - enum:["ITEM_ID","COUNT","MEASURE_UNIT","MEASURE_VALUE"] + enum: [ + "ITEM_ID", + "COUNT", + "MEASURE_UNIT", + "MEASURE_VALUE", + ], }, }, required: ["code"], @@ -472,12 +485,12 @@ module.exports = { "@ondc/org/provider_name", "state", "type", - "stops" + "stops", ], }, }, }, - + required: ["id", "state", "provider", "items"], }, },