hey-pharmacist-ecommerce 1.1.30 → 1.1.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/index.d.mts +1451 -1303
  2. package/dist/index.d.ts +1451 -1303
  3. package/dist/index.js +10502 -5728
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +7817 -3059
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +4 -3
  8. package/src/components/AccountReviewsTab.tsx +97 -0
  9. package/src/components/CouponCodeInput.tsx +190 -0
  10. package/src/components/Header.tsx +5 -1
  11. package/src/components/Notification.tsx +1 -1
  12. package/src/components/NotificationBell.tsx +33 -0
  13. package/src/components/NotificationCard.tsx +211 -0
  14. package/src/components/NotificationDrawer.tsx +195 -0
  15. package/src/components/OrderCard.tsx +164 -99
  16. package/src/components/ProductReviewsSection.tsx +30 -0
  17. package/src/components/RatingDistribution.tsx +86 -0
  18. package/src/components/ReviewCard.tsx +59 -0
  19. package/src/components/ReviewForm.tsx +207 -0
  20. package/src/components/ReviewPromptBanner.tsx +98 -0
  21. package/src/components/ReviewsList.tsx +151 -0
  22. package/src/components/StarRating.tsx +98 -0
  23. package/src/hooks/useDiscounts.ts +7 -0
  24. package/src/hooks/useOrders.ts +15 -0
  25. package/src/hooks/useReviews.ts +230 -0
  26. package/src/index.ts +25 -0
  27. package/src/lib/Apis/apis/discounts-api.ts +23 -72
  28. package/src/lib/Apis/apis/notifications-api.ts +196 -231
  29. package/src/lib/Apis/apis/products-api.ts +84 -0
  30. package/src/lib/Apis/apis/review-api.ts +283 -4
  31. package/src/lib/Apis/apis/stores-api.ts +180 -0
  32. package/src/lib/Apis/models/bulk-channel-toggle-dto.ts +52 -0
  33. package/src/lib/Apis/models/cart-body-populated.ts +3 -3
  34. package/src/lib/Apis/models/channel-settings-dto.ts +39 -0
  35. package/src/lib/Apis/models/{discount-paginated-response.ts → completed-order-dto.ts} +21 -16
  36. package/src/lib/Apis/models/create-discount-dto.ts +31 -92
  37. package/src/lib/Apis/models/create-review-dto.ts +4 -4
  38. package/src/lib/Apis/models/create-shippo-account-dto.ts +45 -0
  39. package/src/lib/Apis/models/create-store-dto.ts +6 -0
  40. package/src/lib/Apis/models/discount.ts +37 -98
  41. package/src/lib/Apis/models/discounts-insights-dto.ts +12 -0
  42. package/src/lib/Apis/models/index.ts +13 -7
  43. package/src/lib/Apis/models/{manual-discount.ts → manual-discount-dto.ts} +10 -10
  44. package/src/lib/Apis/models/manual-order-dto.ts +3 -3
  45. package/src/lib/Apis/models/populated-discount.ts +41 -101
  46. package/src/lib/Apis/models/preference-update-item.ts +59 -0
  47. package/src/lib/Apis/models/product-light-dto.ts +40 -0
  48. package/src/lib/Apis/models/{check-notifications-response-dto.ts → review-status-dto.ts} +8 -7
  49. package/src/lib/Apis/models/review.ts +9 -3
  50. package/src/lib/Apis/models/reviewable-order-dto.ts +58 -0
  51. package/src/lib/Apis/models/reviewable-product-dto.ts +81 -0
  52. package/src/lib/Apis/models/shippo-account-response-dto.ts +51 -0
  53. package/src/lib/Apis/models/store-entity.ts +6 -0
  54. package/src/lib/Apis/models/store.ts +6 -0
  55. package/src/lib/Apis/models/update-discount-dto.ts +31 -92
  56. package/src/lib/Apis/models/update-notification-settings-dto.ts +28 -0
  57. package/src/lib/Apis/models/update-review-dto.ts +4 -4
  58. package/src/lib/Apis/models/update-store-dto.ts +6 -0
  59. package/src/lib/Apis/models/{pick-type-class.ts → variant-light-dto.ts} +20 -14
  60. package/src/lib/utils/discount.ts +155 -0
  61. package/src/lib/validations/discount.ts +11 -0
  62. package/src/providers/CartProvider.tsx +2 -2
  63. package/src/providers/DiscountProvider.tsx +97 -0
  64. package/src/providers/EcommerceProvider.tsx +13 -5
  65. package/src/providers/NotificationCenterProvider.tsx +436 -0
  66. package/src/screens/CartScreen.tsx +1 -1
  67. package/src/screens/CheckoutScreen.tsx +39 -12
  68. package/src/screens/NotificationSettingsScreen.tsx +413 -0
  69. package/src/screens/OrderDetailScreen.tsx +283 -0
  70. package/src/screens/OrderReviewsScreen.tsx +308 -0
  71. package/src/screens/OrdersScreen.tsx +31 -7
  72. package/src/screens/ProductDetailScreen.tsx +24 -11
  73. package/src/screens/ProfileScreen.tsx +5 -0
  74. package/src/lib/Apis/models/create-notification-dto.ts +0 -75
  75. package/src/lib/Apis/models/notification.ts +0 -93
  76. package/src/lib/Apis/models/single-notification-dto.ts +0 -99
