@gofynd/fdk-client-javascript 3.22.0 → 3.23.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.
@@ -1,5 +1,28 @@
1
1
  const Joi = require("joi");
2
2
 
3
+ /**
4
+ * @typedef GenerateShipmentsAndCourierPartnerResult
5
+ * @property {string} [journey] - Describes the shipment's journey or route.
6
+ * @property {CourierPartnerToServiceability} [to_serviceability]
7
+ * @property {CourierPartnerShipments[]} [shipments] - List of shipments
8
+ * generated for the courier partner.
9
+ * @property {string} [payment_mode] - Specifies the mode of payment for the shipment.
10
+ * @property {string} [to_city] - The destination city for the shipment.
11
+ * @property {boolean} [is_cod_available] - Indicates if cash on delivery (COD)
12
+ * is available.
13
+ */
14
+
15
+ /**
16
+ * @typedef CourierPartnerDetails
17
+ * @property {LocationDetailsServiceability} to_serviceability
18
+ * @property {CourierPartnerShipments[]} shipments - A list of shipments for the
19
+ * courier partner request.
20
+ * @property {string} journey - The journey details for the courier partner request.
21
+ * @property {string} [payment_mode] - The payment mode for the courier partner request.
22
+ * @property {boolean} [skip_delivery_rules] - This flag decided whether to run
23
+ * delivery rules configuration for delivery rule fetch or not.
24
+ */
25
+
3
26
  /**
4
27
  * @typedef PlatformShipmentsRequestSchema
5
28
  * @property {string} journey - The journey or route for the shipment.
@@ -1303,6 +1326,306 @@ const Joi = require("joi");
1303
1326
  * @property {string[]} [sort] - An array of strings specifying sorting preferences.
1304
1327
  */
1305
1328
 
