@gofynd/fdk-client-javascript 1.2.0 → 1.3.0

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.
Files changed (262) hide show
  1. package/README.md +44 -7
  2. package/package.json +1 -2
  3. package/sdk/application/ApplicationAPIClient.d.ts +3 -3
  4. package/sdk/application/ApplicationAPIClient.js +6 -4
  5. package/sdk/application/ApplicationClient.d.ts +2 -3
  6. package/sdk/application/ApplicationClient.js +1 -45
  7. package/sdk/application/ApplicationConfig.d.ts +46 -6
  8. package/sdk/application/ApplicationConfig.js +15 -16
  9. package/sdk/application/Cart/CartApplicationClient.d.ts +61 -33
  10. package/sdk/application/Cart/CartApplicationClient.js +225 -134
  11. package/sdk/application/Cart/CartApplicationModel.d.ts +4 -4
  12. package/sdk/application/Cart/CartApplicationModel.js +4 -4
  13. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +61 -30
  14. package/sdk/application/Catalog/CatalogApplicationClient.js +234 -146
  15. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +115 -13
  16. package/sdk/application/Catalog/CatalogApplicationModel.js +77 -12
  17. package/sdk/application/Common/CommonApplicationClient.d.ts +5 -3
  18. package/sdk/application/Common/CommonApplicationClient.js +13 -11
  19. package/sdk/application/Common/CommonApplicationModel.d.ts +3 -83
  20. package/sdk/application/Common/CommonApplicationModel.js +2 -58
  21. package/sdk/application/Communication/CommunicationApplicationClient.d.ts +9 -3
  22. package/sdk/application/Communication/CommunicationApplicationClient.js +25 -13
  23. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +1 -34
  24. package/sdk/application/Communication/CommunicationApplicationModel.js +0 -36
  25. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +46 -16
  26. package/sdk/application/Configuration/ConfigurationApplicationClient.js +144 -68
  27. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +1 -219
  28. package/sdk/application/Configuration/ConfigurationApplicationModel.js +0 -226
  29. package/sdk/application/Content/ContentApplicationClient.d.ts +49 -21
  30. package/sdk/application/Content/ContentApplicationClient.js +159 -80
  31. package/sdk/application/Content/ContentApplicationModel.d.ts +5 -622
  32. package/sdk/application/Content/ContentApplicationModel.js +11 -763
  33. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +6 -3
  34. package/sdk/application/FileStorage/FileStorageApplicationClient.js +20 -14
  35. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +1 -152
  36. package/sdk/application/FileStorage/FileStorageApplicationModel.js +0 -180
  37. package/sdk/application/Lead/LeadApplicationClient.d.ts +14 -7
  38. package/sdk/application/Lead/LeadApplicationClient.js +50 -31
  39. package/sdk/application/Lead/LeadApplicationModel.d.ts +22 -741
  40. package/sdk/application/Lead/LeadApplicationModel.js +21 -481
  41. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +11 -5
  42. package/sdk/application/Logistic/LogisticApplicationClient.js +41 -20
  43. package/sdk/application/Order/OrderApplicationClient.d.ts +24 -12
  44. package/sdk/application/Order/OrderApplicationClient.js +88 -56
  45. package/sdk/application/Payment/PaymentApplicationClient.d.ts +91 -42
  46. package/sdk/application/Payment/PaymentApplicationClient.js +293 -194
  47. package/sdk/application/Payment/PaymentApplicationModel.d.ts +36 -36
  48. package/sdk/application/Payment/PaymentApplicationModel.js +36 -36
  49. package/sdk/application/PosCart/PosCartApplicationClient.d.ts +59 -32
  50. package/sdk/application/PosCart/PosCartApplicationClient.js +214 -130
  51. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +2 -2
  52. package/sdk/application/PosCart/PosCartApplicationModel.js +2 -2
  53. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +16 -7
  54. package/sdk/application/Rewards/RewardsApplicationClient.js +56 -29
  55. package/sdk/application/Share/ShareApplicationClient.d.ts +15 -7
  56. package/sdk/application/Share/ShareApplicationClient.js +51 -31
  57. package/sdk/application/Share/ShareApplicationModel.d.ts +1 -33
  58. package/sdk/application/Share/ShareApplicationModel.js +0 -38
  59. package/sdk/application/Theme/ThemeApplicationClient.d.ts +9 -4
  60. package/sdk/application/Theme/ThemeApplicationClient.js +35 -18
  61. package/sdk/application/Theme/ThemeApplicationModel.d.ts +982 -312
  62. package/sdk/application/Theme/ThemeApplicationModel.js +621 -284
  63. package/sdk/application/User/UserApplicationClient.d.ts +74 -35
  64. package/sdk/application/User/UserApplicationClient.js +252 -161
  65. package/sdk/application/User/UserApplicationModel.d.ts +3 -401
  66. package/sdk/application/User/UserApplicationModel.js +2 -490
  67. package/sdk/common/AxiosHelper.js +1 -2
  68. package/sdk/common/FDKError.d.ts +3 -0
  69. package/sdk/common/FDKError.js +8 -0
  70. package/sdk/common/utils.d.ts +3 -0
  71. package/sdk/common/utils.js +29 -0
  72. package/sdk/partner/PartnerAPIClient.d.ts +5 -4
  73. package/sdk/partner/PartnerAPIClient.js +7 -4
  74. package/sdk/partner/PartnerClient.d.ts +2 -0
  75. package/sdk/partner/PartnerClient.js +3 -0
  76. package/sdk/partner/Theme/ThemePartnerClient.d.ts +299 -0
  77. package/sdk/partner/Theme/ThemePartnerClient.js +768 -0
  78. package/sdk/partner/Theme/ThemePartnerModel.d.ts +1706 -0
  79. package/sdk/partner/Theme/ThemePartnerModel.js +1409 -0
  80. package/sdk/partner/Theme/ThemePartnerValidator.d.ts +22 -0
  81. package/sdk/partner/Theme/ThemePartnerValidator.js +157 -0
  82. package/sdk/partner/index.d.ts +3 -1
  83. package/sdk/partner/index.js +3 -1
  84. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +8 -4
  85. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +38 -16
  86. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +1 -13
  87. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +0 -12
  88. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +10 -0
  89. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +4 -0
  90. package/sdk/platform/Billing/BillingPlatformClient.d.ts +59 -14
  91. package/sdk/platform/Billing/BillingPlatformClient.js +315 -64
  92. package/sdk/platform/Billing/BillingPlatformModel.d.ts +56 -196
  93. package/sdk/platform/Billing/BillingPlatformModel.js +63 -217
  94. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +23 -1
  95. package/sdk/platform/Billing/BillingPlatformValidator.js +31 -0
  96. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +124 -63
  97. package/sdk/platform/Cart/CartPlatformApplicationClient.js +431 -265
  98. package/sdk/platform/Cart/CartPlatformModel.d.ts +253 -53
  99. package/sdk/platform/Cart/CartPlatformModel.js +104 -54
  100. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +120 -53
  101. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +398 -247
  102. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +155 -78
  103. package/sdk/platform/Catalog/CatalogPlatformClient.js +561 -355
  104. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +10 -12
  105. package/sdk/platform/Catalog/CatalogPlatformModel.js +10 -12
  106. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +30 -0
  107. package/sdk/platform/Catalog/CatalogPlatformValidator.js +13 -0
  108. package/sdk/platform/Common/CommonPlatformClient.d.ts +5 -3
  109. package/sdk/platform/Common/CommonPlatformClient.js +13 -11
  110. package/sdk/platform/Common/CommonPlatformModel.d.ts +39 -64
  111. package/sdk/platform/Common/CommonPlatformModel.js +23 -57
  112. package/sdk/platform/Common/CommonPlatformValidator.d.ts +5 -10
  113. package/sdk/platform/Common/CommonPlatformValidator.js +3 -4
  114. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +370 -120
  115. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +2328 -888
  116. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +143 -24
  117. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +179 -15
  118. package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
  119. package/sdk/platform/Communication/CommunicationPlatformClient.js +6 -5
  120. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +386 -308
  121. package/sdk/platform/Communication/CommunicationPlatformModel.js +415 -355
  122. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +38 -13
  123. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +171 -57
  124. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +53 -1
  125. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +54 -0
  126. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +5 -1
  127. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +7 -0
  128. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +96 -29
  129. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +311 -126
  130. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +5 -1
  131. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +7 -0
  132. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +36 -18
  133. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +121 -86
  134. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +13 -180
  135. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +5 -113
  136. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +162 -70
  137. package/sdk/platform/Content/ContentPlatformApplicationClient.js +528 -309
  138. package/sdk/platform/Content/ContentPlatformModel.d.ts +9 -198
  139. package/sdk/platform/Content/ContentPlatformModel.js +8 -231
  140. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +48 -11
  141. package/sdk/platform/Discount/DiscountPlatformClient.js +142 -48
  142. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +40 -1
  143. package/sdk/platform/Discount/DiscountPlatformModel.js +27 -0
  144. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +84 -18
  145. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +486 -53
  146. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +71 -7
  147. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +81 -5
  148. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +13 -18
  149. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +58 -65
  150. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +198 -71
  151. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +212 -64
  152. package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +18 -10
  153. package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +11 -6
  154. package/sdk/platform/Finance/FinancePlatformClient.d.ts +177 -40
  155. package/sdk/platform/Finance/FinancePlatformClient.js +1028 -132
  156. package/sdk/platform/Finance/FinancePlatformModel.d.ts +670 -22
  157. package/sdk/platform/Finance/FinancePlatformModel.js +809 -23
  158. package/sdk/platform/Finance/FinancePlatformValidator.d.ts +111 -1
  159. package/sdk/platform/Finance/FinancePlatformValidator.js +134 -0
  160. package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +24 -12
  161. package/sdk/platform/Inventory/InventoryPlatformClient.js +94 -52
  162. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +27 -13
  163. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +101 -55
  164. package/sdk/platform/Lead/LeadPlatformClient.d.ts +50 -39
  165. package/sdk/platform/Lead/LeadPlatformClient.js +171 -112
  166. package/sdk/platform/Lead/LeadPlatformModel.d.ts +32 -390
  167. package/sdk/platform/Lead/LeadPlatformModel.js +31 -214
  168. package/sdk/platform/Lead/LeadPlatformValidator.d.ts +33 -33
  169. package/sdk/platform/Lead/LeadPlatformValidator.js +23 -23
  170. package/sdk/platform/OAuthClient.js +6 -2
  171. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +4 -2
  172. package/sdk/platform/Order/OrderPlatformApplicationClient.js +12 -10
  173. package/sdk/platform/Order/OrderPlatformClient.d.ts +165 -71
  174. package/sdk/platform/Order/OrderPlatformClient.js +738 -205
  175. package/sdk/platform/Order/OrderPlatformModel.d.ts +261 -3
  176. package/sdk/platform/Order/OrderPlatformModel.js +225 -2
  177. package/sdk/platform/Order/OrderPlatformValidator.d.ts +104 -3
  178. package/sdk/platform/Order/OrderPlatformValidator.js +85 -2
  179. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -22
  180. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +12 -159
  181. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +1 -30
  182. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +0 -26
  183. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -690
  184. package/sdk/platform/Partner/PartnerPlatformModel.js +0 -809
  185. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +167 -32
  186. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +793 -145
  187. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +91 -1
  188. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +91 -0
  189. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +20 -10
  190. package/sdk/platform/Payment/PaymentPlatformClient.js +68 -47
  191. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +549 -7
  192. package/sdk/platform/Payment/PaymentPlatformModel.js +305 -6
  193. package/sdk/platform/PlatformAPIClient.d.ts +3 -3
  194. package/sdk/platform/PlatformAPIClient.js +2 -2
  195. package/sdk/platform/PlatformClient.d.ts +2 -2
  196. package/sdk/platform/PlatformClient.js +4 -4
  197. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +28 -12
  198. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +90 -53
  199. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +1 -12
  200. package/sdk/platform/Rewards/RewardsPlatformModel.js +0 -14
  201. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +62 -26
  202. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +210 -93
  203. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +20 -11
  204. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +23 -11
  205. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +36 -18
  206. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +142 -78
  207. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +12 -3
  208. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +14 -2
  209. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +10 -26
  210. package/sdk/platform/Share/SharePlatformApplicationClient.js +36 -67
  211. package/sdk/platform/Share/SharePlatformModel.d.ts +4 -4
  212. package/sdk/platform/Share/SharePlatformModel.js +4 -4
  213. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +127 -57
  214. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +564 -189
  215. package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +63 -26
  216. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +62 -22
  217. package/sdk/platform/Theme/ThemePlatformClient.d.ts +37 -0
  218. package/sdk/platform/Theme/ThemePlatformClient.js +235 -0
  219. package/sdk/platform/Theme/ThemePlatformModel.d.ts +1167 -261
  220. package/sdk/platform/Theme/ThemePlatformModel.js +801 -244
  221. package/sdk/platform/Theme/ThemePlatformValidator.d.ts +32 -0
  222. package/sdk/platform/Theme/ThemePlatformValidator.js +38 -0
  223. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +35 -17
  224. package/sdk/platform/User/UserPlatformApplicationClient.js +132 -73
  225. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +7 -0
  226. package/sdk/platform/User/UserPlatformApplicationValidator.js +3 -0
  227. package/sdk/platform/User/UserPlatformModel.d.ts +1 -738
  228. package/sdk/platform/User/UserPlatformModel.js +3 -899
  229. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +120 -7
  230. package/sdk/platform/Webhook/WebhookPlatformClient.js +799 -41
  231. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +476 -86
  232. package/sdk/platform/Webhook/WebhookPlatformModel.js +388 -89
  233. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +96 -9
  234. package/sdk/platform/Webhook/WebhookPlatformValidator.js +117 -5
  235. package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +5 -3
  236. package/sdk/public/Configuration/ConfigurationPublicClient.js +13 -11
  237. package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +3 -106
  238. package/sdk/public/Configuration/ConfigurationPublicModel.js +2 -59
  239. package/sdk/public/Inventory/InventoryPublicClient.d.ts +12 -6
  240. package/sdk/public/Inventory/InventoryPublicClient.js +42 -27
  241. package/sdk/public/Partner/PartnerPublicClient.d.ts +22 -0
  242. package/sdk/public/Partner/PartnerPublicClient.js +110 -0
  243. package/sdk/public/Partner/PartnerPublicModel.d.ts +240 -0
  244. package/sdk/public/Partner/PartnerPublicModel.js +280 -0
  245. package/sdk/public/Partner/PartnerPublicValidator.d.ts +18 -0
  246. package/sdk/public/Partner/PartnerPublicValidator.js +19 -0
  247. package/sdk/public/PublicAPIClient.d.ts +14 -1
  248. package/sdk/public/PublicAPIClient.js +7 -1
  249. package/sdk/public/PublicClient.d.ts +2 -0
  250. package/sdk/public/PublicClient.js +4 -0
  251. package/sdk/public/Webhook/WebhookPublicClient.d.ts +5 -2
  252. package/sdk/public/Webhook/WebhookPublicClient.js +15 -9
  253. package/sdk/public/Webhook/WebhookPublicModel.d.ts +1 -191
  254. package/sdk/public/Webhook/WebhookPublicModel.js +0 -229
  255. package/sdk/public/index.d.ts +1 -0
  256. package/sdk/public/index.js +2 -0
  257. package/sdk/application/ApplicationModels.d.ts +0 -48
  258. package/sdk/application/ApplicationModels.js +0 -38
  259. package/sdk/platform/Partner/PartnerPlatformClient.d.ts +0 -106
  260. package/sdk/platform/Partner/PartnerPlatformClient.js +0 -878
  261. package/sdk/platform/Partner/PartnerPlatformValidator.d.ts +0 -208
  262. package/sdk/platform/Partner/PartnerPlatformValidator.js +0 -169
