@gofynd/fdk-client-javascript 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/documentation/application/CART.md +5934 -4502
- package/documentation/application/CATALOG.md +6338 -7245
- package/documentation/application/COMMON.md +95 -222
- package/documentation/application/COMMUNICATION.md +106 -186
- package/documentation/application/CONFIGURATION.md +903 -1597
- package/documentation/application/CONTENT.md +557 -1279
- package/documentation/application/FILESTORAGE.md +84 -220
- package/documentation/application/LEAD.md +314 -660
- package/documentation/application/LOGISTIC.md +229 -305
- package/documentation/application/ORDER.md +642 -1137
- package/documentation/application/PAYMENT.md +2285 -3031
- package/documentation/application/POSCART.md +6079 -4642
- package/documentation/application/REWARDS.md +94 -248
- package/documentation/application/SHARE.md +152 -250
- package/documentation/application/THEME.md +952 -1235
- package/documentation/application/USER.md +1228 -1765
- package/documentation/platform/ANALYTICS.md +207 -349
- package/documentation/platform/AUDITTRAIL.md +121 -204
- package/documentation/platform/BILLING.md +865 -1376
- package/documentation/platform/CART.md +2814 -3662
- package/documentation/platform/CATALOG.md +14453 -17192
- package/documentation/platform/COMMON.md +95 -222
- package/documentation/platform/COMMUNICATION.md +1632 -2380
- package/documentation/platform/COMPANYPROFILE.md +572 -957
- package/documentation/platform/CONFIGURATION.md +3050 -4073
- package/documentation/platform/CONTENT.md +3438 -4172
- package/documentation/platform/DISCOUNT.md +140 -236
- package/documentation/platform/FILESTORAGE.md +187 -323
- package/documentation/platform/INVENTORY.md +268 -911
- package/documentation/platform/LEAD.md +2195 -2541
- package/documentation/platform/ORDER.md +3400 -5361
- package/documentation/platform/PARTNER.md +9 -36
- package/documentation/platform/PAYMENT.md +903 -1213
- package/documentation/platform/REWARDS.md +183 -347
- package/documentation/platform/SHARE.md +120 -213
- package/documentation/platform/THEME.md +12956 -13239
- package/documentation/platform/USER.md +975 -1120
- package/documentation/platform/WEBHOOK.md +78 -184
- package/documentation/public/CONFIGURATION.md +95 -222
- package/documentation/public/INVENTORY.md +100 -282
- package/documentation/public/WEBHOOK.md +27 -133
- package/package.json +1 -1
- package/sdk/application/Cart/CartApplicationClient.d.ts +243 -243
- package/sdk/application/Cart/CartApplicationClient.js +567 -567
- package/sdk/application/Cart/CartApplicationModel.d.ts +64 -63
- package/sdk/application/Cart/CartApplicationModel.js +489 -886
- package/sdk/application/Cart/CartApplicationValidator.d.ts +17 -17
- package/sdk/application/Cart/CartApplicationValidator.js +98 -98
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +358 -358
- package/sdk/application/Catalog/CatalogApplicationClient.js +1036 -1036
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +90 -90
- package/sdk/application/Catalog/CatalogApplicationModel.js +677 -1243
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +19 -19
- package/sdk/application/Catalog/CatalogApplicationValidator.js +110 -110
- package/sdk/application/Common/CommonApplicationClient.d.ts +13 -13
- package/sdk/application/Common/CommonApplicationClient.js +38 -38
- package/sdk/application/Common/CommonApplicationModel.d.ts +12 -12
- package/sdk/application/Common/CommonApplicationModel.js +83 -160
- package/sdk/application/Common/CommonApplicationValidator.d.ts +1 -1
- package/sdk/application/Common/CommonApplicationValidator.js +6 -6
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +11 -11
- package/sdk/application/Communication/CommunicationApplicationClient.js +26 -26
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +6 -6
- package/sdk/application/Communication/CommunicationApplicationModel.js +38 -83
- package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +1 -1
- package/sdk/application/Communication/CommunicationApplicationValidator.js +4 -4
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +116 -116
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +330 -330
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +85 -85
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +480 -851
- package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +8 -8
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +33 -33
- package/sdk/application/Content/ContentApplicationClient.d.ts +67 -67
- package/sdk/application/Content/ContentApplicationClient.js +191 -191
- package/sdk/application/Content/ContentApplicationModel.d.ts +76 -76
- package/sdk/application/Content/ContentApplicationModel.js +467 -884
- package/sdk/application/Content/ContentApplicationValidator.d.ts +5 -5
- package/sdk/application/Content/ContentApplicationValidator.js +24 -24
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +25 -25
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +59 -59
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +13 -13
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +86 -169
- package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +1 -1
- package/sdk/application/FileStorage/FileStorageApplicationValidator.js +7 -7
- package/sdk/application/Lead/LeadApplicationClient.d.ts +24 -24
- package/sdk/application/Lead/LeadApplicationClient.js +100 -100
- package/sdk/application/Lead/LeadApplicationModel.d.ts +35 -35
- package/sdk/application/Lead/LeadApplicationModel.js +267 -474
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +2 -2
- package/sdk/application/Lead/LeadApplicationValidator.js +11 -11
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +30 -19
- package/sdk/application/Logistic/LogisticApplicationClient.js +110 -43
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +17 -14
- package/sdk/application/Logistic/LogisticApplicationModel.js +133 -201
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +3 -2
- package/sdk/application/Logistic/LogisticApplicationValidator.js +14 -8
- package/sdk/application/Order/OrderApplicationClient.d.ts +85 -85
- package/sdk/application/Order/OrderApplicationClient.js +232 -232
- package/sdk/application/Order/OrderApplicationModel.d.ts +50 -50
- package/sdk/application/Order/OrderApplicationModel.js +352 -656
- package/sdk/application/Order/OrderApplicationValidator.d.ts +7 -7
- package/sdk/application/Order/OrderApplicationValidator.js +28 -28
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +318 -318
- package/sdk/application/Payment/PaymentApplicationClient.js +739 -739
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +72 -72
- package/sdk/application/Payment/PaymentApplicationModel.js +570 -1038
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +28 -28
- package/sdk/application/Payment/PaymentApplicationValidator.js +107 -107
- package/sdk/application/PosCart/PosCartApplicationClient.d.ts +254 -254
- package/sdk/application/PosCart/PosCartApplicationClient.js +617 -617
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +64 -63
- package/sdk/application/PosCart/PosCartApplicationModel.js +475 -871
- package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +18 -18
- package/sdk/application/PosCart/PosCartApplicationValidator.js +103 -103
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +27 -27
- package/sdk/application/Rewards/RewardsApplicationClient.js +112 -112
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +14 -14
- package/sdk/application/Rewards/RewardsApplicationModel.js +96 -191
- package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +3 -3
- package/sdk/application/Rewards/RewardsApplicationValidator.js +12 -12
- package/sdk/application/Share/ShareApplicationClient.d.ts +37 -37
- package/sdk/application/Share/ShareApplicationClient.js +84 -84
- package/sdk/application/Share/ShareApplicationModel.d.ts +8 -8
- package/sdk/application/Share/ShareApplicationModel.js +63 -123
- package/sdk/application/Share/ShareApplicationValidator.d.ts +4 -4
- package/sdk/application/Share/ShareApplicationValidator.js +12 -12
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -8
- package/sdk/application/Theme/ThemeApplicationClient.js +31 -31
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +34 -34
- package/sdk/application/Theme/ThemeApplicationModel.js +190 -336
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +1 -1
- package/sdk/application/Theme/ThemeApplicationValidator.js +4 -4
- package/sdk/application/User/UserApplicationClient.d.ts +280 -280
- package/sdk/application/User/UserApplicationClient.js +581 -581
- package/sdk/application/User/UserApplicationModel.d.ts +79 -72
- package/sdk/application/User/UserApplicationModel.js +440 -689
- package/sdk/application/User/UserApplicationValidator.d.ts +24 -24
- package/sdk/application/User/UserApplicationValidator.js +89 -89
- package/sdk/common/AxiosHelper.js +1 -1
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +51 -51
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +179 -179
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +6 -6
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +20 -20
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +11 -11
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +95 -178
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +10 -10
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +41 -41
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +10 -10
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +50 -89
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +1 -1
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +6 -6
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +60 -60
- package/sdk/platform/Billing/BillingPlatformClient.js +181 -181
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +40 -40
- package/sdk/platform/Billing/BillingPlatformModel.js +342 -668
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +8 -8
- package/sdk/platform/Billing/BillingPlatformValidator.js +25 -25
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +168 -168
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +553 -553
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +11 -11
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +63 -63
- package/sdk/platform/Cart/CartPlatformModel.d.ts +84 -83
- package/sdk/platform/Cart/CartPlatformModel.js +671 -1205
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +632 -632
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1525 -1525
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +40 -40
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +174 -174
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +682 -682
- package/sdk/platform/Catalog/CatalogPlatformClient.js +1557 -1557
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +291 -291
- package/sdk/platform/Catalog/CatalogPlatformModel.js +2127 -3904
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +66 -66
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +229 -229
- package/sdk/platform/Common/CommonPlatformClient.d.ts +12 -12
- package/sdk/platform/Common/CommonPlatformClient.js +41 -41
- package/sdk/platform/Common/CommonPlatformModel.d.ts +12 -12
- package/sdk/platform/Common/CommonPlatformModel.js +83 -160
- package/sdk/platform/Common/CommonPlatformValidator.d.ts +1 -1
- package/sdk/platform/Common/CommonPlatformValidator.js +6 -6
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +326 -326
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +943 -943
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +30 -30
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +87 -87
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +67 -67
- package/sdk/platform/Communication/CommunicationPlatformModel.js +522 -974
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +55 -55
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +212 -212
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +27 -27
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +279 -542
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +7 -7
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +24 -24
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +163 -153
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +615 -552
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +22 -21
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +69 -63
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +125 -125
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +342 -342
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +148 -146
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +854 -1508
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +9 -9
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +38 -38
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +534 -534
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1324 -1324
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +50 -50
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +156 -156
- package/sdk/platform/Content/ContentPlatformModel.d.ts +78 -78
- package/sdk/platform/Content/ContentPlatformModel.js +484 -907
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +65 -65
- package/sdk/platform/Discount/DiscountPlatformClient.js +216 -216
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +7 -7
- package/sdk/platform/Discount/DiscountPlatformModel.js +60 -121
- package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +6 -6
- package/sdk/platform/Discount/DiscountPlatformValidator.js +29 -29
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +24 -24
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +58 -58
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +8 -8
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +52 -52
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +123 -123
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +13 -13
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +86 -169
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +3 -3
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +11 -11
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +63 -63
- package/sdk/platform/Inventory/InventoryPlatformClient.js +228 -228
- package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +30 -30
- package/sdk/platform/Inventory/InventoryPlatformModel.js +497 -964
- package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +7 -7
- package/sdk/platform/Inventory/InventoryPlatformValidator.js +28 -28
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +73 -73
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +200 -200
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +7 -7
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +28 -28
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +80 -80
- package/sdk/platform/Lead/LeadPlatformClient.js +212 -212
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +35 -35
- package/sdk/platform/Lead/LeadPlatformModel.js +267 -474
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +6 -6
- package/sdk/platform/Lead/LeadPlatformValidator.js +24 -24
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +10 -10
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +65 -65
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +6 -6
- package/sdk/platform/Order/OrderPlatformClient.d.ts +357 -357
- package/sdk/platform/Order/OrderPlatformClient.js +1035 -1035
- package/sdk/platform/Order/OrderPlatformModel.d.ts +198 -196
- package/sdk/platform/Order/OrderPlatformModel.js +1574 -2861
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +32 -32
- package/sdk/platform/Order/OrderPlatformValidator.js +160 -160
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -1
- package/sdk/platform/Partner/PartnerPlatformModel.js +10 -26
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +57 -57
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +167 -167
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +6 -6
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +23 -23
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +42 -42
- package/sdk/platform/Payment/PaymentPlatformClient.js +153 -153
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +27 -27
- package/sdk/platform/Payment/PaymentPlatformModel.js +222 -410
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +4 -4
- package/sdk/platform/Payment/PaymentPlatformValidator.js +21 -21
- package/sdk/platform/PlatformApplicationClient.d.ts +1496 -10325
- package/sdk/platform/PlatformApplicationClient.js +1584 -13899
- package/sdk/platform/PlatformClient.d.ts +7965 -7885
- package/sdk/platform/PlatformClient.js +8672 -10105
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +83 -83
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +275 -275
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +8 -8
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +34 -34
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +15 -15
- package/sdk/platform/Rewards/RewardsPlatformModel.js +92 -194
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +10 -10
- package/sdk/platform/Share/SharePlatformApplicationClient.js +59 -59
- package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +6 -6
- package/sdk/platform/Share/SharePlatformModel.d.ts +8 -8
- package/sdk/platform/Share/SharePlatformModel.js +60 -118
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +132 -132
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +310 -310
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +15 -15
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +44 -44
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +34 -34
- package/sdk/platform/Theme/ThemePlatformModel.js +190 -336
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +136 -69
- package/sdk/platform/User/UserPlatformApplicationClient.js +505 -166
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +12 -7
- package/sdk/platform/User/UserPlatformApplicationValidator.js +61 -23
- package/sdk/platform/User/UserPlatformModel.d.ts +79 -72
- package/sdk/platform/User/UserPlatformModel.js +440 -689
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +31 -31
- package/sdk/platform/Webhook/WebhookPlatformClient.js +88 -88
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +7 -7
- package/sdk/platform/Webhook/WebhookPlatformModel.js +68 -136
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +3 -3
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +14 -14
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +13 -13
- package/sdk/public/Configuration/ConfigurationPublicClient.js +38 -38
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +12 -12
- package/sdk/public/Configuration/ConfigurationPublicModel.js +85 -162
- package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +1 -1
- package/sdk/public/Configuration/ConfigurationPublicValidator.js +6 -6
- package/sdk/public/Inventory/InventoryPublicClient.d.ts +34 -34
- package/sdk/public/Inventory/InventoryPublicClient.js +113 -113
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +10 -10
- package/sdk/public/Inventory/InventoryPublicModel.js +119 -245
- package/sdk/public/Inventory/InventoryPublicValidator.d.ts +3 -3
- package/sdk/public/Inventory/InventoryPublicValidator.js +15 -15
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +7 -7
- package/sdk/public/Webhook/WebhookPublicModel.js +68 -136
- package/tests/application/catalog.spec.js +7 -0
|
@@ -12,86 +12,15 @@ class Order {
|
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* @param {Object} arg - Arg object.
|
|
15
|
-
* @param {string}
|
|
16
|
-
* @
|
|
17
|
-
* @
|
|
18
|
-
* @
|
|
19
|
-
* @param {string} [arg.searchValue] -
|
|
20
|
-
* @param {string} [arg.searchId] -
|
|
21
|
-
* @param {string} [arg.fromDate] -
|
|
22
|
-
* @param {string} [arg.toDate] -
|
|
23
|
-
* @param {string} [arg.dpIds] -
|
|
24
|
-
* @param {string} [arg.orderingCompanyId] -
|
|
25
|
-
* @param {string} [arg.stores] -
|
|
26
|
-
* @param {string} [arg.salesChannel] -
|
|
27
|
-
* @param {string} [arg.requestByExt] -
|
|
28
|
-
* @param {number} [arg.pageNo] -
|
|
29
|
-
* @param {number} [arg.pageSize] -
|
|
30
|
-
* @param {boolean} [arg.isPrioritySort] -
|
|
31
|
-
* @param {boolean} [arg.fetchActiveShipment] -
|
|
32
|
-
* @param {boolean} [arg.excludeLockedShipments] -
|
|
33
|
-
* @param {string} [arg.paymentMethods] -
|
|
34
|
-
* @param {string} [arg.channelShipmentId] -
|
|
35
|
-
* @param {string} [arg.channelOrderId] -
|
|
36
|
-
* @param {string} [arg.customMeta] -
|
|
37
|
-
* @param {string} [arg.orderingChannel] -
|
|
38
|
-
* @param {string} [arg.companyAffiliateTag] -
|
|
39
|
-
* @returns {Promise<ShipmentInternalPlatformViewResponse>} - Success response
|
|
40
|
-
* @summary:
|
|
41
|
-
* @description:
|
|
15
|
+
* @param {string} arg.batchId -
|
|
16
|
+
* @returns {Promise<BulkActionDetailsResponse>} - Success response
|
|
17
|
+
* @summary: Returns failed, processing and successfully processed shipments.
|
|
18
|
+
* @description: Returns failed, processing and successfully processed shipments along with their counts and failed reasons.
|
|
42
19
|
*/
|
|
43
|
-
async
|
|
44
|
-
|
|
45
|
-
bagStatus,
|
|
46
|
-
statusOverrideLane,
|
|
47
|
-
searchType,
|
|
48
|
-
searchValue,
|
|
49
|
-
searchId,
|
|
50
|
-
fromDate,
|
|
51
|
-
toDate,
|
|
52
|
-
dpIds,
|
|
53
|
-
orderingCompanyId,
|
|
54
|
-
stores,
|
|
55
|
-
salesChannel,
|
|
56
|
-
requestByExt,
|
|
57
|
-
pageNo,
|
|
58
|
-
pageSize,
|
|
59
|
-
isPrioritySort,
|
|
60
|
-
fetchActiveShipment,
|
|
61
|
-
excludeLockedShipments,
|
|
62
|
-
paymentMethods,
|
|
63
|
-
channelShipmentId,
|
|
64
|
-
channelOrderId,
|
|
65
|
-
customMeta,
|
|
66
|
-
orderingChannel,
|
|
67
|
-
companyAffiliateTag,
|
|
68
|
-
} = {}) {
|
|
69
|
-
const { error } = OrderValidator.getShipments().validate(
|
|
20
|
+
async bulkActionDetails({ batchId } = {}) {
|
|
21
|
+
const { error } = OrderValidator.bulkActionDetails().validate(
|
|
70
22
|
{
|
|
71
|
-
|
|
72
|
-
bagStatus,
|
|
73
|
-
statusOverrideLane,
|
|
74
|
-
searchType,
|
|
75
|
-
searchValue,
|
|
76
|
-
searchId,
|
|
77
|
-
fromDate,
|
|
78
|
-
toDate,
|
|
79
|
-
dpIds,
|
|
80
|
-
orderingCompanyId,
|
|
81
|
-
stores,
|
|
82
|
-
salesChannel,
|
|
83
|
-
requestByExt,
|
|
84
|
-
pageNo,
|
|
85
|
-
pageSize,
|
|
86
|
-
isPrioritySort,
|
|
87
|
-
fetchActiveShipment,
|
|
88
|
-
excludeLockedShipments,
|
|
89
|
-
paymentMethods,
|
|
90
|
-
channelShipmentId,
|
|
91
|
-
channelOrderId,
|
|
92
|
-
customMeta,
|
|
93
|
-
orderingChannel,
|
|
94
|
-
companyAffiliateTag,
|
|
23
|
+
batchId,
|
|
95
24
|
},
|
|
96
25
|
{ abortEarly: false, allowUnknown: true }
|
|
97
26
|
);
|
|
@@ -100,75 +29,28 @@ class Order {
|
|
|
100
29
|
}
|
|
101
30
|
|
|
102
31
|
// Showing warrnings if extra unknown parameters are found
|
|
103
|
-
const { error: warrning } = OrderValidator.
|
|
32
|
+
const { error: warrning } = OrderValidator.bulkActionDetails().validate(
|
|
104
33
|
{
|
|
105
|
-
|
|
106
|
-
bagStatus,
|
|
107
|
-
statusOverrideLane,
|
|
108
|
-
searchType,
|
|
109
|
-
searchValue,
|
|
110
|
-
searchId,
|
|
111
|
-
fromDate,
|
|
112
|
-
toDate,
|
|
113
|
-
dpIds,
|
|
114
|
-
orderingCompanyId,
|
|
115
|
-
stores,
|
|
116
|
-
salesChannel,
|
|
117
|
-
requestByExt,
|
|
118
|
-
pageNo,
|
|
119
|
-
pageSize,
|
|
120
|
-
isPrioritySort,
|
|
121
|
-
fetchActiveShipment,
|
|
122
|
-
excludeLockedShipments,
|
|
123
|
-
paymentMethods,
|
|
124
|
-
channelShipmentId,
|
|
125
|
-
channelOrderId,
|
|
126
|
-
customMeta,
|
|
127
|
-
orderingChannel,
|
|
128
|
-
companyAffiliateTag,
|
|
34
|
+
batchId,
|
|
129
35
|
},
|
|
130
36
|
{ abortEarly: false, allowUnknown: false }
|
|
131
37
|
);
|
|
132
38
|
if (warrning) {
|
|
133
39
|
Logger({
|
|
134
40
|
level: "WARN",
|
|
135
|
-
message: "Parameter Validation warrnings for
|
|
41
|
+
message: "Parameter Validation warrnings for bulkActionDetails",
|
|
136
42
|
});
|
|
137
43
|
Logger({ level: "WARN", message: warrning });
|
|
138
44
|
}
|
|
139
45
|
|
|
140
46
|
const query_params = {};
|
|
141
|
-
query_params["lane"] = lane;
|
|
142
|
-
query_params["bag_status"] = bagStatus;
|
|
143
|
-
query_params["status_override_lane"] = statusOverrideLane;
|
|
144
|
-
query_params["search_type"] = searchType;
|
|
145
|
-
query_params["search_value"] = searchValue;
|
|
146
|
-
query_params["search_id"] = searchId;
|
|
147
|
-
query_params["from_date"] = fromDate;
|
|
148
|
-
query_params["to_date"] = toDate;
|
|
149
|
-
query_params["dp_ids"] = dpIds;
|
|
150
|
-
query_params["ordering_company_id"] = orderingCompanyId;
|
|
151
|
-
query_params["stores"] = stores;
|
|
152
|
-
query_params["sales_channel"] = salesChannel;
|
|
153
|
-
query_params["request_by_ext"] = requestByExt;
|
|
154
|
-
query_params["page_no"] = pageNo;
|
|
155
|
-
query_params["page_size"] = pageSize;
|
|
156
|
-
query_params["is_priority_sort"] = isPrioritySort;
|
|
157
|
-
query_params["fetch_active_shipment"] = fetchActiveShipment;
|
|
158
|
-
query_params["exclude_locked_shipments"] = excludeLockedShipments;
|
|
159
|
-
query_params["payment_methods"] = paymentMethods;
|
|
160
|
-
query_params["channel_shipment_id"] = channelShipmentId;
|
|
161
|
-
query_params["channel_order_id"] = channelOrderId;
|
|
162
|
-
query_params["custom_meta"] = customMeta;
|
|
163
|
-
query_params["ordering_channel"] = orderingChannel;
|
|
164
|
-
query_params["company_affiliate_tag"] = companyAffiliateTag;
|
|
165
47
|
|
|
166
48
|
const xHeaders = {};
|
|
167
49
|
|
|
168
50
|
const response = await PlatformAPIClient.execute(
|
|
169
51
|
this.config,
|
|
170
52
|
"get",
|
|
171
|
-
`/service/platform/orders/
|
|
53
|
+
`/service/platform/orders/v2.0/company/${this.config.companyId}/bulk-action/${batchId}`,
|
|
172
54
|
query_params,
|
|
173
55
|
undefined,
|
|
174
56
|
xHeaders
|
|
@@ -176,7 +58,7 @@ class Order {
|
|
|
176
58
|
|
|
177
59
|
const {
|
|
178
60
|
error: res_error,
|
|
179
|
-
} = OrderModel.
|
|
61
|
+
} = OrderModel.BulkActionDetailsResponse().validate(response, {
|
|
180
62
|
abortEarly: false,
|
|
181
63
|
allowUnknown: false,
|
|
182
64
|
});
|
|
@@ -184,7 +66,7 @@ class Order {
|
|
|
184
66
|
if (res_error) {
|
|
185
67
|
Logger({
|
|
186
68
|
level: "WARN",
|
|
187
|
-
message: "Response Validation Warnnings for
|
|
69
|
+
message: "Response Validation Warnnings for bulkActionDetails",
|
|
188
70
|
});
|
|
189
71
|
Logger({ level: "WARN", message: res_error });
|
|
190
72
|
}
|
|
@@ -194,26 +76,15 @@ class Order {
|
|
|
194
76
|
|
|
195
77
|
/**
|
|
196
78
|
* @param {Object} arg - Arg object.
|
|
197
|
-
* @param {
|
|
198
|
-
* @
|
|
199
|
-
* @
|
|
200
|
-
* @
|
|
201
|
-
* @returns {Promise<ShipmentInfoResponse>} - Success response
|
|
202
|
-
* @summary:
|
|
203
|
-
* @description:
|
|
79
|
+
* @param {BulkActionPayload} arg.body
|
|
80
|
+
* @returns {Promise<BulkActionResponse>} - Success response
|
|
81
|
+
* @summary: emits uuid to kafka topic.
|
|
82
|
+
* @description: Use this API to start processing Xlsx file.
|
|
204
83
|
*/
|
|
205
|
-
async
|
|
206
|
-
|
|
207
|
-
shipmentId,
|
|
208
|
-
orderingCompanyId,
|
|
209
|
-
requestByExt,
|
|
210
|
-
} = {}) {
|
|
211
|
-
const { error } = OrderValidator.getShipmentById().validate(
|
|
84
|
+
async bulkActionProcessXlsxFile({ body } = {}) {
|
|
85
|
+
const { error } = OrderValidator.bulkActionProcessXlsxFile().validate(
|
|
212
86
|
{
|
|
213
|
-
|
|
214
|
-
shipmentId,
|
|
215
|
-
orderingCompanyId,
|
|
216
|
-
requestByExt,
|
|
87
|
+
body,
|
|
217
88
|
},
|
|
218
89
|
{ abortEarly: false, allowUnknown: true }
|
|
219
90
|
);
|
|
@@ -222,43 +93,38 @@ class Order {
|
|
|
222
93
|
}
|
|
223
94
|
|
|
224
95
|
// Showing warrnings if extra unknown parameters are found
|
|
225
|
-
const {
|
|
96
|
+
const {
|
|
97
|
+
error: warrning,
|
|
98
|
+
} = OrderValidator.bulkActionProcessXlsxFile().validate(
|
|
226
99
|
{
|
|
227
|
-
|
|
228
|
-
shipmentId,
|
|
229
|
-
orderingCompanyId,
|
|
230
|
-
requestByExt,
|
|
100
|
+
body,
|
|
231
101
|
},
|
|
232
102
|
{ abortEarly: false, allowUnknown: false }
|
|
233
103
|
);
|
|
234
104
|
if (warrning) {
|
|
235
105
|
Logger({
|
|
236
106
|
level: "WARN",
|
|
237
|
-
message: "Parameter Validation warrnings for
|
|
107
|
+
message: "Parameter Validation warrnings for bulkActionProcessXlsxFile",
|
|
238
108
|
});
|
|
239
109
|
Logger({ level: "WARN", message: warrning });
|
|
240
110
|
}
|
|
241
111
|
|
|
242
112
|
const query_params = {};
|
|
243
|
-
query_params["channel_shipment_id"] = channelShipmentId;
|
|
244
|
-
query_params["shipment_id"] = shipmentId;
|
|
245
|
-
query_params["ordering_company_id"] = orderingCompanyId;
|
|
246
|
-
query_params["request_by_ext"] = requestByExt;
|
|
247
113
|
|
|
248
114
|
const xHeaders = {};
|
|
249
115
|
|
|
250
116
|
const response = await PlatformAPIClient.execute(
|
|
251
117
|
this.config,
|
|
252
|
-
"
|
|
253
|
-
`/service/platform/orders/
|
|
118
|
+
"post",
|
|
119
|
+
`/service/platform/orders/v2.0/company/${this.config.companyId}/bulk-action/`,
|
|
254
120
|
query_params,
|
|
255
|
-
|
|
121
|
+
body,
|
|
256
122
|
xHeaders
|
|
257
123
|
);
|
|
258
124
|
|
|
259
125
|
const {
|
|
260
126
|
error: res_error,
|
|
261
|
-
} = OrderModel.
|
|
127
|
+
} = OrderModel.BulkActionResponse().validate(response, {
|
|
262
128
|
abortEarly: false,
|
|
263
129
|
allowUnknown: false,
|
|
264
130
|
});
|
|
@@ -266,7 +132,7 @@ class Order {
|
|
|
266
132
|
if (res_error) {
|
|
267
133
|
Logger({
|
|
268
134
|
level: "WARN",
|
|
269
|
-
message: "Response Validation Warnnings for
|
|
135
|
+
message: "Response Validation Warnnings for bulkActionProcessXlsxFile",
|
|
270
136
|
});
|
|
271
137
|
Logger({ level: "WARN", message: res_error });
|
|
272
138
|
}
|
|
@@ -276,15 +142,15 @@ class Order {
|
|
|
276
142
|
|
|
277
143
|
/**
|
|
278
144
|
* @param {Object} arg - Arg object.
|
|
279
|
-
* @param {
|
|
280
|
-
* @returns {Promise<
|
|
145
|
+
* @param {OrderStatus} arg.body
|
|
146
|
+
* @returns {Promise<OrderStatusResult>} - Success response
|
|
281
147
|
* @summary:
|
|
282
148
|
* @description:
|
|
283
149
|
*/
|
|
284
|
-
async
|
|
285
|
-
const { error } = OrderValidator.
|
|
150
|
+
async checkOrderStatus({ body } = {}) {
|
|
151
|
+
const { error } = OrderValidator.checkOrderStatus().validate(
|
|
286
152
|
{
|
|
287
|
-
|
|
153
|
+
body,
|
|
288
154
|
},
|
|
289
155
|
{ abortEarly: false, allowUnknown: true }
|
|
290
156
|
);
|
|
@@ -293,37 +159,36 @@ class Order {
|
|
|
293
159
|
}
|
|
294
160
|
|
|
295
161
|
// Showing warrnings if extra unknown parameters are found
|
|
296
|
-
const { error: warrning } = OrderValidator.
|
|
162
|
+
const { error: warrning } = OrderValidator.checkOrderStatus().validate(
|
|
297
163
|
{
|
|
298
|
-
|
|
164
|
+
body,
|
|
299
165
|
},
|
|
300
166
|
{ abortEarly: false, allowUnknown: false }
|
|
301
167
|
);
|
|
302
168
|
if (warrning) {
|
|
303
169
|
Logger({
|
|
304
170
|
level: "WARN",
|
|
305
|
-
message: "Parameter Validation warrnings for
|
|
171
|
+
message: "Parameter Validation warrnings for checkOrderStatus",
|
|
306
172
|
});
|
|
307
173
|
Logger({ level: "WARN", message: warrning });
|
|
308
174
|
}
|
|
309
175
|
|
|
310
176
|
const query_params = {};
|
|
311
|
-
query_params["order_id"] = orderId;
|
|
312
177
|
|
|
313
178
|
const xHeaders = {};
|
|
314
179
|
|
|
315
180
|
const response = await PlatformAPIClient.execute(
|
|
316
181
|
this.config,
|
|
317
|
-
"
|
|
318
|
-
`/service/platform/
|
|
182
|
+
"post",
|
|
183
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/debug/order_status`,
|
|
319
184
|
query_params,
|
|
320
|
-
|
|
185
|
+
body,
|
|
321
186
|
xHeaders
|
|
322
187
|
);
|
|
323
188
|
|
|
324
189
|
const {
|
|
325
190
|
error: res_error,
|
|
326
|
-
} = OrderModel.
|
|
191
|
+
} = OrderModel.OrderStatusResult().validate(response, {
|
|
327
192
|
abortEarly: false,
|
|
328
193
|
allowUnknown: false,
|
|
329
194
|
});
|
|
@@ -331,7 +196,7 @@ class Order {
|
|
|
331
196
|
if (res_error) {
|
|
332
197
|
Logger({
|
|
333
198
|
level: "WARN",
|
|
334
|
-
message: "Response Validation Warnnings for
|
|
199
|
+
message: "Response Validation Warnnings for checkOrderStatus",
|
|
335
200
|
});
|
|
336
201
|
Logger({ level: "WARN", message: res_error });
|
|
337
202
|
}
|
|
@@ -341,41 +206,23 @@ class Order {
|
|
|
341
206
|
|
|
342
207
|
/**
|
|
343
208
|
* @param {Object} arg - Arg object.
|
|
344
|
-
* @param {string}
|
|
345
|
-
* @param {string}
|
|
346
|
-
* @param {string}
|
|
347
|
-
* @param {string} [arg.
|
|
348
|
-
* @param {string} [arg.
|
|
349
|
-
* @
|
|
350
|
-
* @param {string} [arg.salesChannel] -
|
|
351
|
-
* @param {string} [arg.paymentMode] -
|
|
352
|
-
* @param {string} [arg.bagStatus] -
|
|
353
|
-
* @returns {Promise<LaneConfigResponse>} - Success response
|
|
209
|
+
* @param {string} arg.caller -
|
|
210
|
+
* @param {string} arg.receiver -
|
|
211
|
+
* @param {string} arg.bagId -
|
|
212
|
+
* @param {string} [arg.callingTo] -
|
|
213
|
+
* @param {string} [arg.callerId] -
|
|
214
|
+
* @returns {Promise<Click2CallResponse>} - Success response
|
|
354
215
|
* @summary:
|
|
355
216
|
* @description:
|
|
356
217
|
*/
|
|
357
|
-
async
|
|
358
|
-
|
|
359
|
-
groupEntity,
|
|
360
|
-
fromDate,
|
|
361
|
-
toDate,
|
|
362
|
-
dpIds,
|
|
363
|
-
stores,
|
|
364
|
-
salesChannel,
|
|
365
|
-
paymentMode,
|
|
366
|
-
bagStatus,
|
|
367
|
-
} = {}) {
|
|
368
|
-
const { error } = OrderValidator.getLaneConfig().validate(
|
|
218
|
+
async click2Call({ caller, receiver, bagId, callingTo, callerId } = {}) {
|
|
219
|
+
const { error } = OrderValidator.click2Call().validate(
|
|
369
220
|
{
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
stores,
|
|
376
|
-
salesChannel,
|
|
377
|
-
paymentMode,
|
|
378
|
-
bagStatus,
|
|
221
|
+
caller,
|
|
222
|
+
receiver,
|
|
223
|
+
bagId,
|
|
224
|
+
callingTo,
|
|
225
|
+
callerId,
|
|
379
226
|
},
|
|
380
227
|
{ abortEarly: false, allowUnknown: true }
|
|
381
228
|
);
|
|
@@ -384,45 +231,37 @@ class Order {
|
|
|
384
231
|
}
|
|
385
232
|
|
|
386
233
|
// Showing warrnings if extra unknown parameters are found
|
|
387
|
-
const { error: warrning } = OrderValidator.
|
|
234
|
+
const { error: warrning } = OrderValidator.click2Call().validate(
|
|
388
235
|
{
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
stores,
|
|
395
|
-
salesChannel,
|
|
396
|
-
paymentMode,
|
|
397
|
-
bagStatus,
|
|
236
|
+
caller,
|
|
237
|
+
receiver,
|
|
238
|
+
bagId,
|
|
239
|
+
callingTo,
|
|
240
|
+
callerId,
|
|
398
241
|
},
|
|
399
242
|
{ abortEarly: false, allowUnknown: false }
|
|
400
243
|
);
|
|
401
244
|
if (warrning) {
|
|
402
245
|
Logger({
|
|
403
246
|
level: "WARN",
|
|
404
|
-
message: "Parameter Validation warrnings for
|
|
247
|
+
message: "Parameter Validation warrnings for click2Call",
|
|
405
248
|
});
|
|
406
249
|
Logger({ level: "WARN", message: warrning });
|
|
407
250
|
}
|
|
408
251
|
|
|
409
252
|
const query_params = {};
|
|
410
|
-
query_params["
|
|
411
|
-
query_params["
|
|
412
|
-
query_params["
|
|
413
|
-
query_params["
|
|
414
|
-
query_params["
|
|
415
|
-
query_params["stores"] = stores;
|
|
416
|
-
query_params["sales_channel"] = salesChannel;
|
|
417
|
-
query_params["payment_mode"] = paymentMode;
|
|
418
|
-
query_params["bag_status"] = bagStatus;
|
|
253
|
+
query_params["caller"] = caller;
|
|
254
|
+
query_params["receiver"] = receiver;
|
|
255
|
+
query_params["bag_id"] = bagId;
|
|
256
|
+
query_params["calling_to"] = callingTo;
|
|
257
|
+
query_params["caller_id"] = callerId;
|
|
419
258
|
|
|
420
259
|
const xHeaders = {};
|
|
421
260
|
|
|
422
261
|
const response = await PlatformAPIClient.execute(
|
|
423
262
|
this.config,
|
|
424
263
|
"get",
|
|
425
|
-
`/service/platform/
|
|
264
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/ninja/click2call`,
|
|
426
265
|
query_params,
|
|
427
266
|
undefined,
|
|
428
267
|
xHeaders
|
|
@@ -430,7 +269,7 @@ class Order {
|
|
|
430
269
|
|
|
431
270
|
const {
|
|
432
271
|
error: res_error,
|
|
433
|
-
} = OrderModel.
|
|
272
|
+
} = OrderModel.Click2CallResponse().validate(response, {
|
|
434
273
|
abortEarly: false,
|
|
435
274
|
allowUnknown: false,
|
|
436
275
|
});
|
|
@@ -438,7 +277,7 @@ class Order {
|
|
|
438
277
|
if (res_error) {
|
|
439
278
|
Logger({
|
|
440
279
|
level: "WARN",
|
|
441
|
-
message: "Response Validation Warnnings for
|
|
280
|
+
message: "Response Validation Warnnings for click2Call",
|
|
442
281
|
});
|
|
443
282
|
Logger({ level: "WARN", message: res_error });
|
|
444
283
|
}
|
|
@@ -448,62 +287,15 @@ class Order {
|
|
|
448
287
|
|
|
449
288
|
/**
|
|
450
289
|
* @param {Object} arg - Arg object.
|
|
451
|
-
* @param {
|
|
452
|
-
* @
|
|
453
|
-
* @param {string} [arg.bagStatus] -
|
|
454
|
-
* @param {string} [arg.timeToDispatch] -
|
|
455
|
-
* @param {string} [arg.paymentMethods] -
|
|
456
|
-
* @param {string} [arg.tags] -
|
|
457
|
-
* @param {string} [arg.searchValue] -
|
|
458
|
-
* @param {string} [arg.fromDate] -
|
|
459
|
-
* @param {string} [arg.toDate] -
|
|
460
|
-
* @param {string} [arg.dpIds] -
|
|
461
|
-
* @param {string} [arg.stores] -
|
|
462
|
-
* @param {string} [arg.salesChannel] -
|
|
463
|
-
* @param {number} [arg.pageNo] -
|
|
464
|
-
* @param {number} [arg.pageSize] -
|
|
465
|
-
* @param {boolean} [arg.isPrioritySort] -
|
|
466
|
-
* @param {string} [arg.customMeta] -
|
|
467
|
-
* @returns {Promise<OrderListingResponse>} - Success response
|
|
290
|
+
* @param {CreateChannelConfigData} arg.body
|
|
291
|
+
* @returns {Promise<CreateChannelConfigResponse>} - Success response
|
|
468
292
|
* @summary:
|
|
469
|
-
* @description:
|
|
293
|
+
* @description: createChannelConfig
|
|
470
294
|
*/
|
|
471
|
-
async
|
|
472
|
-
|
|
473
|
-
searchType,
|
|
474
|
-
bagStatus,
|
|
475
|
-
timeToDispatch,
|
|
476
|
-
paymentMethods,
|
|
477
|
-
tags,
|
|
478
|
-
searchValue,
|
|
479
|
-
fromDate,
|
|
480
|
-
toDate,
|
|
481
|
-
dpIds,
|
|
482
|
-
stores,
|
|
483
|
-
salesChannel,
|
|
484
|
-
pageNo,
|
|
485
|
-
pageSize,
|
|
486
|
-
isPrioritySort,
|
|
487
|
-
customMeta,
|
|
488
|
-
} = {}) {
|
|
489
|
-
const { error } = OrderValidator.getOrders().validate(
|
|
295
|
+
async createChannelConfig({ body } = {}) {
|
|
296
|
+
const { error } = OrderValidator.createChannelConfig().validate(
|
|
490
297
|
{
|
|
491
|
-
|
|
492
|
-
searchType,
|
|
493
|
-
bagStatus,
|
|
494
|
-
timeToDispatch,
|
|
495
|
-
paymentMethods,
|
|
496
|
-
tags,
|
|
497
|
-
searchValue,
|
|
498
|
-
fromDate,
|
|
499
|
-
toDate,
|
|
500
|
-
dpIds,
|
|
501
|
-
stores,
|
|
502
|
-
salesChannel,
|
|
503
|
-
pageNo,
|
|
504
|
-
pageSize,
|
|
505
|
-
isPrioritySort,
|
|
506
|
-
customMeta,
|
|
298
|
+
body,
|
|
507
299
|
},
|
|
508
300
|
{ abortEarly: false, allowUnknown: true }
|
|
509
301
|
);
|
|
@@ -512,67 +304,36 @@ class Order {
|
|
|
512
304
|
}
|
|
513
305
|
|
|
514
306
|
// Showing warrnings if extra unknown parameters are found
|
|
515
|
-
const { error: warrning } = OrderValidator.
|
|
307
|
+
const { error: warrning } = OrderValidator.createChannelConfig().validate(
|
|
516
308
|
{
|
|
517
|
-
|
|
518
|
-
searchType,
|
|
519
|
-
bagStatus,
|
|
520
|
-
timeToDispatch,
|
|
521
|
-
paymentMethods,
|
|
522
|
-
tags,
|
|
523
|
-
searchValue,
|
|
524
|
-
fromDate,
|
|
525
|
-
toDate,
|
|
526
|
-
dpIds,
|
|
527
|
-
stores,
|
|
528
|
-
salesChannel,
|
|
529
|
-
pageNo,
|
|
530
|
-
pageSize,
|
|
531
|
-
isPrioritySort,
|
|
532
|
-
customMeta,
|
|
309
|
+
body,
|
|
533
310
|
},
|
|
534
311
|
{ abortEarly: false, allowUnknown: false }
|
|
535
312
|
);
|
|
536
313
|
if (warrning) {
|
|
537
314
|
Logger({
|
|
538
315
|
level: "WARN",
|
|
539
|
-
message: "Parameter Validation warrnings for
|
|
316
|
+
message: "Parameter Validation warrnings for createChannelConfig",
|
|
540
317
|
});
|
|
541
318
|
Logger({ level: "WARN", message: warrning });
|
|
542
319
|
}
|
|
543
320
|
|
|
544
321
|
const query_params = {};
|
|
545
|
-
query_params["lane"] = lane;
|
|
546
|
-
query_params["search_type"] = searchType;
|
|
547
|
-
query_params["bag_status"] = bagStatus;
|
|
548
|
-
query_params["time_to_dispatch"] = timeToDispatch;
|
|
549
|
-
query_params["payment_methods"] = paymentMethods;
|
|
550
|
-
query_params["tags"] = tags;
|
|
551
|
-
query_params["search_value"] = searchValue;
|
|
552
|
-
query_params["from_date"] = fromDate;
|
|
553
|
-
query_params["to_date"] = toDate;
|
|
554
|
-
query_params["dp_ids"] = dpIds;
|
|
555
|
-
query_params["stores"] = stores;
|
|
556
|
-
query_params["sales_channel"] = salesChannel;
|
|
557
|
-
query_params["page_no"] = pageNo;
|
|
558
|
-
query_params["page_size"] = pageSize;
|
|
559
|
-
query_params["is_priority_sort"] = isPrioritySort;
|
|
560
|
-
query_params["custom_meta"] = customMeta;
|
|
561
322
|
|
|
562
323
|
const xHeaders = {};
|
|
563
324
|
|
|
564
325
|
const response = await PlatformAPIClient.execute(
|
|
565
326
|
this.config,
|
|
566
|
-
"
|
|
567
|
-
`/service/platform/
|
|
327
|
+
"post",
|
|
328
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/order-config`,
|
|
568
329
|
query_params,
|
|
569
|
-
|
|
330
|
+
body,
|
|
570
331
|
xHeaders
|
|
571
332
|
);
|
|
572
333
|
|
|
573
334
|
const {
|
|
574
335
|
error: res_error,
|
|
575
|
-
} = OrderModel.
|
|
336
|
+
} = OrderModel.CreateChannelConfigResponse().validate(response, {
|
|
576
337
|
abortEarly: false,
|
|
577
338
|
allowUnknown: false,
|
|
578
339
|
});
|
|
@@ -580,7 +341,7 @@ class Order {
|
|
|
580
341
|
if (res_error) {
|
|
581
342
|
Logger({
|
|
582
343
|
level: "WARN",
|
|
583
|
-
message: "Response Validation Warnnings for
|
|
344
|
+
message: "Response Validation Warnnings for createChannelConfig",
|
|
584
345
|
});
|
|
585
346
|
Logger({ level: "WARN", message: res_error });
|
|
586
347
|
}
|
|
@@ -590,17 +351,15 @@ class Order {
|
|
|
590
351
|
|
|
591
352
|
/**
|
|
592
353
|
* @param {Object} arg - Arg object.
|
|
593
|
-
* @param {
|
|
594
|
-
* @
|
|
595
|
-
* @returns {Promise<MetricCountResponse>} - Success response
|
|
354
|
+
* @param {CreateOrderAPI} arg.body
|
|
355
|
+
* @returns {Promise<CreateOrderResponse>} - Success response
|
|
596
356
|
* @summary:
|
|
597
357
|
* @description:
|
|
598
358
|
*/
|
|
599
|
-
async
|
|
600
|
-
const { error } = OrderValidator.
|
|
359
|
+
async createOrder({ body } = {}) {
|
|
360
|
+
const { error } = OrderValidator.createOrder().validate(
|
|
601
361
|
{
|
|
602
|
-
|
|
603
|
-
toDate,
|
|
362
|
+
body,
|
|
604
363
|
},
|
|
605
364
|
{ abortEarly: false, allowUnknown: true }
|
|
606
365
|
);
|
|
@@ -609,39 +368,36 @@ class Order {
|
|
|
609
368
|
}
|
|
610
369
|
|
|
611
370
|
// Showing warrnings if extra unknown parameters are found
|
|
612
|
-
const { error: warrning } = OrderValidator.
|
|
371
|
+
const { error: warrning } = OrderValidator.createOrder().validate(
|
|
613
372
|
{
|
|
614
|
-
|
|
615
|
-
toDate,
|
|
373
|
+
body,
|
|
616
374
|
},
|
|
617
375
|
{ abortEarly: false, allowUnknown: false }
|
|
618
376
|
);
|
|
619
377
|
if (warrning) {
|
|
620
378
|
Logger({
|
|
621
379
|
level: "WARN",
|
|
622
|
-
message: "Parameter Validation warrnings for
|
|
380
|
+
message: "Parameter Validation warrnings for createOrder",
|
|
623
381
|
});
|
|
624
382
|
Logger({ level: "WARN", message: warrning });
|
|
625
383
|
}
|
|
626
384
|
|
|
627
385
|
const query_params = {};
|
|
628
|
-
query_params["from_date"] = fromDate;
|
|
629
|
-
query_params["to_date"] = toDate;
|
|
630
386
|
|
|
631
387
|
const xHeaders = {};
|
|
632
388
|
|
|
633
389
|
const response = await PlatformAPIClient.execute(
|
|
634
390
|
this.config,
|
|
635
|
-
"
|
|
636
|
-
`/service/platform/
|
|
391
|
+
"post",
|
|
392
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/create-order`,
|
|
637
393
|
query_params,
|
|
638
|
-
|
|
394
|
+
body,
|
|
639
395
|
xHeaders
|
|
640
396
|
);
|
|
641
397
|
|
|
642
398
|
const {
|
|
643
399
|
error: res_error,
|
|
644
|
-
} = OrderModel.
|
|
400
|
+
} = OrderModel.CreateOrderResponse().validate(response, {
|
|
645
401
|
abortEarly: false,
|
|
646
402
|
allowUnknown: false,
|
|
647
403
|
});
|
|
@@ -649,7 +405,7 @@ class Order {
|
|
|
649
405
|
if (res_error) {
|
|
650
406
|
Logger({
|
|
651
407
|
level: "WARN",
|
|
652
|
-
message: "Response Validation Warnnings for
|
|
408
|
+
message: "Response Validation Warnnings for createOrder",
|
|
653
409
|
});
|
|
654
410
|
Logger({ level: "WARN", message: res_error });
|
|
655
411
|
}
|
|
@@ -659,17 +415,17 @@ class Order {
|
|
|
659
415
|
|
|
660
416
|
/**
|
|
661
417
|
* @param {Object} arg - Arg object.
|
|
662
|
-
* @param {string} arg.
|
|
663
|
-
* @param {string} [arg.
|
|
664
|
-
* @returns {Promise<
|
|
418
|
+
* @param {string} [arg.fromDate] -
|
|
419
|
+
* @param {string} [arg.toDate] -
|
|
420
|
+
* @returns {Promise<Success>} - Success response
|
|
665
421
|
* @summary:
|
|
666
422
|
* @description:
|
|
667
423
|
*/
|
|
668
|
-
async
|
|
669
|
-
const { error } = OrderValidator.
|
|
424
|
+
async createShipmentReport({ fromDate, toDate } = {}) {
|
|
425
|
+
const { error } = OrderValidator.createShipmentReport().validate(
|
|
670
426
|
{
|
|
671
|
-
|
|
672
|
-
|
|
427
|
+
fromDate,
|
|
428
|
+
toDate,
|
|
673
429
|
},
|
|
674
430
|
{ abortEarly: false, allowUnknown: true }
|
|
675
431
|
);
|
|
@@ -678,45 +434,45 @@ class Order {
|
|
|
678
434
|
}
|
|
679
435
|
|
|
680
436
|
// Showing warrnings if extra unknown parameters are found
|
|
681
|
-
const { error: warrning } = OrderValidator.
|
|
437
|
+
const { error: warrning } = OrderValidator.createShipmentReport().validate(
|
|
682
438
|
{
|
|
683
|
-
|
|
684
|
-
|
|
439
|
+
fromDate,
|
|
440
|
+
toDate,
|
|
685
441
|
},
|
|
686
442
|
{ abortEarly: false, allowUnknown: false }
|
|
687
443
|
);
|
|
688
444
|
if (warrning) {
|
|
689
445
|
Logger({
|
|
690
446
|
level: "WARN",
|
|
691
|
-
message: "Parameter Validation warrnings for
|
|
447
|
+
message: "Parameter Validation warrnings for createShipmentReport",
|
|
692
448
|
});
|
|
693
449
|
Logger({ level: "WARN", message: warrning });
|
|
694
450
|
}
|
|
695
451
|
|
|
696
452
|
const query_params = {};
|
|
697
|
-
query_params["
|
|
698
|
-
query_params["
|
|
453
|
+
query_params["from_date"] = fromDate;
|
|
454
|
+
query_params["to_date"] = toDate;
|
|
699
455
|
|
|
700
456
|
const xHeaders = {};
|
|
701
457
|
|
|
702
458
|
const response = await PlatformAPIClient.execute(
|
|
703
459
|
this.config,
|
|
704
|
-
"
|
|
705
|
-
`/service/platform/orders/v1.0/company/${this.config.companyId}/
|
|
460
|
+
"post",
|
|
461
|
+
`/service/platform/orders/v1.0/company/${this.config.companyId}/reports/shipment`,
|
|
706
462
|
query_params,
|
|
707
463
|
undefined,
|
|
708
464
|
xHeaders
|
|
709
465
|
);
|
|
710
466
|
|
|
711
|
-
const { error: res_error } = OrderModel.
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
);
|
|
467
|
+
const { error: res_error } = OrderModel.Success().validate(response, {
|
|
468
|
+
abortEarly: false,
|
|
469
|
+
allowUnknown: false,
|
|
470
|
+
});
|
|
715
471
|
|
|
716
472
|
if (res_error) {
|
|
717
473
|
Logger({
|
|
718
474
|
level: "WARN",
|
|
719
|
-
message: "Response Validation Warnnings for
|
|
475
|
+
message: "Response Validation Warnnings for createShipmentReport",
|
|
720
476
|
});
|
|
721
477
|
Logger({ level: "WARN", message: res_error });
|
|
722
478
|
}
|
|
@@ -726,17 +482,15 @@ class Order {
|
|
|
726
482
|
|
|
727
483
|
/**
|
|
728
484
|
* @param {Object} arg - Arg object.
|
|
729
|
-
* @param {
|
|
730
|
-
* @
|
|
731
|
-
* @returns {Promise<Success>} - Success response
|
|
485
|
+
* @param {DispatchManifest} arg.body
|
|
486
|
+
* @returns {Promise<SuccessResponse>} - Success response
|
|
732
487
|
* @summary:
|
|
733
488
|
* @description:
|
|
734
489
|
*/
|
|
735
|
-
async
|
|
736
|
-
const { error } = OrderValidator.
|
|
490
|
+
async dispatchManifest({ body } = {}) {
|
|
491
|
+
const { error } = OrderValidator.dispatchManifest().validate(
|
|
737
492
|
{
|
|
738
|
-
|
|
739
|
-
toDate,
|
|
493
|
+
body,
|
|
740
494
|
},
|
|
741
495
|
{ abortEarly: false, allowUnknown: true }
|
|
742
496
|
);
|
|
@@ -745,45 +499,180 @@ class Order {
|
|
|
745
499
|
}
|
|
746
500
|
|
|
747
501
|
// Showing warrnings if extra unknown parameters are found
|
|
748
|
-
const { error: warrning } = OrderValidator.
|
|
502
|
+
const { error: warrning } = OrderValidator.dispatchManifest().validate(
|
|
749
503
|
{
|
|
750
|
-
|
|
751
|
-
toDate,
|
|
504
|
+
body,
|
|
752
505
|
},
|
|
753
506
|
{ abortEarly: false, allowUnknown: false }
|
|
754
507
|
);
|
|
755
508
|
if (warrning) {
|
|
756
509
|
Logger({
|
|
757
510
|
level: "WARN",
|
|
758
|
-
message: "Parameter Validation warrnings for
|
|
511
|
+
message: "Parameter Validation warrnings for dispatchManifest",
|
|
759
512
|
});
|
|
760
513
|
Logger({ level: "WARN", message: warrning });
|
|
761
514
|
}
|
|
762
515
|
|
|
763
516
|
const query_params = {};
|
|
764
|
-
query_params["from_date"] = fromDate;
|
|
765
|
-
query_params["to_date"] = toDate;
|
|
766
517
|
|
|
767
518
|
const xHeaders = {};
|
|
768
519
|
|
|
769
520
|
const response = await PlatformAPIClient.execute(
|
|
770
521
|
this.config,
|
|
771
522
|
"post",
|
|
772
|
-
`/service/platform/
|
|
523
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/manifest/dispatch`,
|
|
773
524
|
query_params,
|
|
774
|
-
|
|
525
|
+
body,
|
|
775
526
|
xHeaders
|
|
776
527
|
);
|
|
777
528
|
|
|
778
|
-
const { error: res_error } = OrderModel.
|
|
779
|
-
|
|
780
|
-
allowUnknown: false
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
if (res_error) {
|
|
784
|
-
Logger({
|
|
529
|
+
const { error: res_error } = OrderModel.SuccessResponse().validate(
|
|
530
|
+
response,
|
|
531
|
+
{ abortEarly: false, allowUnknown: false }
|
|
532
|
+
);
|
|
533
|
+
|
|
534
|
+
if (res_error) {
|
|
535
|
+
Logger({
|
|
785
536
|
level: "WARN",
|
|
786
|
-
message: "Response Validation Warnnings for
|
|
537
|
+
message: "Response Validation Warnnings for dispatchManifest",
|
|
538
|
+
});
|
|
539
|
+
Logger({ level: "WARN", message: res_error });
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
return response;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* @param {Object} arg - Arg object.
|
|
547
|
+
* @param {string} [arg.date] -
|
|
548
|
+
* @returns {Promise<AnnouncementsResponse>} - Success response
|
|
549
|
+
* @summary:
|
|
550
|
+
* @description:
|
|
551
|
+
*/
|
|
552
|
+
async getAnnouncements({ date } = {}) {
|
|
553
|
+
const { error } = OrderValidator.getAnnouncements().validate(
|
|
554
|
+
{
|
|
555
|
+
date,
|
|
556
|
+
},
|
|
557
|
+
{ abortEarly: false, allowUnknown: true }
|
|
558
|
+
);
|
|
559
|
+
if (error) {
|
|
560
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
// Showing warrnings if extra unknown parameters are found
|
|
564
|
+
const { error: warrning } = OrderValidator.getAnnouncements().validate(
|
|
565
|
+
{
|
|
566
|
+
date,
|
|
567
|
+
},
|
|
568
|
+
{ abortEarly: false, allowUnknown: false }
|
|
569
|
+
);
|
|
570
|
+
if (warrning) {
|
|
571
|
+
Logger({
|
|
572
|
+
level: "WARN",
|
|
573
|
+
message: "Parameter Validation warrnings for getAnnouncements",
|
|
574
|
+
});
|
|
575
|
+
Logger({ level: "WARN", message: warrning });
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
const query_params = {};
|
|
579
|
+
query_params["date"] = date;
|
|
580
|
+
|
|
581
|
+
const xHeaders = {};
|
|
582
|
+
|
|
583
|
+
const response = await PlatformAPIClient.execute(
|
|
584
|
+
this.config,
|
|
585
|
+
"get",
|
|
586
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/announcements`,
|
|
587
|
+
query_params,
|
|
588
|
+
undefined,
|
|
589
|
+
xHeaders
|
|
590
|
+
);
|
|
591
|
+
|
|
592
|
+
const {
|
|
593
|
+
error: res_error,
|
|
594
|
+
} = OrderModel.AnnouncementsResponse().validate(response, {
|
|
595
|
+
abortEarly: false,
|
|
596
|
+
allowUnknown: false,
|
|
597
|
+
});
|
|
598
|
+
|
|
599
|
+
if (res_error) {
|
|
600
|
+
Logger({
|
|
601
|
+
level: "WARN",
|
|
602
|
+
message: "Response Validation Warnnings for getAnnouncements",
|
|
603
|
+
});
|
|
604
|
+
Logger({ level: "WARN", message: res_error });
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
return response;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* @param {Object} arg - Arg object.
|
|
612
|
+
* @param {string} [arg.bagId] -
|
|
613
|
+
* @param {string} [arg.channelBagId] -
|
|
614
|
+
* @param {string} [arg.channelId] -
|
|
615
|
+
* @returns {Promise<BagDetailsPlatformResponse>} - Success response
|
|
616
|
+
* @summary:
|
|
617
|
+
* @description:
|
|
618
|
+
*/
|
|
619
|
+
async getBagById({ bagId, channelBagId, channelId } = {}) {
|
|
620
|
+
const { error } = OrderValidator.getBagById().validate(
|
|
621
|
+
{
|
|
622
|
+
bagId,
|
|
623
|
+
channelBagId,
|
|
624
|
+
channelId,
|
|
625
|
+
},
|
|
626
|
+
{ abortEarly: false, allowUnknown: true }
|
|
627
|
+
);
|
|
628
|
+
if (error) {
|
|
629
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
// Showing warrnings if extra unknown parameters are found
|
|
633
|
+
const { error: warrning } = OrderValidator.getBagById().validate(
|
|
634
|
+
{
|
|
635
|
+
bagId,
|
|
636
|
+
channelBagId,
|
|
637
|
+
channelId,
|
|
638
|
+
},
|
|
639
|
+
{ abortEarly: false, allowUnknown: false }
|
|
640
|
+
);
|
|
641
|
+
if (warrning) {
|
|
642
|
+
Logger({
|
|
643
|
+
level: "WARN",
|
|
644
|
+
message: "Parameter Validation warrnings for getBagById",
|
|
645
|
+
});
|
|
646
|
+
Logger({ level: "WARN", message: warrning });
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
const query_params = {};
|
|
650
|
+
query_params["bag_id"] = bagId;
|
|
651
|
+
query_params["channel_bag_id"] = channelBagId;
|
|
652
|
+
query_params["channel_id"] = channelId;
|
|
653
|
+
|
|
654
|
+
const xHeaders = {};
|
|
655
|
+
|
|
656
|
+
const response = await PlatformAPIClient.execute(
|
|
657
|
+
this.config,
|
|
658
|
+
"get",
|
|
659
|
+
`/service/platform/orders/v1.0/company/${this.config.companyId}/bag-details/`,
|
|
660
|
+
query_params,
|
|
661
|
+
undefined,
|
|
662
|
+
xHeaders
|
|
663
|
+
);
|
|
664
|
+
|
|
665
|
+
const {
|
|
666
|
+
error: res_error,
|
|
667
|
+
} = OrderModel.BagDetailsPlatformResponse().validate(response, {
|
|
668
|
+
abortEarly: false,
|
|
669
|
+
allowUnknown: false,
|
|
670
|
+
});
|
|
671
|
+
|
|
672
|
+
if (res_error) {
|
|
673
|
+
Logger({
|
|
674
|
+
level: "WARN",
|
|
675
|
+
message: "Response Validation Warnnings for getBagById",
|
|
787
676
|
});
|
|
788
677
|
Logger({ level: "WARN", message: res_error });
|
|
789
678
|
}
|
|
@@ -793,15 +682,39 @@ class Order {
|
|
|
793
682
|
|
|
794
683
|
/**
|
|
795
684
|
* @param {Object} arg - Arg object.
|
|
685
|
+
* @param {string} [arg.bagIds] -
|
|
686
|
+
* @param {string} [arg.shipmentIds] -
|
|
687
|
+
* @param {string} [arg.orderIds] -
|
|
688
|
+
* @param {string} [arg.channelBagIds] -
|
|
689
|
+
* @param {string} [arg.channelShipmentIds] -
|
|
690
|
+
* @param {string} [arg.channelOrderIds] -
|
|
691
|
+
* @param {string} [arg.channelId] -
|
|
796
692
|
* @param {number} [arg.pageNo] -
|
|
797
693
|
* @param {number} [arg.pageSize] -
|
|
798
|
-
* @returns {Promise<
|
|
694
|
+
* @returns {Promise<GetBagsPlatformResponse>} - Success response
|
|
799
695
|
* @summary:
|
|
800
696
|
* @description:
|
|
801
697
|
*/
|
|
802
|
-
async
|
|
803
|
-
|
|
698
|
+
async getBags({
|
|
699
|
+
bagIds,
|
|
700
|
+
shipmentIds,
|
|
701
|
+
orderIds,
|
|
702
|
+
channelBagIds,
|
|
703
|
+
channelShipmentIds,
|
|
704
|
+
channelOrderIds,
|
|
705
|
+
channelId,
|
|
706
|
+
pageNo,
|
|
707
|
+
pageSize,
|
|
708
|
+
} = {}) {
|
|
709
|
+
const { error } = OrderValidator.getBags().validate(
|
|
804
710
|
{
|
|
711
|
+
bagIds,
|
|
712
|
+
shipmentIds,
|
|
713
|
+
orderIds,
|
|
714
|
+
channelBagIds,
|
|
715
|
+
channelShipmentIds,
|
|
716
|
+
channelOrderIds,
|
|
717
|
+
channelId,
|
|
805
718
|
pageNo,
|
|
806
719
|
pageSize,
|
|
807
720
|
},
|
|
@@ -812,10 +725,15 @@ class Order {
|
|
|
812
725
|
}
|
|
813
726
|
|
|
814
727
|
// Showing warrnings if extra unknown parameters are found
|
|
815
|
-
const {
|
|
816
|
-
error: warrning,
|
|
817
|
-
} = OrderValidator.getReportsShipmentListing().validate(
|
|
728
|
+
const { error: warrning } = OrderValidator.getBags().validate(
|
|
818
729
|
{
|
|
730
|
+
bagIds,
|
|
731
|
+
shipmentIds,
|
|
732
|
+
orderIds,
|
|
733
|
+
channelBagIds,
|
|
734
|
+
channelShipmentIds,
|
|
735
|
+
channelOrderIds,
|
|
736
|
+
channelId,
|
|
819
737
|
pageNo,
|
|
820
738
|
pageSize,
|
|
821
739
|
},
|
|
@@ -824,12 +742,19 @@ class Order {
|
|
|
824
742
|
if (warrning) {
|
|
825
743
|
Logger({
|
|
826
744
|
level: "WARN",
|
|
827
|
-
message: "Parameter Validation warrnings for
|
|
745
|
+
message: "Parameter Validation warrnings for getBags",
|
|
828
746
|
});
|
|
829
747
|
Logger({ level: "WARN", message: warrning });
|
|
830
748
|
}
|
|
831
749
|
|
|
832
750
|
const query_params = {};
|
|
751
|
+
query_params["bag_ids"] = bagIds;
|
|
752
|
+
query_params["shipment_ids"] = shipmentIds;
|
|
753
|
+
query_params["order_ids"] = orderIds;
|
|
754
|
+
query_params["channel_bag_ids"] = channelBagIds;
|
|
755
|
+
query_params["channel_shipment_ids"] = channelShipmentIds;
|
|
756
|
+
query_params["channel_order_ids"] = channelOrderIds;
|
|
757
|
+
query_params["channel_id"] = channelId;
|
|
833
758
|
query_params["page_no"] = pageNo;
|
|
834
759
|
query_params["page_size"] = pageSize;
|
|
835
760
|
|
|
@@ -838,13 +763,15 @@ class Order {
|
|
|
838
763
|
const response = await PlatformAPIClient.execute(
|
|
839
764
|
this.config,
|
|
840
765
|
"get",
|
|
841
|
-
`/service/platform/orders/v1.0/company/${this.config.companyId}/
|
|
766
|
+
`/service/platform/orders/v1.0/company/${this.config.companyId}/bags`,
|
|
842
767
|
query_params,
|
|
843
768
|
undefined,
|
|
844
769
|
xHeaders
|
|
845
770
|
);
|
|
846
771
|
|
|
847
|
-
const {
|
|
772
|
+
const {
|
|
773
|
+
error: res_error,
|
|
774
|
+
} = OrderModel.GetBagsPlatformResponse().validate(response, {
|
|
848
775
|
abortEarly: false,
|
|
849
776
|
allowUnknown: false,
|
|
850
777
|
});
|
|
@@ -852,7 +779,7 @@ class Order {
|
|
|
852
779
|
if (res_error) {
|
|
853
780
|
Logger({
|
|
854
781
|
level: "WARN",
|
|
855
|
-
message: "Response Validation Warnnings for
|
|
782
|
+
message: "Response Validation Warnnings for getBags",
|
|
856
783
|
});
|
|
857
784
|
Logger({ level: "WARN", message: res_error });
|
|
858
785
|
}
|
|
@@ -862,15 +789,17 @@ class Order {
|
|
|
862
789
|
|
|
863
790
|
/**
|
|
864
791
|
* @param {Object} arg - Arg object.
|
|
865
|
-
* @param {
|
|
866
|
-
* @
|
|
792
|
+
* @param {string} arg.batchId -
|
|
793
|
+
* @param {string} [arg.reportType] -
|
|
794
|
+
* @returns {Promise<FileResponse>} - Success response
|
|
867
795
|
* @summary:
|
|
868
796
|
* @description:
|
|
869
797
|
*/
|
|
870
|
-
async
|
|
871
|
-
const { error } = OrderValidator.
|
|
798
|
+
async getBulkActionFailedReport({ batchId, reportType } = {}) {
|
|
799
|
+
const { error } = OrderValidator.getBulkActionFailedReport().validate(
|
|
872
800
|
{
|
|
873
|
-
|
|
801
|
+
batchId,
|
|
802
|
+
reportType,
|
|
874
803
|
},
|
|
875
804
|
{ abortEarly: false, allowUnknown: true }
|
|
876
805
|
);
|
|
@@ -879,36 +808,39 @@ class Order {
|
|
|
879
808
|
}
|
|
880
809
|
|
|
881
810
|
// Showing warrnings if extra unknown parameters are found
|
|
882
|
-
const {
|
|
811
|
+
const {
|
|
812
|
+
error: warrning,
|
|
813
|
+
} = OrderValidator.getBulkActionFailedReport().validate(
|
|
883
814
|
{
|
|
884
|
-
|
|
815
|
+
batchId,
|
|
816
|
+
reportType,
|
|
885
817
|
},
|
|
886
818
|
{ abortEarly: false, allowUnknown: false }
|
|
887
819
|
);
|
|
888
820
|
if (warrning) {
|
|
889
821
|
Logger({
|
|
890
822
|
level: "WARN",
|
|
891
|
-
message: "Parameter Validation warrnings for
|
|
823
|
+
message: "Parameter Validation warrnings for getBulkActionFailedReport",
|
|
892
824
|
});
|
|
893
825
|
Logger({ level: "WARN", message: warrning });
|
|
894
826
|
}
|
|
895
827
|
|
|
896
828
|
const query_params = {};
|
|
829
|
+
query_params["batch_id"] = batchId;
|
|
830
|
+
query_params["report_type"] = reportType;
|
|
897
831
|
|
|
898
832
|
const xHeaders = {};
|
|
899
833
|
|
|
900
834
|
const response = await PlatformAPIClient.execute(
|
|
901
835
|
this.config,
|
|
902
|
-
"
|
|
903
|
-
`/service/platform/orders/v1.0/company/${this.config.companyId}/
|
|
836
|
+
"get",
|
|
837
|
+
`/service/platform/orders/v1.0/company/${this.config.companyId}/bulk-action-failed-report/`,
|
|
904
838
|
query_params,
|
|
905
|
-
|
|
839
|
+
undefined,
|
|
906
840
|
xHeaders
|
|
907
841
|
);
|
|
908
842
|
|
|
909
|
-
const {
|
|
910
|
-
error: res_error,
|
|
911
|
-
} = OrderModel.JioCodeUpsertResponse().validate(response, {
|
|
843
|
+
const { error: res_error } = OrderModel.FileResponse().validate(response, {
|
|
912
844
|
abortEarly: false,
|
|
913
845
|
allowUnknown: false,
|
|
914
846
|
});
|
|
@@ -916,7 +848,7 @@ class Order {
|
|
|
916
848
|
if (res_error) {
|
|
917
849
|
Logger({
|
|
918
850
|
level: "WARN",
|
|
919
|
-
message: "Response Validation Warnnings for
|
|
851
|
+
message: "Response Validation Warnnings for getBulkActionFailedReport",
|
|
920
852
|
});
|
|
921
853
|
Logger({ level: "WARN", message: res_error });
|
|
922
854
|
}
|
|
@@ -1074,11 +1006,11 @@ class Order {
|
|
|
1074
1006
|
* @param {number} [arg.pageSize] -
|
|
1075
1007
|
* @param {string} [arg.customerId] -
|
|
1076
1008
|
* @param {boolean} [arg.isPrioritySort] -
|
|
1077
|
-
* @returns {Promise<
|
|
1009
|
+
* @returns {Promise<BulkListingResponse>} - Success response
|
|
1078
1010
|
* @summary:
|
|
1079
1011
|
* @description:
|
|
1080
1012
|
*/
|
|
1081
|
-
async
|
|
1013
|
+
async getBulkList({
|
|
1082
1014
|
lane,
|
|
1083
1015
|
searchType,
|
|
1084
1016
|
searchId,
|
|
@@ -1094,7 +1026,7 @@ class Order {
|
|
|
1094
1026
|
customerId,
|
|
1095
1027
|
isPrioritySort,
|
|
1096
1028
|
} = {}) {
|
|
1097
|
-
const { error } = OrderValidator.
|
|
1029
|
+
const { error } = OrderValidator.getBulkList().validate(
|
|
1098
1030
|
{
|
|
1099
1031
|
lane,
|
|
1100
1032
|
searchType,
|
|
@@ -1118,9 +1050,7 @@ class Order {
|
|
|
1118
1050
|
}
|
|
1119
1051
|
|
|
1120
1052
|
// Showing warrnings if extra unknown parameters are found
|
|
1121
|
-
const {
|
|
1122
|
-
error: warrning,
|
|
1123
|
-
} = OrderValidator.getBulkShipmentExcelFile().validate(
|
|
1053
|
+
const { error: warrning } = OrderValidator.getBulkList().validate(
|
|
1124
1054
|
{
|
|
1125
1055
|
lane,
|
|
1126
1056
|
searchType,
|
|
@@ -1142,7 +1072,7 @@ class Order {
|
|
|
1142
1072
|
if (warrning) {
|
|
1143
1073
|
Logger({
|
|
1144
1074
|
level: "WARN",
|
|
1145
|
-
message: "Parameter Validation warrnings for
|
|
1075
|
+
message: "Parameter Validation warrnings for getBulkList",
|
|
1146
1076
|
});
|
|
1147
1077
|
Logger({ level: "WARN", message: warrning });
|
|
1148
1078
|
}
|
|
@@ -1168,21 +1098,23 @@ class Order {
|
|
|
1168
1098
|
const response = await PlatformAPIClient.execute(
|
|
1169
1099
|
this.config,
|
|
1170
1100
|
"get",
|
|
1171
|
-
`/service/platform/orders/v1.0/company/${this.config.companyId}/
|
|
1101
|
+
`/service/platform/orders/v1.0/company/${this.config.companyId}/bulk-action/listing`,
|
|
1172
1102
|
query_params,
|
|
1173
1103
|
undefined,
|
|
1174
1104
|
xHeaders
|
|
1175
1105
|
);
|
|
1176
1106
|
|
|
1177
|
-
const {
|
|
1178
|
-
|
|
1107
|
+
const {
|
|
1108
|
+
error: res_error,
|
|
1109
|
+
} = OrderModel.BulkListingResponse().validate(response, {
|
|
1110
|
+
abortEarly: false,
|
|
1179
1111
|
allowUnknown: false,
|
|
1180
1112
|
});
|
|
1181
1113
|
|
|
1182
1114
|
if (res_error) {
|
|
1183
1115
|
Logger({
|
|
1184
1116
|
level: "WARN",
|
|
1185
|
-
message: "Response Validation Warnnings for
|
|
1117
|
+
message: "Response Validation Warnnings for getBulkList",
|
|
1186
1118
|
});
|
|
1187
1119
|
Logger({ level: "WARN", message: res_error });
|
|
1188
1120
|
}
|
|
@@ -1206,11 +1138,11 @@ class Order {
|
|
|
1206
1138
|
* @param {number} [arg.pageSize] -
|
|
1207
1139
|
* @param {string} [arg.customerId] -
|
|
1208
1140
|
* @param {boolean} [arg.isPrioritySort] -
|
|
1209
|
-
* @returns {Promise<
|
|
1141
|
+
* @returns {Promise<FileResponse>} - Success response
|
|
1210
1142
|
* @summary:
|
|
1211
1143
|
* @description:
|
|
1212
1144
|
*/
|
|
1213
|
-
async
|
|
1145
|
+
async getBulkShipmentExcelFile({
|
|
1214
1146
|
lane,
|
|
1215
1147
|
searchType,
|
|
1216
1148
|
searchId,
|
|
@@ -1226,7 +1158,7 @@ class Order {
|
|
|
1226
1158
|
customerId,
|
|
1227
1159
|
isPrioritySort,
|
|
1228
1160
|
} = {}) {
|
|
1229
|
-
const { error } = OrderValidator.
|
|
1161
|
+
const { error } = OrderValidator.getBulkShipmentExcelFile().validate(
|
|
1230
1162
|
{
|
|
1231
1163
|
lane,
|
|
1232
1164
|
searchType,
|
|
@@ -1250,7 +1182,9 @@ class Order {
|
|
|
1250
1182
|
}
|
|
1251
1183
|
|
|
1252
1184
|
// Showing warrnings if extra unknown parameters are found
|
|
1253
|
-
const {
|
|
1185
|
+
const {
|
|
1186
|
+
error: warrning,
|
|
1187
|
+
} = OrderValidator.getBulkShipmentExcelFile().validate(
|
|
1254
1188
|
{
|
|
1255
1189
|
lane,
|
|
1256
1190
|
searchType,
|
|
@@ -1272,7 +1206,7 @@ class Order {
|
|
|
1272
1206
|
if (warrning) {
|
|
1273
1207
|
Logger({
|
|
1274
1208
|
level: "WARN",
|
|
1275
|
-
message: "Parameter Validation warrnings for
|
|
1209
|
+
message: "Parameter Validation warrnings for getBulkShipmentExcelFile",
|
|
1276
1210
|
});
|
|
1277
1211
|
Logger({ level: "WARN", message: warrning });
|
|
1278
1212
|
}
|
|
@@ -1298,15 +1232,13 @@ class Order {
|
|
|
1298
1232
|
const response = await PlatformAPIClient.execute(
|
|
1299
1233
|
this.config,
|
|
1300
1234
|
"get",
|
|
1301
|
-
`/service/platform/orders/v1.0/company/${this.config.companyId}/
|
|
1235
|
+
`/service/platform/orders/v1.0/company/${this.config.companyId}/generate/file`,
|
|
1302
1236
|
query_params,
|
|
1303
1237
|
undefined,
|
|
1304
1238
|
xHeaders
|
|
1305
1239
|
);
|
|
1306
1240
|
|
|
1307
|
-
const {
|
|
1308
|
-
error: res_error,
|
|
1309
|
-
} = OrderModel.BulkListingResponse().validate(response, {
|
|
1241
|
+
const { error: res_error } = OrderModel.FileResponse().validate(response, {
|
|
1310
1242
|
abortEarly: false,
|
|
1311
1243
|
allowUnknown: false,
|
|
1312
1244
|
});
|
|
@@ -1314,7 +1246,7 @@ class Order {
|
|
|
1314
1246
|
if (res_error) {
|
|
1315
1247
|
Logger({
|
|
1316
1248
|
level: "WARN",
|
|
1317
|
-
message: "Response Validation Warnnings for
|
|
1249
|
+
message: "Response Validation Warnnings for getBulkShipmentExcelFile",
|
|
1318
1250
|
});
|
|
1319
1251
|
Logger({ level: "WARN", message: res_error });
|
|
1320
1252
|
}
|
|
@@ -1324,18 +1256,13 @@ class Order {
|
|
|
1324
1256
|
|
|
1325
1257
|
/**
|
|
1326
1258
|
* @param {Object} arg - Arg object.
|
|
1327
|
-
* @
|
|
1328
|
-
* @param {string} [arg.reportType] -
|
|
1329
|
-
* @returns {Promise<FileResponse>} - Success response
|
|
1259
|
+
* @returns {Promise<CreateChannelConfigData>} - Success response
|
|
1330
1260
|
* @summary:
|
|
1331
|
-
* @description:
|
|
1261
|
+
* @description: getChannelConfig
|
|
1332
1262
|
*/
|
|
1333
|
-
async
|
|
1334
|
-
const { error } = OrderValidator.
|
|
1335
|
-
{
|
|
1336
|
-
batchId,
|
|
1337
|
-
reportType,
|
|
1338
|
-
},
|
|
1263
|
+
async getChannelConfig({} = {}) {
|
|
1264
|
+
const { error } = OrderValidator.getChannelConfig().validate(
|
|
1265
|
+
{},
|
|
1339
1266
|
{ abortEarly: false, allowUnknown: true }
|
|
1340
1267
|
);
|
|
1341
1268
|
if (error) {
|
|
@@ -1343,39 +1270,34 @@ class Order {
|
|
|
1343
1270
|
}
|
|
1344
1271
|
|
|
1345
1272
|
// Showing warrnings if extra unknown parameters are found
|
|
1346
|
-
const {
|
|
1347
|
-
|
|
1348
|
-
} = OrderValidator.getBulkActionFailedReport().validate(
|
|
1349
|
-
{
|
|
1350
|
-
batchId,
|
|
1351
|
-
reportType,
|
|
1352
|
-
},
|
|
1273
|
+
const { error: warrning } = OrderValidator.getChannelConfig().validate(
|
|
1274
|
+
{},
|
|
1353
1275
|
{ abortEarly: false, allowUnknown: false }
|
|
1354
1276
|
);
|
|
1355
1277
|
if (warrning) {
|
|
1356
1278
|
Logger({
|
|
1357
1279
|
level: "WARN",
|
|
1358
|
-
message: "Parameter Validation warrnings for
|
|
1280
|
+
message: "Parameter Validation warrnings for getChannelConfig",
|
|
1359
1281
|
});
|
|
1360
1282
|
Logger({ level: "WARN", message: warrning });
|
|
1361
1283
|
}
|
|
1362
1284
|
|
|
1363
1285
|
const query_params = {};
|
|
1364
|
-
query_params["batch_id"] = batchId;
|
|
1365
|
-
query_params["report_type"] = reportType;
|
|
1366
1286
|
|
|
1367
1287
|
const xHeaders = {};
|
|
1368
1288
|
|
|
1369
1289
|
const response = await PlatformAPIClient.execute(
|
|
1370
1290
|
this.config,
|
|
1371
1291
|
"get",
|
|
1372
|
-
`/service/platform/
|
|
1292
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/order-config`,
|
|
1373
1293
|
query_params,
|
|
1374
1294
|
undefined,
|
|
1375
1295
|
xHeaders
|
|
1376
1296
|
);
|
|
1377
1297
|
|
|
1378
|
-
const {
|
|
1298
|
+
const {
|
|
1299
|
+
error: res_error,
|
|
1300
|
+
} = OrderModel.CreateChannelConfigData().validate(response, {
|
|
1379
1301
|
abortEarly: false,
|
|
1380
1302
|
allowUnknown: false,
|
|
1381
1303
|
});
|
|
@@ -1383,7 +1305,7 @@ class Order {
|
|
|
1383
1305
|
if (res_error) {
|
|
1384
1306
|
Logger({
|
|
1385
1307
|
level: "WARN",
|
|
1386
|
-
message: "Response Validation Warnnings for
|
|
1308
|
+
message: "Response Validation Warnnings for getChannelConfig",
|
|
1387
1309
|
});
|
|
1388
1310
|
Logger({ level: "WARN", message: res_error });
|
|
1389
1311
|
}
|
|
@@ -1393,22 +1315,41 @@ class Order {
|
|
|
1393
1315
|
|
|
1394
1316
|
/**
|
|
1395
1317
|
* @param {Object} arg - Arg object.
|
|
1396
|
-
* @param {string} arg.
|
|
1397
|
-
*
|
|
1398
|
-
*
|
|
1399
|
-
* @param {string} arg.
|
|
1400
|
-
*
|
|
1401
|
-
* @param {string} arg.
|
|
1402
|
-
* @
|
|
1403
|
-
* @
|
|
1404
|
-
* @
|
|
1318
|
+
* @param {string} [arg.superLane] -
|
|
1319
|
+
* @param {string} [arg.groupEntity] -
|
|
1320
|
+
* @param {string} [arg.fromDate] -
|
|
1321
|
+
* @param {string} [arg.toDate] -
|
|
1322
|
+
* @param {string} [arg.dpIds] -
|
|
1323
|
+
* @param {string} [arg.stores] -
|
|
1324
|
+
* @param {string} [arg.salesChannel] -
|
|
1325
|
+
* @param {string} [arg.paymentMode] -
|
|
1326
|
+
* @param {string} [arg.bagStatus] -
|
|
1327
|
+
* @returns {Promise<LaneConfigResponse>} - Success response
|
|
1328
|
+
* @summary:
|
|
1329
|
+
* @description:
|
|
1405
1330
|
*/
|
|
1406
|
-
async
|
|
1407
|
-
|
|
1331
|
+
async getLaneConfig({
|
|
1332
|
+
superLane,
|
|
1333
|
+
groupEntity,
|
|
1334
|
+
fromDate,
|
|
1335
|
+
toDate,
|
|
1336
|
+
dpIds,
|
|
1337
|
+
stores,
|
|
1338
|
+
salesChannel,
|
|
1339
|
+
paymentMode,
|
|
1340
|
+
bagStatus,
|
|
1341
|
+
} = {}) {
|
|
1342
|
+
const { error } = OrderValidator.getLaneConfig().validate(
|
|
1408
1343
|
{
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1344
|
+
superLane,
|
|
1345
|
+
groupEntity,
|
|
1346
|
+
fromDate,
|
|
1347
|
+
toDate,
|
|
1348
|
+
dpIds,
|
|
1349
|
+
stores,
|
|
1350
|
+
salesChannel,
|
|
1351
|
+
paymentMode,
|
|
1352
|
+
bagStatus,
|
|
1412
1353
|
},
|
|
1413
1354
|
{ abortEarly: false, allowUnknown: true }
|
|
1414
1355
|
);
|
|
@@ -1417,30 +1358,45 @@ class Order {
|
|
|
1417
1358
|
}
|
|
1418
1359
|
|
|
1419
1360
|
// Showing warrnings if extra unknown parameters are found
|
|
1420
|
-
const { error: warrning } = OrderValidator.
|
|
1361
|
+
const { error: warrning } = OrderValidator.getLaneConfig().validate(
|
|
1421
1362
|
{
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1363
|
+
superLane,
|
|
1364
|
+
groupEntity,
|
|
1365
|
+
fromDate,
|
|
1366
|
+
toDate,
|
|
1367
|
+
dpIds,
|
|
1368
|
+
stores,
|
|
1369
|
+
salesChannel,
|
|
1370
|
+
paymentMode,
|
|
1371
|
+
bagStatus,
|
|
1425
1372
|
},
|
|
1426
1373
|
{ abortEarly: false, allowUnknown: false }
|
|
1427
1374
|
);
|
|
1428
1375
|
if (warrning) {
|
|
1429
1376
|
Logger({
|
|
1430
1377
|
level: "WARN",
|
|
1431
|
-
message: "Parameter Validation warrnings for
|
|
1378
|
+
message: "Parameter Validation warrnings for getLaneConfig",
|
|
1432
1379
|
});
|
|
1433
1380
|
Logger({ level: "WARN", message: warrning });
|
|
1434
1381
|
}
|
|
1435
1382
|
|
|
1436
1383
|
const query_params = {};
|
|
1384
|
+
query_params["super_lane"] = superLane;
|
|
1385
|
+
query_params["group_entity"] = groupEntity;
|
|
1386
|
+
query_params["from_date"] = fromDate;
|
|
1387
|
+
query_params["to_date"] = toDate;
|
|
1388
|
+
query_params["dp_ids"] = dpIds;
|
|
1389
|
+
query_params["stores"] = stores;
|
|
1390
|
+
query_params["sales_channel"] = salesChannel;
|
|
1391
|
+
query_params["payment_mode"] = paymentMode;
|
|
1392
|
+
query_params["bag_status"] = bagStatus;
|
|
1437
1393
|
|
|
1438
1394
|
const xHeaders = {};
|
|
1439
1395
|
|
|
1440
1396
|
const response = await PlatformAPIClient.execute(
|
|
1441
1397
|
this.config,
|
|
1442
1398
|
"get",
|
|
1443
|
-
`/service/platform/orders/v1.0/company/${this.config.companyId}/
|
|
1399
|
+
`/service/platform/orders/v1.0/company/${this.config.companyId}/lane-config/`,
|
|
1444
1400
|
query_params,
|
|
1445
1401
|
undefined,
|
|
1446
1402
|
xHeaders
|
|
@@ -1448,7 +1404,7 @@ class Order {
|
|
|
1448
1404
|
|
|
1449
1405
|
const {
|
|
1450
1406
|
error: res_error,
|
|
1451
|
-
} = OrderModel.
|
|
1407
|
+
} = OrderModel.LaneConfigResponse().validate(response, {
|
|
1452
1408
|
abortEarly: false,
|
|
1453
1409
|
allowUnknown: false,
|
|
1454
1410
|
});
|
|
@@ -1456,7 +1412,7 @@ class Order {
|
|
|
1456
1412
|
if (res_error) {
|
|
1457
1413
|
Logger({
|
|
1458
1414
|
level: "WARN",
|
|
1459
|
-
message: "Response Validation Warnnings for
|
|
1415
|
+
message: "Response Validation Warnnings for getLaneConfig",
|
|
1460
1416
|
});
|
|
1461
1417
|
Logger({ level: "WARN", message: res_error });
|
|
1462
1418
|
}
|
|
@@ -1466,15 +1422,17 @@ class Order {
|
|
|
1466
1422
|
|
|
1467
1423
|
/**
|
|
1468
1424
|
* @param {Object} arg - Arg object.
|
|
1469
|
-
* @param {
|
|
1470
|
-
* @
|
|
1471
|
-
* @
|
|
1472
|
-
* @
|
|
1425
|
+
* @param {string} [arg.fromDate] -
|
|
1426
|
+
* @param {string} [arg.toDate] -
|
|
1427
|
+
* @returns {Promise<MetricCountResponse>} - Success response
|
|
1428
|
+
* @summary:
|
|
1429
|
+
* @description:
|
|
1473
1430
|
*/
|
|
1474
|
-
async
|
|
1475
|
-
const { error } = OrderValidator.
|
|
1431
|
+
async getMetricCount({ fromDate, toDate } = {}) {
|
|
1432
|
+
const { error } = OrderValidator.getMetricCount().validate(
|
|
1476
1433
|
{
|
|
1477
|
-
|
|
1434
|
+
fromDate,
|
|
1435
|
+
toDate,
|
|
1478
1436
|
},
|
|
1479
1437
|
{ abortEarly: false, allowUnknown: true }
|
|
1480
1438
|
);
|
|
@@ -1483,38 +1441,39 @@ class Order {
|
|
|
1483
1441
|
}
|
|
1484
1442
|
|
|
1485
1443
|
// Showing warrnings if extra unknown parameters are found
|
|
1486
|
-
const {
|
|
1487
|
-
error: warrning,
|
|
1488
|
-
} = OrderValidator.bulkActionProcessXlsxFile().validate(
|
|
1444
|
+
const { error: warrning } = OrderValidator.getMetricCount().validate(
|
|
1489
1445
|
{
|
|
1490
|
-
|
|
1446
|
+
fromDate,
|
|
1447
|
+
toDate,
|
|
1491
1448
|
},
|
|
1492
1449
|
{ abortEarly: false, allowUnknown: false }
|
|
1493
1450
|
);
|
|
1494
1451
|
if (warrning) {
|
|
1495
1452
|
Logger({
|
|
1496
1453
|
level: "WARN",
|
|
1497
|
-
message: "Parameter Validation warrnings for
|
|
1454
|
+
message: "Parameter Validation warrnings for getMetricCount",
|
|
1498
1455
|
});
|
|
1499
1456
|
Logger({ level: "WARN", message: warrning });
|
|
1500
1457
|
}
|
|
1501
1458
|
|
|
1502
1459
|
const query_params = {};
|
|
1460
|
+
query_params["from_date"] = fromDate;
|
|
1461
|
+
query_params["to_date"] = toDate;
|
|
1503
1462
|
|
|
1504
1463
|
const xHeaders = {};
|
|
1505
1464
|
|
|
1506
1465
|
const response = await PlatformAPIClient.execute(
|
|
1507
1466
|
this.config,
|
|
1508
|
-
"
|
|
1509
|
-
`/service/platform/orders/
|
|
1467
|
+
"get",
|
|
1468
|
+
`/service/platform/orders/v1.0/company/${this.config.companyId}/shipment/metrics-count/`,
|
|
1510
1469
|
query_params,
|
|
1511
|
-
|
|
1470
|
+
undefined,
|
|
1512
1471
|
xHeaders
|
|
1513
1472
|
);
|
|
1514
1473
|
|
|
1515
1474
|
const {
|
|
1516
1475
|
error: res_error,
|
|
1517
|
-
} = OrderModel.
|
|
1476
|
+
} = OrderModel.MetricCountResponse().validate(response, {
|
|
1518
1477
|
abortEarly: false,
|
|
1519
1478
|
allowUnknown: false,
|
|
1520
1479
|
});
|
|
@@ -1522,7 +1481,7 @@ class Order {
|
|
|
1522
1481
|
if (res_error) {
|
|
1523
1482
|
Logger({
|
|
1524
1483
|
level: "WARN",
|
|
1525
|
-
message: "Response Validation Warnnings for
|
|
1484
|
+
message: "Response Validation Warnnings for getMetricCount",
|
|
1526
1485
|
});
|
|
1527
1486
|
Logger({ level: "WARN", message: res_error });
|
|
1528
1487
|
}
|
|
@@ -1532,15 +1491,15 @@ class Order {
|
|
|
1532
1491
|
|
|
1533
1492
|
/**
|
|
1534
1493
|
* @param {Object} arg - Arg object.
|
|
1535
|
-
* @param {string} arg.
|
|
1536
|
-
* @returns {Promise<
|
|
1537
|
-
* @summary:
|
|
1538
|
-
* @description:
|
|
1494
|
+
* @param {string} arg.orderId -
|
|
1495
|
+
* @returns {Promise<ShipmentDetailsResponse>} - Success response
|
|
1496
|
+
* @summary:
|
|
1497
|
+
* @description:
|
|
1539
1498
|
*/
|
|
1540
|
-
async
|
|
1541
|
-
const { error } = OrderValidator.
|
|
1499
|
+
async getOrderById({ orderId } = {}) {
|
|
1500
|
+
const { error } = OrderValidator.getOrderById().validate(
|
|
1542
1501
|
{
|
|
1543
|
-
|
|
1502
|
+
orderId,
|
|
1544
1503
|
},
|
|
1545
1504
|
{ abortEarly: false, allowUnknown: true }
|
|
1546
1505
|
);
|
|
@@ -1549,28 +1508,29 @@ class Order {
|
|
|
1549
1508
|
}
|
|
1550
1509
|
|
|
1551
1510
|
// Showing warrnings if extra unknown parameters are found
|
|
1552
|
-
const { error: warrning } = OrderValidator.
|
|
1511
|
+
const { error: warrning } = OrderValidator.getOrderById().validate(
|
|
1553
1512
|
{
|
|
1554
|
-
|
|
1513
|
+
orderId,
|
|
1555
1514
|
},
|
|
1556
1515
|
{ abortEarly: false, allowUnknown: false }
|
|
1557
1516
|
);
|
|
1558
1517
|
if (warrning) {
|
|
1559
1518
|
Logger({
|
|
1560
1519
|
level: "WARN",
|
|
1561
|
-
message: "Parameter Validation warrnings for
|
|
1520
|
+
message: "Parameter Validation warrnings for getOrderById",
|
|
1562
1521
|
});
|
|
1563
1522
|
Logger({ level: "WARN", message: warrning });
|
|
1564
1523
|
}
|
|
1565
1524
|
|
|
1566
1525
|
const query_params = {};
|
|
1526
|
+
query_params["order_id"] = orderId;
|
|
1567
1527
|
|
|
1568
1528
|
const xHeaders = {};
|
|
1569
1529
|
|
|
1570
1530
|
const response = await PlatformAPIClient.execute(
|
|
1571
1531
|
this.config,
|
|
1572
1532
|
"get",
|
|
1573
|
-
`/service/platform/orders/
|
|
1533
|
+
`/service/platform/orders/v1.0/company/${this.config.companyId}/order-details`,
|
|
1574
1534
|
query_params,
|
|
1575
1535
|
undefined,
|
|
1576
1536
|
xHeaders
|
|
@@ -1578,7 +1538,7 @@ class Order {
|
|
|
1578
1538
|
|
|
1579
1539
|
const {
|
|
1580
1540
|
error: res_error,
|
|
1581
|
-
} = OrderModel.
|
|
1541
|
+
} = OrderModel.ShipmentDetailsResponse().validate(response, {
|
|
1582
1542
|
abortEarly: false,
|
|
1583
1543
|
allowUnknown: false,
|
|
1584
1544
|
});
|
|
@@ -1586,7 +1546,7 @@ class Order {
|
|
|
1586
1546
|
if (res_error) {
|
|
1587
1547
|
Logger({
|
|
1588
1548
|
level: "WARN",
|
|
1589
|
-
message: "Response Validation Warnnings for
|
|
1549
|
+
message: "Response Validation Warnnings for getOrderById",
|
|
1590
1550
|
});
|
|
1591
1551
|
Logger({ level: "WARN", message: res_error });
|
|
1592
1552
|
}
|
|
@@ -1596,54 +1556,123 @@ class Order {
|
|
|
1596
1556
|
|
|
1597
1557
|
/**
|
|
1598
1558
|
* @param {Object} arg - Arg object.
|
|
1599
|
-
* @param {string} [arg.
|
|
1600
|
-
* @param {string} [arg.
|
|
1601
|
-
* @param {string} [arg.
|
|
1602
|
-
* @
|
|
1559
|
+
* @param {string} [arg.lane] -
|
|
1560
|
+
* @param {string} [arg.searchType] -
|
|
1561
|
+
* @param {string} [arg.bagStatus] -
|
|
1562
|
+
* @param {string} [arg.timeToDispatch] -
|
|
1563
|
+
* @param {string} [arg.paymentMethods] -
|
|
1564
|
+
* @param {string} [arg.tags] -
|
|
1565
|
+
* @param {string} [arg.searchValue] -
|
|
1566
|
+
* @param {string} [arg.fromDate] -
|
|
1567
|
+
* @param {string} [arg.toDate] -
|
|
1568
|
+
* @param {string} [arg.dpIds] -
|
|
1569
|
+
* @param {string} [arg.stores] -
|
|
1570
|
+
* @param {string} [arg.salesChannel] -
|
|
1571
|
+
* @param {number} [arg.pageNo] -
|
|
1572
|
+
* @param {number} [arg.pageSize] -
|
|
1573
|
+
* @param {boolean} [arg.isPrioritySort] -
|
|
1574
|
+
* @param {string} [arg.customMeta] -
|
|
1575
|
+
* @returns {Promise<OrderListingResponse>} - Success response
|
|
1603
1576
|
* @summary:
|
|
1604
1577
|
* @description:
|
|
1605
1578
|
*/
|
|
1606
|
-
async
|
|
1607
|
-
|
|
1579
|
+
async getOrders({
|
|
1580
|
+
lane,
|
|
1581
|
+
searchType,
|
|
1582
|
+
bagStatus,
|
|
1583
|
+
timeToDispatch,
|
|
1584
|
+
paymentMethods,
|
|
1585
|
+
tags,
|
|
1586
|
+
searchValue,
|
|
1587
|
+
fromDate,
|
|
1588
|
+
toDate,
|
|
1589
|
+
dpIds,
|
|
1590
|
+
stores,
|
|
1591
|
+
salesChannel,
|
|
1592
|
+
pageNo,
|
|
1593
|
+
pageSize,
|
|
1594
|
+
isPrioritySort,
|
|
1595
|
+
customMeta,
|
|
1596
|
+
} = {}) {
|
|
1597
|
+
const { error } = OrderValidator.getOrders().validate(
|
|
1608
1598
|
{
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1599
|
+
lane,
|
|
1600
|
+
searchType,
|
|
1601
|
+
bagStatus,
|
|
1602
|
+
timeToDispatch,
|
|
1603
|
+
paymentMethods,
|
|
1604
|
+
tags,
|
|
1605
|
+
searchValue,
|
|
1606
|
+
fromDate,
|
|
1607
|
+
toDate,
|
|
1608
|
+
dpIds,
|
|
1609
|
+
stores,
|
|
1610
|
+
salesChannel,
|
|
1611
|
+
pageNo,
|
|
1612
|
+
pageSize,
|
|
1613
|
+
isPrioritySort,
|
|
1614
|
+
customMeta,
|
|
1615
|
+
},
|
|
1616
|
+
{ abortEarly: false, allowUnknown: true }
|
|
1617
|
+
);
|
|
1618
|
+
if (error) {
|
|
1619
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1619
1622
|
// Showing warrnings if extra unknown parameters are found
|
|
1620
|
-
const { error: warrning } = OrderValidator.
|
|
1623
|
+
const { error: warrning } = OrderValidator.getOrders().validate(
|
|
1621
1624
|
{
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
+
lane,
|
|
1626
|
+
searchType,
|
|
1627
|
+
bagStatus,
|
|
1628
|
+
timeToDispatch,
|
|
1629
|
+
paymentMethods,
|
|
1630
|
+
tags,
|
|
1631
|
+
searchValue,
|
|
1632
|
+
fromDate,
|
|
1633
|
+
toDate,
|
|
1634
|
+
dpIds,
|
|
1635
|
+
stores,
|
|
1636
|
+
salesChannel,
|
|
1637
|
+
pageNo,
|
|
1638
|
+
pageSize,
|
|
1639
|
+
isPrioritySort,
|
|
1640
|
+
customMeta,
|
|
1625
1641
|
},
|
|
1626
1642
|
{ abortEarly: false, allowUnknown: false }
|
|
1627
1643
|
);
|
|
1628
1644
|
if (warrning) {
|
|
1629
1645
|
Logger({
|
|
1630
1646
|
level: "WARN",
|
|
1631
|
-
message: "Parameter Validation warrnings for
|
|
1647
|
+
message: "Parameter Validation warrnings for getOrders",
|
|
1632
1648
|
});
|
|
1633
1649
|
Logger({ level: "WARN", message: warrning });
|
|
1634
1650
|
}
|
|
1635
1651
|
|
|
1636
1652
|
const query_params = {};
|
|
1637
|
-
query_params["
|
|
1638
|
-
query_params["
|
|
1639
|
-
query_params["
|
|
1653
|
+
query_params["lane"] = lane;
|
|
1654
|
+
query_params["search_type"] = searchType;
|
|
1655
|
+
query_params["bag_status"] = bagStatus;
|
|
1656
|
+
query_params["time_to_dispatch"] = timeToDispatch;
|
|
1657
|
+
query_params["payment_methods"] = paymentMethods;
|
|
1658
|
+
query_params["tags"] = tags;
|
|
1659
|
+
query_params["search_value"] = searchValue;
|
|
1660
|
+
query_params["from_date"] = fromDate;
|
|
1661
|
+
query_params["to_date"] = toDate;
|
|
1662
|
+
query_params["dp_ids"] = dpIds;
|
|
1663
|
+
query_params["stores"] = stores;
|
|
1664
|
+
query_params["sales_channel"] = salesChannel;
|
|
1665
|
+
query_params["page_no"] = pageNo;
|
|
1666
|
+
query_params["page_size"] = pageSize;
|
|
1667
|
+
query_params["is_priority_sort"] = isPrioritySort;
|
|
1668
|
+
query_params["custom_meta"] = customMeta;
|
|
1640
1669
|
|
|
1641
1670
|
const xHeaders = {};
|
|
1642
1671
|
|
|
1643
1672
|
const response = await PlatformAPIClient.execute(
|
|
1644
1673
|
this.config,
|
|
1645
1674
|
"get",
|
|
1646
|
-
`/service/platform/orders/v1.0/company/${this.config.companyId}/
|
|
1675
|
+
`/service/platform/orders/v1.0/company/${this.config.companyId}/orders-listing`,
|
|
1647
1676
|
query_params,
|
|
1648
1677
|
undefined,
|
|
1649
1678
|
xHeaders
|
|
@@ -1651,7 +1680,7 @@ class Order {
|
|
|
1651
1680
|
|
|
1652
1681
|
const {
|
|
1653
1682
|
error: res_error,
|
|
1654
|
-
} = OrderModel.
|
|
1683
|
+
} = OrderModel.OrderListingResponse().validate(response, {
|
|
1655
1684
|
abortEarly: false,
|
|
1656
1685
|
allowUnknown: false,
|
|
1657
1686
|
});
|
|
@@ -1659,7 +1688,7 @@ class Order {
|
|
|
1659
1688
|
if (res_error) {
|
|
1660
1689
|
Logger({
|
|
1661
1690
|
level: "WARN",
|
|
1662
|
-
message: "Response Validation Warnnings for
|
|
1691
|
+
message: "Response Validation Warnnings for getOrders",
|
|
1663
1692
|
});
|
|
1664
1693
|
Logger({ level: "WARN", message: res_error });
|
|
1665
1694
|
}
|
|
@@ -1669,39 +1698,15 @@ class Order {
|
|
|
1669
1698
|
|
|
1670
1699
|
/**
|
|
1671
1700
|
* @param {Object} arg - Arg object.
|
|
1672
|
-
* @param {string} [arg.bagIds] -
|
|
1673
|
-
* @param {string} [arg.shipmentIds] -
|
|
1674
|
-
* @param {string} [arg.orderIds] -
|
|
1675
|
-
* @param {string} [arg.channelBagIds] -
|
|
1676
|
-
* @param {string} [arg.channelShipmentIds] -
|
|
1677
|
-
* @param {string} [arg.channelOrderIds] -
|
|
1678
|
-
* @param {string} [arg.channelId] -
|
|
1679
1701
|
* @param {number} [arg.pageNo] -
|
|
1680
1702
|
* @param {number} [arg.pageSize] -
|
|
1681
|
-
* @returns {Promise<
|
|
1703
|
+
* @returns {Promise<OmsReports>} - Success response
|
|
1682
1704
|
* @summary:
|
|
1683
1705
|
* @description:
|
|
1684
1706
|
*/
|
|
1685
|
-
async
|
|
1686
|
-
|
|
1687
|
-
shipmentIds,
|
|
1688
|
-
orderIds,
|
|
1689
|
-
channelBagIds,
|
|
1690
|
-
channelShipmentIds,
|
|
1691
|
-
channelOrderIds,
|
|
1692
|
-
channelId,
|
|
1693
|
-
pageNo,
|
|
1694
|
-
pageSize,
|
|
1695
|
-
} = {}) {
|
|
1696
|
-
const { error } = OrderValidator.getBags().validate(
|
|
1707
|
+
async getReportsShipmentListing({ pageNo, pageSize } = {}) {
|
|
1708
|
+
const { error } = OrderValidator.getReportsShipmentListing().validate(
|
|
1697
1709
|
{
|
|
1698
|
-
bagIds,
|
|
1699
|
-
shipmentIds,
|
|
1700
|
-
orderIds,
|
|
1701
|
-
channelBagIds,
|
|
1702
|
-
channelShipmentIds,
|
|
1703
|
-
channelOrderIds,
|
|
1704
|
-
channelId,
|
|
1705
1710
|
pageNo,
|
|
1706
1711
|
pageSize,
|
|
1707
1712
|
},
|
|
@@ -1712,15 +1717,10 @@ class Order {
|
|
|
1712
1717
|
}
|
|
1713
1718
|
|
|
1714
1719
|
// Showing warrnings if extra unknown parameters are found
|
|
1715
|
-
const {
|
|
1720
|
+
const {
|
|
1721
|
+
error: warrning,
|
|
1722
|
+
} = OrderValidator.getReportsShipmentListing().validate(
|
|
1716
1723
|
{
|
|
1717
|
-
bagIds,
|
|
1718
|
-
shipmentIds,
|
|
1719
|
-
orderIds,
|
|
1720
|
-
channelBagIds,
|
|
1721
|
-
channelShipmentIds,
|
|
1722
|
-
channelOrderIds,
|
|
1723
|
-
channelId,
|
|
1724
1724
|
pageNo,
|
|
1725
1725
|
pageSize,
|
|
1726
1726
|
},
|
|
@@ -1729,19 +1729,12 @@ class Order {
|
|
|
1729
1729
|
if (warrning) {
|
|
1730
1730
|
Logger({
|
|
1731
1731
|
level: "WARN",
|
|
1732
|
-
message: "Parameter Validation warrnings for
|
|
1732
|
+
message: "Parameter Validation warrnings for getReportsShipmentListing",
|
|
1733
1733
|
});
|
|
1734
1734
|
Logger({ level: "WARN", message: warrning });
|
|
1735
1735
|
}
|
|
1736
1736
|
|
|
1737
1737
|
const query_params = {};
|
|
1738
|
-
query_params["bag_ids"] = bagIds;
|
|
1739
|
-
query_params["shipment_ids"] = shipmentIds;
|
|
1740
|
-
query_params["order_ids"] = orderIds;
|
|
1741
|
-
query_params["channel_bag_ids"] = channelBagIds;
|
|
1742
|
-
query_params["channel_shipment_ids"] = channelShipmentIds;
|
|
1743
|
-
query_params["channel_order_ids"] = channelOrderIds;
|
|
1744
|
-
query_params["channel_id"] = channelId;
|
|
1745
1738
|
query_params["page_no"] = pageNo;
|
|
1746
1739
|
query_params["page_size"] = pageSize;
|
|
1747
1740
|
|
|
@@ -1750,15 +1743,13 @@ class Order {
|
|
|
1750
1743
|
const response = await PlatformAPIClient.execute(
|
|
1751
1744
|
this.config,
|
|
1752
1745
|
"get",
|
|
1753
|
-
`/service/platform/orders/v1.0/company/${this.config.companyId}/
|
|
1746
|
+
`/service/platform/orders/v1.0/company/${this.config.companyId}/reports/shipment-listing`,
|
|
1754
1747
|
query_params,
|
|
1755
1748
|
undefined,
|
|
1756
1749
|
xHeaders
|
|
1757
1750
|
);
|
|
1758
1751
|
|
|
1759
|
-
const {
|
|
1760
|
-
error: res_error,
|
|
1761
|
-
} = OrderModel.GetBagsPlatformResponse().validate(response, {
|
|
1752
|
+
const { error: res_error } = OrderModel.OmsReports().validate(response, {
|
|
1762
1753
|
abortEarly: false,
|
|
1763
1754
|
allowUnknown: false,
|
|
1764
1755
|
});
|
|
@@ -1766,7 +1757,7 @@ class Order {
|
|
|
1766
1757
|
if (res_error) {
|
|
1767
1758
|
Logger({
|
|
1768
1759
|
level: "WARN",
|
|
1769
|
-
message: "Response Validation Warnnings for
|
|
1760
|
+
message: "Response Validation Warnnings for getReportsShipmentListing",
|
|
1770
1761
|
});
|
|
1771
1762
|
Logger({ level: "WARN", message: res_error });
|
|
1772
1763
|
}
|
|
@@ -1776,16 +1767,13 @@ class Order {
|
|
|
1776
1767
|
|
|
1777
1768
|
/**
|
|
1778
1769
|
* @param {Object} arg - Arg object.
|
|
1779
|
-
* @
|
|
1780
|
-
* @returns {Promise<InvalidateShipmentCacheResponse>} - Success response
|
|
1770
|
+
* @returns {Promise<GetActionsResponse>} - Success response
|
|
1781
1771
|
* @summary:
|
|
1782
|
-
* @description:
|
|
1772
|
+
* @description:
|
|
1783
1773
|
*/
|
|
1784
|
-
async
|
|
1785
|
-
const { error } = OrderValidator.
|
|
1786
|
-
{
|
|
1787
|
-
body,
|
|
1788
|
-
},
|
|
1774
|
+
async getRoleBasedActions({} = {}) {
|
|
1775
|
+
const { error } = OrderValidator.getRoleBasedActions().validate(
|
|
1776
|
+
{},
|
|
1789
1777
|
{ abortEarly: false, allowUnknown: true }
|
|
1790
1778
|
);
|
|
1791
1779
|
if (error) {
|
|
@@ -1793,18 +1781,14 @@ class Order {
|
|
|
1793
1781
|
}
|
|
1794
1782
|
|
|
1795
1783
|
// Showing warrnings if extra unknown parameters are found
|
|
1796
|
-
const {
|
|
1797
|
-
|
|
1798
|
-
} = OrderValidator.invalidateShipmentCache().validate(
|
|
1799
|
-
{
|
|
1800
|
-
body,
|
|
1801
|
-
},
|
|
1784
|
+
const { error: warrning } = OrderValidator.getRoleBasedActions().validate(
|
|
1785
|
+
{},
|
|
1802
1786
|
{ abortEarly: false, allowUnknown: false }
|
|
1803
1787
|
);
|
|
1804
1788
|
if (warrning) {
|
|
1805
1789
|
Logger({
|
|
1806
1790
|
level: "WARN",
|
|
1807
|
-
message: "Parameter Validation warrnings for
|
|
1791
|
+
message: "Parameter Validation warrnings for getRoleBasedActions",
|
|
1808
1792
|
});
|
|
1809
1793
|
Logger({ level: "WARN", message: warrning });
|
|
1810
1794
|
}
|
|
@@ -1815,16 +1799,16 @@ class Order {
|
|
|
1815
1799
|
|
|
1816
1800
|
const response = await PlatformAPIClient.execute(
|
|
1817
1801
|
this.config,
|
|
1818
|
-
"
|
|
1819
|
-
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/
|
|
1802
|
+
"get",
|
|
1803
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/roles`,
|
|
1820
1804
|
query_params,
|
|
1821
|
-
|
|
1805
|
+
undefined,
|
|
1822
1806
|
xHeaders
|
|
1823
1807
|
);
|
|
1824
1808
|
|
|
1825
1809
|
const {
|
|
1826
1810
|
error: res_error,
|
|
1827
|
-
} = OrderModel.
|
|
1811
|
+
} = OrderModel.GetActionsResponse().validate(response, {
|
|
1828
1812
|
abortEarly: false,
|
|
1829
1813
|
allowUnknown: false,
|
|
1830
1814
|
});
|
|
@@ -1832,7 +1816,7 @@ class Order {
|
|
|
1832
1816
|
if (res_error) {
|
|
1833
1817
|
Logger({
|
|
1834
1818
|
level: "WARN",
|
|
1835
|
-
message: "Response Validation Warnnings for
|
|
1819
|
+
message: "Response Validation Warnnings for getRoleBasedActions",
|
|
1836
1820
|
});
|
|
1837
1821
|
Logger({ level: "WARN", message: res_error });
|
|
1838
1822
|
}
|
|
@@ -1842,15 +1826,26 @@ class Order {
|
|
|
1842
1826
|
|
|
1843
1827
|
/**
|
|
1844
1828
|
* @param {Object} arg - Arg object.
|
|
1845
|
-
* @param {
|
|
1846
|
-
* @
|
|
1829
|
+
* @param {string} [arg.channelShipmentId] -
|
|
1830
|
+
* @param {string} [arg.shipmentId] -
|
|
1831
|
+
* @param {string} [arg.orderingCompanyId] -
|
|
1832
|
+
* @param {string} [arg.requestByExt] -
|
|
1833
|
+
* @returns {Promise<ShipmentInfoResponse>} - Success response
|
|
1847
1834
|
* @summary:
|
|
1848
|
-
* @description:
|
|
1835
|
+
* @description:
|
|
1849
1836
|
*/
|
|
1850
|
-
async
|
|
1851
|
-
|
|
1837
|
+
async getShipmentById({
|
|
1838
|
+
channelShipmentId,
|
|
1839
|
+
shipmentId,
|
|
1840
|
+
orderingCompanyId,
|
|
1841
|
+
requestByExt,
|
|
1842
|
+
} = {}) {
|
|
1843
|
+
const { error } = OrderValidator.getShipmentById().validate(
|
|
1852
1844
|
{
|
|
1853
|
-
|
|
1845
|
+
channelShipmentId,
|
|
1846
|
+
shipmentId,
|
|
1847
|
+
orderingCompanyId,
|
|
1848
|
+
requestByExt,
|
|
1854
1849
|
},
|
|
1855
1850
|
{ abortEarly: false, allowUnknown: true }
|
|
1856
1851
|
);
|
|
@@ -1859,36 +1854,43 @@ class Order {
|
|
|
1859
1854
|
}
|
|
1860
1855
|
|
|
1861
1856
|
// Showing warrnings if extra unknown parameters are found
|
|
1862
|
-
const { error: warrning } = OrderValidator.
|
|
1857
|
+
const { error: warrning } = OrderValidator.getShipmentById().validate(
|
|
1863
1858
|
{
|
|
1864
|
-
|
|
1859
|
+
channelShipmentId,
|
|
1860
|
+
shipmentId,
|
|
1861
|
+
orderingCompanyId,
|
|
1862
|
+
requestByExt,
|
|
1865
1863
|
},
|
|
1866
1864
|
{ abortEarly: false, allowUnknown: false }
|
|
1867
1865
|
);
|
|
1868
1866
|
if (warrning) {
|
|
1869
1867
|
Logger({
|
|
1870
1868
|
level: "WARN",
|
|
1871
|
-
message: "Parameter Validation warrnings for
|
|
1869
|
+
message: "Parameter Validation warrnings for getShipmentById",
|
|
1872
1870
|
});
|
|
1873
1871
|
Logger({ level: "WARN", message: warrning });
|
|
1874
1872
|
}
|
|
1875
1873
|
|
|
1876
1874
|
const query_params = {};
|
|
1875
|
+
query_params["channel_shipment_id"] = channelShipmentId;
|
|
1876
|
+
query_params["shipment_id"] = shipmentId;
|
|
1877
|
+
query_params["ordering_company_id"] = orderingCompanyId;
|
|
1878
|
+
query_params["request_by_ext"] = requestByExt;
|
|
1877
1879
|
|
|
1878
1880
|
const xHeaders = {};
|
|
1879
1881
|
|
|
1880
1882
|
const response = await PlatformAPIClient.execute(
|
|
1881
1883
|
this.config,
|
|
1882
|
-
"
|
|
1883
|
-
`/service/platform/
|
|
1884
|
+
"get",
|
|
1885
|
+
`/service/platform/orders/v1.0/company/${this.config.companyId}/shipment-details`,
|
|
1884
1886
|
query_params,
|
|
1885
|
-
|
|
1887
|
+
undefined,
|
|
1886
1888
|
xHeaders
|
|
1887
1889
|
);
|
|
1888
1890
|
|
|
1889
1891
|
const {
|
|
1890
1892
|
error: res_error,
|
|
1891
|
-
} = OrderModel.
|
|
1893
|
+
} = OrderModel.ShipmentInfoResponse().validate(response, {
|
|
1892
1894
|
abortEarly: false,
|
|
1893
1895
|
allowUnknown: false,
|
|
1894
1896
|
});
|
|
@@ -1896,7 +1898,7 @@ class Order {
|
|
|
1896
1898
|
if (res_error) {
|
|
1897
1899
|
Logger({
|
|
1898
1900
|
level: "WARN",
|
|
1899
|
-
message: "Response Validation Warnnings for
|
|
1901
|
+
message: "Response Validation Warnnings for getShipmentById",
|
|
1900
1902
|
});
|
|
1901
1903
|
Logger({ level: "WARN", message: res_error });
|
|
1902
1904
|
}
|
|
@@ -1906,15 +1908,17 @@ class Order {
|
|
|
1906
1908
|
|
|
1907
1909
|
/**
|
|
1908
1910
|
* @param {Object} arg - Arg object.
|
|
1909
|
-
* @param {
|
|
1910
|
-
* @
|
|
1911
|
+
* @param {number} [arg.shipmentId] -
|
|
1912
|
+
* @param {number} [arg.bagId] -
|
|
1913
|
+
* @returns {Promise<ShipmentHistoryResponse>} - Success response
|
|
1911
1914
|
* @summary:
|
|
1912
|
-
* @description:
|
|
1915
|
+
* @description:
|
|
1913
1916
|
*/
|
|
1914
|
-
async
|
|
1915
|
-
const { error } = OrderValidator.
|
|
1917
|
+
async getShipmentHistory({ shipmentId, bagId } = {}) {
|
|
1918
|
+
const { error } = OrderValidator.getShipmentHistory().validate(
|
|
1916
1919
|
{
|
|
1917
|
-
|
|
1920
|
+
shipmentId,
|
|
1921
|
+
bagId,
|
|
1918
1922
|
},
|
|
1919
1923
|
{ abortEarly: false, allowUnknown: true }
|
|
1920
1924
|
);
|
|
@@ -1923,36 +1927,39 @@ class Order {
|
|
|
1923
1927
|
}
|
|
1924
1928
|
|
|
1925
1929
|
// Showing warrnings if extra unknown parameters are found
|
|
1926
|
-
const { error: warrning } = OrderValidator.
|
|
1930
|
+
const { error: warrning } = OrderValidator.getShipmentHistory().validate(
|
|
1927
1931
|
{
|
|
1928
|
-
|
|
1932
|
+
shipmentId,
|
|
1933
|
+
bagId,
|
|
1929
1934
|
},
|
|
1930
1935
|
{ abortEarly: false, allowUnknown: false }
|
|
1931
1936
|
);
|
|
1932
1937
|
if (warrning) {
|
|
1933
1938
|
Logger({
|
|
1934
1939
|
level: "WARN",
|
|
1935
|
-
message: "Parameter Validation warrnings for
|
|
1940
|
+
message: "Parameter Validation warrnings for getShipmentHistory",
|
|
1936
1941
|
});
|
|
1937
1942
|
Logger({ level: "WARN", message: warrning });
|
|
1938
1943
|
}
|
|
1939
1944
|
|
|
1940
1945
|
const query_params = {};
|
|
1946
|
+
query_params["shipment_id"] = shipmentId;
|
|
1947
|
+
query_params["bag_id"] = bagId;
|
|
1941
1948
|
|
|
1942
1949
|
const xHeaders = {};
|
|
1943
1950
|
|
|
1944
1951
|
const response = await PlatformAPIClient.execute(
|
|
1945
1952
|
this.config,
|
|
1946
|
-
"
|
|
1947
|
-
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/
|
|
1953
|
+
"get",
|
|
1954
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/shipment/history`,
|
|
1948
1955
|
query_params,
|
|
1949
|
-
|
|
1956
|
+
undefined,
|
|
1950
1957
|
xHeaders
|
|
1951
1958
|
);
|
|
1952
1959
|
|
|
1953
1960
|
const {
|
|
1954
1961
|
error: res_error,
|
|
1955
|
-
} = OrderModel.
|
|
1962
|
+
} = OrderModel.ShipmentHistoryResponse().validate(response, {
|
|
1956
1963
|
abortEarly: false,
|
|
1957
1964
|
allowUnknown: false,
|
|
1958
1965
|
});
|
|
@@ -1960,7 +1967,7 @@ class Order {
|
|
|
1960
1967
|
if (res_error) {
|
|
1961
1968
|
Logger({
|
|
1962
1969
|
level: "WARN",
|
|
1963
|
-
message: "Response Validation Warnnings for
|
|
1970
|
+
message: "Response Validation Warnnings for getShipmentHistory",
|
|
1964
1971
|
});
|
|
1965
1972
|
Logger({ level: "WARN", message: res_error });
|
|
1966
1973
|
}
|
|
@@ -1970,115 +1977,22 @@ class Order {
|
|
|
1970
1977
|
|
|
1971
1978
|
/**
|
|
1972
1979
|
* @param {Object} arg - Arg object.
|
|
1973
|
-
* @param {string}
|
|
1974
|
-
*
|
|
1975
|
-
*
|
|
1976
|
-
* @
|
|
1980
|
+
* @param {string} arg.shipmentId - ID of the shipment. An order may contain
|
|
1981
|
+
* multiple items and may get divided into one or more shipment, each
|
|
1982
|
+
* having its own ID.
|
|
1983
|
+
* @param {string} arg.bagId - ID of the bag. An order may contain multiple
|
|
1984
|
+
* items and may get divided into one or more shipment, each having its own ID.
|
|
1985
|
+
* @param {string} arg.state - State for which reasons are required.
|
|
1986
|
+
* @returns {Promise<PlatformShipmentReasonsResponse>} - Success response
|
|
1987
|
+
* @summary: Get reasons behind full or partial cancellation of a shipment
|
|
1988
|
+
* @description: Use this API to retrieve the issues that led to the cancellation of bags within a shipment.
|
|
1977
1989
|
*/
|
|
1978
|
-
async
|
|
1979
|
-
const { error } = OrderValidator.
|
|
1980
|
-
{
|
|
1981
|
-
date,
|
|
1982
|
-
},
|
|
1983
|
-
{ abortEarly: false, allowUnknown: true }
|
|
1984
|
-
);
|
|
1985
|
-
if (error) {
|
|
1986
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
1987
|
-
}
|
|
1988
|
-
|
|
1989
|
-
// Showing warrnings if extra unknown parameters are found
|
|
1990
|
-
const { error: warrning } = OrderValidator.getAnnouncements().validate(
|
|
1991
|
-
{
|
|
1992
|
-
date,
|
|
1993
|
-
},
|
|
1994
|
-
{ abortEarly: false, allowUnknown: false }
|
|
1995
|
-
);
|
|
1996
|
-
if (warrning) {
|
|
1997
|
-
Logger({
|
|
1998
|
-
level: "WARN",
|
|
1999
|
-
message: "Parameter Validation warrnings for getAnnouncements",
|
|
2000
|
-
});
|
|
2001
|
-
Logger({ level: "WARN", message: warrning });
|
|
2002
|
-
}
|
|
2003
|
-
|
|
2004
|
-
const query_params = {};
|
|
2005
|
-
query_params["date"] = date;
|
|
2006
|
-
|
|
2007
|
-
const xHeaders = {};
|
|
2008
|
-
|
|
2009
|
-
const response = await PlatformAPIClient.execute(
|
|
2010
|
-
this.config,
|
|
2011
|
-
"get",
|
|
2012
|
-
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/announcements`,
|
|
2013
|
-
query_params,
|
|
2014
|
-
undefined,
|
|
2015
|
-
xHeaders
|
|
2016
|
-
);
|
|
2017
|
-
|
|
2018
|
-
const {
|
|
2019
|
-
error: res_error,
|
|
2020
|
-
} = OrderModel.AnnouncementsResponse().validate(response, {
|
|
2021
|
-
abortEarly: false,
|
|
2022
|
-
allowUnknown: false,
|
|
2023
|
-
});
|
|
2024
|
-
|
|
2025
|
-
if (res_error) {
|
|
2026
|
-
Logger({
|
|
2027
|
-
level: "WARN",
|
|
2028
|
-
message: "Response Validation Warnnings for getAnnouncements",
|
|
2029
|
-
});
|
|
2030
|
-
Logger({ level: "WARN", message: res_error });
|
|
2031
|
-
}
|
|
2032
|
-
|
|
2033
|
-
return response;
|
|
2034
|
-
}
|
|
2035
|
-
|
|
2036
|
-
/**
|
|
2037
|
-
* @param {Object} arg - Arg object.
|
|
2038
|
-
* @param {string} arg.shipmentId -
|
|
2039
|
-
* @param {string} [arg.name] -
|
|
2040
|
-
* @param {string} [arg.address] -
|
|
2041
|
-
* @param {string} [arg.addressType] -
|
|
2042
|
-
* @param {string} [arg.pincode] -
|
|
2043
|
-
* @param {string} [arg.phone] -
|
|
2044
|
-
* @param {string} [arg.email] -
|
|
2045
|
-
* @param {string} [arg.landmark] -
|
|
2046
|
-
* @param {string} arg.addressCategory -
|
|
2047
|
-
* @param {string} [arg.city] -
|
|
2048
|
-
* @param {string} [arg.state] -
|
|
2049
|
-
* @param {string} [arg.country] -
|
|
2050
|
-
* @returns {Promise<BaseResponse>} - Success response
|
|
2051
|
-
* @summary:
|
|
2052
|
-
* @description:
|
|
2053
|
-
*/
|
|
2054
|
-
async updateAddress({
|
|
2055
|
-
shipmentId,
|
|
2056
|
-
addressCategory,
|
|
2057
|
-
name,
|
|
2058
|
-
address,
|
|
2059
|
-
addressType,
|
|
2060
|
-
pincode,
|
|
2061
|
-
phone,
|
|
2062
|
-
email,
|
|
2063
|
-
landmark,
|
|
2064
|
-
city,
|
|
2065
|
-
state,
|
|
2066
|
-
country,
|
|
2067
|
-
} = {}) {
|
|
2068
|
-
const { error } = OrderValidator.updateAddress().validate(
|
|
1990
|
+
async getShipmentReasons({ shipmentId, bagId, state } = {}) {
|
|
1991
|
+
const { error } = OrderValidator.getShipmentReasons().validate(
|
|
2069
1992
|
{
|
|
2070
1993
|
shipmentId,
|
|
2071
|
-
|
|
2072
|
-
name,
|
|
2073
|
-
address,
|
|
2074
|
-
addressType,
|
|
2075
|
-
pincode,
|
|
2076
|
-
phone,
|
|
2077
|
-
email,
|
|
2078
|
-
landmark,
|
|
2079
|
-
city,
|
|
1994
|
+
bagId,
|
|
2080
1995
|
state,
|
|
2081
|
-
country,
|
|
2082
1996
|
},
|
|
2083
1997
|
{ abortEarly: false, allowUnknown: true }
|
|
2084
1998
|
);
|
|
@@ -2087,57 +2001,38 @@ class Order {
|
|
|
2087
2001
|
}
|
|
2088
2002
|
|
|
2089
2003
|
// Showing warrnings if extra unknown parameters are found
|
|
2090
|
-
const { error: warrning } = OrderValidator.
|
|
2004
|
+
const { error: warrning } = OrderValidator.getShipmentReasons().validate(
|
|
2091
2005
|
{
|
|
2092
2006
|
shipmentId,
|
|
2093
|
-
|
|
2094
|
-
name,
|
|
2095
|
-
address,
|
|
2096
|
-
addressType,
|
|
2097
|
-
pincode,
|
|
2098
|
-
phone,
|
|
2099
|
-
email,
|
|
2100
|
-
landmark,
|
|
2101
|
-
city,
|
|
2007
|
+
bagId,
|
|
2102
2008
|
state,
|
|
2103
|
-
country,
|
|
2104
2009
|
},
|
|
2105
2010
|
{ abortEarly: false, allowUnknown: false }
|
|
2106
2011
|
);
|
|
2107
2012
|
if (warrning) {
|
|
2108
2013
|
Logger({
|
|
2109
2014
|
level: "WARN",
|
|
2110
|
-
message: "Parameter Validation warrnings for
|
|
2015
|
+
message: "Parameter Validation warrnings for getShipmentReasons",
|
|
2111
2016
|
});
|
|
2112
2017
|
Logger({ level: "WARN", message: warrning });
|
|
2113
2018
|
}
|
|
2114
2019
|
|
|
2115
2020
|
const query_params = {};
|
|
2116
|
-
query_params["shipment_id"] = shipmentId;
|
|
2117
|
-
query_params["name"] = name;
|
|
2118
|
-
query_params["address"] = address;
|
|
2119
|
-
query_params["address_type"] = addressType;
|
|
2120
|
-
query_params["pincode"] = pincode;
|
|
2121
|
-
query_params["phone"] = phone;
|
|
2122
|
-
query_params["email"] = email;
|
|
2123
|
-
query_params["landmark"] = landmark;
|
|
2124
|
-
query_params["address_category"] = addressCategory;
|
|
2125
|
-
query_params["city"] = city;
|
|
2126
|
-
query_params["state"] = state;
|
|
2127
|
-
query_params["country"] = country;
|
|
2128
2021
|
|
|
2129
2022
|
const xHeaders = {};
|
|
2130
2023
|
|
|
2131
2024
|
const response = await PlatformAPIClient.execute(
|
|
2132
2025
|
this.config,
|
|
2133
|
-
"
|
|
2134
|
-
`/service/platform/
|
|
2026
|
+
"get",
|
|
2027
|
+
`/service/platform/orders/v1.0/company/${this.config.companyId}/shipments/${shipmentId}/bags/${bagId}/state/${state}/reasons`,
|
|
2135
2028
|
query_params,
|
|
2136
2029
|
undefined,
|
|
2137
2030
|
xHeaders
|
|
2138
2031
|
);
|
|
2139
2032
|
|
|
2140
|
-
const {
|
|
2033
|
+
const {
|
|
2034
|
+
error: res_error,
|
|
2035
|
+
} = OrderModel.PlatformShipmentReasonsResponse().validate(response, {
|
|
2141
2036
|
abortEarly: false,
|
|
2142
2037
|
allowUnknown: false,
|
|
2143
2038
|
});
|
|
@@ -2145,7 +2040,7 @@ class Order {
|
|
|
2145
2040
|
if (res_error) {
|
|
2146
2041
|
Logger({
|
|
2147
2042
|
level: "WARN",
|
|
2148
|
-
message: "Response Validation Warnnings for
|
|
2043
|
+
message: "Response Validation Warnnings for getShipmentReasons",
|
|
2149
2044
|
});
|
|
2150
2045
|
Logger({ level: "WARN", message: res_error });
|
|
2151
2046
|
}
|
|
@@ -2155,23 +2050,86 @@ class Order {
|
|
|
2155
2050
|
|
|
2156
2051
|
/**
|
|
2157
2052
|
* @param {Object} arg - Arg object.
|
|
2158
|
-
* @param {string} arg.
|
|
2159
|
-
* @param {string} arg.
|
|
2160
|
-
* @param {
|
|
2161
|
-
* @param {string} [arg.
|
|
2162
|
-
* @param {string} [arg.
|
|
2163
|
-
* @
|
|
2053
|
+
* @param {string} [arg.lane] -
|
|
2054
|
+
* @param {string} [arg.bagStatus] -
|
|
2055
|
+
* @param {boolean} [arg.statusOverrideLane] -
|
|
2056
|
+
* @param {string} [arg.searchType] -
|
|
2057
|
+
* @param {string} [arg.searchValue] -
|
|
2058
|
+
* @param {string} [arg.searchId] -
|
|
2059
|
+
* @param {string} [arg.fromDate] -
|
|
2060
|
+
* @param {string} [arg.toDate] -
|
|
2061
|
+
* @param {string} [arg.dpIds] -
|
|
2062
|
+
* @param {string} [arg.orderingCompanyId] -
|
|
2063
|
+
* @param {string} [arg.stores] -
|
|
2064
|
+
* @param {string} [arg.salesChannel] -
|
|
2065
|
+
* @param {string} [arg.requestByExt] -
|
|
2066
|
+
* @param {number} [arg.pageNo] -
|
|
2067
|
+
* @param {number} [arg.pageSize] -
|
|
2068
|
+
* @param {boolean} [arg.isPrioritySort] -
|
|
2069
|
+
* @param {boolean} [arg.fetchActiveShipment] -
|
|
2070
|
+
* @param {boolean} [arg.excludeLockedShipments] -
|
|
2071
|
+
* @param {string} [arg.paymentMethods] -
|
|
2072
|
+
* @param {string} [arg.channelShipmentId] -
|
|
2073
|
+
* @param {string} [arg.channelOrderId] -
|
|
2074
|
+
* @param {string} [arg.customMeta] -
|
|
2075
|
+
* @param {string} [arg.orderingChannel] -
|
|
2076
|
+
* @param {string} [arg.companyAffiliateTag] -
|
|
2077
|
+
* @returns {Promise<ShipmentInternalPlatformViewResponse>} - Success response
|
|
2164
2078
|
* @summary:
|
|
2165
2079
|
* @description:
|
|
2166
2080
|
*/
|
|
2167
|
-
async
|
|
2168
|
-
|
|
2081
|
+
async getShipments({
|
|
2082
|
+
lane,
|
|
2083
|
+
bagStatus,
|
|
2084
|
+
statusOverrideLane,
|
|
2085
|
+
searchType,
|
|
2086
|
+
searchValue,
|
|
2087
|
+
searchId,
|
|
2088
|
+
fromDate,
|
|
2089
|
+
toDate,
|
|
2090
|
+
dpIds,
|
|
2091
|
+
orderingCompanyId,
|
|
2092
|
+
stores,
|
|
2093
|
+
salesChannel,
|
|
2094
|
+
requestByExt,
|
|
2095
|
+
pageNo,
|
|
2096
|
+
pageSize,
|
|
2097
|
+
isPrioritySort,
|
|
2098
|
+
fetchActiveShipment,
|
|
2099
|
+
excludeLockedShipments,
|
|
2100
|
+
paymentMethods,
|
|
2101
|
+
channelShipmentId,
|
|
2102
|
+
channelOrderId,
|
|
2103
|
+
customMeta,
|
|
2104
|
+
orderingChannel,
|
|
2105
|
+
companyAffiliateTag,
|
|
2106
|
+
} = {}) {
|
|
2107
|
+
const { error } = OrderValidator.getShipments().validate(
|
|
2169
2108
|
{
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2109
|
+
lane,
|
|
2110
|
+
bagStatus,
|
|
2111
|
+
statusOverrideLane,
|
|
2112
|
+
searchType,
|
|
2113
|
+
searchValue,
|
|
2114
|
+
searchId,
|
|
2115
|
+
fromDate,
|
|
2116
|
+
toDate,
|
|
2117
|
+
dpIds,
|
|
2118
|
+
orderingCompanyId,
|
|
2119
|
+
stores,
|
|
2120
|
+
salesChannel,
|
|
2121
|
+
requestByExt,
|
|
2122
|
+
pageNo,
|
|
2123
|
+
pageSize,
|
|
2124
|
+
isPrioritySort,
|
|
2125
|
+
fetchActiveShipment,
|
|
2126
|
+
excludeLockedShipments,
|
|
2127
|
+
paymentMethods,
|
|
2128
|
+
channelShipmentId,
|
|
2129
|
+
channelOrderId,
|
|
2130
|
+
customMeta,
|
|
2131
|
+
orderingChannel,
|
|
2132
|
+
companyAffiliateTag,
|
|
2175
2133
|
},
|
|
2176
2134
|
{ abortEarly: false, allowUnknown: true }
|
|
2177
2135
|
);
|
|
@@ -2180,37 +2138,75 @@ class Order {
|
|
|
2180
2138
|
}
|
|
2181
2139
|
|
|
2182
2140
|
// Showing warrnings if extra unknown parameters are found
|
|
2183
|
-
const { error: warrning } = OrderValidator.
|
|
2141
|
+
const { error: warrning } = OrderValidator.getShipments().validate(
|
|
2184
2142
|
{
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2143
|
+
lane,
|
|
2144
|
+
bagStatus,
|
|
2145
|
+
statusOverrideLane,
|
|
2146
|
+
searchType,
|
|
2147
|
+
searchValue,
|
|
2148
|
+
searchId,
|
|
2149
|
+
fromDate,
|
|
2150
|
+
toDate,
|
|
2151
|
+
dpIds,
|
|
2152
|
+
orderingCompanyId,
|
|
2153
|
+
stores,
|
|
2154
|
+
salesChannel,
|
|
2155
|
+
requestByExt,
|
|
2156
|
+
pageNo,
|
|
2157
|
+
pageSize,
|
|
2158
|
+
isPrioritySort,
|
|
2159
|
+
fetchActiveShipment,
|
|
2160
|
+
excludeLockedShipments,
|
|
2161
|
+
paymentMethods,
|
|
2162
|
+
channelShipmentId,
|
|
2163
|
+
channelOrderId,
|
|
2164
|
+
customMeta,
|
|
2165
|
+
orderingChannel,
|
|
2166
|
+
companyAffiliateTag,
|
|
2190
2167
|
},
|
|
2191
2168
|
{ abortEarly: false, allowUnknown: false }
|
|
2192
2169
|
);
|
|
2193
2170
|
if (warrning) {
|
|
2194
2171
|
Logger({
|
|
2195
2172
|
level: "WARN",
|
|
2196
|
-
message: "Parameter Validation warrnings for
|
|
2173
|
+
message: "Parameter Validation warrnings for getShipments",
|
|
2197
2174
|
});
|
|
2198
2175
|
Logger({ level: "WARN", message: warrning });
|
|
2199
2176
|
}
|
|
2200
2177
|
|
|
2201
2178
|
const query_params = {};
|
|
2202
|
-
query_params["
|
|
2203
|
-
query_params["
|
|
2204
|
-
query_params["
|
|
2205
|
-
query_params["
|
|
2206
|
-
query_params["
|
|
2179
|
+
query_params["lane"] = lane;
|
|
2180
|
+
query_params["bag_status"] = bagStatus;
|
|
2181
|
+
query_params["status_override_lane"] = statusOverrideLane;
|
|
2182
|
+
query_params["search_type"] = searchType;
|
|
2183
|
+
query_params["search_value"] = searchValue;
|
|
2184
|
+
query_params["search_id"] = searchId;
|
|
2185
|
+
query_params["from_date"] = fromDate;
|
|
2186
|
+
query_params["to_date"] = toDate;
|
|
2187
|
+
query_params["dp_ids"] = dpIds;
|
|
2188
|
+
query_params["ordering_company_id"] = orderingCompanyId;
|
|
2189
|
+
query_params["stores"] = stores;
|
|
2190
|
+
query_params["sales_channel"] = salesChannel;
|
|
2191
|
+
query_params["request_by_ext"] = requestByExt;
|
|
2192
|
+
query_params["page_no"] = pageNo;
|
|
2193
|
+
query_params["page_size"] = pageSize;
|
|
2194
|
+
query_params["is_priority_sort"] = isPrioritySort;
|
|
2195
|
+
query_params["fetch_active_shipment"] = fetchActiveShipment;
|
|
2196
|
+
query_params["exclude_locked_shipments"] = excludeLockedShipments;
|
|
2197
|
+
query_params["payment_methods"] = paymentMethods;
|
|
2198
|
+
query_params["channel_shipment_id"] = channelShipmentId;
|
|
2199
|
+
query_params["channel_order_id"] = channelOrderId;
|
|
2200
|
+
query_params["custom_meta"] = customMeta;
|
|
2201
|
+
query_params["ordering_channel"] = orderingChannel;
|
|
2202
|
+
query_params["company_affiliate_tag"] = companyAffiliateTag;
|
|
2207
2203
|
|
|
2208
2204
|
const xHeaders = {};
|
|
2209
2205
|
|
|
2210
2206
|
const response = await PlatformAPIClient.execute(
|
|
2211
2207
|
this.config,
|
|
2212
2208
|
"get",
|
|
2213
|
-
`/service/platform/
|
|
2209
|
+
`/service/platform/orders/v1.0/company/${this.config.companyId}/shipments-listing`,
|
|
2214
2210
|
query_params,
|
|
2215
2211
|
undefined,
|
|
2216
2212
|
xHeaders
|
|
@@ -2218,7 +2214,7 @@ class Order {
|
|
|
2218
2214
|
|
|
2219
2215
|
const {
|
|
2220
2216
|
error: res_error,
|
|
2221
|
-
} = OrderModel.
|
|
2217
|
+
} = OrderModel.ShipmentInternalPlatformViewResponse().validate(response, {
|
|
2222
2218
|
abortEarly: false,
|
|
2223
2219
|
allowUnknown: false,
|
|
2224
2220
|
});
|
|
@@ -2226,7 +2222,7 @@ class Order {
|
|
|
2226
2222
|
if (res_error) {
|
|
2227
2223
|
Logger({
|
|
2228
2224
|
level: "WARN",
|
|
2229
|
-
message: "Response Validation Warnnings for
|
|
2225
|
+
message: "Response Validation Warnnings for getShipments",
|
|
2230
2226
|
});
|
|
2231
2227
|
Logger({ level: "WARN", message: res_error });
|
|
2232
2228
|
}
|
|
@@ -2236,15 +2232,17 @@ class Order {
|
|
|
2236
2232
|
|
|
2237
2233
|
/**
|
|
2238
2234
|
* @param {Object} arg - Arg object.
|
|
2239
|
-
* @param {
|
|
2240
|
-
* @
|
|
2235
|
+
* @param {string} arg.view -
|
|
2236
|
+
* @param {string} [arg.groupEntity] -
|
|
2237
|
+
* @returns {Promise<FiltersResponse>} - Success response
|
|
2241
2238
|
* @summary:
|
|
2242
|
-
* @description:
|
|
2239
|
+
* @description:
|
|
2243
2240
|
*/
|
|
2244
|
-
async
|
|
2245
|
-
const { error } = OrderValidator.
|
|
2241
|
+
async getfilters({ view, groupEntity } = {}) {
|
|
2242
|
+
const { error } = OrderValidator.getfilters().validate(
|
|
2246
2243
|
{
|
|
2247
|
-
|
|
2244
|
+
view,
|
|
2245
|
+
groupEntity,
|
|
2248
2246
|
},
|
|
2249
2247
|
{ abortEarly: false, allowUnknown: true }
|
|
2250
2248
|
);
|
|
@@ -2253,44 +2251,45 @@ class Order {
|
|
|
2253
2251
|
}
|
|
2254
2252
|
|
|
2255
2253
|
// Showing warrnings if extra unknown parameters are found
|
|
2256
|
-
const { error: warrning } = OrderValidator.
|
|
2254
|
+
const { error: warrning } = OrderValidator.getfilters().validate(
|
|
2257
2255
|
{
|
|
2258
|
-
|
|
2256
|
+
view,
|
|
2257
|
+
groupEntity,
|
|
2259
2258
|
},
|
|
2260
2259
|
{ abortEarly: false, allowUnknown: false }
|
|
2261
2260
|
);
|
|
2262
2261
|
if (warrning) {
|
|
2263
2262
|
Logger({
|
|
2264
2263
|
level: "WARN",
|
|
2265
|
-
message: "Parameter Validation warrnings for
|
|
2264
|
+
message: "Parameter Validation warrnings for getfilters",
|
|
2266
2265
|
});
|
|
2267
2266
|
Logger({ level: "WARN", message: warrning });
|
|
2268
2267
|
}
|
|
2269
2268
|
|
|
2270
2269
|
const query_params = {};
|
|
2270
|
+
query_params["view"] = view;
|
|
2271
|
+
query_params["group_entity"] = groupEntity;
|
|
2271
2272
|
|
|
2272
2273
|
const xHeaders = {};
|
|
2273
2274
|
|
|
2274
2275
|
const response = await PlatformAPIClient.execute(
|
|
2275
2276
|
this.config,
|
|
2276
|
-
"
|
|
2277
|
-
`/service/platform/
|
|
2277
|
+
"get",
|
|
2278
|
+
`/service/platform/orders/v1.0/company/${this.config.companyId}/filter-listing`,
|
|
2278
2279
|
query_params,
|
|
2279
|
-
|
|
2280
|
+
undefined,
|
|
2280
2281
|
xHeaders
|
|
2281
2282
|
);
|
|
2282
2283
|
|
|
2283
|
-
const {
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
allowUnknown: false,
|
|
2288
|
-
});
|
|
2284
|
+
const { error: res_error } = OrderModel.FiltersResponse().validate(
|
|
2285
|
+
response,
|
|
2286
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2287
|
+
);
|
|
2289
2288
|
|
|
2290
2289
|
if (res_error) {
|
|
2291
2290
|
Logger({
|
|
2292
2291
|
level: "WARN",
|
|
2293
|
-
message: "Response Validation Warnnings for
|
|
2292
|
+
message: "Response Validation Warnnings for getfilters",
|
|
2294
2293
|
});
|
|
2295
2294
|
Logger({ level: "WARN", message: res_error });
|
|
2296
2295
|
}
|
|
@@ -2300,13 +2299,13 @@ class Order {
|
|
|
2300
2299
|
|
|
2301
2300
|
/**
|
|
2302
2301
|
* @param {Object} arg - Arg object.
|
|
2303
|
-
* @param {
|
|
2304
|
-
* @returns {Promise<
|
|
2302
|
+
* @param {InvalidateShipmentCachePayload} arg.body
|
|
2303
|
+
* @returns {Promise<InvalidateShipmentCacheResponse>} - Success response
|
|
2305
2304
|
* @summary:
|
|
2306
|
-
* @description:
|
|
2305
|
+
* @description: Invalidate shipment Cache
|
|
2307
2306
|
*/
|
|
2308
|
-
async
|
|
2309
|
-
const { error } = OrderValidator.
|
|
2307
|
+
async invalidateShipmentCache({ body } = {}) {
|
|
2308
|
+
const { error } = OrderValidator.invalidateShipmentCache().validate(
|
|
2310
2309
|
{
|
|
2311
2310
|
body,
|
|
2312
2311
|
},
|
|
@@ -2317,7 +2316,9 @@ class Order {
|
|
|
2317
2316
|
}
|
|
2318
2317
|
|
|
2319
2318
|
// Showing warrnings if extra unknown parameters are found
|
|
2320
|
-
const {
|
|
2319
|
+
const {
|
|
2320
|
+
error: warrning,
|
|
2321
|
+
} = OrderValidator.invalidateShipmentCache().validate(
|
|
2321
2322
|
{
|
|
2322
2323
|
body,
|
|
2323
2324
|
},
|
|
@@ -2326,7 +2327,7 @@ class Order {
|
|
|
2326
2327
|
if (warrning) {
|
|
2327
2328
|
Logger({
|
|
2328
2329
|
level: "WARN",
|
|
2329
|
-
message: "Parameter Validation warrnings for
|
|
2330
|
+
message: "Parameter Validation warrnings for invalidateShipmentCache",
|
|
2330
2331
|
});
|
|
2331
2332
|
Logger({ level: "WARN", message: warrning });
|
|
2332
2333
|
}
|
|
@@ -2337,8 +2338,8 @@ class Order {
|
|
|
2337
2338
|
|
|
2338
2339
|
const response = await PlatformAPIClient.execute(
|
|
2339
2340
|
this.config,
|
|
2340
|
-
"
|
|
2341
|
-
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/
|
|
2341
|
+
"put",
|
|
2342
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/update-cache`,
|
|
2342
2343
|
query_params,
|
|
2343
2344
|
body,
|
|
2344
2345
|
xHeaders
|
|
@@ -2346,7 +2347,7 @@ class Order {
|
|
|
2346
2347
|
|
|
2347
2348
|
const {
|
|
2348
2349
|
error: res_error,
|
|
2349
|
-
} = OrderModel.
|
|
2350
|
+
} = OrderModel.InvalidateShipmentCacheResponse().validate(response, {
|
|
2350
2351
|
abortEarly: false,
|
|
2351
2352
|
allowUnknown: false,
|
|
2352
2353
|
});
|
|
@@ -2354,7 +2355,7 @@ class Order {
|
|
|
2354
2355
|
if (res_error) {
|
|
2355
2356
|
Logger({
|
|
2356
2357
|
level: "WARN",
|
|
2357
|
-
message: "Response Validation Warnnings for
|
|
2358
|
+
message: "Response Validation Warnnings for invalidateShipmentCache",
|
|
2358
2359
|
});
|
|
2359
2360
|
Logger({ level: "WARN", message: res_error });
|
|
2360
2361
|
}
|
|
@@ -2364,13 +2365,13 @@ class Order {
|
|
|
2364
2365
|
|
|
2365
2366
|
/**
|
|
2366
2367
|
* @param {Object} arg - Arg object.
|
|
2367
|
-
* @param {
|
|
2368
|
-
* @returns {Promise<
|
|
2368
|
+
* @param {PlatformOrderUpdate} arg.body
|
|
2369
|
+
* @returns {Promise<ResponseDetail>} - Success response
|
|
2369
2370
|
* @summary:
|
|
2370
2371
|
* @description:
|
|
2371
2372
|
*/
|
|
2372
|
-
async
|
|
2373
|
-
const { error } = OrderValidator.
|
|
2373
|
+
async orderUpdate({ body } = {}) {
|
|
2374
|
+
const { error } = OrderValidator.orderUpdate().validate(
|
|
2374
2375
|
{
|
|
2375
2376
|
body,
|
|
2376
2377
|
},
|
|
@@ -2381,7 +2382,7 @@ class Order {
|
|
|
2381
2382
|
}
|
|
2382
2383
|
|
|
2383
2384
|
// Showing warrnings if extra unknown parameters are found
|
|
2384
|
-
const { error: warrning } = OrderValidator.
|
|
2385
|
+
const { error: warrning } = OrderValidator.orderUpdate().validate(
|
|
2385
2386
|
{
|
|
2386
2387
|
body,
|
|
2387
2388
|
},
|
|
@@ -2390,7 +2391,7 @@ class Order {
|
|
|
2390
2391
|
if (warrning) {
|
|
2391
2392
|
Logger({
|
|
2392
2393
|
level: "WARN",
|
|
2393
|
-
message: "Parameter Validation warrnings for
|
|
2394
|
+
message: "Parameter Validation warrnings for orderUpdate",
|
|
2394
2395
|
});
|
|
2395
2396
|
Logger({ level: "WARN", message: warrning });
|
|
2396
2397
|
}
|
|
@@ -2401,14 +2402,14 @@ class Order {
|
|
|
2401
2402
|
|
|
2402
2403
|
const response = await PlatformAPIClient.execute(
|
|
2403
2404
|
this.config,
|
|
2404
|
-
"
|
|
2405
|
-
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/
|
|
2405
|
+
"put",
|
|
2406
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/order/validation`,
|
|
2406
2407
|
query_params,
|
|
2407
2408
|
body,
|
|
2408
2409
|
xHeaders
|
|
2409
2410
|
);
|
|
2410
2411
|
|
|
2411
|
-
const { error: res_error } = OrderModel.
|
|
2412
|
+
const { error: res_error } = OrderModel.ResponseDetail().validate(
|
|
2412
2413
|
response,
|
|
2413
2414
|
{ abortEarly: false, allowUnknown: false }
|
|
2414
2415
|
);
|
|
@@ -2416,7 +2417,7 @@ class Order {
|
|
|
2416
2417
|
if (res_error) {
|
|
2417
2418
|
Logger({
|
|
2418
2419
|
level: "WARN",
|
|
2419
|
-
message: "Response Validation Warnnings for
|
|
2420
|
+
message: "Response Validation Warnnings for orderUpdate",
|
|
2420
2421
|
});
|
|
2421
2422
|
Logger({ level: "WARN", message: res_error });
|
|
2422
2423
|
}
|
|
@@ -2426,76 +2427,17 @@ class Order {
|
|
|
2426
2427
|
|
|
2427
2428
|
/**
|
|
2428
2429
|
* @param {Object} arg - Arg object.
|
|
2429
|
-
* @
|
|
2430
|
+
* @param {ManualAssignDPToShipment} arg.body
|
|
2431
|
+
* @returns {Promise<ManualAssignDPToShipmentResponse>} - Success response
|
|
2430
2432
|
* @summary:
|
|
2431
2433
|
* @description:
|
|
2432
2434
|
*/
|
|
2433
|
-
async
|
|
2434
|
-
const { error } = OrderValidator.getRoleBasedActions().validate(
|
|
2435
|
-
{},
|
|
2436
|
-
{ abortEarly: false, allowUnknown: true }
|
|
2437
|
-
);
|
|
2438
|
-
if (error) {
|
|
2439
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
2440
|
-
}
|
|
2441
|
-
|
|
2442
|
-
// Showing warrnings if extra unknown parameters are found
|
|
2443
|
-
const { error: warrning } = OrderValidator.getRoleBasedActions().validate(
|
|
2444
|
-
{},
|
|
2445
|
-
{ abortEarly: false, allowUnknown: false }
|
|
2446
|
-
);
|
|
2447
|
-
if (warrning) {
|
|
2448
|
-
Logger({
|
|
2449
|
-
level: "WARN",
|
|
2450
|
-
message: "Parameter Validation warrnings for getRoleBasedActions",
|
|
2451
|
-
});
|
|
2452
|
-
Logger({ level: "WARN", message: warrning });
|
|
2453
|
-
}
|
|
2454
|
-
|
|
2455
|
-
const query_params = {};
|
|
2456
|
-
|
|
2457
|
-
const xHeaders = {};
|
|
2458
|
-
|
|
2459
|
-
const response = await PlatformAPIClient.execute(
|
|
2460
|
-
this.config,
|
|
2461
|
-
"get",
|
|
2462
|
-
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/roles`,
|
|
2463
|
-
query_params,
|
|
2464
|
-
undefined,
|
|
2465
|
-
xHeaders
|
|
2466
|
-
);
|
|
2467
|
-
|
|
2435
|
+
async platformManualAssignDPToShipment({ body } = {}) {
|
|
2468
2436
|
const {
|
|
2469
|
-
error
|
|
2470
|
-
} =
|
|
2471
|
-
abortEarly: false,
|
|
2472
|
-
allowUnknown: false,
|
|
2473
|
-
});
|
|
2474
|
-
|
|
2475
|
-
if (res_error) {
|
|
2476
|
-
Logger({
|
|
2477
|
-
level: "WARN",
|
|
2478
|
-
message: "Response Validation Warnnings for getRoleBasedActions",
|
|
2479
|
-
});
|
|
2480
|
-
Logger({ level: "WARN", message: res_error });
|
|
2481
|
-
}
|
|
2482
|
-
|
|
2483
|
-
return response;
|
|
2484
|
-
}
|
|
2485
|
-
|
|
2486
|
-
/**
|
|
2487
|
-
* @param {Object} arg - Arg object.
|
|
2488
|
-
* @param {number} [arg.shipmentId] -
|
|
2489
|
-
* @param {number} [arg.bagId] -
|
|
2490
|
-
* @returns {Promise<ShipmentHistoryResponse>} - Success response
|
|
2491
|
-
* @summary:
|
|
2492
|
-
* @description:
|
|
2493
|
-
*/
|
|
2494
|
-
async getShipmentHistory({ shipmentId, bagId } = {}) {
|
|
2495
|
-
const { error } = OrderValidator.getShipmentHistory().validate(
|
|
2437
|
+
error,
|
|
2438
|
+
} = OrderValidator.platformManualAssignDPToShipment().validate(
|
|
2496
2439
|
{
|
|
2497
|
-
|
|
2498
|
-
bagId,
|
|
2440
|
+
body,
|
|
2499
2441
|
},
|
|
2500
2442
|
{ abortEarly: false, allowUnknown: true }
|
|
2501
2443
|
);
|
|
@@ -2504,39 +2446,39 @@ class Order {
|
|
|
2504
2446
|
}
|
|
2505
2447
|
|
|
2506
2448
|
// Showing warrnings if extra unknown parameters are found
|
|
2507
|
-
const {
|
|
2449
|
+
const {
|
|
2450
|
+
error: warrning,
|
|
2451
|
+
} = OrderValidator.platformManualAssignDPToShipment().validate(
|
|
2508
2452
|
{
|
|
2509
|
-
|
|
2510
|
-
bagId,
|
|
2453
|
+
body,
|
|
2511
2454
|
},
|
|
2512
2455
|
{ abortEarly: false, allowUnknown: false }
|
|
2513
2456
|
);
|
|
2514
2457
|
if (warrning) {
|
|
2515
2458
|
Logger({
|
|
2516
2459
|
level: "WARN",
|
|
2517
|
-
message:
|
|
2460
|
+
message:
|
|
2461
|
+
"Parameter Validation warrnings for platformManualAssignDPToShipment",
|
|
2518
2462
|
});
|
|
2519
2463
|
Logger({ level: "WARN", message: warrning });
|
|
2520
2464
|
}
|
|
2521
2465
|
|
|
2522
2466
|
const query_params = {};
|
|
2523
|
-
query_params["shipment_id"] = shipmentId;
|
|
2524
|
-
query_params["bag_id"] = bagId;
|
|
2525
2467
|
|
|
2526
2468
|
const xHeaders = {};
|
|
2527
2469
|
|
|
2528
2470
|
const response = await PlatformAPIClient.execute(
|
|
2529
2471
|
this.config,
|
|
2530
|
-
"
|
|
2531
|
-
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/shipment
|
|
2472
|
+
"post",
|
|
2473
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/oms/manual-place-shipment`,
|
|
2532
2474
|
query_params,
|
|
2533
|
-
|
|
2475
|
+
body,
|
|
2534
2476
|
xHeaders
|
|
2535
2477
|
);
|
|
2536
2478
|
|
|
2537
2479
|
const {
|
|
2538
2480
|
error: res_error,
|
|
2539
|
-
} = OrderModel.
|
|
2481
|
+
} = OrderModel.ManualAssignDPToShipmentResponse().validate(response, {
|
|
2540
2482
|
abortEarly: false,
|
|
2541
2483
|
allowUnknown: false,
|
|
2542
2484
|
});
|
|
@@ -2544,7 +2486,8 @@ class Order {
|
|
|
2544
2486
|
if (res_error) {
|
|
2545
2487
|
Logger({
|
|
2546
2488
|
level: "WARN",
|
|
2547
|
-
message:
|
|
2489
|
+
message:
|
|
2490
|
+
"Response Validation Warnnings for platformManualAssignDPToShipment",
|
|
2548
2491
|
});
|
|
2549
2492
|
Logger({ level: "WARN", message: res_error });
|
|
2550
2493
|
}
|
|
@@ -2618,13 +2561,13 @@ class Order {
|
|
|
2618
2561
|
|
|
2619
2562
|
/**
|
|
2620
2563
|
* @param {Object} arg - Arg object.
|
|
2621
|
-
* @param {
|
|
2622
|
-
* @returns {Promise<
|
|
2564
|
+
* @param {CreateOrderPayload} arg.body
|
|
2565
|
+
* @returns {Promise<CreateOrderResponse>} - Success response
|
|
2623
2566
|
* @summary:
|
|
2624
2567
|
* @description:
|
|
2625
2568
|
*/
|
|
2626
|
-
async
|
|
2627
|
-
const { error } = OrderValidator.
|
|
2569
|
+
async processManifest({ body } = {}) {
|
|
2570
|
+
const { error } = OrderValidator.processManifest().validate(
|
|
2628
2571
|
{
|
|
2629
2572
|
body,
|
|
2630
2573
|
},
|
|
@@ -2635,7 +2578,7 @@ class Order {
|
|
|
2635
2578
|
}
|
|
2636
2579
|
|
|
2637
2580
|
// Showing warrnings if extra unknown parameters are found
|
|
2638
|
-
const { error: warrning } = OrderValidator.
|
|
2581
|
+
const { error: warrning } = OrderValidator.processManifest().validate(
|
|
2639
2582
|
{
|
|
2640
2583
|
body,
|
|
2641
2584
|
},
|
|
@@ -2644,7 +2587,7 @@ class Order {
|
|
|
2644
2587
|
if (warrning) {
|
|
2645
2588
|
Logger({
|
|
2646
2589
|
level: "WARN",
|
|
2647
|
-
message: "Parameter Validation warrnings for
|
|
2590
|
+
message: "Parameter Validation warrnings for processManifest",
|
|
2648
2591
|
});
|
|
2649
2592
|
Logger({ level: "WARN", message: warrning });
|
|
2650
2593
|
}
|
|
@@ -2656,7 +2599,7 @@ class Order {
|
|
|
2656
2599
|
const response = await PlatformAPIClient.execute(
|
|
2657
2600
|
this.config,
|
|
2658
2601
|
"post",
|
|
2659
|
-
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/
|
|
2602
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/process-manifest`,
|
|
2660
2603
|
query_params,
|
|
2661
2604
|
body,
|
|
2662
2605
|
xHeaders
|
|
@@ -2664,7 +2607,7 @@ class Order {
|
|
|
2664
2607
|
|
|
2665
2608
|
const {
|
|
2666
2609
|
error: res_error,
|
|
2667
|
-
} = OrderModel.
|
|
2610
|
+
} = OrderModel.CreateOrderResponse().validate(response, {
|
|
2668
2611
|
abortEarly: false,
|
|
2669
2612
|
allowUnknown: false,
|
|
2670
2613
|
});
|
|
@@ -2672,7 +2615,7 @@ class Order {
|
|
|
2672
2615
|
if (res_error) {
|
|
2673
2616
|
Logger({
|
|
2674
2617
|
level: "WARN",
|
|
2675
|
-
message: "Response Validation Warnnings for
|
|
2618
|
+
message: "Response Validation Warnnings for processManifest",
|
|
2676
2619
|
});
|
|
2677
2620
|
Logger({ level: "WARN", message: res_error });
|
|
2678
2621
|
}
|
|
@@ -2682,15 +2625,13 @@ class Order {
|
|
|
2682
2625
|
|
|
2683
2626
|
/**
|
|
2684
2627
|
* @param {Object} arg - Arg object.
|
|
2685
|
-
* @param {
|
|
2686
|
-
* @returns {Promise<
|
|
2628
|
+
* @param {StoreReassign} arg.body
|
|
2629
|
+
* @returns {Promise<StoreReassignResponse>} - Success response
|
|
2687
2630
|
* @summary:
|
|
2688
|
-
* @description:
|
|
2631
|
+
* @description: Reassign Location
|
|
2689
2632
|
*/
|
|
2690
|
-
async
|
|
2691
|
-
const {
|
|
2692
|
-
error,
|
|
2693
|
-
} = OrderValidator.platformManualAssignDPToShipment().validate(
|
|
2633
|
+
async reassignLocation({ body } = {}) {
|
|
2634
|
+
const { error } = OrderValidator.reassignLocation().validate(
|
|
2694
2635
|
{
|
|
2695
2636
|
body,
|
|
2696
2637
|
},
|
|
@@ -2701,9 +2642,7 @@ class Order {
|
|
|
2701
2642
|
}
|
|
2702
2643
|
|
|
2703
2644
|
// Showing warrnings if extra unknown parameters are found
|
|
2704
|
-
const {
|
|
2705
|
-
error: warrning,
|
|
2706
|
-
} = OrderValidator.platformManualAssignDPToShipment().validate(
|
|
2645
|
+
const { error: warrning } = OrderValidator.reassignLocation().validate(
|
|
2707
2646
|
{
|
|
2708
2647
|
body,
|
|
2709
2648
|
},
|
|
@@ -2712,8 +2651,7 @@ class Order {
|
|
|
2712
2651
|
if (warrning) {
|
|
2713
2652
|
Logger({
|
|
2714
2653
|
level: "WARN",
|
|
2715
|
-
message:
|
|
2716
|
-
"Parameter Validation warrnings for platformManualAssignDPToShipment",
|
|
2654
|
+
message: "Parameter Validation warrnings for reassignLocation",
|
|
2717
2655
|
});
|
|
2718
2656
|
Logger({ level: "WARN", message: warrning });
|
|
2719
2657
|
}
|
|
@@ -2725,7 +2663,7 @@ class Order {
|
|
|
2725
2663
|
const response = await PlatformAPIClient.execute(
|
|
2726
2664
|
this.config,
|
|
2727
2665
|
"post",
|
|
2728
|
-
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/
|
|
2666
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/store/reassign-internal`,
|
|
2729
2667
|
query_params,
|
|
2730
2668
|
body,
|
|
2731
2669
|
xHeaders
|
|
@@ -2733,7 +2671,7 @@ class Order {
|
|
|
2733
2671
|
|
|
2734
2672
|
const {
|
|
2735
2673
|
error: res_error,
|
|
2736
|
-
} = OrderModel.
|
|
2674
|
+
} = OrderModel.StoreReassignResponse().validate(response, {
|
|
2737
2675
|
abortEarly: false,
|
|
2738
2676
|
allowUnknown: false,
|
|
2739
2677
|
});
|
|
@@ -2741,8 +2679,7 @@ class Order {
|
|
|
2741
2679
|
if (res_error) {
|
|
2742
2680
|
Logger({
|
|
2743
2681
|
level: "WARN",
|
|
2744
|
-
message:
|
|
2745
|
-
"Response Validation Warnnings for platformManualAssignDPToShipment",
|
|
2682
|
+
message: "Response Validation Warnnings for reassignLocation",
|
|
2746
2683
|
});
|
|
2747
2684
|
Logger({ level: "WARN", message: res_error });
|
|
2748
2685
|
}
|
|
@@ -2752,13 +2689,13 @@ class Order {
|
|
|
2752
2689
|
|
|
2753
2690
|
/**
|
|
2754
2691
|
* @param {Object} arg - Arg object.
|
|
2755
|
-
* @param {
|
|
2756
|
-
* @returns {Promise<
|
|
2692
|
+
* @param {SendSmsPayload} arg.body
|
|
2693
|
+
* @returns {Promise<OrderStatusResult>} - Success response
|
|
2757
2694
|
* @summary:
|
|
2758
2695
|
* @description:
|
|
2759
2696
|
*/
|
|
2760
|
-
async
|
|
2761
|
-
const { error } = OrderValidator.
|
|
2697
|
+
async sendSmsNinja({ body } = {}) {
|
|
2698
|
+
const { error } = OrderValidator.sendSmsNinja().validate(
|
|
2762
2699
|
{
|
|
2763
2700
|
body,
|
|
2764
2701
|
},
|
|
@@ -2769,9 +2706,7 @@ class Order {
|
|
|
2769
2706
|
}
|
|
2770
2707
|
|
|
2771
2708
|
// Showing warrnings if extra unknown parameters are found
|
|
2772
|
-
const {
|
|
2773
|
-
error: warrning,
|
|
2774
|
-
} = OrderValidator.updatePackagingDimensions().validate(
|
|
2709
|
+
const { error: warrning } = OrderValidator.sendSmsNinja().validate(
|
|
2775
2710
|
{
|
|
2776
2711
|
body,
|
|
2777
2712
|
},
|
|
@@ -2780,7 +2715,7 @@ class Order {
|
|
|
2780
2715
|
if (warrning) {
|
|
2781
2716
|
Logger({
|
|
2782
2717
|
level: "WARN",
|
|
2783
|
-
message: "Parameter Validation warrnings for
|
|
2718
|
+
message: "Parameter Validation warrnings for sendSmsNinja",
|
|
2784
2719
|
});
|
|
2785
2720
|
Logger({ level: "WARN", message: warrning });
|
|
2786
2721
|
}
|
|
@@ -2792,7 +2727,7 @@ class Order {
|
|
|
2792
2727
|
const response = await PlatformAPIClient.execute(
|
|
2793
2728
|
this.config,
|
|
2794
2729
|
"post",
|
|
2795
|
-
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/
|
|
2730
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/ninja/send-sms`,
|
|
2796
2731
|
query_params,
|
|
2797
2732
|
body,
|
|
2798
2733
|
xHeaders
|
|
@@ -2800,7 +2735,7 @@ class Order {
|
|
|
2800
2735
|
|
|
2801
2736
|
const {
|
|
2802
2737
|
error: res_error,
|
|
2803
|
-
} = OrderModel.
|
|
2738
|
+
} = OrderModel.OrderStatusResult().validate(response, {
|
|
2804
2739
|
abortEarly: false,
|
|
2805
2740
|
allowUnknown: false,
|
|
2806
2741
|
});
|
|
@@ -2808,7 +2743,7 @@ class Order {
|
|
|
2808
2743
|
if (res_error) {
|
|
2809
2744
|
Logger({
|
|
2810
2745
|
level: "WARN",
|
|
2811
|
-
message: "Response Validation Warnnings for
|
|
2746
|
+
message: "Response Validation Warnnings for sendSmsNinja",
|
|
2812
2747
|
});
|
|
2813
2748
|
Logger({ level: "WARN", message: res_error });
|
|
2814
2749
|
}
|
|
@@ -2818,16 +2753,13 @@ class Order {
|
|
|
2818
2753
|
|
|
2819
2754
|
/**
|
|
2820
2755
|
* @param {Object} arg - Arg object.
|
|
2821
|
-
* @
|
|
2822
|
-
* @returns {Promise<CreateOrderResponse>} - Success response
|
|
2756
|
+
* @returns {Promise<OrderStatusResult>} - Success response
|
|
2823
2757
|
* @summary:
|
|
2824
2758
|
* @description:
|
|
2825
2759
|
*/
|
|
2826
|
-
async
|
|
2827
|
-
const { error } = OrderValidator.
|
|
2828
|
-
{
|
|
2829
|
-
body,
|
|
2830
|
-
},
|
|
2760
|
+
async sendSmsNinjaPlatform({} = {}) {
|
|
2761
|
+
const { error } = OrderValidator.sendSmsNinjaPlatform().validate(
|
|
2762
|
+
{},
|
|
2831
2763
|
{ abortEarly: false, allowUnknown: true }
|
|
2832
2764
|
);
|
|
2833
2765
|
if (error) {
|
|
@@ -2835,16 +2767,14 @@ class Order {
|
|
|
2835
2767
|
}
|
|
2836
2768
|
|
|
2837
2769
|
// Showing warrnings if extra unknown parameters are found
|
|
2838
|
-
const { error: warrning } = OrderValidator.
|
|
2839
|
-
{
|
|
2840
|
-
body,
|
|
2841
|
-
},
|
|
2770
|
+
const { error: warrning } = OrderValidator.sendSmsNinjaPlatform().validate(
|
|
2771
|
+
{},
|
|
2842
2772
|
{ abortEarly: false, allowUnknown: false }
|
|
2843
2773
|
);
|
|
2844
2774
|
if (warrning) {
|
|
2845
2775
|
Logger({
|
|
2846
2776
|
level: "WARN",
|
|
2847
|
-
message: "Parameter Validation warrnings for
|
|
2777
|
+
message: "Parameter Validation warrnings for sendSmsNinjaPlatform",
|
|
2848
2778
|
});
|
|
2849
2779
|
Logger({ level: "WARN", message: warrning });
|
|
2850
2780
|
}
|
|
@@ -2855,16 +2785,16 @@ class Order {
|
|
|
2855
2785
|
|
|
2856
2786
|
const response = await PlatformAPIClient.execute(
|
|
2857
2787
|
this.config,
|
|
2858
|
-
"
|
|
2859
|
-
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/
|
|
2788
|
+
"get",
|
|
2789
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/bag/state/transition`,
|
|
2860
2790
|
query_params,
|
|
2861
|
-
|
|
2791
|
+
undefined,
|
|
2862
2792
|
xHeaders
|
|
2863
2793
|
);
|
|
2864
2794
|
|
|
2865
2795
|
const {
|
|
2866
2796
|
error: res_error,
|
|
2867
|
-
} = OrderModel.
|
|
2797
|
+
} = OrderModel.OrderStatusResult().validate(response, {
|
|
2868
2798
|
abortEarly: false,
|
|
2869
2799
|
allowUnknown: false,
|
|
2870
2800
|
});
|
|
@@ -2872,7 +2802,7 @@ class Order {
|
|
|
2872
2802
|
if (res_error) {
|
|
2873
2803
|
Logger({
|
|
2874
2804
|
level: "WARN",
|
|
2875
|
-
message: "Response Validation Warnnings for
|
|
2805
|
+
message: "Response Validation Warnnings for sendSmsNinjaPlatform",
|
|
2876
2806
|
});
|
|
2877
2807
|
Logger({ level: "WARN", message: res_error });
|
|
2878
2808
|
}
|
|
@@ -2882,13 +2812,51 @@ class Order {
|
|
|
2882
2812
|
|
|
2883
2813
|
/**
|
|
2884
2814
|
* @param {Object} arg - Arg object.
|
|
2885
|
-
* @
|
|
2815
|
+
* @param {string} arg.shipmentId -
|
|
2816
|
+
* @param {string} [arg.name] -
|
|
2817
|
+
* @param {string} [arg.address] -
|
|
2818
|
+
* @param {string} [arg.addressType] -
|
|
2819
|
+
* @param {string} [arg.pincode] -
|
|
2820
|
+
* @param {string} [arg.phone] -
|
|
2821
|
+
* @param {string} [arg.email] -
|
|
2822
|
+
* @param {string} [arg.landmark] -
|
|
2823
|
+
* @param {string} arg.addressCategory -
|
|
2824
|
+
* @param {string} [arg.city] -
|
|
2825
|
+
* @param {string} [arg.state] -
|
|
2826
|
+
* @param {string} [arg.country] -
|
|
2827
|
+
* @returns {Promise<BaseResponse>} - Success response
|
|
2886
2828
|
* @summary:
|
|
2887
|
-
* @description:
|
|
2829
|
+
* @description:
|
|
2888
2830
|
*/
|
|
2889
|
-
async
|
|
2890
|
-
|
|
2891
|
-
|
|
2831
|
+
async updateAddress({
|
|
2832
|
+
shipmentId,
|
|
2833
|
+
addressCategory,
|
|
2834
|
+
name,
|
|
2835
|
+
address,
|
|
2836
|
+
addressType,
|
|
2837
|
+
pincode,
|
|
2838
|
+
phone,
|
|
2839
|
+
email,
|
|
2840
|
+
landmark,
|
|
2841
|
+
city,
|
|
2842
|
+
state,
|
|
2843
|
+
country,
|
|
2844
|
+
} = {}) {
|
|
2845
|
+
const { error } = OrderValidator.updateAddress().validate(
|
|
2846
|
+
{
|
|
2847
|
+
shipmentId,
|
|
2848
|
+
addressCategory,
|
|
2849
|
+
name,
|
|
2850
|
+
address,
|
|
2851
|
+
addressType,
|
|
2852
|
+
pincode,
|
|
2853
|
+
phone,
|
|
2854
|
+
email,
|
|
2855
|
+
landmark,
|
|
2856
|
+
city,
|
|
2857
|
+
state,
|
|
2858
|
+
country,
|
|
2859
|
+
},
|
|
2892
2860
|
{ abortEarly: false, allowUnknown: true }
|
|
2893
2861
|
);
|
|
2894
2862
|
if (error) {
|
|
@@ -2896,34 +2864,57 @@ class Order {
|
|
|
2896
2864
|
}
|
|
2897
2865
|
|
|
2898
2866
|
// Showing warrnings if extra unknown parameters are found
|
|
2899
|
-
const { error: warrning } = OrderValidator.
|
|
2900
|
-
{
|
|
2867
|
+
const { error: warrning } = OrderValidator.updateAddress().validate(
|
|
2868
|
+
{
|
|
2869
|
+
shipmentId,
|
|
2870
|
+
addressCategory,
|
|
2871
|
+
name,
|
|
2872
|
+
address,
|
|
2873
|
+
addressType,
|
|
2874
|
+
pincode,
|
|
2875
|
+
phone,
|
|
2876
|
+
email,
|
|
2877
|
+
landmark,
|
|
2878
|
+
city,
|
|
2879
|
+
state,
|
|
2880
|
+
country,
|
|
2881
|
+
},
|
|
2901
2882
|
{ abortEarly: false, allowUnknown: false }
|
|
2902
2883
|
);
|
|
2903
2884
|
if (warrning) {
|
|
2904
2885
|
Logger({
|
|
2905
2886
|
level: "WARN",
|
|
2906
|
-
message: "Parameter Validation warrnings for
|
|
2887
|
+
message: "Parameter Validation warrnings for updateAddress",
|
|
2907
2888
|
});
|
|
2908
2889
|
Logger({ level: "WARN", message: warrning });
|
|
2909
2890
|
}
|
|
2910
2891
|
|
|
2911
2892
|
const query_params = {};
|
|
2893
|
+
query_params["shipment_id"] = shipmentId;
|
|
2894
|
+
query_params["name"] = name;
|
|
2895
|
+
query_params["address"] = address;
|
|
2896
|
+
query_params["address_type"] = addressType;
|
|
2897
|
+
query_params["pincode"] = pincode;
|
|
2898
|
+
query_params["phone"] = phone;
|
|
2899
|
+
query_params["email"] = email;
|
|
2900
|
+
query_params["landmark"] = landmark;
|
|
2901
|
+
query_params["address_category"] = addressCategory;
|
|
2902
|
+
query_params["city"] = city;
|
|
2903
|
+
query_params["state"] = state;
|
|
2904
|
+
query_params["country"] = country;
|
|
2912
2905
|
|
|
2913
2906
|
const xHeaders = {};
|
|
2914
2907
|
|
|
2915
2908
|
const response = await PlatformAPIClient.execute(
|
|
2916
2909
|
this.config,
|
|
2917
|
-
"
|
|
2918
|
-
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/
|
|
2910
|
+
"post",
|
|
2911
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/delight/update-address`,
|
|
2919
2912
|
query_params,
|
|
2920
2913
|
undefined,
|
|
2921
2914
|
xHeaders
|
|
2922
2915
|
);
|
|
2923
2916
|
|
|
2924
|
-
const {
|
|
2925
|
-
error: res_error,
|
|
2926
|
-
} = OrderModel.CreateChannelConfigData().validate(response, {
|
|
2917
|
+
const { error: res_error } = OrderModel.BaseResponse().validate(response, {
|
|
2927
2918
|
abortEarly: false,
|
|
2928
2919
|
allowUnknown: false,
|
|
2929
2920
|
});
|
|
@@ -2931,7 +2922,7 @@ class Order {
|
|
|
2931
2922
|
if (res_error) {
|
|
2932
2923
|
Logger({
|
|
2933
2924
|
level: "WARN",
|
|
2934
|
-
message: "Response Validation Warnnings for
|
|
2925
|
+
message: "Response Validation Warnnings for updateAddress",
|
|
2935
2926
|
});
|
|
2936
2927
|
Logger({ level: "WARN", message: res_error });
|
|
2937
2928
|
}
|
|
@@ -2941,13 +2932,13 @@ class Order {
|
|
|
2941
2932
|
|
|
2942
2933
|
/**
|
|
2943
2934
|
* @param {Object} arg - Arg object.
|
|
2944
|
-
* @param {
|
|
2945
|
-
* @returns {Promise<
|
|
2935
|
+
* @param {CreateOrderPayload} arg.body
|
|
2936
|
+
* @returns {Promise<CreateOrderResponse>} - Success response
|
|
2946
2937
|
* @summary:
|
|
2947
|
-
* @description:
|
|
2938
|
+
* @description:
|
|
2948
2939
|
*/
|
|
2949
|
-
async
|
|
2950
|
-
const { error } = OrderValidator.
|
|
2940
|
+
async updatePackagingDimensions({ body } = {}) {
|
|
2941
|
+
const { error } = OrderValidator.updatePackagingDimensions().validate(
|
|
2951
2942
|
{
|
|
2952
2943
|
body,
|
|
2953
2944
|
},
|
|
@@ -2958,7 +2949,9 @@ class Order {
|
|
|
2958
2949
|
}
|
|
2959
2950
|
|
|
2960
2951
|
// Showing warrnings if extra unknown parameters are found
|
|
2961
|
-
const {
|
|
2952
|
+
const {
|
|
2953
|
+
error: warrning,
|
|
2954
|
+
} = OrderValidator.updatePackagingDimensions().validate(
|
|
2962
2955
|
{
|
|
2963
2956
|
body,
|
|
2964
2957
|
},
|
|
@@ -2967,7 +2960,7 @@ class Order {
|
|
|
2967
2960
|
if (warrning) {
|
|
2968
2961
|
Logger({
|
|
2969
2962
|
level: "WARN",
|
|
2970
|
-
message: "Parameter Validation warrnings for
|
|
2963
|
+
message: "Parameter Validation warrnings for updatePackagingDimensions",
|
|
2971
2964
|
});
|
|
2972
2965
|
Logger({ level: "WARN", message: warrning });
|
|
2973
2966
|
}
|
|
@@ -2979,7 +2972,7 @@ class Order {
|
|
|
2979
2972
|
const response = await PlatformAPIClient.execute(
|
|
2980
2973
|
this.config,
|
|
2981
2974
|
"post",
|
|
2982
|
-
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/
|
|
2975
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/update-packaging-dimension`,
|
|
2983
2976
|
query_params,
|
|
2984
2977
|
body,
|
|
2985
2978
|
xHeaders
|
|
@@ -2987,7 +2980,7 @@ class Order {
|
|
|
2987
2980
|
|
|
2988
2981
|
const {
|
|
2989
2982
|
error: res_error,
|
|
2990
|
-
} = OrderModel.
|
|
2983
|
+
} = OrderModel.CreateOrderResponse().validate(response, {
|
|
2991
2984
|
abortEarly: false,
|
|
2992
2985
|
allowUnknown: false,
|
|
2993
2986
|
});
|
|
@@ -2995,7 +2988,7 @@ class Order {
|
|
|
2995
2988
|
if (res_error) {
|
|
2996
2989
|
Logger({
|
|
2997
2990
|
level: "WARN",
|
|
2998
|
-
message: "Response Validation Warnnings for
|
|
2991
|
+
message: "Response Validation Warnnings for updatePackagingDimensions",
|
|
2999
2992
|
});
|
|
3000
2993
|
Logger({ level: "WARN", message: res_error });
|
|
3001
2994
|
}
|
|
@@ -3005,13 +2998,13 @@ class Order {
|
|
|
3005
2998
|
|
|
3006
2999
|
/**
|
|
3007
3000
|
* @param {Object} arg - Arg object.
|
|
3008
|
-
* @param {
|
|
3009
|
-
* @returns {Promise<
|
|
3001
|
+
* @param {UpdateShipmentLockPayload} arg.body
|
|
3002
|
+
* @returns {Promise<UpdateShipmentLockResponse>} - Success response
|
|
3010
3003
|
* @summary:
|
|
3011
|
-
* @description:
|
|
3004
|
+
* @description: update shipment lock
|
|
3012
3005
|
*/
|
|
3013
|
-
async
|
|
3014
|
-
const { error } = OrderValidator.
|
|
3006
|
+
async updateShipmentLock({ body } = {}) {
|
|
3007
|
+
const { error } = OrderValidator.updateShipmentLock().validate(
|
|
3015
3008
|
{
|
|
3016
3009
|
body,
|
|
3017
3010
|
},
|
|
@@ -3022,7 +3015,7 @@ class Order {
|
|
|
3022
3015
|
}
|
|
3023
3016
|
|
|
3024
3017
|
// Showing warrnings if extra unknown parameters are found
|
|
3025
|
-
const { error: warrning } = OrderValidator.
|
|
3018
|
+
const { error: warrning } = OrderValidator.updateShipmentLock().validate(
|
|
3026
3019
|
{
|
|
3027
3020
|
body,
|
|
3028
3021
|
},
|
|
@@ -3031,7 +3024,7 @@ class Order {
|
|
|
3031
3024
|
if (warrning) {
|
|
3032
3025
|
Logger({
|
|
3033
3026
|
level: "WARN",
|
|
3034
|
-
message: "Parameter Validation warrnings for
|
|
3027
|
+
message: "Parameter Validation warrnings for updateShipmentLock",
|
|
3035
3028
|
});
|
|
3036
3029
|
Logger({ level: "WARN", message: warrning });
|
|
3037
3030
|
}
|
|
@@ -3043,21 +3036,23 @@ class Order {
|
|
|
3043
3036
|
const response = await PlatformAPIClient.execute(
|
|
3044
3037
|
this.config,
|
|
3045
3038
|
"post",
|
|
3046
|
-
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/
|
|
3039
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/entity/lock-manager`,
|
|
3047
3040
|
query_params,
|
|
3048
3041
|
body,
|
|
3049
3042
|
xHeaders
|
|
3050
3043
|
);
|
|
3051
3044
|
|
|
3052
|
-
const {
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3045
|
+
const {
|
|
3046
|
+
error: res_error,
|
|
3047
|
+
} = OrderModel.UpdateShipmentLockResponse().validate(response, {
|
|
3048
|
+
abortEarly: false,
|
|
3049
|
+
allowUnknown: false,
|
|
3050
|
+
});
|
|
3056
3051
|
|
|
3057
3052
|
if (res_error) {
|
|
3058
3053
|
Logger({
|
|
3059
3054
|
level: "WARN",
|
|
3060
|
-
message: "Response Validation Warnnings for
|
|
3055
|
+
message: "Response Validation Warnnings for updateShipmentLock",
|
|
3061
3056
|
});
|
|
3062
3057
|
Logger({ level: "WARN", message: res_error });
|
|
3063
3058
|
}
|
|
@@ -3067,13 +3062,13 @@ class Order {
|
|
|
3067
3062
|
|
|
3068
3063
|
/**
|
|
3069
3064
|
* @param {Object} arg - Arg object.
|
|
3070
|
-
* @param {
|
|
3071
|
-
* @returns {Promise<
|
|
3065
|
+
* @param {UpdateShipmentStatusRequest} arg.body
|
|
3066
|
+
* @returns {Promise<UpdateShipmentStatusResponseBody>} - Success response
|
|
3072
3067
|
* @summary:
|
|
3073
|
-
* @description:
|
|
3068
|
+
* @description: Update shipment status
|
|
3074
3069
|
*/
|
|
3075
|
-
async
|
|
3076
|
-
const { error } = OrderValidator.
|
|
3070
|
+
async updateShipmentStatus({ body } = {}) {
|
|
3071
|
+
const { error } = OrderValidator.updateShipmentStatus().validate(
|
|
3077
3072
|
{
|
|
3078
3073
|
body,
|
|
3079
3074
|
},
|
|
@@ -3084,7 +3079,7 @@ class Order {
|
|
|
3084
3079
|
}
|
|
3085
3080
|
|
|
3086
3081
|
// Showing warrnings if extra unknown parameters are found
|
|
3087
|
-
const { error: warrning } = OrderValidator.
|
|
3082
|
+
const { error: warrning } = OrderValidator.updateShipmentStatus().validate(
|
|
3088
3083
|
{
|
|
3089
3084
|
body,
|
|
3090
3085
|
},
|
|
@@ -3093,7 +3088,7 @@ class Order {
|
|
|
3093
3088
|
if (warrning) {
|
|
3094
3089
|
Logger({
|
|
3095
3090
|
level: "WARN",
|
|
3096
|
-
message: "Parameter Validation warrnings for
|
|
3091
|
+
message: "Parameter Validation warrnings for updateShipmentStatus",
|
|
3097
3092
|
});
|
|
3098
3093
|
Logger({ level: "WARN", message: warrning });
|
|
3099
3094
|
}
|
|
@@ -3105,21 +3100,23 @@ class Order {
|
|
|
3105
3100
|
const response = await PlatformAPIClient.execute(
|
|
3106
3101
|
this.config,
|
|
3107
3102
|
"put",
|
|
3108
|
-
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/
|
|
3103
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/shipment/status-internal`,
|
|
3109
3104
|
query_params,
|
|
3110
3105
|
body,
|
|
3111
3106
|
xHeaders
|
|
3112
3107
|
);
|
|
3113
3108
|
|
|
3114
|
-
const {
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3109
|
+
const {
|
|
3110
|
+
error: res_error,
|
|
3111
|
+
} = OrderModel.UpdateShipmentStatusResponseBody().validate(response, {
|
|
3112
|
+
abortEarly: false,
|
|
3113
|
+
allowUnknown: false,
|
|
3114
|
+
});
|
|
3118
3115
|
|
|
3119
3116
|
if (res_error) {
|
|
3120
3117
|
Logger({
|
|
3121
3118
|
level: "WARN",
|
|
3122
|
-
message: "Response Validation Warnnings for
|
|
3119
|
+
message: "Response Validation Warnnings for updateShipmentStatus",
|
|
3123
3120
|
});
|
|
3124
3121
|
Logger({ level: "WARN", message: res_error });
|
|
3125
3122
|
}
|
|
@@ -3129,13 +3126,13 @@ class Order {
|
|
|
3129
3126
|
|
|
3130
3127
|
/**
|
|
3131
3128
|
* @param {Object} arg - Arg object.
|
|
3132
|
-
* @param {
|
|
3133
|
-
* @returns {Promise<
|
|
3129
|
+
* @param {UploadConsent} arg.body
|
|
3130
|
+
* @returns {Promise<SuccessResponse>} - Success response
|
|
3134
3131
|
* @summary:
|
|
3135
3132
|
* @description:
|
|
3136
3133
|
*/
|
|
3137
|
-
async
|
|
3138
|
-
const { error } = OrderValidator.
|
|
3134
|
+
async uploadConsent({ body } = {}) {
|
|
3135
|
+
const { error } = OrderValidator.uploadConsent().validate(
|
|
3139
3136
|
{
|
|
3140
3137
|
body,
|
|
3141
3138
|
},
|
|
@@ -3146,7 +3143,7 @@ class Order {
|
|
|
3146
3143
|
}
|
|
3147
3144
|
|
|
3148
3145
|
// Showing warrnings if extra unknown parameters are found
|
|
3149
|
-
const { error: warrning } = OrderValidator.
|
|
3146
|
+
const { error: warrning } = OrderValidator.uploadConsent().validate(
|
|
3150
3147
|
{
|
|
3151
3148
|
body,
|
|
3152
3149
|
},
|
|
@@ -3155,7 +3152,7 @@ class Order {
|
|
|
3155
3152
|
if (warrning) {
|
|
3156
3153
|
Logger({
|
|
3157
3154
|
level: "WARN",
|
|
3158
|
-
message: "Parameter Validation warrnings for
|
|
3155
|
+
message: "Parameter Validation warrnings for uploadConsent",
|
|
3159
3156
|
});
|
|
3160
3157
|
Logger({ level: "WARN", message: warrning });
|
|
3161
3158
|
}
|
|
@@ -3167,23 +3164,21 @@ class Order {
|
|
|
3167
3164
|
const response = await PlatformAPIClient.execute(
|
|
3168
3165
|
this.config,
|
|
3169
3166
|
"post",
|
|
3170
|
-
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/
|
|
3167
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/manifest/uploadConsent`,
|
|
3171
3168
|
query_params,
|
|
3172
3169
|
body,
|
|
3173
3170
|
xHeaders
|
|
3174
3171
|
);
|
|
3175
3172
|
|
|
3176
|
-
const {
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
allowUnknown: false,
|
|
3181
|
-
});
|
|
3173
|
+
const { error: res_error } = OrderModel.SuccessResponse().validate(
|
|
3174
|
+
response,
|
|
3175
|
+
{ abortEarly: false, allowUnknown: false }
|
|
3176
|
+
);
|
|
3182
3177
|
|
|
3183
3178
|
if (res_error) {
|
|
3184
3179
|
Logger({
|
|
3185
3180
|
level: "WARN",
|
|
3186
|
-
message: "Response Validation Warnnings for
|
|
3181
|
+
message: "Response Validation Warnnings for uploadConsent",
|
|
3187
3182
|
});
|
|
3188
3183
|
Logger({ level: "WARN", message: res_error });
|
|
3189
3184
|
}
|
|
@@ -3193,13 +3188,16 @@ class Order {
|
|
|
3193
3188
|
|
|
3194
3189
|
/**
|
|
3195
3190
|
* @param {Object} arg - Arg object.
|
|
3196
|
-
* @
|
|
3191
|
+
* @param {JioCodeUpsertPayload} arg.body
|
|
3192
|
+
* @returns {Promise<JioCodeUpsertResponse>} - Success response
|
|
3197
3193
|
* @summary:
|
|
3198
3194
|
* @description:
|
|
3199
3195
|
*/
|
|
3200
|
-
async
|
|
3201
|
-
const { error } = OrderValidator.
|
|
3202
|
-
{
|
|
3196
|
+
async upsertJioCode({ body } = {}) {
|
|
3197
|
+
const { error } = OrderValidator.upsertJioCode().validate(
|
|
3198
|
+
{
|
|
3199
|
+
body,
|
|
3200
|
+
},
|
|
3203
3201
|
{ abortEarly: false, allowUnknown: true }
|
|
3204
3202
|
);
|
|
3205
3203
|
if (error) {
|
|
@@ -3207,14 +3205,16 @@ class Order {
|
|
|
3207
3205
|
}
|
|
3208
3206
|
|
|
3209
3207
|
// Showing warrnings if extra unknown parameters are found
|
|
3210
|
-
const { error: warrning } = OrderValidator.
|
|
3211
|
-
{
|
|
3208
|
+
const { error: warrning } = OrderValidator.upsertJioCode().validate(
|
|
3209
|
+
{
|
|
3210
|
+
body,
|
|
3211
|
+
},
|
|
3212
3212
|
{ abortEarly: false, allowUnknown: false }
|
|
3213
3213
|
);
|
|
3214
3214
|
if (warrning) {
|
|
3215
3215
|
Logger({
|
|
3216
3216
|
level: "WARN",
|
|
3217
|
-
message: "Parameter Validation warrnings for
|
|
3217
|
+
message: "Parameter Validation warrnings for upsertJioCode",
|
|
3218
3218
|
});
|
|
3219
3219
|
Logger({ level: "WARN", message: warrning });
|
|
3220
3220
|
}
|
|
@@ -3225,16 +3225,16 @@ class Order {
|
|
|
3225
3225
|
|
|
3226
3226
|
const response = await PlatformAPIClient.execute(
|
|
3227
3227
|
this.config,
|
|
3228
|
-
"
|
|
3229
|
-
`/service/platform/
|
|
3228
|
+
"post",
|
|
3229
|
+
`/service/platform/orders/v1.0/company/${this.config.companyId}/upsert/jiocode/article`,
|
|
3230
3230
|
query_params,
|
|
3231
|
-
|
|
3231
|
+
body,
|
|
3232
3232
|
xHeaders
|
|
3233
3233
|
);
|
|
3234
3234
|
|
|
3235
3235
|
const {
|
|
3236
3236
|
error: res_error,
|
|
3237
|
-
} = OrderModel.
|
|
3237
|
+
} = OrderModel.JioCodeUpsertResponse().validate(response, {
|
|
3238
3238
|
abortEarly: false,
|
|
3239
3239
|
allowUnknown: false,
|
|
3240
3240
|
});
|
|
@@ -3242,7 +3242,7 @@ class Order {
|
|
|
3242
3242
|
if (res_error) {
|
|
3243
3243
|
Logger({
|
|
3244
3244
|
level: "WARN",
|
|
3245
|
-
message: "Response Validation Warnnings for
|
|
3245
|
+
message: "Response Validation Warnnings for upsertJioCode",
|
|
3246
3246
|
});
|
|
3247
3247
|
Logger({ level: "WARN", message: res_error });
|
|
3248
3248
|
}
|