1329
+ /**
1330
+ * @typedef StorePolygonServiceabilityRequestBody
1331
+ * @property {StorePolygonServiceabilityRequestData} data
1332
+ */
1333
+
1334
+ /**
1335
+ * @typedef StorePolygonServiceabilityResult
1336
+ * @property {boolean} success - Indicates whether the polygon serviceability
1337
+ * operation was successful.
1338
+ * @property {StorePolygonServiceabilityStoreSummary[]} data - List of stores
1339
+ * for which polygon serviceability was successfully processed.
1340
+ * @property {StorePolygonServiceabilityError[]} errors - List of errors
1341
+ * encountered while processing individual entries, if any.
1342
+ * @property {string} identifier - Unique identifier for the polygon
1343
+ * serviceability request.
1344
+ * @property {StorePolygonServiceabilityError[]} failed_entries - List of
1345
+ * entries that failed during polygon serviceability processing.
1346
+ */
1347
+
1348
+ /**
1349
+ * @typedef StorePolygonServiceabilityGetResult
1350
+ * @property {boolean} success - Indicates whether the polygon serviceability
1351
+ * fetch operation was successful.
1352
+ * @property {StorePolygonServiceabilityStore[]} data - List of stores with
1353
+ * their polygon-based serviceability details.
1354
+ * @property {StorePolygonServiceabilityError[]} errors - List of errors
1355
+ * encountered while processing individual entries, if any.
1356
+ * @property {string} identifier - Unique identifier for the polygon
1357
+ * serviceability request.
1358
+ * @property {StorePolygonServiceabilityError[]} failed_entries - List of
1359
+ * entries that failed during polygon serviceability processing.
1360
+ * @property {StorePolygonServiceabilityPagination} pagination - Pagination
1361
+ * details for the polygon serviceability result set.
1362
+ */
1363
+
1364
+ /**
1365
+ * @typedef ZoneProductsBulkPatchDetails
1366
+ * @property {string} file_url - URL of the CSV file containing the zone
1367
+ * products bulk patch data.
1368
+ */
1369
+
1370
+ /**
1371
+ * @typedef GetZoneProductsBulkPatchResult
1372
+ * @property {string} batch_id - A unique identifier for the performed batch operation.
1373
+ * @property {string} [file_path] - CDN path of the uploaded file.
1374
+ * @property {number} total - Total number of records in the batch.
1375
+ * @property {number} failed - Number of failed records in the batch.
1376
+ * @property {string} [error_file_url] - URL to the error file containing
1377
+ * details of failed records.
1378
+ * @property {string} action - The action performed during the bulk operation.
1379
+ * @property {string} updated_at - Timestamp when the batch was last updated.
1380
+ * @property {string} updated_by - User who last updated the batch.
1381
+ * @property {string} type - Type of the bulk operation.
1382
+ * @property {number} company_id - The unique identifier for the company.
1383
+ * @property {string} application_id - A unique identifier for the sales channel.
1384
+ * @property {string} stage - Current stage of the bulk operation.
1385
+ * @property {number} [partial] - Number of partially processed records.
1386
+ * @property {string} [result_file_url] - URL to the result file after
1387
+ * processing is complete.
1388
+ */
1389
+
1390
+ /**
1391
+ * @typedef CourierPartnerToServiceability
1392
+ * @property {ServiceabilityLocation} [location]
1393
+ * @property {string} [pincode] - The pincode of the serviceability location.
1394
+ * @property {string} [sector] - The sector of the serviceability location.
1395
+ * @property {string} [country] - The country where the serviceability location
1396
+ * is situated.
1397
+ * @property {string} [country_iso_code] - The ISO code for the country.
1398
+ * @property {string} [state] - The state of the serviceability location.
1399
+ * @property {string} [city] - The city of the serviceability location.
1400
+ */
1401
+
1402
+ /**
1403
+ * @typedef ServiceabilityLocation
1404
+ * @property {string} longitude - The longitude of the serviceability location.
1405
+ * @property {string} latitude - The latitude of the serviceability location.
1406
+ */
1407
+
1408
+ /**
1409
+ * @typedef CourierPartnerShipments
1410
+ * @property {PromiseObject} [promise]
1411
+ * @property {boolean} [is_cod_available] - Indicates if cash on delivery (COD)
1412
+ * is available.
1413
+ * @property {boolean} [is_auto_assign] - Specifies if the shipment should be
1414
+ * automatically assigned.
1415
+ * @property {CourierPartnerShipmentsMeta} [meta]
1416
+ * @property {number} [volumetric_weight] - The volumetric weight of the shipment.
1417
+ * @property {number} [weight] - The actual weight of the shipment.
1418
+ * @property {ShipmentCourierPartnersResult[]} [courier_partners] - List of
1419
+ * courier partners associated with the shipment.
1420
+ * @property {number} fulfillment_id - The fulfillment Id.
1421
+ * @property {string} fulfillment_type - Fulfillment Type
1422
+ * @property {string[]} fulfillment_tags - Fulfillment level tags
1423
+ * @property {LocationDetailsServiceability} from_serviceability
1424
+ * @property {CourierPartnerShipmentsArticles[]} articles - A list of articles
1425
+ * in the courier partner shipment.
1426
+ * @property {boolean} is_mto - A boolean indicating if the courier partner
1427
+ * supports Made to Order service.
1428
+ * @property {string[]} ignore_scheme_ids - A list of scheme_id which we want to
1429
+ * ignore in courier_partner assignment.
1430
+ * @property {Object} [error] - Error Details
1431
+ */
1432
+
1433
+ /**
1434
+ * @typedef PromiseObject
1435
+ * @property {string} [min] - The minimum promised delivery time in ISO 8601 format.
1436
+ * @property {string} [max] - The maximum promised delivery time in ISO 8601 format.
1437
+ * @property {PromiseData} customer_promise
1438
+ * @property {PromiseMeta} meta
1439
+ */
1440
+
1441
+ /**
1442
+ * @typedef PromiseData
1443
+ * @property {string} [min] - The minimum promised delivery time in ISO 8601 format.
1444
+ * @property {string} [max] - The maximum promised delivery time in ISO 8601 format.
1445
+ */
1446
+
1447
+ /**
1448
+ * @typedef PromiseMeta
1449
+ * @property {PromiseData} [seller_promise]
1450
+ * @property {CourierPartnerPromiseData} [courier_partner_promise]
1451
+ * @property {PromiseData} [customer_initial_promise]
1452
+ */
1453
+
1454
+ /**
1455
+ * @typedef CourierPartnerPromiseData
1456
+ * @property {string} [min] - The minimum promised delivery time in ISO 8601 format.
1457
+ * @property {string} [max] - The maximum promised delivery time in ISO 8601 format.
1458
+ * @property {DeliveryTat} [attributes]
1459
+ */
1460
+
1461
+ /**
1462
+ * @typedef DeliveryTat
1463
+ * @property {DeliveryTatSchema} [tat]
1464
+ */
1465
+
1466
+ /**
1467
+ * @typedef DeliveryTatSchema
1468
+ * @property {number} [min] - The minimum tat in integer.
1469
+ * @property {number} [max] - The maximum tat in integer.
1470
+ */
1471
+
1472
+ /**
1473
+ * @typedef CourierPartnerShipmentsMeta
1474
+ * @property {number} [shipment_cost] - The total cost associated with the
1475
+ * shipment, expressed as a floating-point number. This value includes all
1476
+ * applicable charges, such as transportation, handling, and any additional fees.
1477
+ */
1478
+
1479
+ /**
1480
+ * @typedef ShipmentCourierPartnersResult
1481
+ * @property {string} extension_id - The Id of the courier partner.
1482
+ * @property {string} scheme_id - The scheme Id of the courier partner.
1483
+ * @property {AreaCode} area_code
1484
+ * @property {TAT} tat
1485
+ * @property {string} display_name - The display name of the courier partner.
1486
+ * @property {boolean} is_qc_enabled - A boolean indicating quality control by
1487
+ * the courier partner.
1488
+ * @property {boolean} is_self_ship - A boolean indicating it is self delivery DP support.
1489
+ * @property {boolean} [is_own_account] - Specifies if the courier partner
1490
+ * operates on its own account.
1491
+ * @property {number} [ndr_attempts] - The number of non-delivery report (NDR) attempts.
1492
+ * @property {string} [forward_pickup_cutoff] - Cutoff time for forward pickup (nullable).
1493
+ * @property {string} [reverse_pickup_cutoff] - Cutoff time for reverse pickup (nullable).
1494
+ * @property {number} [qc_shipment_item_quantity] - Quantity of items under
1495
+ * quality control (nullable).
1496
+ * @property {number} [non_qc_shipment_item_quantity] - Quantity of items not
1497
+ * under quality control (nullable).
1498
+ * @property {boolean} [dangerous_goods] - Specifies if the courier partner
1499
+ * operates on dangerous goods.
1500
+ * @property {boolean} [restricted_goods] - Specifies if the courier partner
1501
+ * operates on restricted goods.
1502
+ * @property {boolean} [fragile_goods] - Specifies if the courier partner
1503
+ * operates on fragile goods.
1504
+ * @property {boolean} [cold_storage_goods] - Specifies if the courier partner
1505
+ * operates on cold storage goods.
1506
+ * @property {string} [delivery_type] - Specifies type of courier partner.
1507
+ * @property {boolean} [is_cod] - Specifies if the courier partner operates on
1508
+ * cash on delivery orders.
1509
+ * @property {string} [transport_type] - Mode of transport associated with the
1510
+ * courier partner scheme.
1511
+ */
1512
+
1513
+ /**
1514
+ * @typedef AreaCode
1515
+ * @property {string} [source] - The starting area code.
1516
+ * @property {string} [destination] - The ending area code.
1517
+ */
1518
+
1519
+ /**
1520
+ * @typedef TAT
1521
+ * @property {number} [min] - The minimum tat in integer.
1522
+ * @property {number} [max] - The maximum tat in integer.
1523
+ */
1524
+
1525
+ /**
1526
+ * @typedef LocationDetailsServiceability
1527
+ * @property {string} [pincode] - The pincode of the serviceability location.
1528
+ * @property {string} [sector] - The sector of the serviceability location.
1529
+ * @property {string} [state] - The state of the serviceability location.
1530
+ * @property {string} country - The country of the serviceability location.
1531
+ * @property {string} [city] - The city of the serviceability location.
1532
+ * @property {string} country_iso_code - The ISO code of the country.
1533
+ * @property {ServiceabilityLocation} [location]
1534
+ */
1535
+
1536
+ /**
1537
+ * @typedef CourierPartnerShipmentsArticles
1538
+ * @property {string} [id] - A string serving as the unique identifier.
1539
+ * @property {Object} [delivery_slots] - Represents the delivery date and time
1540
+ * slots available for an article.
1541
+ * @property {Error} [error]
1542
+ * @property {number} [fulfillment_id] - The fulfillment Id.
1543
+ * @property {string[]} [fulfillment_tags] - Fulfillment level tags
1544
+ * @property {string} [fulfillment_type] - Fulfillment Type
1545
+ * @property {string} [group_id] - The group Id of the article.
1546
+ * @property {boolean} [is_gift] - A boolean indicating if the courier partner
1547
+ * supports gift shipments.
1548
+ * @property {boolean} [is_mto] - Flag indicating whether the shipment is MTO
1549
+ * (Make to Order).
1550
+ * @property {boolean} [is_set] - A boolean indicating whether the article is a set.
1551
+ * @property {number} [manufacturing_time] - The manufacturing time of the article.
1552
+ * @property {string} [manufacturing_time_unit] - The unit of measurement for
1553
+ * manufacturing time.
1554
+ * @property {number} [mto_quantity] - The Made to Order quantity of the article.
1555
+ * @property {string} [sla] - Service level agreement (SLA) for the article,
1556
+ * represented as a date-time
1557
+ * @property {number} [price_marked] - Marked price before discounts.
1558
+ * @property {CourierPartnerArticlesPromise} [promise]
1559
+ * @property {Object} [set] - Additional properties related to sets.
1560
+ * @property {CourierPartnerArticlesReturnReasons} [return_reason]
1561
+ * @property {number} [set_quantity] - It represents the number of set of this article
1562
+ * @property {number} quantity - The quantity of the shipment article.
1563
+ * @property {ArticleWeight} weight
1564
+ * @property {ArticleAttributes} [attributes]
1565
+ * @property {number} category_id - The category Id of the article.
1566
+ * @property {ArticleDimension} dimension
1567
+ * @property {number} brand_id - The brand Id of the article.
1568
+ * @property {number} item_id - The Item Id of the article.
1569
+ * @property {string} size - The size of the article.
1570
+ * @property {string[]} tags - Tags assigned to Item
1571
+ * @property {number} department_id - Department of the item
1572
+ * @property {number} price - Final Price of the article after discounts
1573
+ */
1574
+
1575
+ /**
1576
+ * @typedef CourierPartnerArticlesPromise
1577
+ * @property {string} [min] - The minimum delivery promise date.
1578
+ * @property {string} [max] - The maximum delivery promise date.
1579
+ */
1580
+
1581
+ /**
1582
+ * @typedef CourierPartnerArticlesReturnReasons
1583
+ * @property {number} [id] - The unique identifier for the return reason entry.
1584
+ * @property {CourierPartnerArticlesReturnReasonsMeta} [meta]
1585
+ * @property {string[]} [qc_type] - A list of quality check types that apply to
1586
+ * the return reasons.
1587
+ * @property {string[]} [reasons] - A list of return reasons for the article.
1588
+ * @property {boolean} [is_active] - A boolean indicating whether the return
1589
+ * reason is currently active.
1590
+ * @property {string} [display_name] - The display name for the return reason.
1591
+ * @property {string[]} [question_set] - A list of questions associated with the
1592
+ * return reason.
1593
+ * @property {string} [reason_other_text] - Any additional text for other return reasons.
1594
+ */
1595
+
1596
+ /**
1597
+ * @typedef CourierPartnerArticlesReturnReasonsMeta
1598
+ * @property {boolean} [show_text_area] - A boolean indicating whether a text
1599
+ * area should be displayed for additional input regarding the return reason.
1600
+ */
1601
+
1602
+ /**
1603
+ * @typedef ArticleWeight
1604
+ * @property {number} shipping - The weight(grams) of the article for shipping
1605
+ * purposes, typically measured in a specified unit.
1606
+ * @property {string} unit - The unit of measurement used for the weight value.
1607
+ * @property {boolean} is_default - A boolean indicating whether this weight is
1608
+ * the default weight for the article.
1609
+ */
1610
+
1611
+ /**
1612
+ * @typedef ArticleAttributes
1613
+ * @property {string} battery_operated - Yes/no indicating whether the article
1614
+ * is powered by batteries.
1615
+ * @property {string} is_flammable - Yes/no indicating whether the article is
1616
+ * considered flammable or poses a fire hazard.
1617
+ */
1618
+
1619
+ /**
1620
+ * @typedef ArticleDimension
1621
+ * @property {number} height - The height of the article.
1622
+ * @property {boolean} is_default - A boolean indicating whether this dimension
1623
+ * is the default dimension.
1624
+ * @property {number} length - The length of the article.
1625
+ * @property {string} unit - The unit of measurement used for the dimensions.
1626
+ * @property {number} width - The width of the article.
1627
+ */
1628
+
1306
1629
  /**
1307
1630
  * @typedef PlatformLocationArticles
1308
1631
  * @property {PlatformLocationArticle[]} articles - List of articles for this
@@ -1518,18 +1841,6 @@ const Joi = require("joi");
1518
1841
  * under quality control (nullable).
1519
1842
  */