@@ -20,6 +20,7 @@ import { CreateProductDto } from '../models';
20
20
  import { CreateVariantDto } from '../models';
21
21
  import { PaginatedProductsDto } from '../models';
22
22
  import { Product } from '../models';
23
+ import { ProductLightDto } from '../models';
23
24
  import { ProductsInsightsDto } from '../models';
24
25
  import { ReorderProductsDto } from '../models';
25
26
  import { ReorderProductsSuccessResponseDto } from '../models';
@@ -609,6 +610,57 @@ export const ProductsApiAxiosParamCreator = function (configuration?: Configurat
609
610
  options: localVarRequestOptions,
610
611
  };
611
612
  },
613
+ /**
614
+ *
615
+ * @summary Get all products with basic info (lightweight)
616
+ * @param {*} [options] Override http request option.
617
+ * @throws {RequiredError}
618
+ */
619
+ getAllProductsLight: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
620
+ const localVarPath = `/products/light`;
621
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
622
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
623
+ let baseOptions;
624
+ if (configuration) {
625
+ baseOptions = configuration.baseOptions;
626
+ }
627
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
628
+ const localVarHeaderParameter = {} as any;
629
+ const localVarQueryParameter = {} as any;
630
+
631
+ // authentication bearer required
632
+ // http bearer authentication required
633
+ if (configuration && configuration.accessToken) {
634
+ const accessToken = typeof configuration.accessToken === 'function'
635
+ ? await configuration.accessToken()
636
+ : await configuration.accessToken;
637
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
638
+ }
639
+
640
+ // authentication x-store-key required
641
+ if (configuration && configuration.apiKey) {
642
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
643
+ ? await configuration.apiKey("x-store-key")
644
+ : await configuration.apiKey;
645
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
646
+ }
647
+
648
+ const query = new URLSearchParams(localVarUrlObj.search);
649
+ for (const key in localVarQueryParameter) {
650
+ query.set(key, localVarQueryParameter[key]);
651
+ }
652
+ for (const key in options.params) {
653
+ query.set(key, options.params[key]);
654
+ }
655
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
656
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
657
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
658
+
659
+ return {
660
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
661
+ options: localVarRequestOptions,
662
+ };
663
+ },
612
664
  /**
613
665
  *
614
666
  * @summary Get the featured product for home screen
@@ -1421,6 +1473,19 @@ export const ProductsApiFp = function(configuration?: Configuration) {
1421
1473
  return axios.request(axiosRequestArgs);
1422
1474
  };
1423
1475
  },
1476
+ /**
1477
+ *
1478
+ * @summary Get all products with basic info (lightweight)
1479
+ * @param {*} [options] Override http request option.
1480
+ * @throws {RequiredError}
1481
+ */
1482
+ async getAllProductsLight(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Array<ProductLightDto>>>> {
1483
+ const localVarAxiosArgs = await ProductsApiAxiosParamCreator(configuration).getAllProductsLight(options);
1484
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1485
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1486
+ return axios.request(axiosRequestArgs);
1487
+ };
1488
+ },
1424
1489
  /**
1425
1490
  *
1426
1491
  * @summary Get the featured product for home screen
@@ -1690,6 +1755,15 @@ export const ProductsApiFactory = function (configuration?: Configuration, baseP
1690
1755
  async getAllProductsBySubCategory(subCategoryId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
1691
1756
  return ProductsApiFp(configuration).getAllProductsBySubCategory(subCategoryId, options).then((request) => request(axios, basePath));
1692
1757
  },
1758
+ /**
1759
+ *
1760
+ * @summary Get all products with basic info (lightweight)
1761
+ * @param {*} [options] Override http request option.
1762
+ * @throws {RequiredError}
1763
+ */
1764
+ async getAllProductsLight(options?: AxiosRequestConfig): Promise<AxiosResponse<Array<ProductLightDto>>> {
1765
+ return ProductsApiFp(configuration).getAllProductsLight(options).then((request) => request(axios, basePath));
1766
+ },
1693
1767
  /**
1694
1768
  *
1695
1769
  * @summary Get the featured product for home screen
@@ -1925,6 +1999,16 @@ export class ProductsApi extends BaseAPI {
1925
1999
  public async getAllProductsBySubCategory(subCategoryId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
1926
2000
  return ProductsApiFp(this.configuration).getAllProductsBySubCategory(subCategoryId, options).then((request) => request(this.axios, this.basePath));
1927
2001
  }
2002
+ /**
2003
+ *
2004
+ * @summary Get all products with basic info (lightweight)
2005
+ * @param {*} [options] Override http request option.
2006
+ * @throws {RequiredError}
2007
+ * @memberof ProductsApi
2008
+ */
2009
+ public async getAllProductsLight(options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<ProductLightDto>>> {
2010
+ return ProductsApiFp(this.configuration).getAllProductsLight(options).then((request) => request(this.axios, this.basePath));
2011
+ }
1928
2012
  /**
1929
2013
  *
1930
2014
  * @summary Get the featured product for home screen
@@ -16,8 +16,11 @@ import { Configuration } from '../configuration';
16
16
  // Some imports not used depending on template conditions
17
17
  // @ts-ignore
18
18
  import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
19
+ import { CompletedOrderDto } from '../models';
19
20
  import { CreateReviewDto } from '../models';
20
21
  import { Review } from '../models';
22
+ import { ReviewStatusDto } from '../models';
23
+ import { ReviewableOrderDto } from '../models';
21
24
  import { UpdateReviewDto } from '../models';
22
25
  /**
23
26
  * ReviewApi - axios parameter creator
@@ -93,7 +96,70 @@ export const ReviewApiAxiosParamCreator = function (configuration?: Configuratio
93
96
  },
94
97
  /**
95
98
  *
96
- * @summary Create a review
99
+ * @summary Check if a product has been reviewed in an order
100
+ * @param {string} orderId
101
+ * @param {string} productVariantId
102
+ * @param {*} [options] Override http request option.
103
+ * @throws {RequiredError}
104
+ */
105
+ checkReviewStatus: async (orderId: string, productVariantId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
106
+ // verify required parameter 'orderId' is not null or undefined
107
+ if (orderId === null || orderId === undefined) {
108
+ throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling checkReviewStatus.');
109
+ }
110
+ // verify required parameter 'productVariantId' is not null or undefined
111
+ if (productVariantId === null || productVariantId === undefined) {
112
+ throw new RequiredError('productVariantId','Required parameter productVariantId was null or undefined when calling checkReviewStatus.');
113
+ }
114
+ const localVarPath = `/reviews/order/{orderId}/product/{productVariantId}/status`
115
+ .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId)))
116
+ .replace(`{${"productVariantId"}}`, encodeURIComponent(String(productVariantId)));
117
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
118
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
119
+ let baseOptions;
120
+ if (configuration) {
121
+ baseOptions = configuration.baseOptions;
122
+ }
123
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
124
+ const localVarHeaderParameter = {} as any;
125
+ const localVarQueryParameter = {} as any;
126
+
127
+ // authentication bearer required
128
+ // http bearer authentication required
129
+ if (configuration && configuration.accessToken) {
130
+ const accessToken = typeof configuration.accessToken === 'function'
131
+ ? await configuration.accessToken()
132
+ : await configuration.accessToken;
133
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
134
+ }
135
+
136
+ // authentication x-store-key required
137
+ if (configuration && configuration.apiKey) {
138
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
139
+ ? await configuration.apiKey("x-store-key")
140
+ : await configuration.apiKey;
141
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
142
+ }
143
+
144
+ const query = new URLSearchParams(localVarUrlObj.search);
145
+ for (const key in localVarQueryParameter) {
146
+ query.set(key, localVarQueryParameter[key]);
147
+ }
148
+ for (const key in options.params) {
149
+ query.set(key, options.params[key]);
150
+ }
151
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
152
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
153
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
154
+
155
+ return {
156
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
157
+ options: localVarRequestOptions,
158
+ };
159
+ },
160
+ /**
161
+ *
162
+ * @summary Create a review for a product in a completed order
97
163
  * @param {CreateReviewDto} body
98
164
  * @param {string} orderId
99
165
  * @param {*} [options] Override http request option.
@@ -208,6 +274,63 @@ export const ReviewApiAxiosParamCreator = function (configuration?: Configuratio
208
274
  options: localVarRequestOptions,
209
275
  };
210
276
  },
277
+ /**
278
+ *
279
+ * @summary Get all reviewable products from a completed order
280
+ * @param {string} orderId
281
+ * @param {*} [options] Override http request option.
282
+ * @throws {RequiredError}
283
+ */
284
+ getReviewableProducts: async (orderId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
285
+ // verify required parameter 'orderId' is not null or undefined
286
+ if (orderId === null || orderId === undefined) {
287
+ throw new RequiredError('orderId','Required parameter orderId was null or undefined when calling getReviewableProducts.');
288
+ }
289
+ const localVarPath = `/reviews/order/{orderId}/reviewable-products`
290
+ .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId)));
291
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
292
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
293
+ let baseOptions;
294
+ if (configuration) {
295
+ baseOptions = configuration.baseOptions;
296
+ }
297
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
298
+ const localVarHeaderParameter = {} as any;
299
+ const localVarQueryParameter = {} as any;
300
+
301
+ // authentication bearer required
302
+ // http bearer authentication required
303
+ if (configuration && configuration.accessToken) {
304
+ const accessToken = typeof configuration.accessToken === 'function'
305
+ ? await configuration.accessToken()
306
+ : await configuration.accessToken;
307
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
308
+ }
309
+
310
+ // authentication x-store-key required
311
+ if (configuration && configuration.apiKey) {
312
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
313
+ ? await configuration.apiKey("x-store-key")
314
+ : await configuration.apiKey;
315
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
316
+ }
317
+
318
+ const query = new URLSearchParams(localVarUrlObj.search);
319
+ for (const key in localVarQueryParameter) {
320
+ query.set(key, localVarQueryParameter[key]);
321
+ }
322
+ for (const key in options.params) {
323
+ query.set(key, options.params[key]);
324
+ }
325
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
326
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
327
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
328
+
329
+ return {
330
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
331
+ options: localVarRequestOptions,
332
+ };
333
+ },
211
334
  /**
212
335
  *
213
336
  * @summary Get all reviews by date
@@ -607,6 +730,57 @@ export const ReviewApiAxiosParamCreator = function (configuration?: Configuratio
607
730
  options: localVarRequestOptions,
608
731
  };
609
732
  },
733
+ /**
734
+ *
735
+ * @summary Get all completed orders for the current user that can be reviewed
736
+ * @param {*} [options] Override http request option.
737
+ * @throws {RequiredError}
738
+ */
739
+ getUserCompletedOrders: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
740
+ const localVarPath = `/reviews/my-completed-orders`;
741
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
742
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
743
+ let baseOptions;
744
+ if (configuration) {
745
+ baseOptions = configuration.baseOptions;
746
+ }
747
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
748
+ const localVarHeaderParameter = {} as any;
749
+ const localVarQueryParameter = {} as any;
750
+
751
+ // authentication bearer required
752
+ // http bearer authentication required
753
+ if (configuration && configuration.accessToken) {
754
+ const accessToken = typeof configuration.accessToken === 'function'
755
+ ? await configuration.accessToken()
756
+ : await configuration.accessToken;
757
+ localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
758
+ }
759
+
760
+ // authentication x-store-key required
761
+ if (configuration && configuration.apiKey) {
762
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
763
+ ? await configuration.apiKey("x-store-key")
764
+ : await configuration.apiKey;
765
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
766
+ }
767
+
768
+ const query = new URLSearchParams(localVarUrlObj.search);
769
+ for (const key in localVarQueryParameter) {
770
+ query.set(key, localVarQueryParameter[key]);
771
+ }
772
+ for (const key in options.params) {
773
+ query.set(key, options.params[key]);
774
+ }
775
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
776
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
777
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
778
+
779
+ return {
780
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
781
+ options: localVarRequestOptions,
782
+ };
783
+ },
610
784
  /**
611
785
  *
612
786
  * @summary Remove a reply from a review
@@ -879,7 +1053,22 @@ export const ReviewApiFp = function(configuration?: Configuration) {
879
1053
  },
880
1054
  /**
881
1055
  *
882
- * @summary Create a review
1056
+ * @summary Check if a product has been reviewed in an order
1057
+ * @param {string} orderId
1058
+ * @param {string} productVariantId
1059
+ * @param {*} [options] Override http request option.
1060
+ * @throws {RequiredError}
1061
+ */
1062
+ async checkReviewStatus(orderId: string, productVariantId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ReviewStatusDto>>> {
1063
+ const localVarAxiosArgs = await ReviewApiAxiosParamCreator(configuration).checkReviewStatus(orderId, productVariantId, options);
1064
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1065
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1066
+ return axios.request(axiosRequestArgs);
1067
+ };
1068
+ },
1069
+ /**
1070
+ *
1071
+ * @summary Create a review for a product in a completed order
883
1072
  * @param {CreateReviewDto} body
884
1073
  * @param {string} orderId
885
1074
  * @param {*} [options] Override http request option.
@@ -905,6 +1094,20 @@ export const ReviewApiFp = function(configuration?: Configuration) {
905
1094
  return axios.request(axiosRequestArgs);
906
1095
  };
907
1096
  },
1097
+ /**
1098
+ *
1099
+ * @summary Get all reviewable products from a completed order
1100
+ * @param {string} orderId
1101
+ * @param {*} [options] Override http request option.
1102
+ * @throws {RequiredError}
1103
+ */
1104
+ async getReviewableProducts(orderId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ReviewableOrderDto>>> {
1105
+ const localVarAxiosArgs = await ReviewApiAxiosParamCreator(configuration).getReviewableProducts(orderId, options);
1106
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1107
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1108
+ return axios.request(axiosRequestArgs);
1109
+ };
1110
+ },
908
1111
  /**
909
1112
  *
910
1113
  * @summary Get all reviews by date
@@ -1003,6 +1206,19 @@ export const ReviewApiFp = function(configuration?: Configuration) {
1003
1206
  return axios.request(axiosRequestArgs);
1004
1207
  };
1005
1208
  },
1209
+ /**
1210
+ *
1211
+ * @summary Get all completed orders for the current user that can be reviewed
1212
+ * @param {*} [options] Override http request option.
1213
+ * @throws {RequiredError}
1214
+ */
1215
+ async getUserCompletedOrders(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<Array<CompletedOrderDto>>>> {
1216
+ const localVarAxiosArgs = await ReviewApiAxiosParamCreator(configuration).getUserCompletedOrders(options);
1217
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1218
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1219
+ return axios.request(axiosRequestArgs);
1220
+ };
1221
+ },
1006
1222
  /**
1007
1223
  *
1008
1224
  * @summary Remove a reply from a review
@@ -1083,7 +1299,18 @@ export const ReviewApiFactory = function (configuration?: Configuration, basePat
1083
1299
  },
1084
1300
  /**
1085
1301
  *
1086
- * @summary Create a review
1302
+ * @summary Check if a product has been reviewed in an order
1303
+ * @param {string} orderId
1304
+ * @param {string} productVariantId
1305
+ * @param {*} [options] Override http request option.
1306
+ * @throws {RequiredError}
1307
+ */
1308
+ async checkReviewStatus(orderId: string, productVariantId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<ReviewStatusDto>> {
1309
+ return ReviewApiFp(configuration).checkReviewStatus(orderId, productVariantId, options).then((request) => request(axios, basePath));
1310
+ },
1311
+ /**
1312
+ *
1313
+ * @summary Create a review for a product in a completed order
1087
1314
  * @param {CreateReviewDto} body
1088
1315
  * @param {string} orderId
1089
1316
  * @param {*} [options] Override http request option.
@@ -1101,6 +1328,16 @@ export const ReviewApiFactory = function (configuration?: Configuration, basePat
1101
1328
  async getReviewCount(options?: AxiosRequestConfig): Promise<AxiosResponse<number>> {
1102
1329
  return ReviewApiFp(configuration).getReviewCount(options).then((request) => request(axios, basePath));
1103
1330
  },
1331
+ /**
1332
+ *
1333
+ * @summary Get all reviewable products from a completed order
1334
+ * @param {string} orderId
1335
+ * @param {*} [options] Override http request option.
1336
+ * @throws {RequiredError}
1337
+ */
1338
+ async getReviewableProducts(orderId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<ReviewableOrderDto>> {
1339
+ return ReviewApiFp(configuration).getReviewableProducts(orderId, options).then((request) => request(axios, basePath));
1340
+ },
1104
1341
  /**
1105
1342
  *
1106
1343
  * @summary Get all reviews by date
@@ -1171,6 +1408,15 @@ export const ReviewApiFactory = function (configuration?: Configuration, basePat
1171
1408
  async getReviewsByUser(userId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Array<Review>>> {
1172
1409
  return ReviewApiFp(configuration).getReviewsByUser(userId, options).then((request) => request(axios, basePath));
1173
1410
  },
1411
+ /**
1412
+ *
1413
+ * @summary Get all completed orders for the current user that can be reviewed
1414
+ * @param {*} [options] Override http request option.
1415
+ * @throws {RequiredError}
1416
+ */
1417
+ async getUserCompletedOrders(options?: AxiosRequestConfig): Promise<AxiosResponse<Array<CompletedOrderDto>>> {
1418
+ return ReviewApiFp(configuration).getUserCompletedOrders(options).then((request) => request(axios, basePath));
1419
+ },
1174
1420
  /**
1175
1421
  *
1176
1422
  * @summary Remove a reply from a review
@@ -1237,7 +1483,19 @@ export class ReviewApi extends BaseAPI {
1237
1483
  }
1238
1484
  /**
1239
1485
  *
1240
- * @summary Create a review
1486
+ * @summary Check if a product has been reviewed in an order
1487
+ * @param {string} orderId
1488
+ * @param {string} productVariantId
1489
+ * @param {*} [options] Override http request option.
1490
+ * @throws {RequiredError}
1491
+ * @memberof ReviewApi
1492
+ */
1493
+ public async checkReviewStatus(orderId: string, productVariantId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<ReviewStatusDto>> {
1494
+ return ReviewApiFp(this.configuration).checkReviewStatus(orderId, productVariantId, options).then((request) => request(this.axios, this.basePath));
1495
+ }
1496
+ /**
1497
+ *
1498
+ * @summary Create a review for a product in a completed order
1241
1499
  * @param {CreateReviewDto} body
1242
1500
  * @param {string} orderId
1243
1501
  * @param {*} [options] Override http request option.
@@ -1257,6 +1515,17 @@ export class ReviewApi extends BaseAPI {
1257
1515
  public async getReviewCount(options?: AxiosRequestConfig) : Promise<AxiosResponse<number>> {
1258
1516
  return ReviewApiFp(this.configuration).getReviewCount(options).then((request) => request(this.axios, this.basePath));
1259
1517
  }
1518
+ /**
1519
+ *
1520
+ * @summary Get all reviewable products from a completed order
1521
+ * @param {string} orderId
1522
+ * @param {*} [options] Override http request option.
1523
+ * @throws {RequiredError}
1524
+ * @memberof ReviewApi
1525
+ */
1526
+ public async getReviewableProducts(orderId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<ReviewableOrderDto>> {
1527
+ return ReviewApiFp(this.configuration).getReviewableProducts(orderId, options).then((request) => request(this.axios, this.basePath));
1528
+ }
1260
1529
  /**
1261
1530
  *
1262
1531
  * @summary Get all reviews by date
@@ -1334,6 +1603,16 @@ export class ReviewApi extends BaseAPI {
1334
1603
  public async getReviewsByUser(userId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<Review>>> {
1335
1604
  return ReviewApiFp(this.configuration).getReviewsByUser(userId, options).then((request) => request(this.axios, this.basePath));
1336
1605
  }
1606
+ /**
1607
+ *
1608
+ * @summary Get all completed orders for the current user that can be reviewed
1609
+ * @param {*} [options] Override http request option.
1610
+ * @throws {RequiredError}
1611
+ * @memberof ReviewApi
1612
+ */
1613
+ public async getUserCompletedOrders(options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<CompletedOrderDto>>> {
1614
+ return ReviewApiFp(this.configuration).getUserCompletedOrders(options).then((request) => request(this.axios, this.basePath));
1615
+ }
1337
1616
  /**
1338
1617
  *
1339
1618
  * @summary Remove a reply from a review