@gofynd/fdk-client-javascript 1.1.3 → 1.1.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.
Files changed (51) hide show
  1. package/README.md +1 -0
  2. package/index.d.ts +4 -1
  3. package/index.js +7 -0
  4. package/package.json +1 -1
  5. package/partner.d.ts +4 -0
  6. package/partner.js +7 -0
  7. package/sdk/application/Common/CommonApplicationModel.js +4 -0
  8. package/sdk/application/Configuration/ConfigurationApplicationModel.js +5 -5
  9. package/sdk/application/Lead/LeadApplicationModel.js +4 -1
  10. package/sdk/partner/OAuthClient.d.ts +14 -0
  11. package/sdk/partner/OAuthClient.js +112 -0
  12. package/sdk/partner/PartnerAPIClient.d.ts +12 -0
  13. package/sdk/partner/PartnerAPIClient.js +42 -0
  14. package/sdk/partner/PartnerClient.d.ts +6 -0
  15. package/sdk/partner/PartnerClient.js +17 -0
  16. package/sdk/partner/PartnerConfig.d.ts +30 -0
  17. package/sdk/partner/PartnerConfig.js +39 -0
  18. package/sdk/partner/index.d.ts +3 -0
  19. package/sdk/partner/index.js +5 -0
  20. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +32 -0
  21. package/sdk/platform/Cart/CartPlatformApplicationClient.js +184 -0
  22. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +3 -0
  23. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +19 -0
  24. package/sdk/platform/Cart/CartPlatformModel.d.ts +6 -0
  25. package/sdk/platform/Cart/CartPlatformModel.js +72 -1
  26. package/sdk/platform/Catalog/CatalogPlatformModel.js +2 -2
  27. package/sdk/platform/Common/CommonPlatformModel.js +4 -0
  28. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +8 -7
  29. package/sdk/platform/Order/OrderPlatformClient.d.ts +3 -1
  30. package/sdk/platform/Order/OrderPlatformClient.js +5 -0
  31. package/sdk/platform/Order/OrderPlatformModel.js +1 -1
  32. package/sdk/platform/Order/OrderPlatformValidator.js +1 -0
  33. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +4 -0
  34. package/sdk/platform/Payment/PaymentPlatformModel.js +42 -7
  35. package/sdk/platform/PlatformApplicationClient.d.ts +103 -2
  36. package/sdk/platform/PlatformApplicationClient.js +109 -0
  37. package/sdk/platform/PlatformClient.d.ts +642 -36
  38. package/sdk/platform/PlatformClient.js +773 -18
  39. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +134 -0
  40. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +852 -0
  41. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +16 -0
  42. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +81 -0
  43. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +223 -0
  44. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +1296 -0
  45. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +97 -0
  46. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +778 -0
  47. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +21 -0
  48. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +130 -0
  49. package/sdk/platform/index.d.ts +1 -0
  50. package/sdk/platform/index.js +2 -0
  51. package/sdk/public/Configuration/ConfigurationPublicModel.js +5 -0