1520
1843
 
1521
- /**
1522
- * @typedef AreaCode
1523
- * @property {string} [source] - The starting area code.
1524
- * @property {string} [destination] - The ending area code.
1525
- */
1526
-
1527
- /**
1528
- * @typedef TAT
1529
- * @property {number} [min] - The minimum tat in integer.
1530
- * @property {number} [max] - The maximum tat in integer.
1531
- */
1532
-
1533
1844
  /**
1534
1845
  * @typedef BusinessUnit
1535
1846
  * @property {string} [name] - Name of the business unit.
@@ -1780,6 +2091,9 @@ const Joi = require("joi");
1780
2091
  * zone, whether it's a list of categories, departments, tags, or item_ids.
1781
2092
  * @property {Object[]} values - List of values representing the products or the
1782
2093
  * type of products selected for the delivery zone.
2094
+ * @property {string} [action] - The action to perform on the product values -
2095
+ * 'add' to add values to the existing list, 'remove' to remove values from
2096
+ * the existing list.
1783
2097
  */
1784
2098
 
1785
2099
  /**
@@ -2182,33 +2496,6 @@ const Joi = require("joi");
2182
2496
  * @property {ArticleReturnReason} [return_reason]
2183
2497
  */
2184
2498
 
2185
- /**
2186
- * @typedef ArticleWeight
2187
- * @property {number} shipping - The weight(grams) of the article for shipping
2188
- * purposes, typically measured in a specified unit.
2189
- * @property {string} unit - The unit of measurement used for the weight value.
2190
- * @property {boolean} is_default - A boolean indicating whether this weight is
2191
- * the default weight for the article.
2192
- */
2193
-
2194
- /**
2195
- * @typedef ArticleAttributes
2196
- * @property {string} battery_operated - Yes/no indicating whether the article
2197
- * is powered by batteries.
2198
- * @property {string} is_flammable - Yes/no indicating whether the article is
2199
- * considered flammable or poses a fire hazard.
2200
- */
2201
-
2202
- /**
2203
- * @typedef ArticleDimension
2204
- * @property {number} height - The height of the article.
2205
- * @property {boolean} is_default - A boolean indicating whether this dimension
2206
- * is the default dimension.
2207
- * @property {number} length - The length of the article.
2208
- * @property {string} unit - The unit of measurement used for the dimensions.
2209
- * @property {number} width - The width of the article.
2210
- */
2211
-
2212
2499
  /**
2213
2500
  * @typedef ArticleSet
2214
2501
  * @property {string} [name] - The name of the article set.
@@ -2481,23 +2768,6 @@ const Joi = require("joi");
2481
2768
  * specify the desired approach or criteria for selecting optimal locations.
2482
2769
  */
2483
2770
 
2484
- /**
2485
- * @typedef LocationDetailsServiceability
2486
- * @property {string} [pincode] - The pincode of the serviceability location.
2487
- * @property {string} [sector] - The sector of the serviceability location.
2488
- * @property {string} [state] - The state of the serviceability location.
2489
- * @property {string} country - The country of the serviceability location.
2490
- * @property {string} [city] - The city of the serviceability location.
2491
- * @property {string} country_iso_code - The ISO code of the country.
2492
- * @property {ServiceabilityLocation} [location]
2493
- */
2494
-
2495
- /**
2496
- * @typedef ServiceabilityLocation
2497
- * @property {string} longitude - The longitude of the serviceability location.
2498
- * @property {string} latitude - The latitude of the serviceability location.
2499
- */
2500
-
2501
2771
  /**
2502
2772
  * @typedef OptimalLocationsArticles
2503
2773
  * @property {number} item_id - Unique identifier for the item.
@@ -2798,47 +3068,177 @@ const Joi = require("joi");
2798
3068
  * encountered errors during the batch processing.
2799
3069
  */
