@gofynd/fdk-client-javascript 1.4.2-beta.1 → 1.4.2-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/sdk/application/Cart/CartApplicationModel.d.ts +1742 -1726
- package/sdk/application/Cart/CartApplicationModel.js +1497 -1481
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +1917 -1917
- package/sdk/application/Catalog/CatalogApplicationModel.js +1611 -1611
- package/sdk/application/Common/CommonApplicationModel.d.ts +235 -235
- package/sdk/application/Common/CommonApplicationModel.js +172 -172
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +72 -72
- package/sdk/application/Communication/CommunicationApplicationModel.js +64 -64
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +1614 -1614
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +1151 -1151
- package/sdk/application/Content/ContentApplicationModel.d.ts +797 -797
- package/sdk/application/Content/ContentApplicationModel.js +757 -757
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +79 -79
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +84 -84
- package/sdk/application/Lead/LeadApplicationModel.d.ts +417 -417
- package/sdk/application/Lead/LeadApplicationModel.js +301 -301
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +666 -666
- package/sdk/application/Logistic/LogisticApplicationModel.js +601 -601
- package/sdk/application/Order/OrderApplicationModel.d.ts +846 -846
- package/sdk/application/Order/OrderApplicationModel.js +822 -822
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +5 -5
- package/sdk/application/Payment/PaymentApplicationClient.js +10 -10
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +2155 -2150
- package/sdk/application/Payment/PaymentApplicationModel.js +1460 -1458
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +5 -5
- package/sdk/application/Payment/PaymentApplicationValidator.js +3 -3
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +1462 -1462
- package/sdk/application/PosCart/PosCartApplicationModel.js +1260 -1260
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +214 -214
- package/sdk/application/Rewards/RewardsApplicationModel.js +211 -211
- package/sdk/application/Share/ShareApplicationModel.d.ts +114 -114
- package/sdk/application/Share/ShareApplicationModel.js +121 -121
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +895 -895
- package/sdk/application/Theme/ThemeApplicationModel.js +684 -684
- package/sdk/application/User/UserApplicationModel.d.ts +762 -762
- package/sdk/application/User/UserApplicationModel.js +738 -738
- package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +63 -63
- package/sdk/partner/FileStorage/FileStoragePartnerModel.js +65 -65
- package/sdk/partner/Lead/LeadPartnerModel.d.ts +661 -661
- package/sdk/partner/Lead/LeadPartnerModel.js +491 -491
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +223 -223
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +235 -235
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +1087 -1087
- package/sdk/partner/Theme/ThemePartnerModel.js +819 -819
- package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +386 -386
- package/sdk/partner/Webhook/WebhookPartnerModel.js +342 -342
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +123 -123
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +109 -109
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +801 -801
- package/sdk/platform/Billing/BillingPlatformModel.js +783 -783
- package/sdk/platform/Cart/CartPlatformModel.d.ts +3333 -3317
- package/sdk/platform/Cart/CartPlatformModel.js +2936 -2920
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +1013 -1013
- package/sdk/platform/Catalog/CatalogPlatformModel.js +923 -923
- package/sdk/platform/Common/CommonPlatformModel.d.ts +255 -255
- package/sdk/platform/Common/CommonPlatformModel.js +187 -187
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1238 -1238
- package/sdk/platform/Communication/CommunicationPlatformModel.js +1273 -1273
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +661 -661
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +692 -692
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +3198 -3198
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +2247 -2247
- package/sdk/platform/Content/ContentPlatformModel.d.ts +1833 -1833
- package/sdk/platform/Content/ContentPlatformModel.js +1837 -1837
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +245 -245
- package/sdk/platform/Discount/DiscountPlatformModel.js +248 -248
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +865 -865
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +877 -877
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +1044 -1044
- package/sdk/platform/Finance/FinancePlatformModel.js +974 -974
- package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +942 -942
- package/sdk/platform/Inventory/InventoryPlatformModel.js +1003 -1003
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +608 -608
- package/sdk/platform/Lead/LeadPlatformModel.js +465 -465
- package/sdk/platform/Order/OrderPlatformModel.d.ts +5180 -5176
- package/sdk/platform/Order/OrderPlatformModel.js +4740 -4736
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +22 -22
- package/sdk/platform/Partner/PartnerPlatformModel.js +22 -22
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +2670 -2660
- package/sdk/platform/Payment/PaymentPlatformModel.js +1831 -1827
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +204 -204
- package/sdk/platform/Rewards/RewardsPlatformModel.js +199 -199
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +1505 -1507
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +1532 -1536
- package/sdk/platform/Share/SharePlatformModel.d.ts +147 -147
- package/sdk/platform/Share/SharePlatformModel.js +139 -139
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +1046 -1046
- package/sdk/platform/Theme/ThemePlatformModel.js +789 -789
- package/sdk/platform/User/UserPlatformModel.d.ts +758 -758
- package/sdk/platform/User/UserPlatformModel.js +643 -643
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +439 -439
- package/sdk/platform/Webhook/WebhookPlatformModel.js +364 -364
- package/sdk/public/Billing/BillingPublicModel.d.ts +55 -55
- package/sdk/public/Billing/BillingPublicModel.js +51 -51
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +237 -237
- package/sdk/public/Configuration/ConfigurationPublicModel.js +174 -174
- package/sdk/public/Content/ContentPublicModel.d.ts +26 -26
- package/sdk/public/Content/ContentPublicModel.js +28 -28
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +237 -237
- package/sdk/public/Inventory/InventoryPublicModel.js +257 -257
- package/sdk/public/Partner/PartnerPublicModel.d.ts +104 -104
- package/sdk/public/Partner/PartnerPublicModel.js +113 -113
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +87 -87
- package/sdk/public/Webhook/WebhookPublicModel.js +93 -93
|
@@ -1,261 +1,226 @@
|
|
|
1
1
|
const Joi = require("joi");
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @typedef
|
|
5
|
-
* @property {string}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @typedef BadRequestObject
|
|
10
|
-
* @property {string} message
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @typedef BadRequestObjectGet
|
|
15
|
-
* @property {BadRequestData} [data]
|
|
16
|
-
* @property {string} [error]
|
|
17
|
-
* @property {string} [message]
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* @typedef BulkDiscount
|
|
22
|
-
* @property {number} company_id
|
|
23
|
-
* @property {DiscountItems[]} items
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @typedef CancelJobResponse
|
|
28
|
-
* @property {boolean} success
|
|
4
|
+
* @typedef ValidityObject
|
|
5
|
+
* @property {string} start
|
|
6
|
+
* @property {string} end
|
|
29
7
|
*/
|
|
30
8
|
|
|
31
9
|
/**
|
|
32
10
|
* @typedef CreateUpdateDiscount
|
|
33
|
-
* @property {string
|
|
34
|
-
* @property {number[]} [brand_ids]
|
|
11
|
+
* @property {string} name
|
|
35
12
|
* @property {number} company_id
|
|
36
|
-
* @property {string} discount_level
|
|
37
|
-
* @property {DiscountMeta} [discount_meta]
|
|
38
|
-
* @property {string} discount_type
|
|
39
|
-
* @property {string[]} [extension_ids]
|
|
40
|
-
* @property {string} [file_path]
|
|
41
13
|
* @property {boolean} is_active
|
|
14
|
+
* @property {string[]} app_ids
|
|
15
|
+
* @property {string[]} [extension_ids]
|
|
42
16
|
* @property {string} job_type
|
|
43
|
-
* @property {string}
|
|
44
|
-
* @property {
|
|
45
|
-
* @property {ValidityObject} validity
|
|
17
|
+
* @property {string} discount_type
|
|
18
|
+
* @property {string} discount_level
|
|
46
19
|
* @property {number} [value]
|
|
20
|
+
* @property {string} [file_path]
|
|
21
|
+
* @property {number[]} [brand_ids]
|
|
22
|
+
* @property {number[]} [store_ids]
|
|
47
23
|
* @property {string[]} [zone_ids]
|
|
24
|
+
* @property {ValidityObject} validity
|
|
25
|
+
* @property {DiscountMeta} [discount_meta]
|
|
48
26
|
*/
|
|
49
27
|
|
|
50
28
|
/**
|
|
51
|
-
* @typedef
|
|
52
|
-
* @property {
|
|
53
|
-
*
|
|
54
|
-
* @property {
|
|
55
|
-
*
|
|
56
|
-
* @property {
|
|
57
|
-
*
|
|
29
|
+
* @typedef DiscountMeta
|
|
30
|
+
* @property {boolean} timer - Determines whether the discount countdown is
|
|
31
|
+
* visible or not.
|
|
32
|
+
* @property {number} [hours] - The time in hours before the discount ends when
|
|
33
|
+
* the countdown timer should start.
|
|
34
|
+
* @property {number} [minutes] - The time in minutes before the discount ends
|
|
35
|
+
* when the countdown timer should start.
|
|
58
36
|
*/
|
|
59
37
|
|
|
60
38
|
/**
|
|
61
39
|
* @typedef DiscountJob
|
|
62
40
|
* @property {string} _id
|
|
63
|
-
* @property {string
|
|
64
|
-
* @property {number[]} [brand_ids]
|
|
41
|
+
* @property {string} name
|
|
65
42
|
* @property {number} company_id
|
|
66
|
-
* @property {UserDetails} created_by
|
|
67
|
-
* @property {string} created_on
|
|
68
|
-
* @property {string} [discount_level]
|
|
69
|
-
* @property {DiscountMeta} [discount_meta]
|
|
70
|
-
* @property {string} [discount_type]
|
|
71
|
-
* @property {string} [file_path]
|
|
72
43
|
* @property {boolean} is_active
|
|
44
|
+
* @property {string[]} [app_ids]
|
|
73
45
|
* @property {string} [job_type]
|
|
74
|
-
* @property {
|
|
75
|
-
* @property {
|
|
76
|
-
* @property {
|
|
77
|
-
* @property {string}
|
|
46
|
+
* @property {string} [discount_type]
|
|
47
|
+
* @property {string} [discount_level]
|
|
48
|
+
* @property {number} [value]
|
|
49
|
+
* @property {string} [file_path]
|
|
50
|
+
* @property {number[]} [brand_ids]
|
|
78
51
|
* @property {number[]} [store_ids]
|
|
52
|
+
* @property {string[]} [zone_ids]
|
|
53
|
+
* @property {DiscountMeta} [discount_meta]
|
|
79
54
|
* @property {ValidityObject} validity
|
|
55
|
+
* @property {string} created_on
|
|
56
|
+
* @property {string} modified_on
|
|
57
|
+
* @property {UserDetails} created_by
|
|
58
|
+
* @property {UserDetails} modified_by
|
|
59
|
+
* @property {Object} [meta]
|
|
60
|
+
*/
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @typedef FileJobBody
|
|
64
|
+
* @property {string} [name]
|
|
65
|
+
* @property {number} [company_id]
|
|
66
|
+
* @property {boolean} [is_active]
|
|
67
|
+
* @property {string[]} [app_ids]
|
|
68
|
+
* @property {string} [job_type]
|
|
69
|
+
* @property {string} [discount_type]
|
|
70
|
+
* @property {string} [discount_level]
|
|
80
71
|
* @property {number} [value]
|
|
72
|
+
* @property {string} [file_path]
|
|
73
|
+
* @property {number[]} [brand_ids]
|
|
74
|
+
* @property {number[]} [store_ids]
|
|
75
|
+
* @property {string[]} [extension_ids]
|
|
81
76
|
* @property {string[]} [zone_ids]
|
|
77
|
+
* @property {DiscountMeta} [discount_meta]
|
|
78
|
+
* @property {ValidityObject} [validity]
|
|
79
|
+
* @property {string} [created_on]
|
|
80
|
+
* @property {string} [modified_on]
|
|
81
|
+
* @property {UserDetails} [created_by]
|
|
82
|
+
* @property {UserDetails} [modified_by]
|
|
83
|
+
* @property {Object} [meta]
|
|
82
84
|
*/
|
|
83
85
|
|
|
84
86
|
/**
|
|
85
|
-
* @typedef
|
|
86
|
-
* @property {
|
|
87
|
-
*
|
|
88
|
-
* @property {number} [minutes] - The time in minutes before the discount ends
|
|
89
|
-
* when the countdown timer should start.
|
|
90
|
-
* @property {boolean} timer - Determines whether the discount countdown is
|
|
91
|
-
* visible or not.
|
|
87
|
+
* @typedef ListOrCalender
|
|
88
|
+
* @property {DiscountJob[]} items
|
|
89
|
+
* @property {Page} page
|
|
92
90
|
*/
|
|
93
91
|
|
|
94
92
|
/**
|
|
95
|
-
* @typedef
|
|
96
|
-
* @property {
|
|
97
|
-
* @property {
|
|
93
|
+
* @typedef DiscountItems
|
|
94
|
+
* @property {string} [item_code]
|
|
95
|
+
* @property {string} [brand_name]
|
|
96
|
+
* @property {string} [seller_identifier]
|
|
97
|
+
* @property {string} discount_type
|
|
98
|
+
* @property {number} value
|
|
99
|
+
* @property {DiscountMeta} [discount_meta]
|
|
98
100
|
*/
|
|
99
101
|
|
|
100
102
|
/**
|
|
101
|
-
* @typedef
|
|
102
|
-
* @property {
|
|
103
|
-
* @property {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
* @
|
|
108
|
-
* @property {
|
|
109
|
-
* @property {
|
|
110
|
-
* @property {
|
|
103
|
+
* @typedef BulkDiscount
|
|
104
|
+
* @property {number} company_id
|
|
105
|
+
* @property {DiscountItems[]} items
|
|
106
|
+
*/
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* @typedef FileJobResponse
|
|
110
|
+
* @property {string} stage
|
|
111
|
+
* @property {number} total
|
|
112
|
+
* @property {number} failed
|
|
113
|
+
* @property {number} company_id
|
|
114
|
+
* @property {FileJobBody} [body]
|
|
115
|
+
* @property {string} type
|
|
116
|
+
* @property {string} [file_type]
|
|
117
|
+
* @property {string} _id - A unique identifier to distinguish and identify a job.
|
|
111
118
|
* @property {string} [file_path]
|
|
112
|
-
* @property {
|
|
113
|
-
* @property {string} [
|
|
114
|
-
* @property {Object} [meta]
|
|
115
|
-
* @property {UserDetails} [modified_by]
|
|
116
|
-
* @property {string} [modified_on]
|
|
117
|
-
* @property {string} [name]
|
|
118
|
-
* @property {number[]} [store_ids]
|
|
119
|
-
* @property {ValidityObject} [validity]
|
|
120
|
-
* @property {number} [value]
|
|
119
|
+
* @property {number} [progress]
|
|
120
|
+
* @property {string[]} [extension_ids]
|
|
121
121
|
* @property {string[]} [zone_ids]
|
|
122
|
+
* @property {string} [created_on]
|
|
123
|
+
* @property {string} [modified_on]
|
|
124
|
+
* @property {UserDetails} [created_by]
|
|
122
125
|
*/
|
|
123
126
|
|
|
124
127
|
/**
|
|
125
128
|
* @typedef FileJobRequest
|
|
126
|
-
* @property {string
|
|
127
|
-
* @property {
|
|
129
|
+
* @property {string} name
|
|
130
|
+
* @property {boolean} is_active
|
|
128
131
|
* @property {number} company_id
|
|
129
|
-
* @property {string} [
|
|
132
|
+
* @property {string[]} [app_ids]
|
|
133
|
+
* @property {string} [job_type]
|
|
130
134
|
* @property {string} [discount_type]
|
|
135
|
+
* @property {string} [discount_level]
|
|
131
136
|
* @property {string} [file_path]
|
|
132
|
-
* @property {
|
|
133
|
-
* @property {string} [job_type]
|
|
134
|
-
* @property {Object} [meta]
|
|
135
|
-
* @property {string} name
|
|
137
|
+
* @property {number[]} [brand_ids]
|
|
136
138
|
* @property {number[]} [store_ids]
|
|
137
139
|
* @property {ValidityObject} validity
|
|
140
|
+
* @property {Object} [meta]
|
|
138
141
|
*/
|
|
139
142
|
|
|
140
143
|
/**
|
|
141
|
-
* @typedef
|
|
142
|
-
* @property {
|
|
143
|
-
* @property {
|
|
144
|
-
* @property {number} company_id
|
|
145
|
-
* @property {UserDetails} [created_by]
|
|
146
|
-
* @property {string} [created_on]
|
|
147
|
-
* @property {string[]} [extension_ids]
|
|
148
|
-
* @property {number} failed
|
|
149
|
-
* @property {string} [file_path]
|
|
150
|
-
* @property {string} [file_type]
|
|
151
|
-
* @property {string} [modified_on]
|
|
152
|
-
* @property {number} [progress]
|
|
153
|
-
* @property {string} stage
|
|
154
|
-
* @property {number} total
|
|
155
|
-
* @property {string} type
|
|
156
|
-
* @property {string[]} [zone_ids]
|
|
144
|
+
* @typedef DownloadFileJob
|
|
145
|
+
* @property {number[]} [brand_ids]
|
|
146
|
+
* @property {number[]} [store_ids]
|
|
157
147
|
*/
|
|
158
148
|
|
|
159
149
|
/**
|
|
160
|
-
* @typedef
|
|
161
|
-
* @property {
|
|
162
|
-
* @property {Page} page
|
|
150
|
+
* @typedef CancelJobResponse
|
|
151
|
+
* @property {boolean} success
|
|
163
152
|
*/
|
|
164
153
|
|
|
165
154
|
/**
|
|
166
155
|
* @typedef Page
|
|
167
|
-
* @property {number} [current]
|
|
168
|
-
* @property {boolean} [has_next]
|
|
169
|
-
* @property {boolean} [has_previous]
|
|
170
156
|
* @property {number} [item_total]
|
|
171
157
|
* @property {string} [next_id]
|
|
172
|
-
* @property {
|
|
158
|
+
* @property {boolean} [has_previous]
|
|
159
|
+
* @property {boolean} [has_next]
|
|
160
|
+
* @property {number} [current]
|
|
173
161
|
* @property {string} type
|
|
162
|
+
* @property {number} [size]
|
|
174
163
|
*/
|
|
175
164
|
|
|
176
165
|
/**
|
|
177
166
|
* @typedef UserDetails
|
|
178
|
-
* @property {string} user_id
|
|
179
167
|
* @property {string} username
|
|
168
|
+
* @property {string} user_id
|
|
180
169
|
*/
|
|
181
170
|
|
|
182
171
|
/**
|
|
183
|
-
* @typedef
|
|
184
|
-
* @property {string}
|
|
185
|
-
* @property {string} start
|
|
172
|
+
* @typedef BadRequestObject
|
|
173
|
+
* @property {string} message
|
|
186
174
|
*/
|
|
187
175
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
message: Joi.string().allow(""),
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
/** @returns {BadRequestObject} */
|
|
197
|
-
static BadRequestObject() {
|
|
198
|
-
return Joi.object({
|
|
199
|
-
message: Joi.string().allow("").required(),
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
/** @returns {BadRequestObjectGet} */
|
|
204
|
-
static BadRequestObjectGet() {
|
|
205
|
-
return Joi.object({
|
|
206
|
-
data: DiscountPlatformModel.BadRequestData(),
|
|
207
|
-
error: Joi.string().allow(""),
|
|
208
|
-
message: Joi.string().allow(""),
|
|
209
|
-
});
|
|
210
|
-
}
|
|
176
|
+
/**
|
|
177
|
+
* @typedef BadRequestData
|
|
178
|
+
* @property {string} [message]
|
|
179
|
+
*/
|
|
211
180
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
.required(),
|
|
219
|
-
});
|
|
220
|
-
}
|
|
181
|
+
/**
|
|
182
|
+
* @typedef BadRequestObjectGet
|
|
183
|
+
* @property {string} [message]
|
|
184
|
+
* @property {string} [error]
|
|
185
|
+
* @property {BadRequestData} [data]
|
|
186
|
+
*/
|
|
221
187
|
|
|
222
|
-
|
|
223
|
-
|
|
188
|
+
class DiscountPlatformModel {
|
|
189
|
+
/** @returns {ValidityObject} */
|
|
190
|
+
static ValidityObject() {
|
|
224
191
|
return Joi.object({
|
|
225
|
-
|
|
192
|
+
start: Joi.string().allow("").required(),
|
|
193
|
+
end: Joi.string().allow("").required(),
|
|
226
194
|
});
|
|
227
195
|
}
|
|
228
196
|
|
|
229
197
|
/** @returns {CreateUpdateDiscount} */
|
|
230
198
|
static CreateUpdateDiscount() {
|
|
231
199
|
return Joi.object({
|
|
232
|
-
|
|
233
|
-
brand_ids: Joi.array().items(Joi.number()),
|
|
200
|
+
name: Joi.string().allow("").required(),
|
|
234
201
|
company_id: Joi.number().required(),
|
|
235
|
-
discount_level: Joi.string().allow("").required(),
|
|
236
|
-
discount_meta: DiscountPlatformModel.DiscountMeta(),
|
|
237
|
-
discount_type: Joi.string().allow("").required(),
|
|
238
|
-
extension_ids: Joi.array().items(Joi.string().allow("")),
|
|
239
|
-
file_path: Joi.string().allow(""),
|
|
240
202
|
is_active: Joi.boolean().required(),
|
|
203
|
+
app_ids: Joi.array().items(Joi.string().allow("")).required(),
|
|
204
|
+
extension_ids: Joi.array().items(Joi.string().allow("")),
|
|
241
205
|
job_type: Joi.string().allow("").required(),
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
validity: DiscountPlatformModel.ValidityObject().required(),
|
|
206
|
+
discount_type: Joi.string().allow("").required(),
|
|
207
|
+
discount_level: Joi.string().allow("").required(),
|
|
245
208
|
value: Joi.number(),
|
|
209
|
+
file_path: Joi.string().allow(""),
|
|
210
|
+
brand_ids: Joi.array().items(Joi.number()),
|
|
211
|
+
store_ids: Joi.array().items(Joi.number()),
|
|
246
212
|
zone_ids: Joi.array().items(Joi.string().allow("")),
|
|
213
|
+
validity: DiscountPlatformModel.ValidityObject().required(),
|
|
214
|
+
discount_meta: DiscountPlatformModel.DiscountMeta(),
|
|
247
215
|
});
|
|
248
216
|
}
|
|
249
217
|
|
|
250
|
-
/** @returns {
|
|
251
|
-
static
|
|
218
|
+
/** @returns {DiscountMeta} */
|
|
219
|
+
static DiscountMeta() {
|
|
252
220
|
return Joi.object({
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
item_code: Joi.string().allow(""),
|
|
257
|
-
seller_identifier: Joi.string().allow(""),
|
|
258
|
-
value: Joi.number().required(),
|
|
221
|
+
timer: Joi.boolean().required(),
|
|
222
|
+
hours: Joi.number(),
|
|
223
|
+
minutes: Joi.number(),
|
|
259
224
|
});
|
|
260
225
|
}
|
|
261
226
|
|
|
@@ -263,144 +228,179 @@ class DiscountPlatformModel {
|
|
|
263
228
|
static DiscountJob() {
|
|
264
229
|
return Joi.object({
|
|
265
230
|
_id: Joi.string().allow("").required(),
|
|
266
|
-
|
|
267
|
-
brand_ids: Joi.array().items(Joi.number()),
|
|
231
|
+
name: Joi.string().allow("").required(),
|
|
268
232
|
company_id: Joi.number().required(),
|
|
269
|
-
created_by: DiscountPlatformModel.UserDetails().required(),
|
|
270
|
-
created_on: Joi.string().allow("").required(),
|
|
271
|
-
discount_level: Joi.string().allow(""),
|
|
272
|
-
discount_meta: DiscountPlatformModel.DiscountMeta(),
|
|
273
|
-
discount_type: Joi.string().allow(""),
|
|
274
|
-
file_path: Joi.string().allow(""),
|
|
275
233
|
is_active: Joi.boolean().required(),
|
|
234
|
+
app_ids: Joi.array().items(Joi.string().allow("")),
|
|
276
235
|
job_type: Joi.string().allow(""),
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
236
|
+
discount_type: Joi.string().allow(""),
|
|
237
|
+
discount_level: Joi.string().allow(""),
|
|
238
|
+
value: Joi.number(),
|
|
239
|
+
file_path: Joi.string().allow(""),
|
|
240
|
+
brand_ids: Joi.array().items(Joi.number()),
|
|
281
241
|
store_ids: Joi.array().items(Joi.number()),
|
|
242
|
+
zone_ids: Joi.array().items(Joi.string().allow("")),
|
|
243
|
+
discount_meta: DiscountPlatformModel.DiscountMeta(),
|
|
282
244
|
validity: DiscountPlatformModel.ValidityObject().required(),
|
|
245
|
+
created_on: Joi.string().allow("").required(),
|
|
246
|
+
modified_on: Joi.string().allow("").required(),
|
|
247
|
+
created_by: DiscountPlatformModel.UserDetails().required(),
|
|
248
|
+
modified_by: DiscountPlatformModel.UserDetails().required(),
|
|
249
|
+
meta: Joi.any(),
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/** @returns {FileJobBody} */
|
|
254
|
+
static FileJobBody() {
|
|
255
|
+
return Joi.object({
|
|
256
|
+
name: Joi.string().allow(""),
|
|
257
|
+
company_id: Joi.number(),
|
|
258
|
+
is_active: Joi.boolean(),
|
|
259
|
+
app_ids: Joi.array().items(Joi.string().allow("")),
|
|
260
|
+
job_type: Joi.string().allow(""),
|
|
261
|
+
discount_type: Joi.string().allow(""),
|
|
262
|
+
discount_level: Joi.string().allow(""),
|
|
283
263
|
value: Joi.number(),
|
|
264
|
+
file_path: Joi.string().allow(""),
|
|
265
|
+
brand_ids: Joi.array().items(Joi.number()),
|
|
266
|
+
store_ids: Joi.array().items(Joi.number()),
|
|
267
|
+
extension_ids: Joi.array().items(Joi.string().allow("")),
|
|
284
268
|
zone_ids: Joi.array().items(Joi.string().allow("")),
|
|
269
|
+
discount_meta: DiscountPlatformModel.DiscountMeta(),
|
|
270
|
+
validity: DiscountPlatformModel.ValidityObject(),
|
|
271
|
+
created_on: Joi.string().allow(""),
|
|
272
|
+
modified_on: Joi.string().allow(""),
|
|
273
|
+
created_by: DiscountPlatformModel.UserDetails(),
|
|
274
|
+
modified_by: DiscountPlatformModel.UserDetails(),
|
|
275
|
+
meta: Joi.any(),
|
|
285
276
|
});
|
|
286
277
|
}
|
|
287
278
|
|
|
288
|
-
/** @returns {
|
|
289
|
-
static
|
|
279
|
+
/** @returns {ListOrCalender} */
|
|
280
|
+
static ListOrCalender() {
|
|
290
281
|
return Joi.object({
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
timer: Joi.boolean().required(),
|
|
282
|
+
items: Joi.array().items(DiscountPlatformModel.DiscountJob()).required(),
|
|
283
|
+
page: DiscountPlatformModel.Page().required(),
|
|
294
284
|
});
|
|
295
285
|
}
|
|
296
286
|
|
|
297
|
-
/** @returns {
|
|
298
|
-
static
|
|
287
|
+
/** @returns {DiscountItems} */
|
|
288
|
+
static DiscountItems() {
|
|
299
289
|
return Joi.object({
|
|
300
|
-
|
|
301
|
-
|
|
290
|
+
item_code: Joi.string().allow(""),
|
|
291
|
+
brand_name: Joi.string().allow(""),
|
|
292
|
+
seller_identifier: Joi.string().allow(""),
|
|
293
|
+
discount_type: Joi.string().allow("").required(),
|
|
294
|
+
value: Joi.number().required(),
|
|
295
|
+
discount_meta: DiscountPlatformModel.DiscountMeta(),
|
|
302
296
|
});
|
|
303
297
|
}
|
|
304
298
|
|
|
305
|
-
/** @returns {
|
|
306
|
-
static
|
|
299
|
+
/** @returns {BulkDiscount} */
|
|
300
|
+
static BulkDiscount() {
|
|
307
301
|
return Joi.object({
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
302
|
+
company_id: Joi.number().required(),
|
|
303
|
+
items: Joi.array()
|
|
304
|
+
.items(DiscountPlatformModel.DiscountItems())
|
|
305
|
+
.required(),
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/** @returns {FileJobResponse} */
|
|
310
|
+
static FileJobResponse() {
|
|
311
|
+
return Joi.object({
|
|
312
|
+
stage: Joi.string().allow("").required(),
|
|
313
|
+
total: Joi.number().required(),
|
|
314
|
+
failed: Joi.number().required(),
|
|
315
|
+
company_id: Joi.number().required(),
|
|
316
|
+
body: DiscountPlatformModel.FileJobBody(),
|
|
317
|
+
type: Joi.string().allow("").required(),
|
|
318
|
+
file_type: Joi.string().allow(""),
|
|
319
|
+
_id: Joi.string().allow("").required(),
|
|
317
320
|
file_path: Joi.string().allow(""),
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
meta: Joi.any(),
|
|
321
|
-
modified_by: DiscountPlatformModel.UserDetails(),
|
|
322
|
-
modified_on: Joi.string().allow(""),
|
|
323
|
-
name: Joi.string().allow(""),
|
|
324
|
-
store_ids: Joi.array().items(Joi.number()),
|
|
325
|
-
validity: DiscountPlatformModel.ValidityObject(),
|
|
326
|
-
value: Joi.number(),
|
|
321
|
+
progress: Joi.number(),
|
|
322
|
+
extension_ids: Joi.array().items(Joi.string().allow("")),
|
|
327
323
|
zone_ids: Joi.array().items(Joi.string().allow("")),
|
|
324
|
+
created_on: Joi.string().allow(""),
|
|
325
|
+
modified_on: Joi.string().allow(""),
|
|
326
|
+
created_by: DiscountPlatformModel.UserDetails(),
|
|
328
327
|
});
|
|
329
328
|
}
|
|
330
329
|
|
|
331
330
|
/** @returns {FileJobRequest} */
|
|
332
331
|
static FileJobRequest() {
|
|
333
332
|
return Joi.object({
|
|
334
|
-
|
|
335
|
-
|
|
333
|
+
name: Joi.string().allow("").required(),
|
|
334
|
+
is_active: Joi.boolean().required(),
|
|
336
335
|
company_id: Joi.number().required(),
|
|
337
|
-
|
|
336
|
+
app_ids: Joi.array().items(Joi.string().allow("")),
|
|
337
|
+
job_type: Joi.string().allow(""),
|
|
338
338
|
discount_type: Joi.string().allow(""),
|
|
339
|
+
discount_level: Joi.string().allow(""),
|
|
339
340
|
file_path: Joi.string().allow(""),
|
|
340
|
-
|
|
341
|
-
job_type: Joi.string().allow(""),
|
|
342
|
-
meta: Joi.any(),
|
|
343
|
-
name: Joi.string().allow("").required(),
|
|
341
|
+
brand_ids: Joi.array().items(Joi.number()),
|
|
344
342
|
store_ids: Joi.array().items(Joi.number()),
|
|
345
343
|
validity: DiscountPlatformModel.ValidityObject().required(),
|
|
344
|
+
meta: Joi.any(),
|
|
346
345
|
});
|
|
347
346
|
}
|
|
348
347
|
|
|
349
|
-
/** @returns {
|
|
350
|
-
static
|
|
348
|
+
/** @returns {DownloadFileJob} */
|
|
349
|
+
static DownloadFileJob() {
|
|
351
350
|
return Joi.object({
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
company_id: Joi.number().required(),
|
|
355
|
-
created_by: DiscountPlatformModel.UserDetails(),
|
|
356
|
-
created_on: Joi.string().allow(""),
|
|
357
|
-
extension_ids: Joi.array().items(Joi.string().allow("")),
|
|
358
|
-
failed: Joi.number().required(),
|
|
359
|
-
file_path: Joi.string().allow(""),
|
|
360
|
-
file_type: Joi.string().allow(""),
|
|
361
|
-
modified_on: Joi.string().allow(""),
|
|
362
|
-
progress: Joi.number(),
|
|
363
|
-
stage: Joi.string().allow("").required(),
|
|
364
|
-
total: Joi.number().required(),
|
|
365
|
-
type: Joi.string().allow("").required(),
|
|
366
|
-
zone_ids: Joi.array().items(Joi.string().allow("")),
|
|
351
|
+
brand_ids: Joi.array().items(Joi.number()),
|
|
352
|
+
store_ids: Joi.array().items(Joi.number()),
|
|
367
353
|
});
|
|
368
354
|
}
|
|
369
355
|
|
|
370
|
-
/** @returns {
|
|
371
|
-
static
|
|
356
|
+
/** @returns {CancelJobResponse} */
|
|
357
|
+
static CancelJobResponse() {
|
|
372
358
|
return Joi.object({
|
|
373
|
-
|
|
374
|
-
page: DiscountPlatformModel.Page().required(),
|
|
359
|
+
success: Joi.boolean().required(),
|
|
375
360
|
});
|
|
376
361
|
}
|
|
377
362
|
|
|
378
363
|
/** @returns {Page} */
|
|
379
364
|
static Page() {
|
|
380
365
|
return Joi.object({
|
|
381
|
-
current: Joi.number(),
|
|
382
|
-
has_next: Joi.boolean(),
|
|
383
|
-
has_previous: Joi.boolean(),
|
|
384
366
|
item_total: Joi.number(),
|
|
385
367
|
next_id: Joi.string().allow(""),
|
|
386
|
-
|
|
368
|
+
has_previous: Joi.boolean(),
|
|
369
|
+
has_next: Joi.boolean(),
|
|
370
|
+
current: Joi.number(),
|
|
387
371
|
type: Joi.string().allow("").required(),
|
|
372
|
+
size: Joi.number(),
|
|
388
373
|
});
|
|
389
374
|
}
|
|
390
375
|
|
|
391
376
|
/** @returns {UserDetails} */
|
|
392
377
|
static UserDetails() {
|
|
393
378
|
return Joi.object({
|
|
394
|
-
user_id: Joi.string().allow("").required(),
|
|
395
379
|
username: Joi.string().allow("").required(),
|
|
380
|
+
user_id: Joi.string().allow("").required(),
|
|
396
381
|
});
|
|
397
382
|
}
|
|
398
383
|
|
|
399
|
-
/** @returns {
|
|
400
|
-
static
|
|
384
|
+
/** @returns {BadRequestObject} */
|
|
385
|
+
static BadRequestObject() {
|
|
401
386
|
return Joi.object({
|
|
402
|
-
|
|
403
|
-
|
|
387
|
+
message: Joi.string().allow("").required(),
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/** @returns {BadRequestData} */
|
|
392
|
+
static BadRequestData() {
|
|
393
|
+
return Joi.object({
|
|
394
|
+
message: Joi.string().allow(""),
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
/** @returns {BadRequestObjectGet} */
|
|
399
|
+
static BadRequestObjectGet() {
|
|
400
|
+
return Joi.object({
|
|
401
|
+
message: Joi.string().allow(""),
|
|
402
|
+
error: Joi.string().allow(""),
|
|
403
|
+
data: DiscountPlatformModel.BadRequestData(),
|
|
404
404
|
});
|
|
405
405
|
}
|
|
406
406
|
}
|