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