@medusajs/types 1.12.0-snapshot-20240406075900 → 1.12.0-snapshot-20240409114424

Sign up to get free protection for your applications and to get access to all the features.
Files changed (242) hide show
  1. package/dist/cart/common.d.ts +64 -47
  2. package/dist/cart/common.d.ts.map +1 -1
  3. package/dist/cart/mutations.d.ts +14 -13
  4. package/dist/cart/mutations.d.ts.map +1 -1
  5. package/dist/cart/mutations.js.map +1 -1
  6. package/dist/cart/workflows.d.ts +6 -5
  7. package/dist/cart/workflows.d.ts.map +1 -1
  8. package/dist/common/rule.d.ts +3 -0
  9. package/dist/common/rule.d.ts.map +1 -1
  10. package/dist/customer/common.d.ts +21 -13
  11. package/dist/customer/common.d.ts.map +1 -1
  12. package/dist/customer/mutations.d.ts +13 -13
  13. package/dist/customer/mutations.d.ts.map +1 -1
  14. package/dist/dal/repository-service.d.ts +1 -1
  15. package/dist/dal/repository-service.d.ts.map +1 -1
  16. package/dist/file/index.d.ts +1 -0
  17. package/dist/file/index.d.ts.map +1 -1
  18. package/dist/file/index.js +1 -0
  19. package/dist/file/index.js.map +1 -1
  20. package/dist/file/provider.d.ts +100 -0
  21. package/dist/file/provider.d.ts.map +1 -0
  22. package/dist/file/provider.js +3 -0
  23. package/dist/file/provider.js.map +1 -0
  24. package/dist/fulfillment/common/address.d.ts +51 -0
  25. package/dist/fulfillment/common/address.d.ts.map +1 -1
  26. package/dist/fulfillment/common/fulfillment-item.d.ts +39 -0
  27. package/dist/fulfillment/common/fulfillment-item.d.ts.map +1 -1
  28. package/dist/fulfillment/common/fulfillment-label.d.ts +30 -0
  29. package/dist/fulfillment/common/fulfillment-label.d.ts.map +1 -1
  30. package/dist/fulfillment/common/fulfillment-provider.d.ts +24 -0
  31. package/dist/fulfillment/common/fulfillment-provider.d.ts.map +1 -1
  32. package/dist/fulfillment/common/fulfillment-set.d.ts +42 -0
  33. package/dist/fulfillment/common/fulfillment-set.d.ts.map +1 -1
  34. package/dist/fulfillment/common/fulfillment.d.ts +91 -0
  35. package/dist/fulfillment/common/fulfillment.d.ts.map +1 -1
  36. package/dist/fulfillment/common/geo-zone.d.ts +54 -0
  37. package/dist/fulfillment/common/geo-zone.d.ts.map +1 -1
  38. package/dist/fulfillment/common/service-zone.d.ts +52 -0
  39. package/dist/fulfillment/common/service-zone.d.ts.map +1 -1
  40. package/dist/fulfillment/common/shipping-option-rule.d.ts +51 -0
  41. package/dist/fulfillment/common/shipping-option-rule.d.ts.map +1 -1
  42. package/dist/fulfillment/common/shipping-option-type.d.ts +45 -0
  43. package/dist/fulfillment/common/shipping-option-type.d.ts.map +1 -1
  44. package/dist/fulfillment/common/shipping-option.d.ts +117 -0
  45. package/dist/fulfillment/common/shipping-option.d.ts.map +1 -1
  46. package/dist/fulfillment/common/shipping-profile.d.ts +42 -0
  47. package/dist/fulfillment/common/shipping-profile.d.ts.map +1 -1
  48. package/dist/fulfillment/mutations/fulfillment-address.d.ts +39 -0
  49. package/dist/fulfillment/mutations/fulfillment-address.d.ts.map +1 -1
  50. package/dist/fulfillment/mutations/fulfillment-item.d.ts +24 -0
  51. package/dist/fulfillment/mutations/fulfillment-item.d.ts.map +1 -1
  52. package/dist/fulfillment/mutations/fulfillment-label.d.ts +15 -0
  53. package/dist/fulfillment/mutations/fulfillment-label.d.ts.map +1 -1
  54. package/dist/fulfillment/mutations/fulfillment-set.d.ts +32 -2
  55. package/dist/fulfillment/mutations/fulfillment-set.d.ts.map +1 -1
  56. package/dist/fulfillment/mutations/fulfillment.d.ts +66 -0
  57. package/dist/fulfillment/mutations/fulfillment.d.ts.map +1 -1
  58. package/dist/fulfillment/mutations/geo-zone.d.ts +123 -0
  59. package/dist/fulfillment/mutations/geo-zone.d.ts.map +1 -1
  60. package/dist/fulfillment/mutations/service-zone.d.ts +33 -1
  61. package/dist/fulfillment/mutations/service-zone.d.ts.map +1 -1
  62. package/dist/fulfillment/mutations/shipping-option-rule.d.ts +21 -0
  63. package/dist/fulfillment/mutations/shipping-option-rule.d.ts.map +1 -1
  64. package/dist/fulfillment/mutations/shipping-option-type.d.ts +21 -0
  65. package/dist/fulfillment/mutations/shipping-option-type.d.ts.map +1 -1
  66. package/dist/fulfillment/mutations/shipping-option.d.ts +71 -1
  67. package/dist/fulfillment/mutations/shipping-option.d.ts.map +1 -1
  68. package/dist/fulfillment/mutations/shipping-profile.d.ts +15 -0
  69. package/dist/fulfillment/mutations/shipping-profile.d.ts.map +1 -1
  70. package/dist/fulfillment/service.d.ts +1933 -218
  71. package/dist/fulfillment/service.d.ts.map +1 -1
  72. package/dist/http/api-key/admin/api-key.d.ts +31 -0
  73. package/dist/http/api-key/admin/api-key.d.ts.map +1 -0
  74. package/dist/http/api-key/admin/api-key.js +3 -0
  75. package/dist/http/api-key/admin/api-key.js.map +1 -0
  76. package/dist/http/api-key/admin/index.d.ts +2 -0
  77. package/dist/http/api-key/admin/index.d.ts.map +1 -0
  78. package/dist/http/api-key/admin/index.js +18 -0
  79. package/dist/http/api-key/admin/index.js.map +1 -0
  80. package/dist/http/api-key/index.d.ts +2 -0
  81. package/dist/http/api-key/index.d.ts.map +1 -0
  82. package/dist/http/api-key/index.js +18 -0
  83. package/dist/http/api-key/index.js.map +1 -0
  84. package/dist/http/common/index.d.ts +2 -0
  85. package/dist/http/common/index.d.ts.map +1 -0
  86. package/dist/http/common/index.js +18 -0
  87. package/dist/http/common/index.js.map +1 -0
  88. package/dist/http/common/paginated-response.d.ts +6 -0
  89. package/dist/http/common/paginated-response.d.ts.map +1 -0
  90. package/dist/http/common/paginated-response.js +3 -0
  91. package/dist/http/common/paginated-response.js.map +1 -0
  92. package/dist/http/customer/admin/customer.d.ts +79 -0
  93. package/dist/http/customer/admin/customer.d.ts.map +1 -0
  94. package/dist/http/customer/admin/customer.js +3 -0
  95. package/dist/http/customer/admin/customer.js.map +1 -0
  96. package/dist/http/customer/admin/index.d.ts +2 -0
  97. package/dist/http/customer/admin/index.d.ts.map +1 -0
  98. package/dist/http/customer/admin/index.js +18 -0
  99. package/dist/http/customer/admin/index.js.map +1 -0
  100. package/dist/http/customer/index.d.ts +2 -0
  101. package/dist/http/customer/index.d.ts.map +1 -0
  102. package/dist/http/customer/index.js +18 -0
  103. package/dist/http/customer/index.js.map +1 -0
  104. package/dist/http/fulfillment/admin/fulfillment-set.d.ts +9 -3
  105. package/dist/http/fulfillment/admin/fulfillment-set.d.ts.map +1 -1
  106. package/dist/http/fulfillment/admin/service-zone.d.ts +16 -0
  107. package/dist/http/fulfillment/admin/service-zone.d.ts.map +1 -1
  108. package/dist/http/fulfillment/admin/shipping-option.d.ts +11 -4
  109. package/dist/http/fulfillment/admin/shipping-option.d.ts.map +1 -1
  110. package/dist/http/fulfillment/admin/shipping-profile.d.ts +8 -1
  111. package/dist/http/fulfillment/admin/shipping-profile.d.ts.map +1 -1
  112. package/dist/http/index.d.ts +7 -1
  113. package/dist/http/index.d.ts.map +1 -1
  114. package/dist/http/index.js +7 -1
  115. package/dist/http/index.js.map +1 -1
  116. package/dist/http/pricing/index.d.ts +2 -0
  117. package/dist/http/pricing/index.d.ts.map +1 -0
  118. package/dist/http/pricing/index.js +18 -0
  119. package/dist/http/pricing/index.js.map +1 -0
  120. package/dist/http/pricing/price.d.ts +8 -0
  121. package/dist/http/pricing/price.d.ts.map +1 -0
  122. package/dist/http/pricing/price.js +3 -0
  123. package/dist/http/pricing/price.js.map +1 -0
  124. package/dist/http/product-category/admin/index.d.ts +2 -0
  125. package/dist/http/product-category/admin/index.d.ts.map +1 -0
  126. package/dist/http/product-category/admin/index.js +18 -0
  127. package/dist/http/product-category/admin/index.js.map +1 -0
  128. package/dist/http/product-category/admin/product-category.d.ts +32 -0
  129. package/dist/http/product-category/admin/product-category.d.ts.map +1 -0
  130. package/dist/http/product-category/admin/product-category.js +3 -0
  131. package/dist/http/product-category/admin/product-category.js.map +1 -0
  132. package/dist/http/product-category/index.d.ts +2 -0
  133. package/dist/http/product-category/index.d.ts.map +1 -0
  134. package/dist/http/product-category/index.js +18 -0
  135. package/dist/http/product-category/index.js.map +1 -0
  136. package/dist/http/sales-channel/admin/index.d.ts +2 -0
  137. package/dist/http/sales-channel/admin/index.d.ts.map +1 -0
  138. package/dist/http/sales-channel/admin/index.js +18 -0
  139. package/dist/http/sales-channel/admin/index.js.map +1 -0
  140. package/dist/http/sales-channel/admin/sales-channel.d.ts +25 -0
  141. package/dist/http/sales-channel/admin/sales-channel.d.ts.map +1 -0
  142. package/dist/http/sales-channel/admin/sales-channel.js +3 -0
  143. package/dist/http/sales-channel/admin/sales-channel.js.map +1 -0
  144. package/dist/http/sales-channel/index.d.ts +2 -0
  145. package/dist/http/sales-channel/index.d.ts.map +1 -0
  146. package/dist/http/sales-channel/index.js +18 -0
  147. package/dist/http/sales-channel/index.js.map +1 -0
  148. package/dist/http/tax/admin/index.d.ts +2 -0
  149. package/dist/http/tax/admin/index.d.ts.map +1 -0
  150. package/dist/http/tax/admin/index.js +18 -0
  151. package/dist/http/tax/admin/index.js.map +1 -0
  152. package/dist/http/tax/admin/tax-regions.d.ts +32 -0
  153. package/dist/http/tax/admin/tax-regions.d.ts.map +1 -0
  154. package/dist/http/tax/admin/tax-regions.js +3 -0
  155. package/dist/http/tax/admin/tax-regions.js.map +1 -0
  156. package/dist/http/tax/index.d.ts +2 -0
  157. package/dist/http/tax/index.d.ts.map +1 -0
  158. package/dist/http/tax/index.js +18 -0
  159. package/dist/http/tax/index.js.map +1 -0
  160. package/dist/joiner/index.d.ts +2 -2
  161. package/dist/joiner/index.d.ts.map +1 -1
  162. package/dist/modules-sdk/index.d.ts +12 -10
  163. package/dist/modules-sdk/index.d.ts.map +1 -1
  164. package/dist/order/common.d.ts +111 -45
  165. package/dist/order/common.d.ts.map +1 -1
  166. package/dist/order/index.d.ts +1 -0
  167. package/dist/order/index.d.ts.map +1 -1
  168. package/dist/order/index.js +1 -0
  169. package/dist/order/index.js.map +1 -1
  170. package/dist/order/mutations.d.ts +14 -14
  171. package/dist/order/mutations.d.ts.map +1 -1
  172. package/dist/order/mutations.js.map +1 -1
  173. package/dist/order/service.d.ts +60 -662
  174. package/dist/order/service.d.ts.map +1 -1
  175. package/dist/order/workflows.d.ts +8 -0
  176. package/dist/order/workflows.d.ts.map +1 -0
  177. package/dist/order/workflows.js +3 -0
  178. package/dist/order/workflows.js.map +1 -0
  179. package/dist/payment/common.d.ts +14 -13
  180. package/dist/payment/common.d.ts.map +1 -1
  181. package/dist/payment/common.js.map +1 -1
  182. package/dist/payment/mutations.d.ts +9 -8
  183. package/dist/payment/mutations.d.ts.map +1 -1
  184. package/dist/payment/provider.d.ts +6 -5
  185. package/dist/payment/provider.d.ts.map +1 -1
  186. package/dist/payment/provider.js.map +1 -1
  187. package/dist/payment/service.d.ts +1 -0
  188. package/dist/payment/service.d.ts.map +1 -1
  189. package/dist/pricing/common/money-amount.d.ts +10 -9
  190. package/dist/pricing/common/money-amount.d.ts.map +1 -1
  191. package/dist/pricing/common/price-set.d.ts +9 -8
  192. package/dist/pricing/common/price-set.d.ts.map +1 -1
  193. package/dist/pricing/common/price.d.ts +10 -9
  194. package/dist/pricing/common/price.d.ts.map +1 -1
  195. package/dist/pricing/workflows.d.ts +10 -20
  196. package/dist/pricing/workflows.d.ts.map +1 -1
  197. package/dist/product/common.d.ts +26 -40
  198. package/dist/product/common.d.ts.map +1 -1
  199. package/dist/promotion/http.d.ts +14 -0
  200. package/dist/promotion/http.d.ts.map +1 -0
  201. package/dist/promotion/http.js +3 -0
  202. package/dist/promotion/http.js.map +1 -0
  203. package/dist/promotion/index.d.ts +1 -0
  204. package/dist/promotion/index.d.ts.map +1 -1
  205. package/dist/promotion/index.js +1 -0
  206. package/dist/promotion/index.js.map +1 -1
  207. package/dist/region/common.d.ts +5 -0
  208. package/dist/region/common.d.ts.map +1 -1
  209. package/dist/region/mutations.d.ts +4 -0
  210. package/dist/region/mutations.d.ts.map +1 -1
  211. package/dist/tax/common.d.ts +4 -3
  212. package/dist/tax/common.d.ts.map +1 -1
  213. package/dist/totals/big-number.d.ts +1 -0
  214. package/dist/totals/big-number.d.ts.map +1 -1
  215. package/dist/totals/index.d.ts +24 -0
  216. package/dist/totals/index.d.ts.map +1 -1
  217. package/dist/totals/index.js.map +1 -1
  218. package/dist/workflow/fulfillment/create-shipping-options.d.ts +31 -0
  219. package/dist/workflow/fulfillment/create-shipping-options.d.ts.map +1 -0
  220. package/dist/workflow/fulfillment/create-shipping-options.js +3 -0
  221. package/dist/workflow/fulfillment/create-shipping-options.js.map +1 -0
  222. package/dist/workflow/fulfillment/index.d.ts +5 -0
  223. package/dist/workflow/fulfillment/index.d.ts.map +1 -0
  224. package/dist/workflow/fulfillment/index.js +21 -0
  225. package/dist/workflow/fulfillment/index.js.map +1 -0
  226. package/dist/workflow/fulfillment/service-zones.d.ts +21 -0
  227. package/dist/workflow/fulfillment/service-zones.d.ts.map +1 -0
  228. package/dist/workflow/fulfillment/service-zones.js +3 -0
  229. package/dist/workflow/fulfillment/service-zones.js.map +1 -0
  230. package/dist/workflow/fulfillment/shipping-profiles.d.ts +18 -0
  231. package/dist/workflow/fulfillment/shipping-profiles.d.ts.map +1 -0
  232. package/dist/workflow/fulfillment/shipping-profiles.js +3 -0
  233. package/dist/workflow/fulfillment/shipping-profiles.js.map +1 -0
  234. package/dist/workflow/fulfillment/update-shipping-options.d.ts +32 -0
  235. package/dist/workflow/fulfillment/update-shipping-options.d.ts.map +1 -0
  236. package/dist/workflow/fulfillment/update-shipping-options.js +3 -0
  237. package/dist/workflow/fulfillment/update-shipping-options.js.map +1 -0
  238. package/dist/workflow/index.d.ts +1 -0
  239. package/dist/workflow/index.d.ts.map +1 -1
  240. package/dist/workflow/index.js +2 -1
  241. package/dist/workflow/index.js.map +1 -1
  242. package/package.json +1 -1
