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