@@ -13,13 +13,17 @@ class Discount {
13
13
 
14
14
  /**
15
15
  * @param {DiscountPlatformValidator.CancelDownloadJobParam} arg - Arg object
16
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
16
17
  * @param {import("../PlatformAPIClient").Options} - Options
17
18
  * @returns {Promise<DiscountPlatformModel.CancelJobResponse>} - Success response
18
19
  * @name cancelDownloadJob
19
20
  * @summary: Cancel Download Job.
20
21
  * @description: Cancel Download Job. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/discount/cancelDownloadJob/).
21
22
  */
22
- async cancelDownloadJob({ id } = {}, { headers } = { headers: false }) {
23
+ async cancelDownloadJob(
24
+ { id, requestHeaders } = { requestHeaders: {} },
25
+ { responseHeaders } = { responseHeaders: false }
26
+ ) {
23
27
  const { error } = DiscountPlatformValidator.cancelDownloadJob().validate(
24
28
  {
25
29
  id,
@@ -56,12 +60,12 @@ class Discount {
56
60
  `/service/platform/discount/v1.0/company/${this.config.companyId}/file/download/${id}/`,
57
61
  query_params,
58
62
  undefined,
59
- xHeaders,
60
- { headers }
63
+ { ...xHeaders, ...requestHeaders },
64
+ { responseHeaders }
61
65
  );
62
66
 
63
67
  let responseData = response;
64
- if (headers) {
68
+ if (responseHeaders) {
65
69
  responseData = response[0];
66
70
  }
67
71
 
@@ -84,13 +88,17 @@ class Discount {
84
88
 
85
89
  /**
86
90
  * @param {DiscountPlatformValidator.CancelValidationJobParam} arg - Arg object
91
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
87
92
  * @param {import("../PlatformAPIClient").Options} - Options
88
93
  * @returns {Promise<DiscountPlatformModel.CancelJobResponse>} - Success response
89
94
  * @name cancelValidationJob
90
95
  * @summary: Cancel Validation Job.
91
96
  * @description: Cancel Validation Job. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/discount/cancelValidationJob/).
92
97
  */
93
- async cancelValidationJob({ id } = {}, { headers } = { headers: false }) {
98
+ async cancelValidationJob(
99
+ { id, requestHeaders } = { requestHeaders: {} },
100
+ { responseHeaders } = { responseHeaders: false }
101
+ ) {
94
102
  const { error } = DiscountPlatformValidator.cancelValidationJob().validate(
95
103
  {
96
104
  id,
@@ -127,12 +135,12 @@ class Discount {
127
135
  `/service/platform/discount/v1.0/company/${this.config.companyId}/file/validation/${id}/`,
128
136
  query_params,
129
137
  undefined,
130
- xHeaders,
131
- { headers }
138
+ { ...xHeaders, ...requestHeaders },
139
+ { responseHeaders }
132
140
  );
133
141
 
134
142
  let responseData = response;
135
- if (headers) {
143
+ if (responseHeaders) {
136
144
  responseData = response[0];
137
145
  }
138
146
 
@@ -155,13 +163,17 @@ class Discount {
155
163
 
156
164
  /**
157
165
  * @param {DiscountPlatformValidator.CreateDiscountParam} arg - Arg object
166
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
158
167
  * @param {import("../PlatformAPIClient").Options} - Options
159
168
  * @returns {Promise<DiscountPlatformModel.DiscountJob>} - Success response
160
169
  * @name createDiscount
161
170
  * @summary: Create Discount.
162
171
  * @description: Create Discount. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/discount/createDiscount/).
163
172
  */
164
- async createDiscount({ body } = {}, { headers } = { headers: false }) {
173
+ async createDiscount(
174
+ { body, requestHeaders } = { requestHeaders: {} },
175
+ { responseHeaders } = { responseHeaders: false }
176
+ ) {
165
177
  const { error } = DiscountPlatformValidator.createDiscount().validate(
166
178
  {
167
179
  body,
@@ -198,12 +210,12 @@ class Discount {
198
210
  `/service/platform/discount/v1.0/company/${this.config.companyId}/job/`,
199
211
  query_params,
200
212
  body,
201
- xHeaders,
202
- { headers }
213
+ { ...xHeaders, ...requestHeaders },
214
+ { responseHeaders }
203
215
  );
204
216
 
205
217
  let responseData = response;
206
- if (headers) {
218
+ if (responseHeaders) {
207
219
  responseData = response[0];
208
220
  }
209
221
 
@@ -226,6 +238,7 @@ class Discount {
226
238
 
227
239
  /**
228
240
  * @param {DiscountPlatformValidator.DownloadDiscountFileParam} arg - Arg object
241
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
229
242
  * @param {import("../PlatformAPIClient").Options} - Options
230
243
  * @returns {Promise<DiscountPlatformModel.FileJobResponse>} - Success response
231
244
  * @name downloadDiscountFile
@@ -233,8 +246,8 @@ class Discount {
233
246
  * @description: Validate File. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/discount/downloadDiscountFile/).
234
247
  */
235
248
  async downloadDiscountFile(
236
- { type, body } = {},
237
- { headers } = { headers: false }
249
+ { type, body, requestHeaders } = { requestHeaders: {} },
250
+ { responseHeaders } = { responseHeaders: false }
238
251
  ) {
239
252
  const { error } = DiscountPlatformValidator.downloadDiscountFile().validate(
240
253
  {
@@ -274,12 +287,12 @@ class Discount {
274
287
  `/service/platform/discount/v1.0/company/${this.config.companyId}/file/${type}/download/`,
275
288
  query_params,
276
289
  body,
277
- xHeaders,
278
- { headers }
290
+ { ...xHeaders, ...requestHeaders },
291
+ { responseHeaders }
279
292
  );
280
293
 
281
294
  let responseData = response;
282
- if (headers) {
295
+ if (responseHeaders) {
283
296
  responseData = response[0];
284
297
  }
285
298
 
@@ -302,13 +315,17 @@ class Discount {
302
315
 
303
316
  /**
304
317
  * @param {DiscountPlatformValidator.GetDiscountParam} arg - Arg object
318
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
305
319
  * @param {import("../PlatformAPIClient").Options} - Options
306
320
  * @returns {Promise<DiscountPlatformModel.DiscountJob>} - Success response
307
321
  * @name getDiscount
308
322
  * @summary: Fetch discount.
309
323
  * @description: Fetch discount. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/discount/getDiscount/).
310
324
  */
311
- async getDiscount({ id } = {}, { headers } = { headers: false }) {
325
+ async getDiscount(
326
+ { id, requestHeaders } = { requestHeaders: {} },
327
+ { responseHeaders } = { responseHeaders: false }
328
+ ) {
312
329
  const { error } = DiscountPlatformValidator.getDiscount().validate(
313
330
  {
314
331
  id,
@@ -345,12 +362,12 @@ class Discount {
345
362
  `/service/platform/discount/v1.0/company/${this.config.companyId}/job/${id}/`,
346
363
  query_params,
347
364
  undefined,
348
- xHeaders,
349
- { headers }
365
+ { ...xHeaders, ...requestHeaders },
366
+ { responseHeaders }
350
367
  );
351
368
 
352
369
  let responseData = response;
353
- if (headers) {
370
+ if (responseHeaders) {
354
371
  responseData = response[0];
355
372
  }
356
373
 
@@ -373,6 +390,7 @@ class Discount {
373
390
 
374
391
  /**
375
392
  * @param {DiscountPlatformValidator.GetDiscountsParam} arg - Arg object
393
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
376
394
  * @param {import("../PlatformAPIClient").Options} - Options
377
395
  * @returns {Promise<DiscountPlatformModel.ListOrCalender>} - Success response
378
396
  * @name getDiscounts
@@ -380,8 +398,19 @@ class Discount {
380
398
  * @description: Fetch discount list. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/discount/getDiscounts/).
381
399
  */
382
400
  async getDiscounts(
383
- { view, q, pageNo, pageSize, archived, month, year, type, appIds } = {},
384
- { headers } = { headers: false }
401
+ {
402
+ view,
403
+ q,
404
+ pageNo,
405
+ pageSize,
406
+ archived,
407
+ month,
408
+ year,
409
+ type,
410
+ appIds,
411
+ requestHeaders,
412
+ } = { requestHeaders: {} },
413
+ { responseHeaders } = { responseHeaders: false }
385
414
  ) {
386
415
  const { error } = DiscountPlatformValidator.getDiscounts().validate(
387
416
  {
@@ -444,12 +473,12 @@ class Discount {
444
473
  `/service/platform/discount/v1.0/company/${this.config.companyId}/job/`,
445
474
  query_params,
446
475
  undefined,
447
- xHeaders,
448
- { headers }
476
+ { ...xHeaders, ...requestHeaders },
477
+ { responseHeaders }
449
478
  );
450
479
 
451
480
  let responseData = response;
452
- if (headers) {
481
+ if (responseHeaders) {
453
482
  responseData = response[0];
454
483
  }
455
484
 
@@ -470,15 +499,70 @@ class Discount {
470
499
  return response;
471
500
  }
472
501
 
502
+ /**
503
+ * @param {Object} arg - Arg object.
504
+ * @param {string} [arg.view] - Listing or calender. Default is listing.
505
+ * @param {string} [arg.q] - The search query. This can be a partial or
506
+ * complete name of a discount.
507
+ * @param {number} [arg.pageSize] - Page size. Default is 12.
508
+ * @param {boolean} [arg.archived] - Archived. Default is false.
509
+ * @param {number} [arg.month] - Month. Default is current month.
510
+ * @param {number} [arg.year] - Year. Default is current year.
511
+ * @param {string} [arg.type] - Basic or custom.
512
+ * @param {string[]} [arg.appIds] - Application ids.
513
+ * @returns {Paginator<DiscountPlatformModel.ListOrCalender>}
514
+ * @summary: Fetch discount list.
515
+ * @description: Fetch discount list.
516
+ */
517
+ getDiscountsPaginator({
518
+ view,
519
+ q,
520
+ pageSize,
521
+ archived,
522
+ month,
523
+ year,
524
+ type,
525
+ appIds,
526
+ } = {}) {
527
+ const paginator = new Paginator();
528
+ const callback = async () => {
529
+ const pageId = paginator.nextId;
530
+ const pageNo = paginator.pageNo;
531
+ const pageType = "number";
532
+ const data = await this.getDiscounts({
533
+ view: view,
534
+ q: q,
535
+ pageNo: pageNo,
536
+ pageSize: pageSize,
537
+ archived: archived,
538
+ month: month,
539
+ year: year,
540
+ type: type,
541
+ appIds: appIds,
542
+ });
543
+ paginator.setPaginator({
544
+ hasNext: data.page.has_next ? true : false,
545
+ nextId: data.page.next_id,
546
+ });
547
+ return data;
548
+ };
549
+ paginator.setCallback(callback.bind(this));
550
+ return paginator;
551
+ }
552
+
473
553
  /**
474
554
  * @param {DiscountPlatformValidator.GetDownloadJobParam} arg - Arg object
555
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
475
556
  * @param {import("../PlatformAPIClient").Options} - Options
476
557
  * @returns {Promise<DiscountPlatformModel.FileJobResponse>} - Success response
477
558
  * @name getDownloadJob
478
559
  * @summary: Download File Job.
479
560
  * @description: Download File Job. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/discount/getDownloadJob/).
480
561
  */
481
- async getDownloadJob({ id } = {}, { headers } = { headers: false }) {
562
+ async getDownloadJob(
563
+ { id, requestHeaders } = { requestHeaders: {} },
564
+ { responseHeaders } = { responseHeaders: false }
565
+ ) {
482
566
  const { error } = DiscountPlatformValidator.getDownloadJob().validate(
483
567
  {
484
568
  id,
@@ -515,12 +599,12 @@ class Discount {
515
599
  `/service/platform/discount/v1.0/company/${this.config.companyId}/file/download/${id}/`,
516
600
  query_params,
517
601
  undefined,
518
- xHeaders,
519
- { headers }
602
+ { ...xHeaders, ...requestHeaders },
603
+ { responseHeaders }
520
604
  );
521
605
 
522
606
  let responseData = response;
523
- if (headers) {
607
+ if (responseHeaders) {
524
608
  responseData = response[0];
525
609
  }
526
610
 
@@ -543,13 +627,17 @@ class Discount {
543
627
 
544
628
  /**
545
629
  * @param {DiscountPlatformValidator.GetValidationJobParam} arg - Arg object
630
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
546
631
  * @param {import("../PlatformAPIClient").Options} - Options
547
632
  * @returns {Promise<DiscountPlatformModel.FileJobResponse>} - Success response
548
633
  * @name getValidationJob
549
634
  * @summary: Validate File Job.
550
635
  * @description: Validate File Job. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/discount/getValidationJob/).
551
636
  */
552
- async getValidationJob({ id } = {}, { headers } = { headers: false }) {
637
+ async getValidationJob(
638
+ { id, requestHeaders } = { requestHeaders: {} },
639
+ { responseHeaders } = { responseHeaders: false }
640
+ ) {
553
641
  const { error } = DiscountPlatformValidator.getValidationJob().validate(
554
642
  {
555
643
  id,
@@ -586,12 +674,12 @@ class Discount {
586
674
  `/service/platform/discount/v1.0/company/${this.config.companyId}/file/validation/${id}/`,
587
675
  query_params,
588
676
  undefined,
589
- xHeaders,
590
- { headers }
677
+ { ...xHeaders, ...requestHeaders },
678
+ { responseHeaders }
591
679
  );
592
680
 
593
681
  let responseData = response;
594
- if (headers) {
682
+ if (responseHeaders) {
595
683
  responseData = response[0];
596
684
  }
597
685
 
@@ -614,13 +702,17 @@ class Discount {
614
702
 
615
703
  /**
616
704
  * @param {DiscountPlatformValidator.UpdateDiscountParam} arg - Arg object
705
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
617
706
  * @param {import("../PlatformAPIClient").Options} - Options
618
707
  * @returns {Promise<DiscountPlatformModel.DiscountJob>} - Success response
619
708
  * @name updateDiscount
620
709
  * @summary: Create Discount.
621
710
  * @description: Create Discount. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/discount/updateDiscount/).
622
711
  */
623
- async updateDiscount({ id, body } = {}, { headers } = { headers: false }) {
712
+ async updateDiscount(
713
+ { id, body, requestHeaders } = { requestHeaders: {} },
714
+ { responseHeaders } = { responseHeaders: false }
715
+ ) {
624
716
  const { error } = DiscountPlatformValidator.updateDiscount().validate(
625
717
  {
626
718
  id,
@@ -659,12 +751,12 @@ class Discount {
659
751
  `/service/platform/discount/v1.0/company/${this.config.companyId}/job/${id}/`,
660
752
  query_params,
661
753
  body,
662
- xHeaders,
663
- { headers }
754
+ { ...xHeaders, ...requestHeaders },
755
+ { responseHeaders }
664
756
  );
665
757
 
666
758
  let responseData = response;
667
- if (headers) {
759
+ if (responseHeaders) {
668
760
  responseData = response[0];
669
761
  }
670
762
 
@@ -687,6 +779,7 @@ class Discount {
687
779
 
688
780
  /**
689
781
  * @param {DiscountPlatformValidator.UpsertDiscountItemsParam} arg - Arg object
782
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
690
783
  * @param {import("../PlatformAPIClient").Options} - Options
691
784
  * @returns {Promise<Object>} - Success response
692
785
  * @name upsertDiscountItems
@@ -694,8 +787,8 @@ class Discount {
694
787
  * @description: Create custom discounts through API. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/discount/upsertDiscountItems/).
695
788
  */
696
789
  async upsertDiscountItems(
697
- { id, body } = {},
698
- { headers } = { headers: false }
790
+ { id, body, requestHeaders } = { requestHeaders: {} },
791
+ { responseHeaders } = { responseHeaders: false }
699
792
  ) {
700
793
  const { error } = DiscountPlatformValidator.upsertDiscountItems().validate(
701
794
  {
@@ -735,12 +828,12 @@ class Discount {
735
828
  `/service/platform/discount/v1.0/company/${this.config.companyId}/job/${id}/items/`,
736
829
  query_params,
737
830
  body,
738
- xHeaders,
739
- { headers }
831
+ { ...xHeaders, ...requestHeaders },
832
+ { responseHeaders }
740
833
  );
741
834
 
742
835
  let responseData = response;
743
- if (headers) {
836
+ if (responseHeaders) {
744
837
  responseData = response[0];
745
838
  }
746
839
 
@@ -761,6 +854,7 @@ class Discount {
761
854
 
762
855
  /**
763
856
  * @param {DiscountPlatformValidator.ValidateDiscountFileParam} arg - Arg object
857
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
764
858
  * @param {import("../PlatformAPIClient").Options} - Options
765
859
  * @returns {Promise<DiscountPlatformModel.FileJobResponse>} - Success response
766
860
  * @name validateDiscountFile
@@ -768,8 +862,8 @@ class Discount {
768
862
  * @description: Validate File. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/discount/validateDiscountFile/).
769
863
  */
770
864
  async validateDiscountFile(
771
- { body, discount } = {},
772
- { headers } = { headers: false }
865
+ { body, discount, requestHeaders } = { requestHeaders: {} },
866
+ { responseHeaders } = { responseHeaders: false }
773
867
  ) {
774
868
  const { error } = DiscountPlatformValidator.validateDiscountFile().validate(
775
869
  {
@@ -810,12 +904,12 @@ class Discount {
810
904
  `/service/platform/discount/v1.0/company/${this.config.companyId}/file/validation/`,
811
905
  query_params,
812
906
  body,
813
- xHeaders,
814
- { headers }
907
+ { ...xHeaders, ...requestHeaders },
908
+ { responseHeaders }
815
909
  );
816
910
 
817
911
  let responseData = response;
818
- if (headers) {
912
+ if (responseHeaders) {
819
913
  responseData = response[0];
820
914
  }
821
915
 
@@ -18,6 +18,7 @@ export = DiscountPlatformModel;
18
18
  * @property {number[]} [brand_ids]
19
19
  * @property {number} company_id
20
20
  * @property {string} discount_level
21
+ * @property {DiscountMeta} [discount_meta]
21
22
  * @property {string} discount_type
22
23
  * @property {string[]} extension_ids
23
24
  * @property {string} [file_path]
@@ -31,6 +32,7 @@ export = DiscountPlatformModel;
31
32
  /**
32
33
  * @typedef DiscountItems
33
34
  * @property {number} [brand_uid]
35
+ * @property {DiscountMeta} [discount_meta]
34
36
  * @property {string} discount_type
35
37
  * @property {string} [item_code]
36
38
  * @property {string} [seller_identifier]
@@ -45,6 +47,7 @@ export = DiscountPlatformModel;
45
47
  * @property {UserDetails} created_by
46
48
  * @property {string} created_on
47
49
  * @property {string} [discount_level]
50
+ * @property {DiscountMeta} [discount_meta]
48
51
  * @property {string} [discount_type]
49
52
  * @property {string} [file_path]
50
53
  * @property {boolean} is_active
@@ -57,6 +60,15 @@ export = DiscountPlatformModel;
57
60
  * @property {ValidityObject} validity
58
61
  * @property {number} [value]
59
62
  */
63
+ /**
64
+ * @typedef DiscountMeta
65
+ * @property {number} [hours] - The time in hours before the discount ends when
66
+ * the countdown timer should start.
67
+ * @property {number} [minutes] - The time in minutes before the discount ends
68
+ * when the countdown timer should start.
69
+ * @property {boolean} timer - Determines whether the discount countdown is
70
+ * visible or not.
71
+ */
60
72
  /**
61
73
  * @typedef DownloadFileJob
62
74
  * @property {number[]} [brand_ids]
@@ -78,6 +90,7 @@ export = DiscountPlatformModel;
78
90
  */
79
91
  /**
80
92
  * @typedef FileJobResponse
93
+ * @property {string} _id - A unique identifier to distinguish and identify a job.
81
94
  * @property {Object} [body]
82
95
  * @property {number} company_id
83
96
  * @property {number} failed
@@ -114,7 +127,7 @@ export = DiscountPlatformModel;
114
127
  declare class DiscountPlatformModel {
115
128
  }
116
129
  declare namespace DiscountPlatformModel {
117
- export { BadRequestObject, BulkDiscount, CancelJobResponse, CreateUpdateDiscount, DiscountItems, DiscountJob, DownloadFileJob, FileJobRequest, FileJobResponse, ListOrCalender, Page, UserDetails, ValidityObject };
130
+ export { BadRequestObject, BulkDiscount, CancelJobResponse, CreateUpdateDiscount, DiscountItems, DiscountJob, DiscountMeta, DownloadFileJob, FileJobRequest, FileJobResponse, ListOrCalender, Page, UserDetails, ValidityObject };
118
131
  }
119
132
  /** @returns {BadRequestObject} */
120
133
  declare function BadRequestObject(): BadRequestObject;
@@ -139,6 +152,7 @@ type CreateUpdateDiscount = {
139
152
  brand_ids?: number[];
140
153
  company_id: number;
141
154
  discount_level: string;
155
+ discount_meta?: DiscountMeta;
142
156
  discount_type: string;
143
157
  extension_ids: string[];
144
158
  file_path?: string;
@@ -153,6 +167,7 @@ type CreateUpdateDiscount = {
153
167
  declare function DiscountItems(): DiscountItems;
154
168
  type DiscountItems = {
155
169
  brand_uid?: number;
170
+ discount_meta?: DiscountMeta;
156
171
  discount_type: string;
157
172
  item_code?: string;
158
173
  seller_identifier?: string;
@@ -168,6 +183,7 @@ type DiscountJob = {
168
183
  created_by: UserDetails;
169
184
  created_on: string;
170
185
  discount_level?: string;
186
+ discount_meta?: DiscountMeta;
171
187
  discount_type?: string;
172
188
  file_path?: string;
173
189
  is_active: boolean;
@@ -180,6 +196,25 @@ type DiscountJob = {
180
196
  validity: ValidityObject;
181
197
  value?: number;
182
198
  };
199
+ /** @returns {DiscountMeta} */
200
+ declare function DiscountMeta(): DiscountMeta;
201
+ type DiscountMeta = {
202
+ /**
203
+ * - The time in hours before the discount ends when
204
+ * the countdown timer should start.
205
+ */
206
+ hours?: number;
207
+ /**
208
+ * - The time in minutes before the discount ends
209
+ * when the countdown timer should start.
210
+ */
211
+ minutes?: number;
212
+ /**
213
+ * - Determines whether the discount countdown is
214
+ * visible or not.
215
+ */
216
+ timer: boolean;
217
+ };
183
218
  /** @returns {DownloadFileJob} */
184
219
  declare function DownloadFileJob(): DownloadFileJob;
185
220
  type DownloadFileJob = {
@@ -204,6 +239,10 @@ type FileJobRequest = {
204
239
  /** @returns {FileJobResponse} */
205
240
  declare function FileJobResponse(): FileJobResponse;
206
241
  type FileJobResponse = {
242
+ /**
243
+ * - A unique identifier to distinguish and identify a job.
244
+ */
245
+ _id: string;
207
246
  body?: any;
208
247
  company_id: number;
209
248
  failed: number;
@@ -22,6 +22,7 @@ const Joi = require("joi");
22
22
  * @property {number[]} [brand_ids]
23
23
  * @property {number} company_id
24
24
  * @property {string} discount_level
25
+ * @property {DiscountMeta} [discount_meta]
25
26
  * @property {string} discount_type
26
27
  * @property {string[]} extension_ids
27
28
  * @property {string} [file_path]
@@ -36,6 +37,7 @@ const Joi = require("joi");
36
37
  /**
37
38
  * @typedef DiscountItems
38
39
  * @property {number} [brand_uid]
40
+ * @property {DiscountMeta} [discount_meta]
39
41
  * @property {string} discount_type
40
42
  * @property {string} [item_code]
41
43
  * @property {string} [seller_identifier]
@@ -51,6 +53,7 @@ const Joi = require("joi");
51
53
  * @property {UserDetails} created_by
52
54
  * @property {string} created_on
53
55
  * @property {string} [discount_level]
56
+ * @property {DiscountMeta} [discount_meta]
54
57
  * @property {string} [discount_type]
55
58
  * @property {string} [file_path]
56
59
  * @property {boolean} is_active
@@ -64,6 +67,16 @@ const Joi = require("joi");
64
67
  * @property {number} [value]
65
68
  */
66
69
 
70
+ /**
71
+ * @typedef DiscountMeta
72
+ * @property {number} [hours] - The time in hours before the discount ends when
73
+ * the countdown timer should start.
74
+ * @property {number} [minutes] - The time in minutes before the discount ends
75
+ * when the countdown timer should start.
76
+ * @property {boolean} timer - Determines whether the discount countdown is
77
+ * visible or not.
78
+ */
79
+
67
80
  /**
68
81
  * @typedef DownloadFileJob
69
82
  * @property {number[]} [brand_ids]
@@ -87,6 +100,7 @@ const Joi = require("joi");
87
100
 
88
101
  /**
89
102
  * @typedef FileJobResponse
103
+ * @property {string} _id - A unique identifier to distinguish and identify a job.
90
104
  * @property {Object} [body]
91
105
  * @property {number} company_id
92
106
  * @property {number} failed
@@ -157,6 +171,7 @@ class DiscountPlatformModel {
157
171
  brand_ids: Joi.array().items(Joi.number()),
158
172
  company_id: Joi.number().required(),
159
173
  discount_level: Joi.string().allow("").required(),
174
+ discount_meta: DiscountPlatformModel.DiscountMeta(),
160
175
  discount_type: Joi.string().allow("").required(),
161
176
  extension_ids: Joi.array().items(Joi.string().allow("")).required(),
162
177
  file_path: Joi.string().allow(""),
@@ -173,6 +188,7 @@ class DiscountPlatformModel {
173
188
  static DiscountItems() {
174
189
  return Joi.object({
175
190
  brand_uid: Joi.number(),
191
+ discount_meta: DiscountPlatformModel.DiscountMeta(),
176
192
  discount_type: Joi.string().allow("").required(),
177
193
  item_code: Joi.string().allow(""),
178
194
  seller_identifier: Joi.string().allow(""),
@@ -190,6 +206,7 @@ class DiscountPlatformModel {
190
206
  created_by: DiscountPlatformModel.UserDetails().required(),
191
207
  created_on: Joi.string().allow("").required(),
192
208
  discount_level: Joi.string().allow(""),
209
+ discount_meta: DiscountPlatformModel.DiscountMeta(),
193
210
  discount_type: Joi.string().allow(""),
194
211
  file_path: Joi.string().allow(""),
195
212
  is_active: Joi.boolean().required(),
@@ -204,6 +221,15 @@ class DiscountPlatformModel {
204
221
  });
205
222
  }
206
223
 
224
+ /** @returns {DiscountMeta} */
225
+ static DiscountMeta() {
226
+ return Joi.object({
227
+ hours: Joi.number(),
228
+ minutes: Joi.number(),
229
+ timer: Joi.boolean().required(),
230
+ });
231
+ }
232
+
207
233
  /** @returns {DownloadFileJob} */
208
234
  static DownloadFileJob() {
209
235
  return Joi.object({
@@ -232,6 +258,7 @@ class DiscountPlatformModel {
232
258
  /** @returns {FileJobResponse} */
233
259
  static FileJobResponse() {
234
260
  return Joi.object({
261
+ _id: Joi.string().allow("").required(),
235
262
  body: Joi.any(),
236
263
  company_id: Joi.number().required(),
237
264
  failed: Joi.number().required(),