2800
3070
 
2801
- class ServiceabilityPlatformModel {
2802
- /** @returns {PlatformShipmentsRequestSchema} */
2803
- static PlatformShipmentsRequestSchema() {
2804
- return Joi.object({
2805
- journey: Joi.string().allow("").required(),
2806
- location_articles: Joi.array()
2807
- .items(ServiceabilityPlatformModel.PlatformLocationArticles())
2808
- .required(),
2809
- to_serviceability: ServiceabilityPlatformModel.PlatformShipmentsToServiceability().required(),
2810
- payment_mode: Joi.string().allow("").allow(null),
2811
- });
2812
- }
3071
+ /**
3072
+ * @typedef StorePolygonServiceabilityRequestData
3073
+ * @property {StorePolygonServiceabilityStore[]} stores - List of stores for
3074
+ * which polygon-based serviceability is being configured.
3075
+ */
2813
3076
 
2814
- /** @returns {PlatformShipmentsResponseSchema} */
2815
- static PlatformShipmentsResponseSchema() {
2816
- return Joi.object({
2817
- is_cod_available: Joi.boolean().required(),
2818
- shipments: Joi.array()
2819
- .items(ServiceabilityPlatformModel.PlatformShipmentsSchema())
2820
- .required(),
2821
- });
2822
- }
3077
+ /**
3078
+ * @typedef StorePolygonServiceabilityStore
3079
+ * @property {string} store_code - Unique identifier of the store.
3080
+ * @property {string} name - Name of the store.
3081
+ * @property {string} address - Address of the store.
3082
+ * @property {string} area_code - Area code associated with the store.
3083
+ * @property {boolean} is_active - Indicates whether the store is active.
3084
+ * @property {Object} [meta] - Additional metadata associated with the store.
3085
+ * @property {StorePolygonServiceabilityStoreCoordinates} coordinates
3086
+ * @property {StorePolygonServiceabilityConfig[]} serviceabilities - List of
3087
+ * polygon-based serviceability configurations for the store.
3088
+ * @property {string} [created_at] - Timestamp when the store entry was created.
3089
+ * @property {string} [updated_at] - Timestamp when the store entry was last updated.
3090
+ */
2823
3091
 
2824
- /** @returns {ShipmentsErrorResult} */
2825
- static ShipmentsErrorResult() {
2826
- return Joi.object({
2827
- message: Joi.string().allow("").allow(null),
2828
- type: Joi.string().allow("").required(),
2829
- value: Joi.string().allow("").required(),
2830
- });
2831
- }
3092
+ /**
3093
+ * @typedef StorePolygonServiceabilityStoreCoordinates
3094
+ * @property {number} lng - Longitude of the store.
3095
+ * @property {number} lat - Latitude of the store.
3096
+ */
2832
3097
 
2833
- /** @returns {FulfillmentOption} */
2834
- static FulfillmentOption() {
2835
- return Joi.object({
2836
- name: Joi.string().allow(""),
2837
- slug: Joi.string().allow(""),
2838
- company_id: Joi.number(),
2839
- application_id: Joi.string().allow(""),
2840
- description: Joi.string().allow(""),
2841
- is_default: Joi.boolean(),
3098
+ /**
3099
+ * @typedef StorePolygonServiceabilityConfig
3100
+ * @property {string} name - Name of the polygon-based serviceability configuration.
3101
+ * @property {string} serviceability_type - Type of serviceability
3102
+ * configuration. Currently supports quick_commerce.
3103
+ * @property {StorePolygonServiceabilityPolygon} polygon
3104
+ * @property {Object} [meta] - Additional metadata associated with the
3105
+ * serviceability configuration.
3106
+ * @property {boolean} is_active - Indicates whether the serviceability
3107
+ * configuration is active.
3108
+ * @property {string} [uid] - Unique identifier of the serviceability configuration.
3109
+ * @property {string} [created_at] - Timestamp when the serviceability
3110
+ * configuration was created.
3111
+ * @property {string} [updated_at] - Timestamp when the serviceability
3112
+ * configuration was last updated.
3113
+ */
3114
+
3115
+ /**
3116
+ * @typedef StorePolygonServiceabilityPolygon
3117
+ * @property {string} type - Type of the GeoJSON collection, typically FeatureCollection.
3118
+ * @property {StorePolygonServiceabilityFeature[]} features - List of GeoJSON
3119
+ * features defining the polygon.
3120
+ * @property {StorePolygonServiceabilityAttributes} [attributes]
3121
+ */
3122
+
3123
+ /**
3124
+ * @typedef StorePolygonServiceabilityFeature
3125
+ * @property {string} type - Type of the feature, typically Feature.
3126
+ * @property {Object} [properties] - Additional properties for the feature.
3127
+ * @property {StorePolygonServiceabilityGeometry} geometry
3128
+ */
3129
+
3130
+ /**
3131
+ * @typedef StorePolygonServiceabilityGeometry
3132
+ * @property {string} [type] - Type of geometry, typically Polygon.
3133
+ * @property {number[][][]} [coordinates] - List of polygon coordinates as
3134
+ * longitude and latitude pairs.
3135
+ */
3136
+
3137
+ /**
3138
+ * @typedef StorePolygonServiceabilityAttributes
3139
+ * @property {string} [contour_type] - Type of contour used for the polygon,
3140
+ * either distance-based or manually defined.
3141
+ * @property {number} [travel_distance] - Travel distance used to derive the
3142
+ * polygon contour, typically in meters.
3143
+ * @property {StorePolygonServiceabilityReferenceCoordinates} [reference_coordinates]
3144
+ */
3145
+
3146
+ /**
3147
+ * @typedef StorePolygonServiceabilityReferenceCoordinates
3148
+ * @property {number} lng - Longitude of the reference point.
3149
+ * @property {number} lat - Latitude of the reference point.
3150
+ */
3151
+
3152
+ /**
3153
+ * @typedef StorePolygonServiceabilityStoreSummary
3154
+ * @property {string} store_code - Unique identifier of the store.
3155
+ * @property {string} [name] - Name of the store.
3156
+ */
3157
+
3158
+ /**
3159
+ * @typedef StorePolygonServiceabilityError
3160
+ * @property {string} store_code - Store code identifier.
3161
+ * @property {string} message - Detailed error message describing the validation
3162
+ * failure for a specific record.
3163
+ * @property {string} [error_code] - Error code for the failure.
3164
+ */
3165
+
3166
+ /**
3167
+ * @typedef StorePolygonServiceabilityPagination
3168
+ * @property {number} page_size - Number of records per page.
3169
+ * @property {number} page_number - The current page number.
3170
+ * @property {boolean} has_next - Indicates whether more pages are available.
3171
+ * @property {number} total_records - Total number of records matching the criteria.
3172
+ */
3173
+
3174
+ class ServiceabilityPlatformModel {
3175
+ /** @returns {GenerateShipmentsAndCourierPartnerResult} */
3176
+ static GenerateShipmentsAndCourierPartnerResult() {
3177
+ return Joi.object({
3178
+ journey: Joi.string().allow(""),
3179
+ to_serviceability: ServiceabilityPlatformModel.CourierPartnerToServiceability(),
3180
+ shipments: Joi.array().items(
3181
+ ServiceabilityPlatformModel.CourierPartnerShipments()
3182
+ ),
3183
+ payment_mode: Joi.string().allow(""),
3184
+ to_city: Joi.string().allow(""),
3185
+ is_cod_available: Joi.boolean(),
3186
+ });
3187
+ }
3188
+
3189
+ /** @returns {CourierPartnerDetails} */
3190
+ static CourierPartnerDetails() {
3191
+ return Joi.object({
3192
+ to_serviceability: ServiceabilityPlatformModel.LocationDetailsServiceability().required(),
3193
+ shipments: Joi.array()
3194
+ .items(ServiceabilityPlatformModel.CourierPartnerShipments())
3195
+ .required(),
3196
+ journey: Joi.string().allow("").required(),
3197
+ payment_mode: Joi.string().allow(""),
3198
+ skip_delivery_rules: Joi.boolean(),
3199
+ });
3200
+ }
3201
+
3202
+ /** @returns {PlatformShipmentsRequestSchema} */
3203
+ static PlatformShipmentsRequestSchema() {
3204
+ return Joi.object({
3205
+ journey: Joi.string().allow("").required(),
3206
+ location_articles: Joi.array()
3207
+ .items(ServiceabilityPlatformModel.PlatformLocationArticles())
3208
+ .required(),
3209
+ to_serviceability: ServiceabilityPlatformModel.PlatformShipmentsToServiceability().required(),
3210
+ payment_mode: Joi.string().allow("").allow(null),
3211
+ });
3212
+ }
3213
+
3214
+ /** @returns {PlatformShipmentsResponseSchema} */
3215
+ static PlatformShipmentsResponseSchema() {
3216
+ return Joi.object({
3217
+ is_cod_available: Joi.boolean().required(),
3218
+ shipments: Joi.array()
3219
+ .items(ServiceabilityPlatformModel.PlatformShipmentsSchema())
3220
+ .required(),
3221
+ });
3222
+ }
3223
+
3224
+ /** @returns {ShipmentsErrorResult} */
3225
+ static ShipmentsErrorResult() {
3226
+ return Joi.object({
3227
+ message: Joi.string().allow("").allow(null),
3228
+ type: Joi.string().allow("").required(),
3229
+ value: Joi.string().allow("").required(),
3230
+ });
3231
+ }
3232
+
3233
+ /** @returns {FulfillmentOption} */
3234
+ static FulfillmentOption() {
3235
+ return Joi.object({
3236
+ name: Joi.string().allow(""),
3237
+ slug: Joi.string().allow(""),
3238
+ company_id: Joi.number(),
3239
+ application_id: Joi.string().allow(""),
3240
+ description: Joi.string().allow(""),
3241
+ is_default: Joi.boolean(),
2842
3242
  type: Joi.string().allow(""),
2843
3243
  status: Joi.string().allow(""),
2844
3244
  business_unit: Joi.array().items(
@@ -4193,6 +4593,329 @@ class ServiceabilityPlatformModel {
4193
4593
  });
4194
4594
  }
4195
4595
 
4596
+ /** @returns {StorePolygonServiceabilityRequestBody} */
4597
+ static StorePolygonServiceabilityRequestBody() {
4598
+ return Joi.object({
4599
+ data: ServiceabilityPlatformModel.StorePolygonServiceabilityRequestData().required(),
4600
+ });
4601
+ }
4602
+
4603
+ /** @returns {StorePolygonServiceabilityResult} */
4604
+ static StorePolygonServiceabilityResult() {
4605
+ return Joi.object({
4606
+ success: Joi.boolean().required(),
4607
+ data: Joi.array()
4608
+ .items(
4609
+ ServiceabilityPlatformModel.StorePolygonServiceabilityStoreSummary()
4610
+ )
4611
+ .required(),
4612
+ errors: Joi.array()
4613
+ .items(ServiceabilityPlatformModel.StorePolygonServiceabilityError())
4614
+ .required(),
4615
+ identifier: Joi.string().allow("").required(),
4616
+ failed_entries: Joi.array()
4617
+ .items(ServiceabilityPlatformModel.StorePolygonServiceabilityError())
4618
+ .required(),
4619
+ });
4620
+ }
4621
+
4622
+ /** @returns {StorePolygonServiceabilityGetResult} */
4623
+ static StorePolygonServiceabilityGetResult() {
4624
+ return Joi.object({
4625
+ success: Joi.boolean().required(),
4626
+ data: Joi.array()
4627
+ .items(ServiceabilityPlatformModel.StorePolygonServiceabilityStore())
4628
+ .required(),
4629
+ errors: Joi.array()
4630
+ .items(ServiceabilityPlatformModel.StorePolygonServiceabilityError())
4631
+ .required(),
4632
+ identifier: Joi.string().allow("").required(),
4633
+ failed_entries: Joi.array()
4634
+ .items(ServiceabilityPlatformModel.StorePolygonServiceabilityError())
4635
+ .required(),
4636
+ pagination: ServiceabilityPlatformModel.StorePolygonServiceabilityPagination().required(),
4637
+ });
4638
+ }
4639
+
4640
+ /** @returns {ZoneProductsBulkPatchDetails} */
4641
+ static ZoneProductsBulkPatchDetails() {
4642
+ return Joi.object({
4643
+ file_url: Joi.string().allow("").required(),
4644
+ });
4645
+ }
4646
+
4647
+ /** @returns {GetZoneProductsBulkPatchResult} */
4648
+ static GetZoneProductsBulkPatchResult() {
4649
+ return Joi.object({
4650
+ batch_id: Joi.string().allow("").required(),
4651
+ file_path: Joi.string().allow("").allow(null),
4652
+ total: Joi.number().required(),
4653
+ failed: Joi.number().required(),
4654
+ error_file_url: Joi.string().allow("").allow(null),
4655
+ action: Joi.string().allow("").required(),
4656
+ updated_at: Joi.string().allow("").required(),
4657
+ updated_by: Joi.string().allow("").required(),
4658
+ type: Joi.string().allow("").required(),
4659
+ company_id: Joi.number().required(),
4660
+ application_id: Joi.string().allow("").required(),
4661
+ stage: Joi.string().allow("").required(),
4662
+ partial: Joi.number(),
4663
+ result_file_url: Joi.string().allow("").allow(null),
4664
+ });
4665
+ }
4666
+
4667
+ /** @returns {CourierPartnerToServiceability} */
4668
+ static CourierPartnerToServiceability() {
4669
+ return Joi.object({
4670
+ location: ServiceabilityPlatformModel.ServiceabilityLocation(),
4671
+ pincode: Joi.string().allow(""),
4672
+ sector: Joi.string().allow(""),
4673
+ country: Joi.string().allow(""),
4674
+ country_iso_code: Joi.string().allow(""),
4675
+ state: Joi.string().allow(""),
4676
+ city: Joi.string().allow(""),
4677
+ });
4678
+ }
4679
+
4680
+ /** @returns {ServiceabilityLocation} */
4681
+ static ServiceabilityLocation() {
4682
+ return Joi.object({
4683
+ longitude: Joi.string().allow("").required(),
4684
+ latitude: Joi.string().allow("").required(),
4685
+ });
4686
+ }
4687
+
4688
+ /** @returns {CourierPartnerShipments} */
4689
+ static CourierPartnerShipments() {
4690
+ return Joi.object({
4691
+ promise: ServiceabilityPlatformModel.PromiseObject(),
4692
+ is_cod_available: Joi.boolean(),
4693
+ is_auto_assign: Joi.boolean(),
4694
+ meta: ServiceabilityPlatformModel.CourierPartnerShipmentsMeta(),
4695
+ volumetric_weight: Joi.number(),
4696
+ weight: Joi.number(),
4697
+ courier_partners: Joi.array().items(
4698
+ ServiceabilityPlatformModel.ShipmentCourierPartnersResult()
4699
+ ),
4700
+ fulfillment_id: Joi.number().required(),
4701
+ fulfillment_type: Joi.string().allow("").required(),
4702
+ fulfillment_tags: Joi.array().items(Joi.string().allow("")).required(),
4703
+ from_serviceability: ServiceabilityPlatformModel.LocationDetailsServiceability().required(),
4704
+ articles: Joi.array()
4705
+ .items(ServiceabilityPlatformModel.CourierPartnerShipmentsArticles())
4706
+ .required(),
4707
+ is_mto: Joi.boolean().required(),
4708
+ ignore_scheme_ids: Joi.array().items(Joi.string().allow("")).required(),
4709
+ error: Joi.object().pattern(/\S/, Joi.any()),
4710
+ });
4711
+ }
4712
+
4713
+ /** @returns {PromiseObject} */
4714
+ static PromiseObject() {
4715
+ return Joi.object({
4716
+ min: Joi.string().allow(""),
4717
+ max: Joi.string().allow(""),
4718
+ customer_promise: ServiceabilityPlatformModel.PromiseData().required(),
4719
+ meta: ServiceabilityPlatformModel.PromiseMeta().required(),
4720
+ });
4721
+ }
4722
+
4723
+ /** @returns {PromiseData} */
4724
+ static PromiseData() {
4725
+ return Joi.object({
4726
+ min: Joi.string().allow(""),
4727
+ max: Joi.string().allow(""),
4728
+ });
4729
+ }
4730
+
4731
+ /** @returns {PromiseMeta} */
4732
+ static PromiseMeta() {
4733
+ return Joi.object({
4734
+ seller_promise: ServiceabilityPlatformModel.PromiseData(),
4735
+ courier_partner_promise: ServiceabilityPlatformModel.CourierPartnerPromiseData(),
4736
+ customer_initial_promise: ServiceabilityPlatformModel.PromiseData(),
4737
+ });
4738
+ }
4739
+
4740
+ /** @returns {CourierPartnerPromiseData} */
4741
+ static CourierPartnerPromiseData() {
4742
+ return Joi.object({
4743
+ min: Joi.string().allow("").allow(null),
4744
+ max: Joi.string().allow("").allow(null),
4745
+ attributes: ServiceabilityPlatformModel.DeliveryTat(),
4746
+ });
4747
+ }
4748
+
4749
+ /** @returns {DeliveryTat} */
4750
+ static DeliveryTat() {
4751
+ return Joi.object({
4752
+ tat: ServiceabilityPlatformModel.DeliveryTatSchema(),
4753
+ });
4754
+ }
4755
+
4756
+ /** @returns {DeliveryTatSchema} */
4757
+ static DeliveryTatSchema() {
4758
+ return Joi.object({
4759
+ min: Joi.number(),
4760
+ max: Joi.number(),
4761
+ });
4762
+ }
4763
+
4764
+ /** @returns {CourierPartnerShipmentsMeta} */
4765
+ static CourierPartnerShipmentsMeta() {
4766
+ return Joi.object({
4767
+ shipment_cost: Joi.number(),
4768
+ });
4769
+ }
4770
+
4771
+ /** @returns {ShipmentCourierPartnersResult} */
4772
+ static ShipmentCourierPartnersResult() {
4773
+ return Joi.object({
4774
+ extension_id: Joi.string().allow("").required(),
4775
+ scheme_id: Joi.string().allow("").required(),
4776
+ area_code: ServiceabilityPlatformModel.AreaCode().required(),
4777
+ tat: ServiceabilityPlatformModel.TAT().required(),
4778
+ display_name: Joi.string().allow("").required(),
4779
+ is_qc_enabled: Joi.boolean().required(),
4780
+ is_self_ship: Joi.boolean().required(),
4781
+ is_own_account: Joi.boolean(),
4782
+ ndr_attempts: Joi.number(),
4783
+ forward_pickup_cutoff: Joi.string().allow("").allow(null),
4784
+ reverse_pickup_cutoff: Joi.string().allow("").allow(null),
4785
+ qc_shipment_item_quantity: Joi.number().allow(null),
4786
+ non_qc_shipment_item_quantity: Joi.number().allow(null),
4787
+ dangerous_goods: Joi.boolean(),
4788
+ restricted_goods: Joi.boolean(),
4789
+ fragile_goods: Joi.boolean(),
4790
+ cold_storage_goods: Joi.boolean(),
4791
+ delivery_type: Joi.string().allow(""),
4792
+ is_cod: Joi.boolean(),
4793
+ transport_type: Joi.string().allow(""),
4794
+ });
4795
+ }
4796
+
4797
+ /** @returns {AreaCode} */
4798
+ static AreaCode() {
4799
+ return Joi.object({
4800
+ source: Joi.string().allow(""),
4801
+ destination: Joi.string().allow(""),
4802
+ });
4803
+ }
4804
+
4805
+ /** @returns {TAT} */
4806
+ static TAT() {
4807
+ return Joi.object({
4808
+ min: Joi.number(),
4809
+ max: Joi.number(),
4810
+ });
4811
+ }
4812
+
4813
+ /** @returns {LocationDetailsServiceability} */
4814
+ static LocationDetailsServiceability() {
4815
+ return Joi.object({
4816
+ pincode: Joi.string().allow(""),
4817
+ sector: Joi.string().allow(""),
4818
+ state: Joi.string().allow(""),
4819
+ country: Joi.string().allow("").required(),
4820
+ city: Joi.string().allow(""),
4821
+ country_iso_code: Joi.string().allow("").required(),
4822
+ location: ServiceabilityPlatformModel.ServiceabilityLocation(),
4823
+ });
4824
+ }
4825
+
4826
+ /** @returns {CourierPartnerShipmentsArticles} */
4827
+ static CourierPartnerShipmentsArticles() {
4828
+ return Joi.object({
4829
+ id: Joi.string().allow(""),
4830
+ delivery_slots: Joi.object().pattern(/\S/, Joi.any()),
4831
+ error: ServiceabilityPlatformModel.Error(),
4832
+ fulfillment_id: Joi.number(),
4833
+ fulfillment_tags: Joi.array().items(Joi.string().allow("")),
4834
+ fulfillment_type: Joi.string().allow(""),
4835
+ group_id: Joi.string().allow(""),
4836
+ is_gift: Joi.boolean(),
4837
+ is_mto: Joi.boolean(),
4838
+ is_set: Joi.boolean(),
4839
+ manufacturing_time: Joi.number(),
4840
+ manufacturing_time_unit: Joi.string().allow(""),
4841
+ mto_quantity: Joi.number(),
4842
+ sla: Joi.string().allow(""),
4843
+ price_marked: Joi.number(),
4844
+ promise: ServiceabilityPlatformModel.CourierPartnerArticlesPromise(),
4845
+ set: Joi.object().pattern(/\S/, Joi.any()),
4846
+ return_reason: ServiceabilityPlatformModel.CourierPartnerArticlesReturnReasons(),
4847
+ set_quantity: Joi.number(),
4848
+ quantity: Joi.number().required(),
4849
+ weight: ServiceabilityPlatformModel.ArticleWeight().required(),
4850
+ attributes: ServiceabilityPlatformModel.ArticleAttributes(),
4851
+ category_id: Joi.number().required(),
4852
+ dimension: ServiceabilityPlatformModel.ArticleDimension().required(),
4853
+ brand_id: Joi.number().required(),
4854
+ item_id: Joi.number().required(),
4855
+ size: Joi.string().allow("").required(),
4856
+ tags: Joi.array().items(Joi.string().allow("")).required(),
4857
+ department_id: Joi.number().required(),
4858
+ price: Joi.number().required(),
4859
+ });
4860
+ }
4861
+
4862
+ /** @returns {CourierPartnerArticlesPromise} */
4863
+ static CourierPartnerArticlesPromise() {
4864
+ return Joi.object({
4865
+ min: Joi.string().allow(""),
4866
+ max: Joi.string().allow(""),
4867
+ });
4868
+ }
4869
+
4870
+ /** @returns {CourierPartnerArticlesReturnReasons} */
4871
+ static CourierPartnerArticlesReturnReasons() {
4872
+ return Joi.object({
4873
+ id: Joi.number(),
4874
+ meta: ServiceabilityPlatformModel.CourierPartnerArticlesReturnReasonsMeta(),
4875
+ qc_type: Joi.array().items(Joi.string().allow("")),
4876
+ reasons: Joi.array().items(Joi.string().allow("")),
4877
+ is_active: Joi.boolean(),
4878
+ display_name: Joi.string().allow(""),
4879
+ question_set: Joi.array().items(Joi.string().allow("")),
4880
+ reason_other_text: Joi.string().allow(""),
4881
+ });
4882
+ }
4883
+
4884
+ /** @returns {CourierPartnerArticlesReturnReasonsMeta} */
4885
+ static CourierPartnerArticlesReturnReasonsMeta() {
4886
+ return Joi.object({
4887
+ show_text_area: Joi.boolean(),
4888
+ });
4889
+ }
4890
+
4891
+ /** @returns {ArticleWeight} */
4892
+ static ArticleWeight() {
4893
+ return Joi.object({
4894
+ shipping: Joi.number().required(),
4895
+ unit: Joi.string().allow("").required(),
4896
+ is_default: Joi.boolean().required(),
4897
+ });
4898
+ }
4899
+
4900
+ /** @returns {ArticleAttributes} */
4901
+ static ArticleAttributes() {
4902
+ return Joi.object({
4903
+ battery_operated: Joi.string().allow("").required(),
4904
+ is_flammable: Joi.string().allow("").required(),
4905
+ });
4906
+ }
4907
+
4908
+ /** @returns {ArticleDimension} */
4909
+ static ArticleDimension() {
4910
+ return Joi.object({
4911
+ height: Joi.number().required(),
4912
+ is_default: Joi.boolean().required(),
4913
+ length: Joi.number().required(),
4914
+ unit: Joi.string().allow("").required(),
4915
+ width: Joi.number().required(),
4916
+ });
4917
+ }
4918
+
4196
4919
  /** @returns {PlatformLocationArticles} */
4197
4920
  static PlatformLocationArticles() {
4198
4921
  return Joi.object({
@@ -4433,22 +5156,6 @@ class ServiceabilityPlatformModel {
4433
5156
  });
4434
5157
  }
4435
5158
 
4436
- /** @returns {AreaCode} */
4437
- static AreaCode() {
4438
- return Joi.object({
4439
- source: Joi.string().allow(""),
4440
- destination: Joi.string().allow(""),
4441
- });
4442
- }
4443
-
4444
- /** @returns {TAT} */
4445
- static TAT() {
4446
- return Joi.object({
4447
- min: Joi.number(),
4448
- max: Joi.number(),
4449
- });
4450
- }
4451
-
4452
5159
  /** @returns {BusinessUnit} */
4453
5160
  static BusinessUnit() {
4454
5161
  return Joi.object({
@@ -4731,6 +5438,7 @@ class ServiceabilityPlatformModel {
4731
5438
  return Joi.object({
4732
5439
  type: Joi.string().allow("").required(),
4733
5440
  values: Joi.array().items(Joi.any()).required(),
5441
+ action: Joi.string().allow(""),
4734
5442
  });
4735
5443
  }
4736
5444
 
@@ -5170,34 +5878,6 @@ class ServiceabilityPlatformModel {
5170
5878
  });
5171
5879
  }
5172
5880
 
5173
- /** @returns {ArticleWeight} */
5174
- static ArticleWeight() {
5175
- return Joi.object({
5176
- shipping: Joi.number().required(),
5177
- unit: Joi.string().allow("").required(),
5178
- is_default: Joi.boolean().required(),
5179
- });
5180
- }
5181
-
5182
- /** @returns {ArticleAttributes} */
5183
- static ArticleAttributes() {
5184
- return Joi.object({
5185
- battery_operated: Joi.string().allow("").required(),
5186
- is_flammable: Joi.string().allow("").required(),
5187
- });
5188
- }
5189
-
5190
- /** @returns {ArticleDimension} */
5191
- static ArticleDimension() {
5192
- return Joi.object({
5193
- height: Joi.number().required(),
5194
- is_default: Joi.boolean().required(),
5195
- length: Joi.number().required(),
5196
- unit: Joi.string().allow("").required(),
5197
- width: Joi.number().required(),
5198
- });
5199
- }
5200
-
5201
5881
  /** @returns {ArticleSet} */
5202
5882
  static ArticleSet() {
5203
5883
  return Joi.object({
@@ -5513,27 +6193,6 @@ class ServiceabilityPlatformModel {
5513
6193
  });
5514
6194
  }
5515
6195
 
5516
- /** @returns {LocationDetailsServiceability} */
5517
- static LocationDetailsServiceability() {
5518
- return Joi.object({
5519
- pincode: Joi.string().allow(""),
5520
- sector: Joi.string().allow(""),
5521
- state: Joi.string().allow(""),
5522
- country: Joi.string().allow("").required(),
5523
- city: Joi.string().allow(""),
5524
- country_iso_code: Joi.string().allow("").required(),
5525
- location: ServiceabilityPlatformModel.ServiceabilityLocation(),
5526
- });
5527
- }
5528
-
5529
- /** @returns {ServiceabilityLocation} */
5530
- static ServiceabilityLocation() {
5531
- return Joi.object({
5532
- longitude: Joi.string().allow("").required(),
5533
- latitude: Joi.string().allow("").required(),
5534
- });
5535
- }
5536
-
5537
6196
  /** @returns {OptimalLocationsArticles} */
5538
6197
  static OptimalLocationsArticles() {
5539
6198
  return Joi.object({
@@ -5845,5 +6504,128 @@ class ServiceabilityPlatformModel {
5845
6504
  total_error_count: Joi.number(),
5846
6505
  });
5847
6506
  }
6507
+
6508
+ /** @returns {StorePolygonServiceabilityRequestData} */
6509
+ static StorePolygonServiceabilityRequestData() {
6510
+ return Joi.object({
6511
+ stores: Joi.array()
6512
+ .items(ServiceabilityPlatformModel.StorePolygonServiceabilityStore())
6513
+ .required(),
6514
+ });
6515
+ }
6516
+
6517
+ /** @returns {StorePolygonServiceabilityStore} */
6518
+ static StorePolygonServiceabilityStore() {
6519
+ return Joi.object({
6520
+ store_code: Joi.string().allow("").required(),
6521
+ name: Joi.string().allow("").required(),
6522
+ address: Joi.string().allow("").required(),
6523
+ area_code: Joi.string().allow("").required(),
6524
+ is_active: Joi.boolean().required(),
6525
+ meta: Joi.object().pattern(/\S/, Joi.any()),
6526
+ coordinates: ServiceabilityPlatformModel.StorePolygonServiceabilityStoreCoordinates().required(),
6527
+ serviceabilities: Joi.array()
6528
+ .items(ServiceabilityPlatformModel.StorePolygonServiceabilityConfig())
6529
+ .required(),
6530
+ created_at: Joi.string().allow(""),
6531
+ updated_at: Joi.string().allow(""),
6532
+ });
6533
+ }
6534
+
6535
+ /** @returns {StorePolygonServiceabilityStoreCoordinates} */
6536
+ static StorePolygonServiceabilityStoreCoordinates() {
6537
+ return Joi.object({
6538
+ lng: Joi.number().required(),
6539
+ lat: Joi.number().required(),
6540
+ });
6541
+ }
6542
+
6543
+ /** @returns {StorePolygonServiceabilityConfig} */
6544
+ static StorePolygonServiceabilityConfig() {
6545
+ return Joi.object({
6546
+ name: Joi.string().allow("").required(),
6547
+ serviceability_type: Joi.string().allow("").required(),
6548
+ polygon: ServiceabilityPlatformModel.StorePolygonServiceabilityPolygon().required(),
6549
+ meta: Joi.object().pattern(/\S/, Joi.any()),
6550
+ is_active: Joi.boolean().required(),
6551
+ uid: Joi.string().allow(""),
6552
+ created_at: Joi.string().allow(""),
6553
+ updated_at: Joi.string().allow(""),
6554
+ });
6555
+ }
6556
+
6557
+ /** @returns {StorePolygonServiceabilityPolygon} */
6558
+ static StorePolygonServiceabilityPolygon() {
6559
+ return Joi.object({
6560
+ type: Joi.string().allow("").required(),
6561
+ features: Joi.array()
6562
+ .items(ServiceabilityPlatformModel.StorePolygonServiceabilityFeature())
6563
+ .required(),
6564
+ attributes: ServiceabilityPlatformModel.StorePolygonServiceabilityAttributes(),
6565
+ });
6566
+ }
6567
+
6568
+ /** @returns {StorePolygonServiceabilityFeature} */
6569
+ static StorePolygonServiceabilityFeature() {
6570
+ return Joi.object({
6571
+ type: Joi.string().allow("").required(),
6572
+ properties: Joi.object().pattern(/\S/, Joi.any()),
6573
+ geometry: ServiceabilityPlatformModel.StorePolygonServiceabilityGeometry().required(),
6574
+ });
6575
+ }
6576
+
6577
+ /** @returns {StorePolygonServiceabilityGeometry} */
6578
+ static StorePolygonServiceabilityGeometry() {
6579
+ return Joi.object({
6580
+ type: Joi.string().allow(""),
6581
+ coordinates: Joi.array().items(
6582
+ Joi.array().items(Joi.array().items(Joi.number()))
6583
+ ),
6584
+ });
6585
+ }
6586
+
6587
+ /** @returns {StorePolygonServiceabilityAttributes} */
6588
+ static StorePolygonServiceabilityAttributes() {
6589
+ return Joi.object({
6590
+ contour_type: Joi.string().allow(""),
6591
+ travel_distance: Joi.number(),
6592
+ reference_coordinates: ServiceabilityPlatformModel.StorePolygonServiceabilityReferenceCoordinates(),
6593
+ });
6594
+ }
6595
+
6596
+ /** @returns {StorePolygonServiceabilityReferenceCoordinates} */
6597
+ static StorePolygonServiceabilityReferenceCoordinates() {
6598
+ return Joi.object({
6599
+ lng: Joi.number().required(),
6600
+ lat: Joi.number().required(),
6601
+ });
6602
+ }
6603
+
6604
+ /** @returns {StorePolygonServiceabilityStoreSummary} */
6605
+ static StorePolygonServiceabilityStoreSummary() {
6606
+ return Joi.object({
6607
+ store_code: Joi.string().allow("").required(),
6608
+ name: Joi.string().allow(""),
6609
+ });
6610
+ }
6611
+
6612
+ /** @returns {StorePolygonServiceabilityError} */
6613
+ static StorePolygonServiceabilityError() {
6614
+ return Joi.object({
6615
+ store_code: Joi.string().allow("").required(),
6616
+ message: Joi.string().allow("").required(),
6617
+ error_code: Joi.string().allow(""),
6618
+ });
6619
+ }
6620
+
6621
+ /** @returns {StorePolygonServiceabilityPagination} */
6622
+ static StorePolygonServiceabilityPagination() {
6623
+ return Joi.object({
6624
+ page_size: Joi.number().required(),
6625
+ page_number: Joi.number().required(),
6626
+ has_next: Joi.boolean().required(),
6627
+ total_records: Joi.number().required(),
6628
+ });
6629
+ }
5848
6630
  }
5849
6631
  module.exports = ServiceabilityPlatformModel;