@@ -0,0 +1,778 @@
1
+ const Joi = require("joi");
2
+
3
+ class ServiceabilityModel {
4
+ static AddressResponse() {
5
+ return Joi.object({
6
+ address1: Joi.string().allow(""),
7
+ address2: Joi.string().allow(""),
8
+ city: Joi.string().allow(""),
9
+ country: Joi.string().allow(""),
10
+ landmark: Joi.string().allow(""),
11
+ latitude: Joi.number(),
12
+ longitude: Joi.number(),
13
+ pincode: Joi.number(),
14
+ state: Joi.string().allow(""),
15
+ });
16
+ }
17
+ static ApplicationCompanyDpViewRequest() {
18
+ return Joi.object({
19
+ dp_id: Joi.string().allow(""),
20
+ });
21
+ }
22
+ static ApplicationCompanyDpViewResponse() {
23
+ return Joi.object({
24
+ application_id: Joi.string().allow("").required(),
25
+ company_id: Joi.number().required(),
26
+ courier_partner_id: Joi.number(),
27
+ success: Joi.boolean().required(),
28
+ });
29
+ }
30
+ static ApplicationSelfShipConfig() {
31
+ return Joi.object({
32
+ self_ship: ServiceabilityModel.SelfShipResponse(),
33
+ });
34
+ }
35
+ static ApplicationSelfShipConfigResponse() {
36
+ return Joi.object({
37
+ data: ServiceabilityModel.ApplicationSelfShipConfig(),
38
+ error: ServiceabilityModel.ServiceabilityErrorResponse(),
39
+ success: Joi.boolean().required(),
40
+ });
41
+ }
42
+ static ApplicationServiceabilityConfig() {
43
+ return Joi.object({
44
+ channel_id: Joi.string().allow("").required(),
45
+ channel_type: Joi.string().allow("").required(),
46
+ serviceability_type: Joi.string().allow("").required(),
47
+ });
48
+ }
49
+ static ApplicationServiceabilityConfigResponse() {
50
+ return Joi.object({
51
+ data: ServiceabilityModel.ApplicationServiceabilityConfig(),
52
+ error: ServiceabilityModel.ServiceabilityErrorResponse(),
53
+ success: Joi.boolean().required(),
54
+ });
55
+ }
56
+ static CommonError() {
57
+ return Joi.object({
58
+ error: Joi.any(),
59
+ status_code: Joi.string().allow(""),
60
+ success: Joi.string().allow(""),
61
+ });
62
+ }
63
+ static CompanyDpAccountListResponse() {
64
+ return Joi.object({
65
+ items: Joi.array().items(ServiceabilityModel.Dp1()).required(),
66
+ page: ServiceabilityModel.Page().required(),
67
+ success: Joi.boolean().required(),
68
+ });
69
+ }
70
+ static CompanyDpAccountRequest() {
71
+ return Joi.object({
72
+ data: Joi.array().items(ServiceabilityModel.Dp1()).required(),
73
+ });
74
+ }
75
+ static CompanyDpAccountResponse() {
76
+ return Joi.object({
77
+ success: Joi.boolean().required(),
78
+ });
79
+ }
80
+ static CompanyStoreView_PageItems() {
81
+ return Joi.object({
82
+ current: Joi.number().required(),
83
+ has_next: Joi.boolean().required(),
84
+ item_total: Joi.number().required(),
85
+ size: Joi.number().required(),
86
+ type: Joi.string().allow("").required(),
87
+ });
88
+ }
89
+ static CompanyStoreView_Response() {
90
+ return Joi.object({
91
+ items: Joi.array().items(Joi.any()),
92
+ page: Joi.array()
93
+ .items(ServiceabilityModel.CompanyStoreView_PageItems())
94
+ .required(),
95
+ });
96
+ }
97
+ static ContactNumberResponse() {
98
+ return Joi.object({
99
+ country_code: Joi.number(),
100
+ number: Joi.string().allow(""),
101
+ });
102
+ }
103
+ static CreatedByResponse() {
104
+ return Joi.object({
105
+ user_id: Joi.string().allow(""),
106
+ username: Joi.string().allow(""),
107
+ });
108
+ }
109
+ static CreateZoneData() {
110
+ return Joi.object({
111
+ assignment_preference: Joi.string().allow(""),
112
+ channels: Joi.array()
113
+ .items(ServiceabilityModel.GetZoneDataViewChannels())
114
+ .required(),
115
+ company_id: Joi.number().required(),
116
+ is_active: Joi.boolean().required(),
117
+ mapping: Joi.array()
118
+ .items(ServiceabilityModel.ZoneMappingType())
119
+ .required(),
120
+ name: Joi.string().allow("").required(),
121
+ product: ServiceabilityModel.ZoneProductTypes().required(),
122
+ region_type: Joi.string().allow("").required(),
123
+ slug: Joi.string().allow("").required(),
124
+ store_ids: Joi.array().items(Joi.number()).required(),
125
+ });
126
+ }
127
+ static DocumentsResponse() {
128
+ return Joi.object({
129
+ legal_name: Joi.string().allow(""),
130
+ type: Joi.string().allow(""),
131
+ value: Joi.string().allow(""),
132
+ verified: Joi.boolean(),
133
+ });
134
+ }
135
+ static Dp() {
136
+ return Joi.object({
137
+ area_code: Joi.number().allow(null),
138
+ assign_dp_from_sb: Joi.boolean(),
139
+ external_account_id: Joi.string().allow("").allow(null),
140
+ fm_priority: Joi.number(),
141
+ internal_account_id: Joi.string().allow(""),
142
+ lm_priority: Joi.number(),
143
+ operations: Joi.array().items(Joi.string().allow("")),
144
+ payment_mode: Joi.string().allow(""),
145
+ rvp_priority: Joi.number(),
146
+ transport_mode: Joi.string().allow(""),
147
+ });
148
+ }
149
+ static Dp1() {
150
+ return Joi.object({
151
+ account_id: Joi.string().allow("").required(),
152
+ dp_id: Joi.string().allow("").required(),
153
+ is_self_ship: Joi.boolean().required(),
154
+ name: Joi.string().allow("").required(),
155
+ plan_id: Joi.string().allow("").required(),
156
+ plan_rules: Joi.any().required(),
157
+ stage: Joi.string().allow("").required(),
158
+ });
159
+ }
160
+ static DpAccountFailureResponse() {
161
+ return Joi.object({
162
+ error: Joi.array().items(ServiceabilityModel.ErrorResponse()).required(),
163
+ status_code: Joi.number().required(),
164
+ success: Joi.boolean().required(),
165
+ });
166
+ }
167
+ static DPApplicationRuleRequest() {
168
+ return Joi.object({
169
+ shipping_rules: Joi.array().items(Joi.string().allow("")).required(),
170
+ });
171
+ }
172
+ static DPApplicationRuleResponse() {
173
+ return Joi.object({
174
+ data: Joi.array().items(ServiceabilityModel.DpRuleResponse()).required(),
175
+ status_code: Joi.boolean().required(),
176
+ success: Joi.boolean().required(),
177
+ });
178
+ }
179
+ static DPCompanyRuleRequest() {
180
+ return Joi.object({
181
+ rule_ids: Joi.array().items(Joi.string().allow("")).required(),
182
+ });
183
+ }
184
+ static DPCompanyRuleResponse() {
185
+ return Joi.object({
186
+ data: Joi.array().items(ServiceabilityModel.DpRuleResponse()).required(),
187
+ status_code: Joi.number().required(),
188
+ success: Joi.boolean().required(),
189
+ });
190
+ }
191
+ static DpIds() {
192
+ return Joi.object({
193
+ enabled: Joi.boolean().required(),
194
+ meta: Joi.any(),
195
+ priority: Joi.number().required(),
196
+ });
197
+ }
198
+ static DpMultipleRuleSuccessResponse() {
199
+ return Joi.object({
200
+ items: Joi.array().items(ServiceabilityModel.DpRule()).required(),
201
+ page: ServiceabilityModel.Page().required(),
202
+ success: Joi.boolean().required(),
203
+ });
204
+ }
205
+ static DpRule() {
206
+ return Joi.object({
207
+ company_id: Joi.number(),
208
+ conditions: Joi.array().items(Joi.any()).required(),
209
+ dp_ids: Joi.object()
210
+ .pattern(/\S/, ServiceabilityModel.DpSchemaInRuleListing())
211
+ .required(),
212
+ is_active: Joi.boolean(),
213
+ name: Joi.string().allow("").required(),
214
+ });
215
+ }
216
+ static DpRuleRequest() {
217
+ return Joi.object({
218
+ company_id: Joi.number(),
219
+ conditions: Joi.array().items(Joi.any()).required(),
220
+ dp_ids: Joi.object()
221
+ .pattern(/\S/, ServiceabilityModel.DpIds())
222
+ .required(),
223
+ is_active: Joi.boolean(),
224
+ name: Joi.string().allow("").required(),
225
+ });
226
+ }
227
+ static DpRuleResponse() {
228
+ return Joi.object({
229
+ company_id: Joi.number().required(),
230
+ conditions: Joi.array().items(Joi.string().allow("")).required(),
231
+ created_by: Joi.any(),
232
+ created_on: Joi.string().allow(""),
233
+ dp_ids: Joi.any().required(),
234
+ is_active: Joi.boolean(),
235
+ modified_by: Joi.any(),
236
+ modified_on: Joi.string().allow(""),
237
+ name: Joi.string().allow("").required(),
238
+ uid: Joi.string().allow("").required(),
239
+ });
240
+ }
241
+ static DpRuleSuccessResponse() {
242
+ return Joi.object({
243
+ data: ServiceabilityModel.DpRule().required(),
244
+ status_code: Joi.number().required(),
245
+ success: Joi.boolean().required(),
246
+ });
247
+ }
248
+ static DpRulesUpdateRequest() {
249
+ return Joi.object({
250
+ conditions: Joi.array().items(Joi.any()).required(),
251
+ dp_ids: Joi.object().pattern(/\S/, Joi.any()).required(),
252
+ is_active: Joi.boolean().required(),
253
+ name: Joi.string().allow("").required(),
254
+ });
255
+ }
256
+ static DpRuleUpdateSuccessResponse() {
257
+ return Joi.object({
258
+ data: ServiceabilityModel.DpRuleResponse().required(),
259
+ status_code: Joi.number().required(),
260
+ success: Joi.boolean().required(),
261
+ });
262
+ }
263
+ static DpSchemaInRuleListing() {
264
+ return Joi.object({
265
+ account_id: Joi.string().allow("").required(),
266
+ dp_id: Joi.string().allow("").required(),
267
+ is_self_ship: Joi.boolean().required(),
268
+ name: Joi.string().allow("").required(),
269
+ plan_id: Joi.string().allow("").required(),
270
+ plan_rules: Joi.any().required(),
271
+ priority: Joi.number().required(),
272
+ stage: Joi.string().allow("").required(),
273
+ });
274
+ }
275
+ static EinvoiceResponse() {
276
+ return Joi.object({
277
+ enabled: Joi.boolean(),
278
+ });
279
+ }
280
+ static EntityRegionView_Error() {
281
+ return Joi.object({
282
+ message: Joi.string().allow(""),
283
+ type: Joi.string().allow(""),
284
+ value: Joi.string().allow(""),
285
+ });
286
+ }
287
+ static EntityRegionView_Items() {
288
+ return Joi.object({
289
+ name: Joi.string().allow("").required(),
290
+ sub_type: Joi.string().allow("").required(),
291
+ uid: Joi.string().allow("").required(),
292
+ });
293
+ }
294
+ static EntityRegionView_page() {
295
+ return Joi.object({
296
+ current: Joi.number().required(),
297
+ has_next: Joi.boolean().required(),
298
+ item_total: Joi.number().required(),
299
+ size: Joi.number().required(),
300
+ type: Joi.string().allow("").required(),
301
+ });
302
+ }
303
+ static EntityRegionView_Request() {
304
+ return Joi.object({
305
+ parent_id: Joi.array().items(Joi.string().allow("")),
306
+ sub_type: Joi.array().items(Joi.string().allow("")).required(),
307
+ });
308
+ }
309
+ static EntityRegionView_Response() {
310
+ return Joi.object({
311
+ error: ServiceabilityModel.EntityRegionView_Error().required(),
312
+ items: Joi.array().items(ServiceabilityModel.EntityRegionView_Items()),
313
+ page: ServiceabilityModel.EntityRegionView_page().required(),
314
+ success: Joi.boolean().required(),
315
+ });
316
+ }
317
+ static Error() {
318
+ return Joi.object({
319
+ message: Joi.string().allow("").allow(null),
320
+ type: Joi.string().allow("").allow(null),
321
+ value: Joi.string().allow("").allow(null),
322
+ });
323
+ }
324
+ static ErrorResponse() {
325
+ return Joi.object({
326
+ message: Joi.string().allow("").required(),
327
+ type: Joi.string().allow("").required(),
328
+ value: Joi.string().allow("").required(),
329
+ });
330
+ }
331
+ static EwayBillResponse() {
332
+ return Joi.object({
333
+ enabled: Joi.boolean(),
334
+ });
335
+ }
336
+ static FailureResponse() {
337
+ return Joi.object({
338
+ error: Joi.array().items(ServiceabilityModel.ErrorResponse()).required(),
339
+ status_code: Joi.number().required(),
340
+ success: Joi.boolean().required(),
341
+ });
342
+ }
343
+ static GetSingleZoneDataViewResponse() {
344
+ return Joi.object({
345
+ data: ServiceabilityModel.GetZoneDataViewItems().required(),
346
+ });
347
+ }
348
+ static GetStoresViewResponse() {
349
+ return Joi.object({
350
+ items: Joi.array().items(ServiceabilityModel.ItemResponse()),
351
+ page: ServiceabilityModel.ServiceabilityPageResponse().required(),
352
+ });
353
+ }
354
+ static GetZoneDataViewChannels() {
355
+ return Joi.object({
356
+ channel_id: Joi.string().allow("").required(),
357
+ channel_type: Joi.string().allow("").required(),
358
+ });
359
+ }
360
+ static GetZoneDataViewItems() {
361
+ return Joi.object({
362
+ assignment_preference: Joi.string().allow(""),
363
+ channels: Joi.array()
364
+ .items(ServiceabilityModel.GetZoneDataViewChannels())
365
+ .required(),
366
+ company_id: Joi.number(),
367
+ is_active: Joi.boolean().required(),
368
+ mapping: Joi.array()
369
+ .items(ServiceabilityModel.ZoneMappingType())
370
+ .required(),
371
+ name: Joi.string().allow("").required(),
372
+ pincodes_count: Joi.number().required(),
373
+ product: ServiceabilityModel.ZoneProductTypes().required(),
374
+ region_type: Joi.string().allow("").required(),
375
+ slug: Joi.string().allow("").required(),
376
+ store_ids: Joi.array().items(Joi.number()).required(),
377
+ stores_count: Joi.number().required(),
378
+ zone_id: Joi.string().allow("").required(),
379
+ });
380
+ }
381
+ static GetZoneFromApplicationIdViewResponse() {
382
+ return Joi.object({
383
+ items: Joi.array().items(ServiceabilityModel.ListViewItems()).required(),
384
+ page: Joi.array().items(ServiceabilityModel.ZoneDataItem()).required(),
385
+ });
386
+ }
387
+ static GetZoneFromPincodeViewRequest() {
388
+ return Joi.object({
389
+ country: Joi.string().allow("").required(),
390
+ pincode: Joi.string().allow("").required(),
391
+ });
392
+ }
393
+ static GetZoneFromPincodeViewResponse() {
394
+ return Joi.object({
395
+ serviceability_type: Joi.string().allow("").required(),
396
+ zones: Joi.array().items(ServiceabilityModel.Zone()).required(),
397
+ });
398
+ }
399
+ static GstCredentialsResponse() {
400
+ return Joi.object({
401
+ e_invoice: ServiceabilityModel.EinvoiceResponse(),
402
+ e_waybill: ServiceabilityModel.EwayBillResponse(),
403
+ });
404
+ }
405
+ static IntegrationTypeResponse() {
406
+ return Joi.object({
407
+ inventory: Joi.string().allow(""),
408
+ order: Joi.string().allow(""),
409
+ });
410
+ }
411
+ static ItemResponse() {
412
+ return Joi.object({
413
+ _cls: Joi.string().allow(""),
414
+ _custom_json: Joi.any(),
415
+ address: ServiceabilityModel.AddressResponse(),
416
+ code: Joi.string().allow(""),
417
+ company: Joi.number(),
418
+ company_id: Joi.number(),
419
+ contact_numbers: Joi.array().items(
420
+ ServiceabilityModel.ContactNumberResponse()
421
+ ),
422
+ created_by: ServiceabilityModel.CreatedByResponse(),
423
+ created_on: Joi.string().allow(""),
424
+ display_name: Joi.string().allow(""),
425
+ documents: Joi.array().items(ServiceabilityModel.DocumentsResponse()),
426
+ gst_credentials: ServiceabilityModel.GstCredentialsResponse(),
427
+ integration_type: ServiceabilityModel.IntegrationTypeResponse(),
428
+ logistics: ServiceabilityModel.LogisticsResponse(),
429
+ manager: ServiceabilityModel.ManagerResponse(),
430
+ modified_by: ServiceabilityModel.ModifiedByResponse(),
431
+ modified_on: Joi.string().allow(""),
432
+ name: Joi.string().allow(""),
433
+ notification_emails: Joi.array().items(Joi.string().allow("")),
434
+ product_return_config: ServiceabilityModel.ProductReturnConfigResponse(),
435
+ stage: Joi.string().allow(""),
436
+ store_type: Joi.string().allow(""),
437
+ sub_type: Joi.string().allow(""),
438
+ timing: Joi.array().items(ServiceabilityModel.TimmingResponse()),
439
+ uid: Joi.number(),
440
+ verified_by: ServiceabilityModel.ModifiedByResponse(),
441
+ verified_on: Joi.string().allow(""),
442
+ warnings: ServiceabilityModel.WarningsResponse(),
443
+ });
444
+ }
445
+ static ListViewChannels() {
446
+ return Joi.object({
447
+ channel_id: Joi.string().allow("").required(),
448
+ channel_type: Joi.string().allow("").required(),
449
+ });
450
+ }
451
+ static ListViewItems() {
452
+ return Joi.object({
453
+ channels: Joi.array()
454
+ .items(ServiceabilityModel.ListViewChannels())
455
+ .required(),
456
+ company_id: Joi.number().required(),
457
+ is_active: Joi.boolean().required(),
458
+ name: Joi.string().allow("").required(),
459
+ pincodes_count: Joi.number().required(),
460
+ product: ServiceabilityModel.ListViewProduct().required(),
461
+ slug: Joi.string().allow("").required(),
462
+ stores_count: Joi.number().required(),
463
+ zone_id: Joi.string().allow("").required(),
464
+ });
465
+ }
466
+ static ListViewProduct() {
467
+ return Joi.object({
468
+ count: Joi.number().required(),
469
+ type: Joi.string().allow("").required(),
470
+ });
471
+ }
472
+ static ListViewResponse() {
473
+ return Joi.object({
474
+ items: Joi.array().items(ServiceabilityModel.ListViewItems()).required(),
475
+ page: Joi.array().items(ServiceabilityModel.ZoneDataItem()).required(),
476
+ summary: Joi.array()
477
+ .items(ServiceabilityModel.ListViewSummary())
478
+ .required(),
479
+ });
480
+ }
481
+ static ListViewSummary() {
482
+ return Joi.object({
483
+ total_active_zones: Joi.number().required(),
484
+ total_pincodes_served: Joi.number().required(),
485
+ total_zones: Joi.number().required(),
486
+ });
487
+ }
488
+ static LogisticsResponse() {
489
+ return Joi.object({
490
+ dp: ServiceabilityModel.Dp(),
491
+ override: Joi.boolean(),
492
+ });
493
+ }
494
+ static ManagerResponse() {
495
+ return Joi.object({
496
+ email: Joi.string().allow(""),
497
+ mobile_no: ServiceabilityModel.MobileNo(),
498
+ name: Joi.string().allow(""),
499
+ });
500
+ }
501
+ static MobileNo() {
502
+ return Joi.object({
503
+ country_code: Joi.number(),
504
+ number: Joi.string().allow(""),
505
+ });
506
+ }
507
+ static ModifiedByResponse() {
508
+ return Joi.object({
509
+ user_id: Joi.string().allow(""),
510
+ username: Joi.string().allow(""),
511
+ });
512
+ }
513
+ static OpeningClosing() {
514
+ return Joi.object({
515
+ hour: Joi.number(),
516
+ minute: Joi.number(),
517
+ });
518
+ }
519
+ static Page() {
520
+ return Joi.object({
521
+ current: Joi.number(),
522
+ has_next: Joi.boolean(),
523
+ has_previous: Joi.boolean(),
524
+ item_total: Joi.number(),
525
+ next_id: Joi.string().allow(""),
526
+ size: Joi.number(),
527
+ type: Joi.string().allow("").required(),
528
+ });
529
+ }
530
+ static PincodeBulkViewResponse() {
531
+ return Joi.object({
532
+ batch_id: Joi.string().allow("").required(),
533
+ s3_url: Joi.string().allow("").required(),
534
+ });
535
+ }
536
+ static PincodeCodStatusListingPage() {
537
+ return Joi.object({
538
+ current: Joi.number().required(),
539
+ has_next: Joi.boolean().required(),
540
+ item_total: Joi.number().required(),
541
+ size: Joi.number().required(),
542
+ type: Joi.string().allow("").required(),
543
+ });
544
+ }
545
+ static PincodeCodStatusListingRequest() {
546
+ return Joi.object({
547
+ country: Joi.string().allow(""),
548
+ current: Joi.number(),
549
+ is_active: Joi.boolean(),
550
+ page_size: Joi.number(),
551
+ pincode: Joi.number().allow(null),
552
+ });
553
+ }
554
+ static PincodeCodStatusListingResponse() {
555
+ return Joi.object({
556
+ country: Joi.string().allow("").required(),
557
+ data: Joi.array()
558
+ .items(Joi.link("#PincodeCodStatusListingResponse"))
559
+ .required(),
560
+ errors: Joi.array().items(ServiceabilityModel.Error()),
561
+ page: ServiceabilityModel.PincodeCodStatusListingPage().required(),
562
+ success: Joi.boolean().required(),
563
+ summary: ServiceabilityModel.PincodeCodStatusListingSummary().required(),
564
+ });
565
+ }
566
+ static PincodeCodStatusListingSummary() {
567
+ return Joi.object({
568
+ total_active_pincodes: Joi.number().required(),
569
+ total_inactive_pincodes: Joi.number().required(),
570
+ });
571
+ }
572
+ static PincodeMopBulkData() {
573
+ return Joi.object({
574
+ batch_id: Joi.string().allow("").required(),
575
+ s3_url: Joi.string().allow("").required(),
576
+ });
577
+ }
578
+ static PincodeMopData() {
579
+ return Joi.object({
580
+ action: Joi.string().allow("").required(),
581
+ country: Joi.string().allow("").required(),
582
+ pincodes: Joi.array().items(Joi.number()).required(),
583
+ });
584
+ }
585
+ static PincodeMOPresponse() {
586
+ return Joi.object({
587
+ action: Joi.string().allow("").required(),
588
+ batch_id: Joi.string().allow("").required(),
589
+ country: Joi.string().allow("").required(),
590
+ pincodes: Joi.array().items(Joi.number()),
591
+ status_code: Joi.number().required(),
592
+ success: Joi.boolean().required(),
593
+ updated_pincodes: Joi.array().items(
594
+ ServiceabilityModel.PincodeMopUpdateResponse()
595
+ ),
596
+ });
597
+ }
598
+ static PincodeMopUpdateAuditHistoryPaging() {
599
+ return Joi.object({
600
+ current: Joi.number(),
601
+ has_next: Joi.boolean(),
602
+ item_total: Joi.number(),
603
+ size: Joi.number(),
604
+ type: Joi.string().allow(""),
605
+ });
606
+ }
607
+ static PincodeMopUpdateAuditHistoryRequest() {
608
+ return Joi.object({
609
+ entity_type: Joi.string().allow("").required(),
610
+ file_name: Joi.string().allow(""),
611
+ });
612
+ }
613
+ static PincodeMopUpdateAuditHistoryResponse() {
614
+ return Joi.object({
615
+ batch_id: Joi.string().allow(""),
616
+ entity_type: Joi.string().allow(""),
617
+ error_file_s3_url: Joi.string().allow(""),
618
+ file_name: Joi.string().allow(""),
619
+ s3_url: Joi.string().allow(""),
620
+ success: Joi.boolean(),
621
+ updated_at: Joi.string().allow(""),
622
+ updated_by: Joi.string().allow(""),
623
+ });
624
+ }
625
+ static PincodeMopUpdateAuditHistoryResponseData() {
626
+ return Joi.object({
627
+ data: Joi.array()
628
+ .items(ServiceabilityModel.PincodeMopUpdateAuditHistoryResponse())
629
+ .required(),
630
+ entity_type: Joi.string().allow(""),
631
+ page: ServiceabilityModel.PincodeMopUpdateAuditHistoryPaging().required(),
632
+ });
633
+ }
634
+ static PincodeMopUpdateResponse() {
635
+ return Joi.object({
636
+ channel_id: Joi.string().allow("").required(),
637
+ country: Joi.string().allow("").required(),
638
+ is_active: Joi.boolean().required(),
639
+ pincode: Joi.number().required(),
640
+ });
641
+ }
642
+ static ProductReturnConfigResponse() {
643
+ return Joi.object({
644
+ on_same_store: Joi.boolean(),
645
+ });
646
+ }
647
+ static ReAssignStoreRequest() {
648
+ return Joi.object({
649
+ articles: Joi.array().items(Joi.any()).required(),
650
+ configuration: Joi.any().required(),
651
+ identifier: Joi.string().allow("").required(),
652
+ ignored_locations: Joi.array().items(Joi.string().allow("")).required(),
653
+ to_pincode: Joi.string().allow("").required(),
654
+ });
655
+ }
656
+ static ReAssignStoreResponse() {
657
+ return Joi.object({
658
+ articles: Joi.array().items(Joi.any()),
659
+ error: Joi.any().required(),
660
+ success: Joi.boolean().required(),
661
+ to_pincode: Joi.string().allow("").required(),
662
+ });
663
+ }
664
+ static SelfShipResponse() {
665
+ return Joi.object({
666
+ is_active: Joi.boolean().required(),
667
+ tat: Joi.number().required(),
668
+ });
669
+ }
670
+ static ServiceabilityErrorResponse() {
671
+ return Joi.object({
672
+ message: Joi.string().allow("").required(),
673
+ type: Joi.string().allow("").required(),
674
+ value: Joi.string().allow("").required(),
675
+ });
676
+ }
677
+ static ServiceabilityPageResponse() {
678
+ return Joi.object({
679
+ current: Joi.number(),
680
+ has_next: Joi.boolean(),
681
+ item_total: Joi.number(),
682
+ size: Joi.number(),
683
+ type: Joi.string().allow(""),
684
+ });
685
+ }
686
+ static TimmingResponse() {
687
+ return Joi.object({
688
+ closing: ServiceabilityModel.OpeningClosing(),
689
+ open: Joi.boolean(),
690
+ opening: ServiceabilityModel.OpeningClosing(),
691
+ weekday: Joi.string().allow(""),
692
+ });
693
+ }
694
+ static UpdateZoneData() {
695
+ return Joi.object({
696
+ assignment_preference: Joi.string().allow(""),
697
+ channels: Joi.array()
698
+ .items(ServiceabilityModel.GetZoneDataViewChannels())
699
+ .required(),
700
+ company_id: Joi.number().required(),
701
+ is_active: Joi.boolean().required(),
702
+ mapping: Joi.array()
703
+ .items(ServiceabilityModel.ZoneMappingType())
704
+ .required(),
705
+ name: Joi.string().allow("").required(),
706
+ product: ServiceabilityModel.ZoneProductTypes().required(),
707
+ region_type: Joi.string().allow("").required(),
708
+ slug: Joi.string().allow("").required(),
709
+ store_ids: Joi.array().items(Joi.number()).required(),
710
+ zone_id: Joi.string().allow("").required(),
711
+ });
712
+ }
713
+ static WarningsResponse() {
714
+ return Joi.object({
715
+ store_address: Joi.string().allow(""),
716
+ });
717
+ }
718
+ static Zone() {
719
+ return Joi.object({
720
+ assignment_preference: Joi.string().allow("").required(),
721
+ is_active: Joi.boolean().required(),
722
+ name: Joi.string().allow("").required(),
723
+ slug: Joi.string().allow("").required(),
724
+ store_ids: Joi.array().items(Joi.number()).required(),
725
+ tags: Joi.array().items(Joi.string().allow("")).required(),
726
+ type: Joi.string().allow("").required(),
727
+ zone_id: Joi.string().allow("").required(),
728
+ });
729
+ }
730
+ static ZoneDataItem() {
731
+ return Joi.object({
732
+ current: Joi.number().required(),
733
+ has_next: Joi.boolean().required(),
734
+ item_total: Joi.number().required(),
735
+ size: Joi.number().required(),
736
+ type: Joi.string().allow("").required(),
737
+ });
738
+ }
739
+ static ZoneMappingType() {
740
+ return Joi.object({
741
+ country: Joi.string().allow("").required(),
742
+ pincode: Joi.array().items(Joi.string().allow("")),
743
+ state: Joi.array().items(Joi.string().allow("")),
744
+ });
745
+ }
746
+ static ZoneProductTypes() {
747
+ return Joi.object({
748
+ tags: Joi.array().items(Joi.string().allow("")).required(),
749
+ type: Joi.string().allow("").required(),
750
+ });
751
+ }
752
+ static ZoneRequest() {
753
+ return Joi.object({
754
+ data: ServiceabilityModel.CreateZoneData().required(),
755
+ identifier: Joi.string().allow("").required(),
756
+ });
757
+ }
758
+ static ZoneResponse() {
759
+ return Joi.object({
760
+ status_code: Joi.number().required(),
761
+ success: Joi.boolean().required(),
762
+ zone_id: Joi.string().allow("").required(),
763
+ });
764
+ }
765
+ static ZoneSuccessResponse() {
766
+ return Joi.object({
767
+ status_code: Joi.number().required(),
768
+ success: Joi.boolean().required(),
769
+ });
770
+ }
771
+ static ZoneUpdateRequest() {
772
+ return Joi.object({
773
+ data: ServiceabilityModel.UpdateZoneData().required(),
774
+ identifier: Joi.string().allow("").required(),
775
+ });
776
+ }
777
+ }
778
+ module.exports = ServiceabilityModel;