@@ -1,418 +1,2133 @@
1
- import { IModuleService } from "../modules-sdk";
2
- import { FilterableFulfillmentProps, FilterableFulfillmentSetProps, FilterableGeoZoneProps, FilterableServiceZoneProps, FilterableShippingOptionForContextProps, FilterableShippingOptionProps, FilterableShippingOptionRuleProps, FilterableShippingOptionTypeProps, FilterableShippingProfileProps, FulfillmentDTO, FulfillmentSetDTO, GeoZoneDTO, ServiceZoneDTO, ShippingOptionDTO, ShippingOptionRuleDTO, ShippingOptionTypeDTO, ShippingProfileDTO } from "./common";
3
1
  import { FindConfig } from "../common";
4
- import { Context } from "../shared-context";
5
2
  import { RestoreReturn, SoftDeleteReturn } from "../dal";
6
- import { CreateFulfillmentSetDTO, CreateGeoZoneDTO, CreateServiceZoneDTO, CreateShippingOptionDTO, CreateShippingOptionRuleDTO, UpdateFulfillmentDTO, UpdateFulfillmentSetDTO, UpdateGeoZoneDTO, UpdateServiceZoneDTO, UpdateShippingOptionDTO, UpdateShippingOptionRuleDTO, UpdateShippingProfileDTO } from "./mutations";
7
- import { CreateShippingProfileDTO } from "./mutations/shipping-profile";
3
+ import { IModuleService } from "../modules-sdk";
4
+ import { Context } from "../shared-context";
5
+ import { FilterableFulfillmentProps, FilterableFulfillmentSetProps, FilterableGeoZoneProps, FilterableServiceZoneProps, FilterableShippingOptionForContextProps, FilterableShippingOptionProps, FilterableShippingOptionRuleProps, FilterableShippingOptionTypeProps, FilterableShippingProfileProps, FulfillmentDTO, FulfillmentSetDTO, GeoZoneDTO, ServiceZoneDTO, ShippingOptionDTO, ShippingOptionRuleDTO, ShippingOptionTypeDTO, ShippingProfileDTO } from "./common";
6
+ import { CreateFulfillmentSetDTO, CreateGeoZoneDTO, CreateServiceZoneDTO, CreateShippingOptionDTO, CreateShippingOptionRuleDTO, UpdateFulfillmentDTO, UpdateFulfillmentSetDTO, UpdateGeoZoneDTO, UpdateServiceZoneDTO, UpdateShippingOptionDTO, UpdateShippingOptionRuleDTO, UpdateShippingProfileDTO, UpsertServiceZoneDTO, UpsertShippingOptionDTO } from "./mutations";
8
7
  import { CreateFulfillmentDTO } from "./mutations/fulfillment";
8
+ import { CreateShippingProfileDTO } from "./mutations/shipping-profile";
9
+ /**
10
+ * The main service interface for the Fulfillment Module.
11
+ */
9
12
  export interface IFulfillmentModuleService extends IModuleService {
10
13
  /**
11
- * Retrieve a fulfillment set
12
- * @param id
13
- * @param config
14
- * @param sharedContext
14
+ * This method retrieves a fulfillment set by its ID.
15
+ *
16
+ * @param {string} id - The ID of the fulfillment set.
17
+ * @param {FindConfig<FulfillmentSetDTO>} config - The configurations determining how the fulfillment set is retrieved. Its properties, such as `select` or `relations`, accept the
18
+ * attributes or relations associated with a fulfillment set.
19
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
20
+ * @returns {Promise<FulfillmentSetDTO>} The retrieved fulfillment set.
21
+ *
22
+ * @example
23
+ * A simple example that retrieves a fulfillment set by its ID:
24
+ *
25
+ * ```ts
26
+ * const fulfillmentSet =
27
+ * await fulfillmentModuleService.retrieve("fuset_123")
28
+ * ```
29
+ *
30
+ * To specify relations that should be retrieved:
31
+ *
32
+ * ```ts
33
+ * const fulfillmentSet = await fulfillmentModuleService.retrieve(
34
+ * "fuset_123",
35
+ * {
36
+ * relations: ["service_zones"],
37
+ * }
38
+ * )
39
+ * ```
15
40
  */
16
41
  retrieve(id: string, config?: FindConfig<FulfillmentSetDTO>, sharedContext?: Context): Promise<FulfillmentSetDTO>;
17
42
  /**
18
- * List fulfillment sets
19
- * @param filters
20
- * @param config
21
- * @param sharedContext
43
+ * This method retrieves a paginated list of fulfillment sets based on optional filters and configuration.
44
+ *
45
+ * @param {FilterableFulfillmentSetProps} filters - The filters to apply on the retrieved fulfillment sets.
46
+ * @param {FindConfig<FulfillmentSetDTO>} config - The configurations determining how the fulfillment set is retrieved. Its properties, such as `select` or `relations`, accept the
47
+ * attributes or relations associated with a fulfillment set.
48
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
49
+ * @returns {Promise<FulfillmentSetDTO[]>} The list of fulfillment sets.
50
+ *
51
+ * @example
52
+ * To retrieve a list of fulfillment sets using their IDs:
53
+ *
54
+ * ```ts
55
+ * const fulfillmentSets = await fulfillmentModuleService.list({
56
+ * id: ["fuset_123", "fuset_321"],
57
+ * })
58
+ * ```
59
+ *
60
+ * To specify relations that should be retrieved within the fulfillment set:
61
+ *
62
+ * ```ts
63
+ * const fulfillmentSets = await fulfillmentModuleService.list(
64
+ * {
65
+ * id: ["fuset_123", "fuset_321"],
66
+ * },
67
+ * {
68
+ * relations: ["search_zones"],
69
+ * }
70
+ * )
71
+ * ```
72
+ *
73
+ * By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
74
+ *
75
+ * ```ts
76
+ * const fulfillmentSets = await fulfillmentModuleService.list(
77
+ * {
78
+ * id: ["fuset_123", "fuset_321"],
79
+ * },
80
+ * {
81
+ * relations: ["search_zones"],
82
+ * take: 20,
83
+ * skip: 2,
84
+ * }
85
+ * )
86
+ * ```
22
87
  */
23
88
  list(filters?: FilterableFulfillmentSetProps, config?: FindConfig<FulfillmentSetDTO>, sharedContext?: Context): Promise<FulfillmentSetDTO[]>;
24
89
  /**
25
- * List and count fulfillment sets
26
- * @param filters
27
- * @param config
28
- * @param sharedContext
90
+ * This method retrieves a paginated list of fulfillment sets along with the total count of available fulfillment sets satisfying the provided filters.
91
+ *
92
+ * @param {FilterableFulfillmentSetProps} filters - The filters to apply on the retrieved fulfillment sets.
93
+ * @param {FindConfig<FulfillmentSetDTO>} config - The configurations determining how the fulfillment set is retrieved. Its properties, such as `select` or `relations`, accept the
94
+ * attributes or relations associated with a fulfillment set.
95
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
96
+ * @returns {Promise<[FulfillmentSetDTO[], number]>} The list of fulfillment sets along with their total count.
97
+ *
98
+ * @example
99
+ * To retrieve a list of fulfillment sets using their IDs:
100
+ *
101
+ * ```ts
102
+ * const [fulfillmentSets, count] =
103
+ * await fulfillmentModuleService.listAndCount({
104
+ * id: ["fuset_123", "fuset_321"],
105
+ * })
106
+ * ```
107
+ *
108
+ * To specify relations that should be retrieved within the fulfillment set:
109
+ *
110
+ * ```ts
111
+ * const [fulfillmentSets, count] =
112
+ * await fulfillmentModuleService.listAndCount(
113
+ * {
114
+ * id: ["fuset_123", "fuset_321"],
115
+ * },
116
+ * {
117
+ * relations: ["search_zones"],
118
+ * }
119
+ * )
120
+ * ```
121
+ *
122
+ * By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
123
+ *
124
+ * ```ts
125
+ * const [fulfillmentSets, count] =
126
+ * await fulfillmentModuleService.listAndCount(
127
+ * {
128
+ * id: ["fuset_123", "fuset_321"],
129
+ * },
130
+ * {
131
+ * relations: ["search_zones"],
132
+ * take: 20,
133
+ * skip: 2,
134
+ * }
135
+ * )
136
+ * ```
29
137
  */
30
138
  listAndCount(filters?: FilterableFulfillmentSetProps, config?: FindConfig<FulfillmentSetDTO>, sharedContext?: Context): Promise<[FulfillmentSetDTO[], number]>;
31
139
  /**
32
- * Create a new fulfillment set
33
- * @param data
34
- * @param sharedContext
140
+ * This method creates fulfillment sets.
141
+ *
142
+ * @param {CreateFulfillmentSetDTO[]} data - The fulfillment sets to be created.
143
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
144
+ * @returns {Promise<FulfillmentSetDTO[]>} The created fulfillment sets.
145
+ *
146
+ * @example
147
+ * const fulfillmentSets = await fulfillmentModuleService.create(
148
+ * [
149
+ * {
150
+ * name: "Shipping",
151
+ * type: "default",
152
+ * },
153
+ * {
154
+ * name: "Pickup",
155
+ * type: "provider-controlled",
156
+ * },
157
+ * ]
158
+ * )
35
159
  */
36
160
  create(data: CreateFulfillmentSetDTO[], sharedContext?: Context): Promise<FulfillmentSetDTO[]>;
161
+ /**
162
+ * This method creates a fulfillment set.
163
+ *
164
+ * @param {CreateFulfillmentSetDTO} data - The fulfillment set to be created.
165
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
166
+ * @returns {Promise<FulfillmentSetDTO>} The created fulfillment set.
167
+ *
168
+ * @example
169
+ * const fulfillmentSet = await fulfillmentModuleService.create({
170
+ * name: "Shipping",
171
+ * type: "default",
172
+ * })
173
+ */
37
174
  create(data: CreateFulfillmentSetDTO, sharedContext?: Context): Promise<FulfillmentSetDTO>;
38
175
  /**
39
- * Update a fulfillment set
40
- * @param data
41
- * @param sharedContext
176
+ * This method updates existing fulfillment sets.
177
+ *
178
+ * @param {UpdateFulfillmentSetDTO[]} data - The attributes to update in the fulfillment sets.
179
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
180
+ * @returns {Promise<FulfillmentSetDTO[]>} The updated fulfillment sets.
181
+ *
182
+ * @example
183
+ * const fulfillmentSets = await fulfillmentModuleService.update(
184
+ * [
185
+ * {
186
+ * id: "fuset_123",
187
+ * name: "Shipping",
188
+ * },
189
+ * {
190
+ * id: "fuset_321",
191
+ * name: "Pickup",
192
+ * },
193
+ * ]
194
+ * )
42
195
  */
43
196
  update(data: UpdateFulfillmentSetDTO[], sharedContext?: Context): Promise<FulfillmentSetDTO[]>;
197
+ /**
198
+ * This method updates an existing fulfillment set.
199
+ *
200
+ * @param {UpdateFulfillmentSetDTO} data - The attributes to update in the fulfillment set.
201
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
202
+ * @returns {Promise<FulfillmentSetDTO>} The updated fulfillment set.
203
+ *
204
+ * @example
205
+ * const fulfillmentSet = await fulfillmentModuleService.update({
206
+ * id: "fuset_123",
207
+ * name: "Shipping",
208
+ * })
209
+ */
44
210
  update(data: UpdateFulfillmentSetDTO, sharedContext?: Context): Promise<FulfillmentSetDTO>;
45
211
  /**
46
- * Delete a fulfillment set
47
- * @param ids
48
- * @param sharedContext
212
+ * This method deletes fulfillment sets by their IDs.
213
+ *
214
+ * @param {string[]} ids - The IDs of the fulfillment sets.
215
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
216
+ * @returns {Promise<void>} Resolves when the fulfillment sets are deleted successfully.
217
+ *
218
+ * @example
219
+ * await fulfillmentModuleService.delete([
220
+ * "fuset_123",
221
+ * "fuset_321",
222
+ * ])
49
223
  */
50
224
  delete(ids: string[], sharedContext?: Context): Promise<void>;
225
+ /**
226
+ * This method deletes a fulfillment set by its ID.
227
+ *
228
+ * @param {string} id - The ID of the fulfillment set.
229
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
230
+ * @returns {Promise<void>} Resolves when the fulfillment set is deleted successfully.
231
+ *
232
+ * @example
233
+ * await fulfillmentModuleService.delete("fuset_123")
234
+ */
51
235
  delete(id: string, sharedContext?: Context): Promise<void>;
52
236
  /**
53
- * Soft delete fulfillment sets
54
- * @param fulfillmentIds
55
- * @param config
56
- * @param sharedContext
237
+ * This method soft deletes fulfillment sets by their IDs.
238
+ *
239
+ * @param {string[]} fulfillmentIds - The IDs of the fulfillment sets.
240
+ * @param {SoftDeleteReturn<TReturnableLinkableKeys>} config - An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
241
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
242
+ * @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were also soft deleted.
243
+ * If there are no related records, the promise resolves to `void`.
244
+ *
245
+ * @example
246
+ * await fulfillmentModuleService.softDelete([
247
+ * "fuset_123",
248
+ * "fuset_321",
249
+ * ])
57
250
  */
58
251
  softDelete<TReturnableLinkableKeys extends string = string>(fulfillmentIds: string[], config?: SoftDeleteReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
59
252
  /**
60
- * Restore fulfillment sets
61
- * @param fulfillmentIds
62
- * @param config
63
- * @param sharedContext
253
+ * This method restores a soft deleted fulfillment by its IDs.
254
+ *
255
+ * @param {string[]} fulfillmentIds - The IDs of the fulfillment sets.
256
+ * @param {RestoreReturn<TReturnableLinkableKeys>} config - Configurations determining which relations to restore along with each of the fulfillment sets. You can pass to its `returnLinkableKeys`
257
+ * property any of the fulfillment set's relation attribute names.
258
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
259
+ * @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were restored.
260
+ * If there are no related records restored, the promise resolves to `void`.
261
+ *
262
+ * @example
263
+ * await fulfillmentModuleService.restore([
264
+ * "fuset_123",
265
+ * "fuset_321",
266
+ * ])
64
267
  */
65
268
  restore<TReturnableLinkableKeys extends string = string>(fulfillmentIds: string[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
66
269
  /**
67
- * Retrieve a service zone
68
- * @param id
69
- * @param config
70
- * @param sharedContext
270
+ * This method retrieves a service zone by its ID.
271
+ *
272
+ * @param {string} id - The ID of the service zone.
273
+ * @param {FindConfig<ServiceZoneDTO>} config - The configurations determining how the service zone is retrieved. Its properties, such as `select` or `relations`, accept the
274
+ * attributes or relations associated with a service zone.
275
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
276
+ * @returns {Promise<ServiceZoneDTO>} The retrieved service zone.
277
+ *
278
+ * @example
279
+ * A simple example that retrieves a service zone by its ID:
280
+ *
281
+ * ```ts
282
+ * const serviceZone =
283
+ * await fulfillmentModuleService.retrieveServiceZone(
284
+ * "serzo_123"
285
+ * )
286
+ * ```
287
+ *
288
+ * To specify relations that should be retrieved:
289
+ *
290
+ * ```ts
291
+ * const serviceZone =
292
+ * await fulfillmentModuleService.retrieveServiceZone(
293
+ * "serzo_123",
294
+ * {
295
+ * relations: ["shipping_options"],
296
+ * }
297
+ * )
298
+ * ```
71
299
  */
72
300
  retrieveServiceZone(id: string, config?: FindConfig<ServiceZoneDTO>, sharedContext?: Context): Promise<ServiceZoneDTO>;
73
301
  /**
74
- * List service zones
75
- * @param filters
76
- * @param config
77
- * @param sharedContext
302
+ * This method retrieves a paginated list of service zones based on optional filters and configuration.
303
+ *
304
+ * @param {FilterableServiceZoneProps} filters - The filters to apply on the retrieved service zones.
305
+ * @param {FindConfig<ServiceZoneDTO>} config - The configurations determining how the service zone is retrieved. Its properties, such as `select` or `relations`, accept the
306
+ * attributes or relations associated with a service zone.
307
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
308
+ * @returns {Promise<ServiceZoneDTO[]>} The list of service zones.
309
+ *
310
+ * @example
311
+ * To retrieve a list of service zones using their IDs:
312
+ *
313
+ * ```ts
314
+ * const serviceZones =
315
+ * await fulfillmentModuleService.listServiceZones({
316
+ * id: ["serzo_123", "serzo_321"],
317
+ * })
318
+ * ```
319
+ *
320
+ * To specify relations that should be retrieved within the service zone:
321
+ *
322
+ * ```ts
323
+ * const serviceZones =
324
+ * await fulfillmentModuleService.listServiceZones(
325
+ * {
326
+ * id: ["serzo_123", "serzo_321"],
327
+ * },
328
+ * {
329
+ * relations: ["shipping_options"],
330
+ * }
331
+ * )
332
+ * ```
333
+ *
334
+ * By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
335
+ *
336
+ * ```ts
337
+ * const serviceZones =
338
+ * await fulfillmentModuleService.listServiceZones(
339
+ * {
340
+ * id: ["serzo_123", "serzo_321"],
341
+ * },
342
+ * {
343
+ * relations: ["shipping_options"],
344
+ * take: 20,
345
+ * skip: 2,
346
+ * }
347
+ * )
348
+ * ```
78
349
  */
79
350
  listServiceZones(filters?: FilterableServiceZoneProps, config?: FindConfig<ServiceZoneDTO>, sharedContext?: Context): Promise<ServiceZoneDTO[]>;
80
351
  /**
81
- * List and count service zones
82
- * @param filters
83
- * @param config
84
- * @param sharedContext
352
+ * This method retrieves a paginated list of service zones along with the total count of available service zones satisfying the provided filters.
353
+ *
354
+ * @param {FilterableServiceZoneProps} filters - The filters to apply on the retrieved service zones.
355
+ * @param {FindConfig<ServiceZoneDTO>} config - The configurations determining how the service zone is retrieved. Its properties, such as `select` or `relations`, accept the
356
+ * attributes or relations associated with a service zone.
357
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
358
+ * @returns {Promise<[ServiceZoneDTO[], number]>} The list of service zones along with their total count.
359
+ *
360
+ * @example
361
+ * To retrieve a list of service zones using their IDs:
362
+ *
363
+ * ```ts
364
+ * const [serviceZones, count] =
365
+ * await fulfillmentModuleService.listAndCountServiceZones({
366
+ * id: ["serzo_123", "serzo_321"],
367
+ * })
368
+ * ```
369
+ *
370
+ * To specify relations that should be retrieved within the service zone:
371
+ *
372
+ * ```ts
373
+ * const [serviceZones, count] =
374
+ * await fulfillmentModuleService.listAndCountServiceZones(
375
+ * {
376
+ * id: ["serzo_123", "serzo_321"],
377
+ * },
378
+ * {
379
+ * relations: ["shipping_options"],
380
+ * }
381
+ * )
382
+ * ```
383
+ *
384
+ * By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
385
+ *
386
+ * ```ts
387
+ * const [serviceZones, count] =
388
+ * await fulfillmentModuleService.listAndCountServiceZones(
389
+ * {
390
+ * id: ["serzo_123", "serzo_321"],
391
+ * },
392
+ * {
393
+ * relations: ["shipping_options"],
394
+ * take: 20,
395
+ * skip: 2,
396
+ * }
397
+ * )
398
+ * ```
85
399
  */
86
400
  listAndCountServiceZones(filters?: FilterableServiceZoneProps, config?: FindConfig<ServiceZoneDTO>, sharedContext?: Context): Promise<[ServiceZoneDTO[], number]>;
87
401
  /**
88
- * Create a new service zone
89
- * @param data
90
- * @param sharedContext
402
+ * This method creates service zones.
403
+ *
404
+ * @param {CreateServiceZoneDTO[]} data - The service zones to be created.
405
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
406
+ * @returns {Promise<ServiceZoneDTO[]>} The created service zones.
407
+ *
408
+ * @example
409
+ * const serviceZones =
410
+ * await fulfillmentModuleService.createServiceZones([
411
+ * {
412
+ * name: "Nordic Shipping Methods",
413
+ * fulfillment_set_id: "fuset_123",
414
+ * },
415
+ * {
416
+ * name: "Pickup Service Area",
417
+ * fulfillment_set_id: "fuset_321",
418
+ * },
419
+ * ])
91
420
  */
92
421
  createServiceZones(data: CreateServiceZoneDTO[], sharedContext?: Context): Promise<ServiceZoneDTO[]>;
422
+ /**
423
+ * This method creates a service zone.
424
+ *
425
+ * @param {CreateServiceZoneDTO} data - The service zone to be created.
426
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
427
+ * @returns {Promise<ServiceZoneDTO>} The created service zone.
428
+ *
429
+ * @example
430
+ * const serviceZone =
431
+ * await fulfillmentModuleService.createServiceZones({
432
+ * name: "Nordic Shipping Methods",
433
+ * fulfillment_set_id: "fuset_123",
434
+ * })
435
+ */
93
436
  createServiceZones(data: CreateServiceZoneDTO, sharedContext?: Context): Promise<ServiceZoneDTO>;
94
437
  /**
95
- * Update a service zone
96
- * @param data
97
- * @param sharedContext
438
+ * This method updates an existing service zone.
439
+ *
440
+ * @param {string} id - The ID of the service zone.
441
+ * @param {UpdateServiceZoneDTO} data - The attributes to update in the service zone.
442
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
443
+ * @returns {Promise<ServiceZoneDTO>} The updated service zone.
444
+ *
445
+ * @example
446
+ * const serviceZone =
447
+ * await fulfillmentModuleService.updateServiceZones(
448
+ * "serzo_123",
449
+ * {
450
+ * name: "US",
451
+ * }
452
+ * )
453
+ */
454
+ updateServiceZones(id: string, data: UpdateServiceZoneDTO, sharedContext?: Context): Promise<ServiceZoneDTO>;
455
+ /**
456
+ * This method updates existing service zones matching the specified filters.
457
+ *
458
+ * @param {FilterableServiceZoneProps} selector - The filters specifying which service zones to update.
459
+ * @param {UpdateServiceZoneDTO} data - The attributes to update in the service zone.
460
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
461
+ * @returns {Promise<ServiceZoneDTO[]>} The updated service zones.
462
+ *
463
+ * @example
464
+ * const serviceZones =
465
+ * await fulfillmentModuleService.updateServiceZones(
466
+ * {
467
+ * id: ["serzo_123", "serzo_321"],
468
+ * },
469
+ * {
470
+ * name: "US",
471
+ * }
472
+ * )
98
473
  */
99
- updateServiceZones(data: UpdateServiceZoneDTO[], sharedContext?: Context): Promise<ServiceZoneDTO[]>;
100
- updateServiceZones(data: UpdateServiceZoneDTO, sharedContext?: Context): Promise<ServiceZoneDTO>;
474
+ updateServiceZones(selector: FilterableServiceZoneProps, data: UpdateServiceZoneDTO, sharedContext?: Context): Promise<ServiceZoneDTO[]>;
101
475
  /**
102
- * Delete a service zone
103
- * @param ids
104
- * @param sharedContext
476
+ * This method updates or creates a service zone if it doesn't exist.
477
+ *
478
+ * @param {UpsertServiceZoneDTO} data - The attributes in the service zone to be created or updated.
479
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
480
+ * @returns {Promise<ServiceZoneDTO>} The created or updated service zone.
481
+ *
482
+ * @example
483
+ * const serviceZone =
484
+ * await fulfillmentModuleService.upsertServiceZones({
485
+ * id: "serzo_123",
486
+ * name: "US",
487
+ * })
488
+ */
489
+ upsertServiceZones(data: UpsertServiceZoneDTO, sharedContext?: Context): Promise<ServiceZoneDTO>;
490
+ /**
491
+ * This method updates or creates service zones if they don't exist.
492
+ *
493
+ * @param {UpsertServiceZoneDTO[]} data - The attributes in the service zones to be created or updated.
494
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
495
+ * @returns {Promise<ServiceZoneDTO[]>} The created or updated service zones.
496
+ *
497
+ * @example
498
+ * const serviceZones =
499
+ * await fulfillmentModuleService.upsertServiceZones([
500
+ * {
501
+ * id: "serzo_123",
502
+ * name: "US",
503
+ * },
504
+ * {
505
+ * name: "US",
506
+ * fulfillment_set_id: "fuset_123",
507
+ * },
508
+ * ])
509
+ */
510
+ upsertServiceZones(data: UpsertServiceZoneDTO[], sharedContext?: Context): Promise<ServiceZoneDTO[]>;
511
+ /**
512
+ * This method deletes service zones by their IDs.
513
+ *
514
+ * @param {string[]} ids - The IDs of the service zone.
515
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
516
+ * @returns {Promise<void>} Resolves when the service zones are deleted.
517
+ *
518
+ * @example
519
+ * await fulfillmentModuleService.deleteServiceZones([
520
+ * "serzo_123",
521
+ * "serzo_321",
522
+ * ])
105
523
  */
106
524
  deleteServiceZones(ids: string[], sharedContext?: Context): Promise<void>;
525
+ /**
526
+ * This method deletes a service zone by its ID.
527
+ *
528
+ * @param {string} id - The ID of the service zone.
529
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
530
+ * @returns {Promise<void>} Resolves when the service zone is deleted.
531
+ *
532
+ * @example
533
+ * await fulfillmentModuleService.deleteServiceZones("serzo_123")
534
+ */
107
535
  deleteServiceZones(id: string, sharedContext?: Context): Promise<void>;
108
536
  /**
109
- * Soft delete service zones
110
- * @param serviceZoneIds
111
- * @param config
112
- * @param sharedContext
537
+ * This method soft deletes service zones by their IDs.
538
+ *
539
+ * @param {string[]} serviceZoneIds - The IDs of the service zones.
540
+ * @param {SoftDeleteReturn<TReturnableLinkableKeys>} config - An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
541
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
542
+ * @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were also soft deleted.
543
+ * If there are no related records, the promise resolves to `void`.
544
+ *
545
+ * @example
546
+ * await fulfillmentModuleService.softDeleteServiceZones([
547
+ * "serzo_123",
548
+ * "serzo_321",
549
+ * ])
113
550
  */
114
551
  softDeleteServiceZones<TReturnableLinkableKeys extends string = string>(serviceZoneIds: string[], config?: SoftDeleteReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
115
552
  /**
116
- * Restore service zones
117
- * @param serviceZoneIds
118
- * @param config
119
- * @param sharedContext
553
+ * This method restores a soft deleted service zones by their IDs.
554
+ *
555
+ * @param {string[]} serviceZoneIds - The IDs of the service zones.
556
+ * @param {RestoreReturn<TReturnableLinkableKeys>} config - Configurations determining which relations to restore along with each of the service zones. You can pass to its `returnLinkableKeys`
557
+ * property any of the service zone's relation attribute names, such as `{type relation name}`.
558
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
559
+ * @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were restored.
560
+ * If there are no related records restored, the promise resolves to `void`.
561
+ *
562
+ * @example
563
+ * await fulfillmentModuleService.restoreServiceZones([
564
+ * "serzo_123",
565
+ * "serzo_321",
566
+ * ])
120
567
  */
121
568
  restoreServiceZones<TReturnableLinkableKeys extends string = string>(serviceZoneIds: string[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
122
569
  /**
123
- * Retrieve a geo zone
124
- * @param id
125
- * @param config
126
- * @param sharedContext
570
+ * This method retrieves a geo zone by its ID.
571
+ *
572
+ * @param {string} id - The ID of the geo zone.
573
+ * @param {FindConfig<GeoZoneDTO>} config - The configurations determining how the geo zone is retrieved. Its properties, such as `select` or `relations`, accept the
574
+ * attributes or relations associated with a geo zone.
575
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
576
+ * @returns {Promise<GeoZoneDTO>} The retrieved geo zone.
577
+ *
578
+ * @example
579
+ * A simple example that retrieves a geo zone by its ID:
580
+ *
581
+ * ```ts
582
+ * const geoZone =
583
+ * await fulfillmentModuleService.retrieveGeoZone("fgz_123")
584
+ * ```
585
+ *
586
+ * To specify relations that should be retrieved:
587
+ *
588
+ * ```ts
589
+ * const geoZone =
590
+ * await fulfillmentModuleService.retrieveGeoZone("fgz_123", {
591
+ * relations: ["service_zone"],
592
+ * })
593
+ * ```
127
594
  */
128
595
  retrieveGeoZone(id: string, config?: FindConfig<GeoZoneDTO>, sharedContext?: Context): Promise<GeoZoneDTO>;
129
596
  /**
130
- * List geo zones
131
- * @param filters
132
- * @param config
133
- * @param sharedContext
597
+ * This method retrieves a paginated list of geo zones based on optional filters and configuration.
598
+ *
599
+ * @param {FilterableGeoZoneProps} filters - The filters to apply on the retrieved geo zones.
600
+ * @param {FindConfig<GeoZoneDTO>} config - The configurations determining how the geo zone is retrieved. Its properties, such as `select` or `relations`, accept the
601
+ * attributes or relations associated with a geo zone.
602
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
603
+ * @returns {Promise<GeoZoneDTO[]>} The list of geo zones.
604
+ *
605
+ * @example
606
+ * To retrieve a list of geo zones using their IDs:
607
+ *
608
+ * ```ts
609
+ * const geoZones = await fulfillmentModuleService.listGeoZones({
610
+ * id: ["fgz_123", "fgz_321"],
611
+ * })
612
+ * ```
613
+ *
614
+ * To specify relations that should be retrieved within the geo zone:
615
+ *
616
+ * ```ts
617
+ * const geoZones = await fulfillmentModuleService.listGeoZones(
618
+ * {
619
+ * id: ["fgz_123", "fgz_321"],
620
+ * },
621
+ * {
622
+ * relations: ["service_zone"],
623
+ * }
624
+ * )
625
+ * ```
626
+ *
627
+ * By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
628
+ *
629
+ * ```ts
630
+ * const geoZones = await fulfillmentModuleService.listGeoZones(
631
+ * {
632
+ * id: ["fgz_123", "fgz_321"],
633
+ * },
634
+ * {
635
+ * relations: ["service_zone"],
636
+ * take: 20,
637
+ * skip: 2,
638
+ * }
639
+ * )
640
+ * ```
134
641
  */
135
642
  listGeoZones(filters?: FilterableGeoZoneProps, config?: FindConfig<GeoZoneDTO>, sharedContext?: Context): Promise<GeoZoneDTO[]>;
136
643
  /**
137
- * List and count geo zones
138
- * @param filters
139
- * @param config
140
- * @param sharedContext
644
+ * This method retrieves a paginated list of geo zones along with the total count of available geo zones satisfying the provided filters.
645
+ *
646
+ * @param {FilterableGeoZoneProps} filters - The filters to apply on the retrieved geo zones.
647
+ * @param {FindConfig<GeoZoneDTO>} config - The configurations determining how the geo zone is retrieved. Its properties, such as `select` or `relations`, accept the
648
+ * attributes or relations associated with a geo zone.
649
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
650
+ * @returns {Promise<[GeoZoneDTO[], number]>} The list of geo zones along with their total count.
651
+ *
652
+ * @example
653
+ * To retrieve a list of geo zones using their IDs:
654
+ *
655
+ * ```ts
656
+ * const [geoZones, count] =
657
+ * await fulfillmentModuleService.listAndCountGeoZones({
658
+ * id: ["fgz_123", "fgz_321"],
659
+ * })
660
+ * ```
661
+ *
662
+ * To specify relations that should be retrieved within the geo zone:
663
+ *
664
+ * ```ts
665
+ * const [geoZones, count] =
666
+ * await fulfillmentModuleService.listAndCountGeoZones(
667
+ * {
668
+ * id: ["fgz_123", "fgz_321"],
669
+ * },
670
+ * {
671
+ * relations: ["service_zone"],
672
+ * }
673
+ * )
674
+ * ```
675
+ *
676
+ * By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
677
+ *
678
+ * ```ts
679
+ * const [geoZones, count] =
680
+ * await fulfillmentModuleService.listAndCountGeoZones(
681
+ * {
682
+ * id: ["fgz_123", "fgz_321"],
683
+ * },
684
+ * {
685
+ * relations: ["service_zone"],
686
+ * take: 20,
687
+ * skip: 2,
688
+ * }
689
+ * )
690
+ * ```
141
691
  */
142
692
  listAndCountGeoZones(filters?: FilterableGeoZoneProps, config?: FindConfig<GeoZoneDTO>, sharedContext?: Context): Promise<[GeoZoneDTO[], number]>;
143
693
  /**
144
- * Create a new geo zone
145
- * @param data
146
- * @param sharedContext
694
+ * This method creates geo zones.
695
+ *
696
+ * @param {CreateGeoZoneDTO[]} data - The geo zones to be created.
697
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
698
+ * @returns {Promise<GeoZoneDTO[]>} The created geo zones.
699
+ *
700
+ * @example
701
+ * const geoZones =
702
+ * await fulfillmentModuleService.createGeoZones([
703
+ * {
704
+ * type: "country",
705
+ * service_zone_id: "serzo_123",
706
+ * country_code: "us",
707
+ * },
708
+ * {
709
+ * type: "city",
710
+ * service_zone_id: "serzo_321",
711
+ * province_code: "VT",
712
+ * city: "Vermont",
713
+ * country_code: "us",
714
+ * },
715
+ * ])
147
716
  */
148
717
  createGeoZones(data: CreateGeoZoneDTO[], sharedContext?: Context): Promise<GeoZoneDTO[]>;
718
+ /**
719
+ * This method creates a geo zones.
720
+ *
721
+ * @param {CreateGeoZoneDTO} data - The geo zone to be created.
722
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
723
+ * @returns {Promise<GeoZoneDTO>} The created geo zones.
724
+ *
725
+ * @example
726
+ * const geoZones =
727
+ * await fulfillmentModuleService.createGeoZones({
728
+ * type: "country",
729
+ * service_zone_id: "serzo_123",
730
+ * country_code: "us",
731
+ * })
732
+ */
149
733
  createGeoZones(data: CreateGeoZoneDTO, sharedContext?: Context): Promise<GeoZoneDTO>;
150
734
  /**
151
- * Update a geo zone
152
- * @param data
153
- * @param sharedContext
735
+ * This method updates existing geo zones.
736
+ *
737
+ * @param {UpdateGeoZoneDTO[]} data - The attributes to update in the geo zones.
738
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
739
+ * @returns {Promise<GeoZoneDTO[]>} The updated geo zones.
740
+ *
741
+ * @example
742
+ * const geoZones =
743
+ * await fulfillmentModuleService.updateGeoZones([
744
+ * {
745
+ * id: "fgz_123",
746
+ * type: "country",
747
+ * country_code: "us",
748
+ * },
749
+ * {
750
+ * id: "fgz_321",
751
+ * type: "city",
752
+ * province_code: "VT",
753
+ * },
754
+ * ])
154
755
  */
155
756
  updateGeoZones(data: UpdateGeoZoneDTO[], sharedContext?: Context): Promise<GeoZoneDTO[]>;
757
+ /**
758
+ * This method updates an existing fulfillment.
759
+ *
760
+ * @param {UpdateGeoZoneDTO} data - The attributes to update in the geo zone.
761
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
762
+ * @returns {Promise<GeoZoneDTO>} The updated fulfillment.
763
+ *
764
+ * @example
765
+ * const geoZones =
766
+ * await fulfillmentModuleService.updateGeoZones({
767
+ * id: "fgz_123",
768
+ * type: "country",
769
+ * country_code: "us",
770
+ * })
771
+ */
156
772
  updateGeoZones(data: UpdateGeoZoneDTO, sharedContext?: Context): Promise<GeoZoneDTO>;
157
773
  /**
158
- * Delete a geo zone
159
- * @param ids
160
- * @param sharedContext
774
+ * This method deletes geo zones by their IDs.
775
+ *
776
+ * @param {string[]} ids - The IDs of the geo zones.
777
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
778
+ * @returns {Promise<void>} Resolves when the geo zones are deleted.
779
+ *
780
+ * @example
781
+ * await fulfillmentModuleService.deleteGeoZones([
782
+ * "fgz_123",
783
+ * "fgz_321",
784
+ * ])
161
785
  */
162
786
  deleteGeoZones(ids: string[], sharedContext?: Context): Promise<void>;
787
+ /**
788
+ * This method deletes a geo zone by its ID.
789
+ *
790
+ * @param {string} id - The ID of the geo zone.
791
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
792
+ * @returns {Promise<void>} Resolves when the geo zone is deleted.
793
+ *
794
+ * @example
795
+ * await fulfillmentModuleService.deleteGeoZones("fgz_123")
796
+ */
163
797
  deleteGeoZones(id: string, sharedContext?: Context): Promise<void>;
164
798
  /**
165
- * Soft delete geo zones
166
- * @param geoZoneIds
167
- * @param config
168
- * @param sharedContext
799
+ * This method soft deletes geo zones by their IDs.
800
+ *
801
+ * @param {string[]} geoZoneIds - The IDs of the geo zones.
802
+ * @param {SoftDeleteReturn<TReturnableLinkableKeys>} config - An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
803
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
804
+ * @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were also soft deleted.
805
+ * If there are no related records, the promise resolves to `void`.
806
+ *
807
+ * @example
808
+ * await fulfillmentModuleService.softDeleteGeoZones([
809
+ * "fgz_123",
810
+ * "fgz_321",
811
+ * ])
169
812
  */
170
813
  softDeleteGeoZones<TReturnableLinkableKeys extends string = string>(geoZoneIds: string[], config?: SoftDeleteReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
171
814
  /**
172
- * Restore geo zones
173
- * @param geoZoneIds
174
- * @param config
175
- * @param sharedContext
815
+ * This method restores soft deleted geo zones by their IDs.
816
+ *
817
+ * @param {string[]} geoZoneIds - The IDs of the geo zones.
818
+ * @param {RestoreReturn<TReturnableLinkableKeys>} config - Configurations determining which relations to restore along with each of the geo zones. You can pass to its `returnLinkableKeys`
819
+ * property any of the geo zone's relation attribute names, such as `{type relation name}`.
820
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
821
+ * @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were restored.
822
+ * If there are no related records restored, the promise resolves to `void`.
823
+ *
824
+ * @example
825
+ * await fulfillmentModuleService.restoreGeoZones([
826
+ * "fgz_123",
827
+ * "fgz_321",
828
+ * ])
176
829
  */
177
830
  restoreGeoZones<TReturnableLinkableKeys extends string = string>(geoZoneIds: string[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
178
831
  /**
179
- * Retrieve a shipping option
180
- * @param id
181
- * @param config
182
- * @param sharedContext
832
+ * This method retrieves a shipping option by its ID.
833
+ *
834
+ * @param {string} id - The ID of the shipping option.
835
+ * @param {FindConfig<ShippingOptionDTO>} config - The configurations determining how the shipping option is retrieved. Its properties, such as `select` or `relations`, accept the
836
+ * attributes or relations associated with a shipping option.
837
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
838
+ * @returns {Promise<ShippingOptionDTO>} The retrieved shipping option.
839
+ *
840
+ * @example
841
+ * A simple example that retrieves a shipping option by its ID:
842
+ *
843
+ * ```ts
844
+ * const shippingOption =
845
+ * await fulfillmentModuleService.retrieveShippingOption(
846
+ * "so_123"
847
+ * )
848
+ * ```
849
+ *
850
+ * To specify relations that should be retrieved:
851
+ *
852
+ * ```ts
853
+ * const shippingOption =
854
+ * await fulfillmentModuleService.retrieveShippingOption(
855
+ * "so_123",
856
+ * {
857
+ * relations: ["fulfillments"],
858
+ * }
859
+ * )
860
+ * ```
183
861
  */
184
862
  retrieveShippingOption(id: string, config?: FindConfig<ShippingOptionDTO>, sharedContext?: Context): Promise<ShippingOptionDTO>;
185
863
  /**
186
- * List shipping options
187
- * @param filters
188
- * @param config
189
- * @param sharedContext
864
+ * This method retrieves a paginated list of shipping options based on optional filters and configuration.
865
+ *
866
+ * @param {FilterableShippingOptionProps} filters - The filters to apply on the retrieved shipping options.
867
+ * @param {FindConfig<ShippingOptionDTO>} config - The configurations determining how the shipping option is retrieved. Its properties, such as `select` or `relations`, accept the
868
+ * attributes or relations associated with a shipping option.
869
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
870
+ * @returns {Promise<ShippingOptionDTO[]>} The list of shipping options.
871
+ *
872
+ * @example
873
+ * To retrieve a list of shipping options using their IDs:
874
+ *
875
+ * ```ts
876
+ * const shippingOptions =
877
+ * await fulfillmentModuleService.listShippingOptions({
878
+ * id: ["so_123", "so_321"],
879
+ * })
880
+ * ```
881
+ *
882
+ * To specify relations that should be retrieved within the shipping option:
883
+ *
884
+ * ```ts
885
+ * const shippingOptions =
886
+ * await fulfillmentModuleService.listShippingOptions(
887
+ * {
888
+ * id: ["so_123", "so_321"],
889
+ * },
890
+ * {
891
+ * relations: ["fulfillments"],
892
+ * }
893
+ * )
894
+ * ```
895
+ *
896
+ * By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
897
+ *
898
+ * ```ts
899
+ * const shippingOptions =
900
+ * await fulfillmentModuleService.listShippingOptions(
901
+ * {
902
+ * id: ["so_123", "so_321"],
903
+ * },
904
+ * {
905
+ * relations: ["fulfillments"],
906
+ * take: 20,
907
+ * skip: 2,
908
+ * }
909
+ * )
910
+ * ```
190
911
  */
191
912
  listShippingOptions(filters?: FilterableShippingOptionProps, config?: FindConfig<ShippingOptionDTO>, sharedContext?: Context): Promise<ShippingOptionDTO[]>;
192
913
  /**
193
- * List shipping options and eventually filter the result based on the context and their rules
194
- * @param filters
195
- * @param config
196
- * @param sharedContext
914
+ * This method retrieves a paginated list of shipping options based on the provided context.
915
+ *
916
+ * @param {FilterableShippingOptionForContextProps} filters - The context of the how the shipping option is being used. It
917
+ * acts as a filter for the retrieved shipping options.
918
+ * @param {FindConfig<ShippingOptionDTO>} config - The configurations determining how the shipping option is retrieved. Its properties, such as `select` or `relations`, accept the
919
+ * attributes or relations associated with a shipping option.
920
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
921
+ * @returns {Promise<ShippingOptionDTO[]>} The list of shipping options.
922
+ *
923
+ * @example
924
+ * To retrieve a list of shipping options matching a context:
925
+ *
926
+ * ```ts
927
+ * const shippingOptions =
928
+ * await fulfillmentModuleService.listShippingOptionsForContext(
929
+ * {
930
+ * fulfillment_set_id: ["fuset_123"],
931
+ * address: {
932
+ * country_code: "us",
933
+ * },
934
+ * }
935
+ * )
936
+ * ```
937
+ *
938
+ * To specify relations that should be retrieved within the shipping option:
939
+ *
940
+ * ```ts
941
+ * const shippingOptions =
942
+ * await fulfillmentModuleService.listShippingOptionsForContext(
943
+ * {
944
+ * fulfillment_set_id: ["fuset_123"],
945
+ * address: {
946
+ * country_code: "us",
947
+ * },
948
+ * },
949
+ * {
950
+ * relations: ["fulfillments"],
951
+ * }
952
+ * )
953
+ * ```
954
+ *
955
+ * By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
956
+ *
957
+ * ```ts
958
+ * const shippingOptions =
959
+ * await fulfillmentModuleService.listShippingOptionsForContext(
960
+ * {
961
+ * fulfillment_set_id: ["fuset_123"],
962
+ * address: {
963
+ * country_code: "us",
964
+ * },
965
+ * },
966
+ * {
967
+ * relations: ["fulfillments"],
968
+ * take: 20,
969
+ * skip: 2,
970
+ * }
971
+ * )
972
+ * ```
197
973
  */
198
974
  listShippingOptionsForContext(filters: FilterableShippingOptionForContextProps, config?: FindConfig<ShippingOptionDTO>, sharedContext?: Context): Promise<ShippingOptionDTO[]>;
199
975
  /**
200
- * List and count shipping options without taking into account the context
201
- * @param filters
202
- * @param config
203
- * @param sharedContext
976
+ * This method retrieves a paginated list of shipping options along with the total count of available shipping options satisfying the provided filters.
977
+ *
978
+ * @param {Omit<FilterableShippingOptionProps, "context">} filters - Construct a type with the properties of T except for those in type K.
979
+ * @param {FindConfig<ShippingOptionDTO>} config - The configurations determining how the shipping option is retrieved. Its properties, such as `select` or `relations`, accept the
980
+ * attributes or relations associated with a shipping option.
981
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
982
+ * @returns {Promise<[ShippingOptionDTO[], number]>} The list of shipping options along with their total count.
983
+ *
984
+ * @example
985
+ * To retrieve a list of shipping options using their IDs:
986
+ *
987
+ * ```ts
988
+ * const [shippingOptions, count] =
989
+ * await fulfillmentModuleService.listAndCountShippingOptions({
990
+ * id: ["so_123", "so_321"],
991
+ * })
992
+ * ```
993
+ *
994
+ * To specify relations that should be retrieved within the shipping option:
995
+ *
996
+ * ```ts
997
+ * const [shippingOptions, count] =
998
+ * await fulfillmentModuleService.listAndCountShippingOptions(
999
+ * {
1000
+ * id: ["so_123", "so_321"],
1001
+ * },
1002
+ * {
1003
+ * relations: ["fulfillments"],
1004
+ * }
1005
+ * )
1006
+ * ```
1007
+ *
1008
+ * By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
1009
+ *
1010
+ * ```ts
1011
+ * const [shippingOptions, count] =
1012
+ * await fulfillmentModuleService.listAndCountShippingOptions(
1013
+ * {
1014
+ * id: ["so_123", "so_321"],
1015
+ * },
1016
+ * {
1017
+ * relations: ["fulfillments"],
1018
+ * take: 20,
1019
+ * skip: 2,
1020
+ * }
1021
+ * )
1022
+ * ```
204
1023
  */
205
1024
  listAndCountShippingOptions(filters?: Omit<FilterableShippingOptionProps, "context">, config?: FindConfig<ShippingOptionDTO>, sharedContext?: Context): Promise<[ShippingOptionDTO[], number]>;
206
1025
  /**
207
- * Create a new shipping option
208
- * @param data
209
- * @param sharedContext
1026
+ * This method creates shipping options.
1027
+ *
1028
+ * @param {CreateShippingOptionDTO[]} data - The shipping options to be created.
1029
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1030
+ * @returns {Promise<ShippingOptionDTO[]>} The created shipping options.
1031
+ *
1032
+ * @example
1033
+ * const shippingOptions =
1034
+ * await fulfillmentModuleService.createShippingOptions([
1035
+ * {
1036
+ * name: "DHL Express Shipping",
1037
+ * price_type: "flat",
1038
+ * service_zone_id: "serzo_123",
1039
+ * shipping_profile_id: "sp_123",
1040
+ * provider_id: "dhl",
1041
+ * type: {
1042
+ * label: "Express",
1043
+ * description: "Ship in 24 hours",
1044
+ * code: "express",
1045
+ * },
1046
+ * },
1047
+ * {
1048
+ * name: "Webshipper Shipping",
1049
+ * price_type: "flat",
1050
+ * service_zone_id: "serzo_321",
1051
+ * shipping_profile_id: "sp_321",
1052
+ * provider_id: "webshipper",
1053
+ * type: {
1054
+ * label: "Express",
1055
+ * description: "Ship in 24 hours",
1056
+ * code: "express",
1057
+ * },
1058
+ * },
1059
+ * ])
210
1060
  */
211
1061
  createShippingOptions(data: CreateShippingOptionDTO[], sharedContext?: Context): Promise<ShippingOptionDTO[]>;
1062
+ /**
1063
+ * This method creates a shipping option.
1064
+ *
1065
+ * @param {CreateShippingOptionDTO} data - The shipping option to be created.
1066
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1067
+ * @returns {Promise<ShippingOptionDTO>} The created shipping option.
1068
+ *
1069
+ * @example
1070
+ * const shippingOption =
1071
+ * await fulfillmentModuleService.createShippingOptions({
1072
+ * name: "DHL Express Shipping",
1073
+ * price_type: "flat",
1074
+ * service_zone_id: "serzo_123",
1075
+ * shipping_profile_id: "sp_123",
1076
+ * provider_id: "dhl",
1077
+ * type: {
1078
+ * label: "Express",
1079
+ * description: "Ship in 24 hours",
1080
+ * code: "express",
1081
+ * },
1082
+ * })
1083
+ */
212
1084
  createShippingOptions(data: CreateShippingOptionDTO, sharedContext?: Context): Promise<ShippingOptionDTO>;
213
1085
  /**
214
- * Update a shipping option
215
- * @param data
216
- * @param sharedContext
1086
+ * This method updates an existing shipping option.
1087
+ *
1088
+ * @param {string} id - The ID of the shipping option.
1089
+ * @param {UpdateShippingOptionDTO} data - The attributes to update in the shipping option.
1090
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1091
+ * @returns {Promise<ShippingOptionDTO>} The updated shipping option.
1092
+ *
1093
+ * @example
1094
+ * const shippingOption =
1095
+ * await fulfillmentModuleService.updateShippingOptions(
1096
+ * "so_123",
1097
+ * {
1098
+ * name: "Express shipping",
1099
+ * }
1100
+ * )
1101
+ */
1102
+ updateShippingOptions(id: string, data: UpdateShippingOptionDTO, sharedContext?: Context): Promise<ShippingOptionDTO>;
1103
+ /**
1104
+ * This method updates existing shipping options matching the specified filters.
1105
+ *
1106
+ * @param {FilterableShippingOptionProps} selector - The filters specifying which shipping options to update.
1107
+ * @param {UpdateShippingOptionDTO} data - The attributes to update in the shipping option.
1108
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1109
+ * @returns {Promise<ShippingOptionDTO[]>} The updated shipping options.
1110
+ *
1111
+ * @example
1112
+ * const shippingOptions =
1113
+ * await fulfillmentModuleService.updateShippingOptions(
1114
+ * {
1115
+ * id: ["so_123", "so_321"],
1116
+ * },
1117
+ * {
1118
+ * name: "Express Shipping",
1119
+ * }
1120
+ * )
217
1121
  */
218
- updateShippingOptions(data: UpdateShippingOptionDTO[], sharedContext?: Context): Promise<ShippingOptionDTO[]>;
219
- updateShippingOptions(data: UpdateShippingOptionDTO, sharedContext?: Context): Promise<ShippingOptionDTO>;
1122
+ updateShippingOptions(selector: FilterableShippingOptionProps, data: UpdateShippingOptionDTO, sharedContext?: Context): Promise<ShippingOptionDTO[]>;
220
1123
  /**
221
- * Delete a shippingOption
222
- * @param ids
223
- * @param sharedContext
1124
+ * This method updates or creates a shipping option if it doesn't exist.
1125
+ *
1126
+ * @param {UpsertShippingOptionDTO} data - The attributes in the shipping option to be created or updated.
1127
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1128
+ * @returns {Promise<ShippingOptionDTO>} The created or updated shipping option.
1129
+ *
1130
+ * @example
1131
+ * const shippingOptions =
1132
+ * await fulfillmentModuleService.upsertShippingOptions({
1133
+ * id: "so_123",
1134
+ * name: "Express Shipping",
1135
+ * })
1136
+ */
1137
+ upsertShippingOptions(data: UpsertShippingOptionDTO, sharedContext?: Context): Promise<ShippingOptionDTO>;
1138
+ /**
1139
+ * This method updates or creates shipping options if they don't exist.
1140
+ *
1141
+ * @param {UpsertShippingOptionDTO[]} data - The attributes in the shipping options to be created or updated.
1142
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1143
+ * @returns {Promise<ShippingOptionDTO[]>} The created or updated shipping options.
1144
+ *
1145
+ * @example
1146
+ * const shippingOptions =
1147
+ * await fulfillmentModuleService.upsertShippingOptions([
1148
+ * {
1149
+ * id: "so_123",
1150
+ * name: "Express Shipping",
1151
+ * },
1152
+ * {
1153
+ * name: "Express Shipping",
1154
+ * price_type: "flat",
1155
+ * service_zone_id: "serzo_123",
1156
+ * shipping_profile_id: "sp_123",
1157
+ * provider_id: "webshipper",
1158
+ * type: {
1159
+ * label: "Express",
1160
+ * description: "express shipping",
1161
+ * code: "express",
1162
+ * },
1163
+ * },
1164
+ * ])
1165
+ */
1166
+ upsertShippingOptions(data: UpsertShippingOptionDTO[], sharedContext?: Context): Promise<ShippingOptionDTO[]>;
1167
+ /**
1168
+ * This method deletes shipping options by their IDs.
1169
+ *
1170
+ * @param {string[]} ids - The IDs of the shipping options.
1171
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1172
+ * @returns {Promise<void>} Resolves when the shipping options are deleted successfully.
1173
+ *
1174
+ * @example
1175
+ * await fulfillmentModuleService.deleteShippingOptions([
1176
+ * "so_123",
1177
+ * "so_321",
1178
+ * ])
224
1179
  */
225
1180
  deleteShippingOptions(ids: string[], sharedContext?: Context): Promise<void>;
1181
+ /**
1182
+ * This method deletes a shipping option by its ID.
1183
+ *
1184
+ * @param {string} id - The ID of the shipping option.
1185
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1186
+ * @returns {Promise<void>} Resolves when the shipping option is deleted successfully.
1187
+ *
1188
+ * @example
1189
+ * await fulfillmentModuleService.deleteShippingOptions("so_123")
1190
+ */
226
1191
  deleteShippingOptions(id: string, sharedContext?: Context): Promise<void>;
227
1192
  /**
228
- * Soft delete shipping options
229
- * @param shippingOptionIds
230
- * @param config
231
- * @param sharedContext
1193
+ * This method soft deletes shipping option by their IDs.
1194
+ *
1195
+ * @param {string[]} shippingOptionIds - The IDs of the shipping options.
1196
+ * @param {SoftDeleteReturn<TReturnableLinkableKeys>} config - An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
1197
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1198
+ * @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were also soft deleted.
1199
+ * If there are no related records, the promise resolves to `void`.
1200
+ *
1201
+ * @example
1202
+ * await fulfillmentModuleService.softDeleteShippingOptions([
1203
+ * "so_123",
1204
+ * "so_321",
1205
+ * ])
232
1206
  */
233
1207
  softDeleteShippingOptions<TReturnableLinkableKeys extends string = string>(shippingOptionIds: string[], config?: SoftDeleteReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
234
1208
  /**
235
- * Restore shipping options
236
- * @param shippingOptionIds
237
- * @param config
238
- * @param sharedContext
1209
+ * This method restores soft deleted shipping options by their IDs.
1210
+ *
1211
+ * @param {string[]} shippingOptionIds - The list of {summary}
1212
+ * @param {RestoreReturn<TReturnableLinkableKeys>} config - Configurations determining which relations to restore along with each of the shipping options. You can pass to its `returnLinkableKeys`
1213
+ * property any of the shipping option's relation attribute names.
1214
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1215
+ * @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were restored.
1216
+ * If there are no related records restored, the promise resolves to `void`.
1217
+ *
1218
+ * @example
1219
+ * await fulfillmentModuleService.restoreShippingOptions([
1220
+ * "so_123",
1221
+ * "so_321",
1222
+ * ])
239
1223
  */
240
1224
  restoreShippingOptions<TReturnableLinkableKeys extends string = string>(shippingOptionIds: string[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
241
1225
  /**
242
- * Retrieve a shipping profile
243
- * @param id
244
- * @param config
245
- * @param sharedContext
1226
+ * This method retrieves a shipping profile by its ID.
1227
+ *
1228
+ * @param {string} id - The ID of the shipping profile.
1229
+ * @param {FindConfig<ShippingProfileDTO>} config - The configurations determining how the shipping profile is retrieved. Its properties, such as `select` or `relations`, accept the
1230
+ * attributes or relations associated with a shipping profile.
1231
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1232
+ * @returns {Promise<ShippingProfileDTO>} The retrieved shipping profile.
1233
+ *
1234
+ * @example
1235
+ * A simple example that retrieves a shipping profile by its ID:
1236
+ *
1237
+ * ```ts
1238
+ * const shippingProfile =
1239
+ * await fulfillmentModuleService.retrieveShippingProfile(
1240
+ * "sp_123"
1241
+ * )
1242
+ * ```
1243
+ *
1244
+ * To specify relations that should be retrieved:
1245
+ *
1246
+ * ```ts
1247
+ * const shippingProfile =
1248
+ * await fulfillmentModuleService.retrieveShippingProfile(
1249
+ * "sp_123",
1250
+ * {
1251
+ * relations: ["options"],
1252
+ * }
1253
+ * )
1254
+ * ```
246
1255
  */
247
1256
  retrieveShippingProfile(id: string, config?: FindConfig<ShippingProfileDTO>, sharedContext?: Context): Promise<ShippingProfileDTO>;
248
1257
  /**
249
- * List shipping profiles
250
- * @param filters
251
- * @param config
252
- * @param sharedContext
1258
+ * This method retrieves a paginated list of shipping profiles based on optional filters and configuration.
1259
+ *
1260
+ * @param {FilterableShippingProfileProps} filters - The filters to apply on the retrieved shipping profiles.
1261
+ * @param {FindConfig<ShippingProfileDTO>} config - The configurations determining how the shipping profile is retrieved. Its properties, such as `select` or `relations`, accept the
1262
+ * attributes or relations associated with a shipping profile.
1263
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1264
+ * @returns {Promise<ShippingProfileDTO[]>} The list of shipping profiles.
1265
+ *
1266
+ * @example
1267
+ * To retrieve a list of shipping profiles using their IDs:
1268
+ *
1269
+ * ```ts
1270
+ * const shippingProfiles =
1271
+ * await fulfillmentModuleService.listShippingProfiles({
1272
+ * id: ["sp_123", "sp_321"],
1273
+ * })
1274
+ * ```
1275
+ *
1276
+ * To specify relations that should be retrieved within the shipping profile:
1277
+ *
1278
+ * ```ts
1279
+ * const shippingProfiles =
1280
+ * await fulfillmentModuleService.listShippingProfiles(
1281
+ * {
1282
+ * id: ["sp_123", "sp_321"],
1283
+ * },
1284
+ * {
1285
+ * relations: ["shipping_options"],
1286
+ * }
1287
+ * )
1288
+ * ```
1289
+ *
1290
+ * By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
1291
+ *
1292
+ * ```ts
1293
+ * const shippingProfiles =
1294
+ * await fulfillmentModuleService.listShippingProfiles(
1295
+ * {
1296
+ * id: ["sp_123", "sp_321"],
1297
+ * },
1298
+ * {
1299
+ * relations: ["shipping_options"],
1300
+ * take: 20,
1301
+ * skip: 2,
1302
+ * }
1303
+ * )
1304
+ * ```
253
1305
  */
254
1306
  listShippingProfiles(filters?: FilterableShippingProfileProps, config?: FindConfig<ShippingProfileDTO>, sharedContext?: Context): Promise<ShippingProfileDTO[]>;
255
1307
  /**
256
- * List and count shipping profiles
257
- * @param filters
258
- * @param config
259
- * @param sharedContext
1308
+ * This method retrieves a paginated list of shipping profiles along with the total count of available shipping profiles satisfying the provided filters.
1309
+ *
1310
+ * @param {FilterableShippingProfileProps} filters - The filters to apply on the retrieved shipping profiles.
1311
+ * @param {FindConfig<ShippingProfileDTO>} config - The configurations determining how the shipping profile is retrieved. Its properties, such as `select` or `relations`, accept the
1312
+ * attributes or relations associated with a shipping profile.
1313
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1314
+ * @returns {Promise<[ShippingProfileDTO[], number]>} The list of shipping profiles along with their total count.
1315
+ *
1316
+ * @example
1317
+ * To retrieve a list of shipping profiles using their IDs:
1318
+ *
1319
+ * ```ts
1320
+ * const [shippingProfiles, count] =
1321
+ * await fulfillmentModuleService.listAndCountShippingProfiles(
1322
+ * {
1323
+ * id: ["sp_123", "sp_321"],
1324
+ * }
1325
+ * )
1326
+ * ```
1327
+ *
1328
+ * To specify relations that should be retrieved within the shipping profile:
1329
+ *
1330
+ * ```ts
1331
+ * const [shippingProfiles, count] =
1332
+ * await fulfillmentModuleService.listAndCountShippingProfiles(
1333
+ * {
1334
+ * id: ["sp_123", "sp_321"],
1335
+ * },
1336
+ * {
1337
+ * relations: ["shipping_options"],
1338
+ * }
1339
+ * )
1340
+ * ```
1341
+ *
1342
+ * By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
1343
+ *
1344
+ * ```ts
1345
+ * const [shippingProfiles, count] =
1346
+ * await fulfillmentModuleService.listAndCountShippingProfiles(
1347
+ * {
1348
+ * id: ["sp_123", "sp_321"],
1349
+ * },
1350
+ * {
1351
+ * relations: ["shipping_options"],
1352
+ * take: 20,
1353
+ * skip: 2,
1354
+ * }
1355
+ * )
1356
+ * ```
260
1357
  */
261
1358
  listAndCountShippingProfiles(filters?: FilterableShippingProfileProps, config?: FindConfig<ShippingProfileDTO>, sharedContext?: Context): Promise<[ShippingProfileDTO[], number]>;
262
1359
  /**
263
- * Create a new shipping profile
264
- * @param data
265
- * @param sharedContext
1360
+ * This method creates shipping profiles.
1361
+ *
1362
+ * @param {CreateShippingProfileDTO[]} data - The shipping profiles to be created.
1363
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1364
+ * @returns {Promise<ShippingProfileDTO[]>} The created shipping profiles.
1365
+ *
1366
+ * @example
1367
+ * const shippingProfiles =
1368
+ * await fulfillmentModuleService.createShippingProfiles([
1369
+ * {
1370
+ * name: "Default",
1371
+ * },
1372
+ * {
1373
+ * name: "Digital",
1374
+ * },
1375
+ * ])
266
1376
  */
267
1377
  createShippingProfiles(data: CreateShippingProfileDTO[], sharedContext?: Context): Promise<ShippingProfileDTO[]>;
1378
+ /**
1379
+ * This method creates a shipping profile.
1380
+ *
1381
+ * @param {CreateShippingProfileDTO} data - The shipping profile to be created.
1382
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1383
+ * @returns {Promise<ShippingProfileDTO>} The created shipping profile.
1384
+ *
1385
+ * @example
1386
+ * const shippingProfile =
1387
+ * await fulfillmentModuleService.createShippingProfiles({
1388
+ * name: "Default",
1389
+ * })
1390
+ */
268
1391
  createShippingProfiles(data: CreateShippingProfileDTO, sharedContext?: Context): Promise<ShippingProfileDTO>;
269
1392
  /**
270
- * Update a shipping profile
271
- * @param data
272
- * @param sharedContext
1393
+ * This method updates existing shipping profiles.
1394
+ *
1395
+ * @param {CreateShippingProfileDTO[]} data - The shipping profiles to be created.
1396
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1397
+ * @returns {Promise<ShippingProfileDTO[]>} The updated shipping profiles.
1398
+ *
1399
+ * @example
1400
+ * const shippingProfiles =
1401
+ * await fulfillmentModuleService.updateShippingProfiles([
1402
+ * {
1403
+ * id: "sp_123",
1404
+ * name: "Default",
1405
+ * },
1406
+ * {
1407
+ * id: "sp_321",
1408
+ * name: "Digital",
1409
+ * },
1410
+ * ])
273
1411
  */
274
1412
  updateShippingProfiles(data: UpdateShippingProfileDTO[], sharedContext?: Context): Promise<ShippingProfileDTO[]>;
1413
+ /**
1414
+ * This method updates an existing shipping profiles.
1415
+ *
1416
+ * @param {CreateShippingProfileDTO} data - The shipping profile to be created.
1417
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1418
+ * @returns {Promise<ShippingProfileDTO>} The updated shipping profiles.
1419
+ *
1420
+ * @example
1421
+ * const shippingProfiles =
1422
+ * await fulfillmentModuleService.updateShippingProfiles({
1423
+ * id: "sp_123",
1424
+ * name: "Default",
1425
+ * })
1426
+ */
275
1427
  updateShippingProfiles(data: UpdateShippingProfileDTO, sharedContext?: Context): Promise<ShippingProfileDTO>;
276
1428
  /**
277
- * Delete a shipping profile
278
- * @param ids
279
- * @param sharedContext
1429
+ * This method deletes shipping profiles by their IDs.
1430
+ *
1431
+ * @param {string[]} ids - The IDs of the shipping profiles.
1432
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1433
+ * @returns {Promise<void>} Resolves when the shipping profiles are deleted.
1434
+ *
1435
+ * @example
1436
+ * await fulfillmentModuleService.deleteShippingProfiles([
1437
+ * "sp_123",
1438
+ * "sp_321",
1439
+ * ])
280
1440
  */
281
1441
  deleteShippingProfiles(ids: string[], sharedContext?: Context): Promise<void>;
1442
+ /**
1443
+ * This method deletes a shipping profile by its ID.
1444
+ *
1445
+ * @param {string} id - The ID of the shipping profile.
1446
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1447
+ * @returns {Promise<void>} Resolves when the shipping profile is deleted.
1448
+ *
1449
+ * @example
1450
+ * await fulfillmentModuleService.deleteShippingProfiles(
1451
+ * "sp_123"
1452
+ * )
1453
+ */
282
1454
  deleteShippingProfiles(id: string, sharedContext?: Context): Promise<void>;
283
1455
  /**
284
- * Soft delete shipping profiles
285
- * @param shippingProfileIds
286
- * @param config
287
- * @param sharedContext
1456
+ * This method soft deletes shipping profiles by their IDs.
1457
+ *
1458
+ * @param {string[]} shippingProfileIds - The IDs of the shipping profiles.
1459
+ * @param {SoftDeleteReturn<TReturnableLinkableKeys>} config - An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
1460
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1461
+ * @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were also soft deleted.
1462
+ * If there are no related records, the promise resolves to `void`.
1463
+ *
1464
+ * @example
1465
+ * await fulfillmentModuleService.softDeleteShippingProfiles([
1466
+ * "sp_123",
1467
+ * "sp_321",
1468
+ * ])
288
1469
  */
289
1470
  softDeleteShippingProfiles<TReturnableLinkableKeys extends string = string>(shippingProfileIds: string[], config?: SoftDeleteReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
290
1471
  /**
291
- * Restore shipping profiles
292
- * @param shippingProfileIds
293
- * @param config
294
- * @param sharedContext
1472
+ * This method restores soft deleted shipping profiles by their IDs.
1473
+ *
1474
+ * @param {string[]} shippingProfileIds - The IDs of the shipping profiles.
1475
+ * @param {RestoreReturn<TReturnableLinkableKeys>} config - Configurations determining which relations to restore along with each of the shipping profiles. You can pass to its `returnLinkableKeys`
1476
+ * property any of the shipping profile's relation attribute names, such as `{type relation name}`.
1477
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1478
+ * @returns {Promise<void | Record<string, string[]>>} An object that includes the IDs of related records that were restored.
1479
+ * If there are no related records restored, the promise resolves to `void`.
1480
+ *
1481
+ * @example
1482
+ * await fulfillmentModuleService.restoreShippingProfiles([
1483
+ * "sp_123",
1484
+ * "sp_321",
1485
+ * ])
295
1486
  */
296
1487
  restoreShippingProfiles<TReturnableLinkableKeys extends string = string>(shippingProfileIds: string[], config?: RestoreReturn<TReturnableLinkableKeys>, sharedContext?: Context): Promise<Record<string, string[]> | void>;
297
1488
  /**
298
- * Retrieve a shipping option rule
299
- * @param id
300
- * @param config
301
- * @param sharedContext
1489
+ * This method retrieves a shipping option rule by its ID.
1490
+ *
1491
+ * @param {string} id - The ID of the shipping option rule.
1492
+ * @param {FindConfig<ShippingOptionRuleDTO>} config - The configurations determining how the shipping option rule is retrieved. Its properties, such as `select` or `relations`, accept the
1493
+ * attributes or relations associated with a shipping option rule.
1494
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1495
+ * @returns {Promise<ShippingOptionRuleDTO>} The retrieved shipping option rule.
1496
+ *
1497
+ * @example
1498
+ * A simple example that retrieves a shipping option rule by its ID:
1499
+ *
1500
+ * ```ts
1501
+ * const shippingOptionRule =
1502
+ * await fulfillmentModuleService.retrieveShippingOptionRule(
1503
+ * "sorul_123"
1504
+ * )
1505
+ * ```
1506
+ *
1507
+ * To specify relations that should be retrieved:
1508
+ *
1509
+ * ```ts
1510
+ * const shippingOptionRule =
1511
+ * await fulfillmentModuleService.retrieveShippingOptionRule(
1512
+ * "sorul_123",
1513
+ * {
1514
+ * relations: ["shipping_option"],
1515
+ * }
1516
+ * )
1517
+ * ```
302
1518
  */
303
1519
  retrieveShippingOptionRule(id: string, config?: FindConfig<ShippingOptionRuleDTO>, sharedContext?: Context): Promise<ShippingOptionRuleDTO>;
304
1520
  /**
305
- * List shipping option rules
306
- * @param filters
307
- * @param config
308
- * @param sharedContext
1521
+ * This method retrieves a paginated list of shipping option rules based on optional filters and configuration.
1522
+ *
1523
+ * @param {FilterableShippingOptionRuleProps} filters - The filters to apply on the retrieved shipping option rules.
1524
+ * @param {FindConfig<ShippingOptionRuleDTO>} config - The configurations determining how the shipping option rule is retrieved. Its properties, such as `select` or `relations`, accept the
1525
+ * attributes or relations associated with a shipping option rule.
1526
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1527
+ * @returns {Promise<ShippingOptionRuleDTO[]>} The list of shipping option rules.
1528
+ *
1529
+ * @example
1530
+ * To retrieve a list of shipping option rules using their IDs:
1531
+ *
1532
+ * ```ts
1533
+ * const shippingOptionRules =
1534
+ * await fulfillmentModuleService.listShippingOptionRules({
1535
+ * id: ["sorul_123", "sorul_321"],
1536
+ * })
1537
+ * ```
1538
+ *
1539
+ * To specify relations that should be retrieved within the shipping option rule:
1540
+ *
1541
+ * ```ts
1542
+ * const shippingOptionRules =
1543
+ * await fulfillmentModuleService.listShippingOptionRules(
1544
+ * {
1545
+ * id: ["sorul_123", "sorul_321"],
1546
+ * },
1547
+ * {
1548
+ * relations: ["shipping_option"],
1549
+ * }
1550
+ * )
1551
+ * ```
1552
+ *
1553
+ * By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
1554
+ *
1555
+ * ```ts
1556
+ * const shippingOptionRules =
1557
+ * await fulfillmentModuleService.listShippingOptionRules(
1558
+ * {
1559
+ * id: ["sorul_123", "sorul_321"],
1560
+ * },
1561
+ * {
1562
+ * relations: ["shipping_option"],
1563
+ * take: 20,
1564
+ * skip: 2,
1565
+ * }
1566
+ * )
1567
+ * ```
309
1568
  */
310
1569
  listShippingOptionRules(filters?: FilterableShippingOptionRuleProps, config?: FindConfig<ShippingOptionRuleDTO>, sharedContext?: Context): Promise<ShippingOptionRuleDTO[]>;
311
1570
  /**
312
- * List and count shipping option rules
313
- * @param filters
314
- * @param config
315
- * @param sharedContext
1571
+ * This method retrieves a paginated list of shipping option rules along with the total count of available shipping option rules satisfying the provided filters.
1572
+ *
1573
+ * @param {FilterableShippingOptionRuleProps} filters - The filters to apply on the retrieved shipping option rules.
1574
+ * @param {FindConfig<ShippingOptionRuleDTO>} config - The configurations determining how the shipping option rule is retrieved. Its properties, such as `select` or `relations`, accept the
1575
+ * attributes or relations associated with a shipping option rule.
1576
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1577
+ * @returns {Promise<[ShippingOptionRuleDTO[], number]>} The list of shipping option rules along with their total count.
1578
+ *
1579
+ * @example
1580
+ * To retrieve a list of shipping option rules using their IDs:
1581
+ *
1582
+ * ```ts
1583
+ * const [shippingOptionRules, count] =
1584
+ * await fulfillmentModuleService.listAndCountShippingOptionRules(
1585
+ * {
1586
+ * id: ["sorul_123", "sorul_321"],
1587
+ * }
1588
+ * )
1589
+ * ```
1590
+ *
1591
+ * To specify relations that should be retrieved within the shipping option rule:
1592
+ *
1593
+ * ```ts
1594
+ * const [shippingOptionRules, count] =
1595
+ * await fulfillmentModuleService.listAndCountShippingOptionRules(
1596
+ * {
1597
+ * id: ["sorul_123", "sorul_321"],
1598
+ * },
1599
+ * {
1600
+ * relations: ["shipping_option"],
1601
+ * }
1602
+ * )
1603
+ * ```
1604
+ *
1605
+ * By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
1606
+ *
1607
+ * ```ts
1608
+ * const [shippingOptionRules, count] =
1609
+ * await fulfillmentModuleService.listAndCountShippingOptionRules(
1610
+ * {
1611
+ * id: ["sorul_123", "sorul_321"],
1612
+ * },
1613
+ * {
1614
+ * relations: ["shipping_option"],
1615
+ * take: 20,
1616
+ * skip: 2,
1617
+ * }
1618
+ * )
1619
+ * ```
316
1620
  */
317
1621
  listAndCountShippingOptionRules(filters?: FilterableShippingOptionRuleProps, config?: FindConfig<ShippingOptionRuleDTO>, sharedContext?: Context): Promise<[ShippingOptionRuleDTO[], number]>;
318
1622
  /**
319
- * Create a new shipping option rules
320
- * @param data
321
- * @param sharedContext
1623
+ * This method creates shipping option rules.
1624
+ *
1625
+ * @param {CreateShippingOptionRuleDTO[]} data - The shipping option rules to be created.
1626
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1627
+ * @returns {Promise<ShippingOptionRuleDTO[]>} The created shipping option rules.
1628
+ *
1629
+ * @example
1630
+ * const shippingOptionRules =
1631
+ * await fulfillmentModuleService.createShippingOptionRules([
1632
+ * {
1633
+ * attribute: "customer_group",
1634
+ * operator: "in",
1635
+ * value: "cg_vipgroup",
1636
+ * shipping_option_id: "so_123",
1637
+ * },
1638
+ * {
1639
+ * attribute: "total_weight",
1640
+ * operator: "lt",
1641
+ * value: "2000",
1642
+ * shipping_option_id: "so_321",
1643
+ * },
1644
+ * ])
322
1645
  */
323
1646
  createShippingOptionRules(data: CreateShippingOptionRuleDTO[], sharedContext?: Context): Promise<ShippingOptionRuleDTO[]>;
1647
+ /**
1648
+ * This method creates a shipping option rule.
1649
+ *
1650
+ * @param {CreateShippingOptionRuleDTO} data - The shipping option rule to be created.
1651
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1652
+ * @returns {Promise<ShippingOptionRuleDTO>} The created shipping option rule.
1653
+ *
1654
+ * @example
1655
+ * const shippingOptionRule =
1656
+ * await fulfillmentModuleService.createShippingOptionRules({
1657
+ * attribute: "customer_group",
1658
+ * operator: "in",
1659
+ * value: "cg_vipgroup",
1660
+ * shipping_option_id: "so_123",
1661
+ * })
1662
+ */
324
1663
  createShippingOptionRules(data: CreateShippingOptionRuleDTO, sharedContext?: Context): Promise<ShippingOptionRuleDTO>;
325
1664
  /**
326
- * Update a shipping option rule
327
- * @param data
328
- * @param sharedContext
1665
+ * This method updates existing shipping option rules.
1666
+ *
1667
+ * @param {UpdateShippingOptionRuleDTO[]} data - The attributes to update in the shipping option rules.
1668
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1669
+ * @returns {Promise<ShippingOptionRuleDTO[]>} The updated shipping option rules.
1670
+ *
1671
+ * @example
1672
+ * const shippingOptionRules =
1673
+ * await fulfillmentModuleService.updateShippingOptionRules([
1674
+ * {
1675
+ * id: "sorul_123",
1676
+ * operator: "in",
1677
+ * },
1678
+ * {
1679
+ * id: "sorul_321",
1680
+ * attribute: "customer_group",
1681
+ * value: "cp_vipgroup",
1682
+ * },
1683
+ * ])
329
1684
  */
330
1685
  updateShippingOptionRules(data: UpdateShippingOptionRuleDTO[], sharedContext?: Context): Promise<ShippingOptionRuleDTO[]>;
1686
+ /**
1687
+ * This method updates an existing shipping option rule.
1688
+ *
1689
+ * @param {UpdateShippingOptionRuleDTO} data - The attributes to update in the shipping option rule.
1690
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1691
+ * @returns {Promise<ShippingOptionRuleDTO>} The updated shipping option rule.
1692
+ *
1693
+ * @example
1694
+ * const shippingOptionRule =
1695
+ * await fulfillmentModuleService.updateShippingOptionRules({
1696
+ * id: "sorul_123",
1697
+ * operator: "in",
1698
+ * })
1699
+ */
331
1700
  updateShippingOptionRules(data: UpdateShippingOptionRuleDTO, sharedContext?: Context): Promise<ShippingOptionRuleDTO>;
332
1701
  /**
333
- * Delete a shipping option rule
334
- * @param ids
335
- * @param sharedContext
1702
+ * This method deletes shipping option rules by their IDs.
1703
+ *
1704
+ * @param {string[]} ids - The IDs of the shipping option rules.
1705
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1706
+ * @returns {Promise<void>} Resolves when the shipping option rules are deleted successfully.
1707
+ *
1708
+ * @example
1709
+ * await fulfillmentModuleService.deleteShippingOptionRules([
1710
+ * "sorul_123",
1711
+ * "sorul_321",
1712
+ * ])
336
1713
  */
337
1714
  deleteShippingOptionRules(ids: string[], sharedContext?: Context): Promise<void>;
1715
+ /**
1716
+ * This method deletes a shipping option by its ID.
1717
+ *
1718
+ * @param {string} id - The ID of the shipping option.
1719
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1720
+ * @returns {Promise<void>} Resolves when the shipping option is deleted successfully.
1721
+ *
1722
+ * @example
1723
+ * await fulfillmentModuleService.deleteShippingOptionRules(
1724
+ * "sorul_123"
1725
+ * )
1726
+ */
338
1727
  deleteShippingOptionRules(id: string, sharedContext?: Context): Promise<void>;
339
1728
  /**
340
- * Retrieve a shipping option type
341
- * @param id
342
- * @param config
343
- * @param sharedContext
1729
+ * This method retrieves a shipping option type by its ID.
1730
+ *
1731
+ * @param {string} id - The ID of the shipping option type.
1732
+ * @param {FindConfig<ShippingOptionTypeDTO>} config - The configurations determining how the shipping option type is retrieved. Its properties, such as `select` or `relations`, accept the
1733
+ * attributes or relations associated with a shipping option type.
1734
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1735
+ * @returns {Promise<ShippingOptionTypeDTO>} The retrieved shipping option type.
1736
+ *
1737
+ * @example
1738
+ * A simple example that retrieves a shipping option type by its ID:
1739
+ *
1740
+ * ```ts
1741
+ * const shippingOptionType =
1742
+ * await fulfillmentModuleService.retrieveShippingOptionType(
1743
+ * "sotype_123"
1744
+ * )
1745
+ * ```
1746
+ *
1747
+ * To specify relations that should be retrieved:
1748
+ *
1749
+ * ```ts
1750
+ * const shippingOptionType =
1751
+ * await fulfillmentModuleService.retrieveShippingOptionType(
1752
+ * "sotype_123",
1753
+ * {
1754
+ * relations: ["shipping_option"],
1755
+ * }
1756
+ * )
1757
+ * ```
344
1758
  */
345
1759
  retrieveShippingOptionType(id: string, config?: FindConfig<ShippingOptionTypeDTO>, sharedContext?: Context): Promise<ShippingOptionTypeDTO>;
346
1760
  /**
347
- * List shipping option types
348
- * @param filters
349
- * @param config
350
- * @param sharedContext
1761
+ * This method retrieves a paginated list of shipping option types based on optional filters and configuration.
1762
+ *
1763
+ * @param {FilterableShippingOptionTypeProps} filters - The filters to apply on the retrieved shipping option types.
1764
+ * @param {FindConfig<ShippingOptionTypeDTO>} config - The configurations determining how the shipping option type is retrieved. Its properties, such as `select` or `relations`, accept the
1765
+ * attributes or relations associated with a shipping option type.
1766
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1767
+ * @returns {Promise<ShippingOptionTypeDTO[]>} The list of shipping option types.
1768
+ *
1769
+ * @example
1770
+ * To retrieve a list of shipping option types using their IDs:
1771
+ *
1772
+ * ```ts
1773
+ * const shippingOptionTypes =
1774
+ * await fulfillmentModuleService.listShippingOptionTypes({
1775
+ * id: ["sotype_123", "sotype_321"],
1776
+ * })
1777
+ * ```
1778
+ *
1779
+ * To specify relations that should be retrieved within the shipping option type:
1780
+ *
1781
+ * ```ts
1782
+ * const shippingOptionTypes =
1783
+ * await fulfillmentModuleService.listShippingOptionTypes(
1784
+ * {
1785
+ * id: ["sotype_123", "sotype_321"],
1786
+ * },
1787
+ * {
1788
+ * relations: ["shipping_option"],
1789
+ * }
1790
+ * )
1791
+ * ```
1792
+ *
1793
+ * By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
1794
+ *
1795
+ * ```ts
1796
+ * const shippingOptionTypes =
1797
+ * await fulfillmentModuleService.listShippingOptionTypes(
1798
+ * {
1799
+ * id: ["sotype_123", "sotype_321"],
1800
+ * },
1801
+ * {
1802
+ * relations: ["shipping_option"],
1803
+ * take: 20,
1804
+ * skip: 2,
1805
+ * }
1806
+ * )
1807
+ * ```
351
1808
  */
352
1809
  listShippingOptionTypes(filters?: FilterableShippingOptionTypeProps, config?: FindConfig<ShippingOptionTypeDTO>, sharedContext?: Context): Promise<ShippingOptionTypeDTO[]>;
353
1810
  /**
354
- * List and count shipping options types
355
- * @param filters
356
- * @param config
357
- * @param sharedContext
1811
+ * This method retrieves a paginated list of shipping option types along with the total count of available shipping option types satisfying the provided filters.
1812
+ *
1813
+ * @param {FilterableShippingOptionTypeProps} filters - The filters to apply on the retrieved shipping option types.
1814
+ * @param {FindConfig<ShippingOptionTypeDTO>} config - The configurations determining how the shipping option type is retrieved. Its properties, such as `select` or `relations`, accept the
1815
+ * attributes or relations associated with a shipping option type.
1816
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1817
+ * @returns {Promise<[ShippingOptionTypeDTO[], number]>} The list of shipping option types along with their total count.
1818
+ *
1819
+ * @example
1820
+ * To retrieve a list of shipping option types using their IDs:
1821
+ *
1822
+ * ```ts
1823
+ * const [shippingOptionTypes, count] =
1824
+ * await fulfillmentModuleService.listAndCountShippingOptionTypes(
1825
+ * {
1826
+ * id: ["sotype_123", "sotype_321"],
1827
+ * }
1828
+ * )
1829
+ * ```
1830
+ *
1831
+ * To specify relations that should be retrieved within the shipping option type:
1832
+ *
1833
+ * ```ts
1834
+ * const [shippingOptionTypes, count] =
1835
+ * await fulfillmentModuleService.listAndCountShippingOptionTypes(
1836
+ * {
1837
+ * id: ["sotype_123", "sotype_321"],
1838
+ * },
1839
+ * {
1840
+ * relations: ["shipping_option"],
1841
+ * }
1842
+ * )
1843
+ * ```
1844
+ *
1845
+ * By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
1846
+ *
1847
+ * ```ts
1848
+ * const [shippingOptionTypes, count] =
1849
+ * await fulfillmentModuleService.listAndCountShippingOptionTypes(
1850
+ * {
1851
+ * id: ["sotype_123", "sotype_321"],
1852
+ * },
1853
+ * {
1854
+ * relations: ["shipping_option"],
1855
+ * take: 20,
1856
+ * skip: 2,
1857
+ * }
1858
+ * )
1859
+ * ```
358
1860
  */
359
1861
  listAndCountShippingOptionTypes(filters?: FilterableShippingOptionTypeProps, config?: FindConfig<ShippingOptionTypeDTO>, sharedContext?: Context): Promise<[ShippingOptionTypeDTO[], number]>;
360
1862
  /**
361
- * delete a shipping option type
362
- * @param ids
363
- * @param sharedContext
1863
+ * This method deletes shipping option types by their IDs.
1864
+ *
1865
+ * @param {string[]} ids - The IDs of the shipping option types.
1866
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1867
+ * @returns {Promise<void>} Resolves when the shipping option types are deleted successfully.
1868
+ *
1869
+ * @example
1870
+ * await fulfillmentModuleService.deleteShippingOptionTypes([
1871
+ * "sotype_123",
1872
+ * "sotype_321",
1873
+ * ])
364
1874
  */
365
1875
  deleteShippingOptionTypes(ids: string[], sharedContext?: Context): Promise<void>;
1876
+ /**
1877
+ * This method deletes a shipping option type by its ID.
1878
+ *
1879
+ * @param {string} id - The ID of the shipping option type.
1880
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1881
+ * @returns {Promise<void>} Resolves when the shipping option type is deleted.
1882
+ *
1883
+ * @example
1884
+ * await fulfillmentModuleService.deleteShippingOptionTypes(
1885
+ * "sotype_123"
1886
+ * )
1887
+ */
366
1888
  deleteShippingOptionTypes(id: string, sharedContext?: Context): Promise<void>;
367
1889
  /**
368
- * Retrieve a fulfillment
369
- * @param id
370
- * @param config
371
- * @param sharedContext
1890
+ * This method retrieves a fulfillment by its ID.
1891
+ *
1892
+ * @param {string} id - The ID of the fulfillment.
1893
+ * @param {FindConfig<FulfillmentDTO>} config - The configurations determining how the fulfillment is retrieved. Its properties, such as `select` or `relations`, accept the
1894
+ * attributes or relations associated with a fulfillment.
1895
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1896
+ * @returns {Promise<FulfillmentDTO>} The retrieved fulfillment.
1897
+ *
1898
+ * @example
1899
+ * A simple example that retrieves a fulfillment by its ID:
1900
+ *
1901
+ * ```ts
1902
+ * const fulfillment =
1903
+ * await fulfillmentModuleService.retrieveFulfillment(
1904
+ * "ful_123"
1905
+ * )
1906
+ * ```
1907
+ *
1908
+ * To specify relations that should be retrieved:
1909
+ *
1910
+ * ```ts
1911
+ * const fulfillment =
1912
+ * await fulfillmentModuleService.retrieveFulfillment(
1913
+ * "ful_123",
1914
+ * {
1915
+ * relations: ["shipping_option"],
1916
+ * }
1917
+ * )
1918
+ * ```
372
1919
  */
373
1920
  retrieveFulfillment(id: string, config?: FindConfig<FulfillmentDTO>, sharedContext?: Context): Promise<FulfillmentDTO>;
374
1921
  /**
375
- * List fulfillments
376
- * @param filters
377
- * @param config
378
- * @param sharedContext
1922
+ * This method retrieves a paginated list of fulfillments based on optional filters and configuration.
1923
+ *
1924
+ * @param {FilterableFulfillmentSetProps} filters - The filters to apply on the retrieved fulfillments.
1925
+ * @param {FindConfig<FulfillmentDTO>} config - The configurations determining how the fulfillment is retrieved. Its properties, such as `select` or `relations`, accept the
1926
+ * attributes or relations associated with a fulfillment.
1927
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1928
+ * @returns {Promise<FulfillmentDTO[]>} The list of fulfillments.
1929
+ *
1930
+ * @example
1931
+ * To retrieve a list of fulfillments using their IDs:
1932
+ *
1933
+ * ```ts
1934
+ * const fulfillments =
1935
+ * await fulfillmentModuleService.listFulfillments({
1936
+ * id: ["ful_123", "ful_321"],
1937
+ * })
1938
+ * ```
1939
+ *
1940
+ * To specify relations that should be retrieved within the fulfillment:
1941
+ *
1942
+ * ```ts
1943
+ * const fulfillments =
1944
+ * await fulfillmentModuleService.listFulfillments(
1945
+ * {
1946
+ * id: ["ful_123", "ful_321"],
1947
+ * },
1948
+ * {
1949
+ * relations: ["shipping_option"],
1950
+ * }
1951
+ * )
1952
+ * ```
1953
+ *
1954
+ * By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
1955
+ *
1956
+ * ```ts
1957
+ * const fulfillments =
1958
+ * await fulfillmentModuleService.listFulfillments(
1959
+ * {
1960
+ * id: ["ful_123", "ful_321"],
1961
+ * },
1962
+ * {
1963
+ * relations: ["shipping_option"],
1964
+ * take: 20,
1965
+ * skip: 2,
1966
+ * }
1967
+ * )
1968
+ * ```
379
1969
  */
380
1970
  listFulfillments(filters?: FilterableFulfillmentProps, config?: FindConfig<FulfillmentDTO>, sharedContext?: Context): Promise<FulfillmentDTO[]>;
381
1971
  /**
382
- * List and count fulfillments
383
- * @param filters
384
- * @param config
385
- * @param sharedContext
1972
+ * This method retrieves a paginated list of fulfillments along with the total count of available fulfillments satisfying the provided filters.
1973
+ *
1974
+ * @param {FilterableFulfillmentSetProps} filters - The filters to apply on the retrieved fulfillment sets.
1975
+ * @param {FindConfig<FulfillmentDTO>} config - The configurations determining how the fulfillment is retrieved. Its properties, such as `select` or `relations`, accept the
1976
+ * attributes or relations associated with a fulfillment.
1977
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
1978
+ * @returns {Promise<[FulfillmentDTO[], number]>} The list of fulfillments along with their total count.
1979
+ *
1980
+ * @example
1981
+ * To retrieve a list of fulfillments using their IDs:
1982
+ *
1983
+ * ```ts
1984
+ * const [fulfillments, count] =
1985
+ * await fulfillmentModuleService.listAndCountFulfillments(
1986
+ * {
1987
+ * id: ["ful_123", "ful_321"],
1988
+ * },
1989
+ * {
1990
+ * relations: ["shipping_option"],
1991
+ * take: 20,
1992
+ * skip: 2,
1993
+ * }
1994
+ * )
1995
+ * ```
1996
+ *
1997
+ * To specify relations that should be retrieved within the fulfillment:
1998
+ *
1999
+ * ```ts
2000
+ * const [fulfillments, count] =
2001
+ * await fulfillmentModuleService.listAndCountFulfillments(
2002
+ * {
2003
+ * id: ["ful_123", "ful_321"],
2004
+ * },
2005
+ * {
2006
+ * relations: ["shipping_option"],
2007
+ * }
2008
+ * )
2009
+ * ```
2010
+ *
2011
+ * By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
2012
+ *
2013
+ * ```ts
2014
+ * const [fulfillments, count] =
2015
+ * await fulfillmentModuleService.listAndCountFulfillments({
2016
+ * id: ["ful_123", "ful_321"],
2017
+ * })
2018
+ * ```
386
2019
  */
387
2020
  listAndCountFulfillments(filters?: FilterableFulfillmentProps, config?: FindConfig<FulfillmentDTO>, sharedContext?: Context): Promise<[FulfillmentDTO[], number]>;
388
2021
  /**
389
- * Create a new fulfillment including into the third party provider
390
- * @param data
391
- * @param sharedContext
2022
+ * This method creates a fulfillment.
2023
+ *
2024
+ * @param {CreateFulfillmentDTO} data - The fulfillment to be created.
2025
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
2026
+ * @returns {Promise<FulfillmentDTO>} The created fulfillment.
2027
+ *
2028
+ * @example
2029
+ * const fulfillment =
2030
+ * await fulfillmentModuleService.createFulfillment({
2031
+ * location_id: "loc_123",
2032
+ * provider_id: "webshipper",
2033
+ * delivery_address: {
2034
+ * address_1: "4120 Auto Park Cir",
2035
+ * country_code: "us",
2036
+ * },
2037
+ * items: [
2038
+ * {
2039
+ * title: "Shirt",
2040
+ * sku: "SHIRT",
2041
+ * quantity: 1,
2042
+ * barcode: "ABCED",
2043
+ * },
2044
+ * ],
2045
+ * labels: [
2046
+ * {
2047
+ * tracking_number: "1234567",
2048
+ * tracking_url: "https://example.com/tracking",
2049
+ * label_url: "https://example.com/label",
2050
+ * },
2051
+ * ],
2052
+ * order: {},
2053
+ * })
392
2054
  */
393
2055
  createFulfillment(data: CreateFulfillmentDTO, sharedContext?: Context): Promise<FulfillmentDTO>;
394
2056
  /**
395
- * Update a fulfillment
396
- * @param data
397
- * @param sharedContext
2057
+ * This method updates an existing fulfillment.
2058
+ *
2059
+ * @param {string} id - The ID of the fulfillment.
2060
+ * @param {UpdateFulfillmentDTO} data - The attributes to update in the fulfillment.
2061
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
2062
+ * @returns {Promise<FulfillmentDTO>} The updated fulfillment.
2063
+ *
2064
+ * @example
2065
+ * const fulfillment =
2066
+ * await fulfillmentModuleService.updateFulfillment(
2067
+ * "ful_123",
2068
+ * {
2069
+ * location_id: "loc_123",
2070
+ * }
2071
+ * )
398
2072
  */
399
2073
  updateFulfillment(id: string, data: UpdateFulfillmentDTO, sharedContext?: Context): Promise<FulfillmentDTO>;
400
2074
  /**
401
- * Cancel the given fulfillment including into the third party provider
402
- * @param id
403
- * @param sharedContext
2075
+ * This method cancels a fulfillment.
2076
+ *
2077
+ * @param {string} id - The ID of the fulfillment.
2078
+ * @param {Context} sharedContext - A context used to share resources, such as transaction manager, between the application and the module.
2079
+ * @returns {Promise<FulfillmentDTO>} cancels a fulfillment.
2080
+ *
2081
+ * @example
2082
+ * const fulfillment =
2083
+ * await fulfillmentModuleService.cancelFulfillment("ful_123")
404
2084
  */
405
2085
  cancelFulfillment(id: string, sharedContext?: Context): Promise<FulfillmentDTO>;
406
2086
  /**
407
- * Retrieve the available fulfillment options for the given data.
2087
+ * This method retrieves the fulfillment options of a fulfillment provider.
2088
+ *
2089
+ * @param {string} providerId - The fulfillment provider's ID.
2090
+ * @returns {Promise<Record<string, unknown>[]>} The fulfillment provider's options.
2091
+ *
2092
+ * @example
2093
+ * const fulfillment =
2094
+ * await fulfillmentModuleService.retrieveFulfillmentOptions(
2095
+ * "ful_123"
2096
+ * )
408
2097
  */
409
2098
  retrieveFulfillmentOptions(providerId: string): Promise<Record<string, unknown>[]>;
410
2099
  /**
411
- * Validate the given shipping option fulfillment option from the provided data
2100
+ * This method validates a fulfillment option with the provider it belongs to.
2101
+ *
2102
+ * @param {string} providerId - The fulfillment provider's ID.
2103
+ * @param {Record<string, unknown>} data - The fulfillment option to validate.
2104
+ * @returns {Promise<boolean>} Whether the fulfillment option is valid with the specified provider.
2105
+ *
2106
+ * @example
2107
+ * const isValid =
2108
+ * await fulfillmentModuleService.validateFulfillmentOption(
2109
+ * "webshipper",
2110
+ * {
2111
+ * code: "express",
2112
+ * }
2113
+ * )
412
2114
  */
413
2115
  validateFulfillmentOption(providerId: string, data: Record<string, unknown>): Promise<boolean>;
414
2116
  /**
415
- * Validate if the given shipping option is valid for a given context
2117
+ * This method checks whether a shipping option can be used for a specified context.
2118
+ *
2119
+ * @param {string} shippingOptionId - The shipping option's ID.
2120
+ * @param {Record<string, unknown>} context - The context to check.
2121
+ * @returns {Promise<boolean>} Whether the shipping option is valid for the specified context.
2122
+ *
2123
+ * @example
2124
+ * const isValid =
2125
+ * await fulfillmentModuleService.validateShippingOption(
2126
+ * "so_123",
2127
+ * {
2128
+ * customer_group: "cg_vipgroup",
2129
+ * }
2130
+ * )
416
2131
  */
417
2132
  validateShippingOption(shippingOptionId: string, context: Record<string, unknown>): Promise<boolean>;
418
2133
  }