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
@@ -16,11 +16,13 @@ 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 { CreateShippoAccountDto } from '../models';
19
20
  import { CreateStoreDto } from '../models';
20
21
  import { NewClientEmailDto } from '../models';
21
22
  import { RefillRequest } from '../models';
22
23
  import { RefillRequestDto } from '../models';
23
24
  import { ScheduleTourEmailDto } from '../models';
25
+ import { ShippoAccountResponseDto } from '../models';
24
26
  import { StoreApiKeysResponseDto } from '../models';
25
27
  import { StoreCapabilitiesDto } from '../models';
26
28
  import { StoreEntity } from '../models';
@@ -36,6 +38,63 @@ import { UpdateTransferePatientsRequestDto } from '../models';
36
38
  */
37
39
  export const StoresApiAxiosParamCreator = function (configuration?: Configuration) {
38
40
  return {
41
+ /**
42
+ *
43
+ * @summary Create a Shippo managed account for the store
44
+ * @param {CreateShippoAccountDto} body
45
+ * @param {string} storeId
46
+ * @param {*} [options] Override http request option.
47
+ * @throws {RequiredError}
48
+ */
49
+ createShippoAccount: async (body: CreateShippoAccountDto, storeId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
50
+ // verify required parameter 'body' is not null or undefined
51
+ if (body === null || body === undefined) {
52
+ throw new RequiredError('body','Required parameter body was null or undefined when calling createShippoAccount.');
53
+ }
54
+ // verify required parameter 'storeId' is not null or undefined
55
+ if (storeId === null || storeId === undefined) {
56
+ throw new RequiredError('storeId','Required parameter storeId was null or undefined when calling createShippoAccount.');
57
+ }
58
+ const localVarPath = `/stores/{storeId}/shippo-account`
59
+ .replace(`{${"storeId"}}`, encodeURIComponent(String(storeId)));
60
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
61
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
62
+ let baseOptions;
63
+ if (configuration) {
64
+ baseOptions = configuration.baseOptions;
65
+ }
66
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
67
+ const localVarHeaderParameter = {} as any;
68
+ const localVarQueryParameter = {} as any;
69
+
70
+ // authentication x-store-key required
71
+ if (configuration && configuration.apiKey) {
72
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
73
+ ? await configuration.apiKey("x-store-key")
74
+ : await configuration.apiKey;
75
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
76
+ }
77
+
78
+ localVarHeaderParameter['Content-Type'] = 'application/json';
79
+
80
+ const query = new URLSearchParams(localVarUrlObj.search);
81
+ for (const key in localVarQueryParameter) {
82
+ query.set(key, localVarQueryParameter[key]);
83
+ }
84
+ for (const key in options.params) {
85
+ query.set(key, options.params[key]);
86
+ }
87
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
88
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
89
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
90
+ const needsSerialization = (typeof body !== "string") || (localVarRequestOptions.headers ||= {})['Content-Type'] === 'application/json';
91
+ localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");
92
+
93
+ return {
94
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
95
+ options: localVarRequestOptions,
96
+ };
97
+ },
39
98
  /**
40
99
  *
41
100
  * @summary Create a new store
@@ -369,6 +428,54 @@ export const StoresApiAxiosParamCreator = function (configuration?: Configuratio
369
428
  options: localVarRequestOptions,
370
429
  };
371
430
  },
431
+ /**
432
+ *
433
+ * @summary Check if store has a Shippo platform account
434
+ * @param {string} storeId
435
+ * @param {*} [options] Override http request option.
436
+ * @throws {RequiredError}
437
+ */
438
+ getShippoAccount: async (storeId: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
439
+ // verify required parameter 'storeId' is not null or undefined
440
+ if (storeId === null || storeId === undefined) {
441
+ throw new RequiredError('storeId','Required parameter storeId was null or undefined when calling getShippoAccount.');
442
+ }
443
+ const localVarPath = `/stores/{storeId}/shippo-account`
444
+ .replace(`{${"storeId"}}`, encodeURIComponent(String(storeId)));
445
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
446
+ const localVarUrlObj = new URL(localVarPath, 'https://example.com');
447
+ let baseOptions;
448
+ if (configuration) {
449
+ baseOptions = configuration.baseOptions;
450
+ }
451
+ const localVarRequestOptions :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
452
+ const localVarHeaderParameter = {} as any;
453
+ const localVarQueryParameter = {} as any;
454
+
455
+ // authentication x-store-key required
456
+ if (configuration && configuration.apiKey) {
457
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
458
+ ? await configuration.apiKey("x-store-key")
459
+ : await configuration.apiKey;
460
+ localVarHeaderParameter["x-store-key"] = localVarApiKeyValue;
461
+ }
462
+
463
+ const query = new URLSearchParams(localVarUrlObj.search);
464
+ for (const key in localVarQueryParameter) {
465
+ query.set(key, localVarQueryParameter[key]);
466
+ }
467
+ for (const key in options.params) {
468
+ query.set(key, options.params[key]);
469
+ }
470
+ localVarUrlObj.search = (new URLSearchParams(query)).toString();
471
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
472
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
473
+
474
+ return {
475
+ url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
476
+ options: localVarRequestOptions,
477
+ };
478
+ },
372
479
  /**
373
480
  *
374
481
  * @summary Get store by id
@@ -1293,6 +1400,21 @@ export const StoresApiAxiosParamCreator = function (configuration?: Configuratio
1293
1400
  */
1294
1401
  export const StoresApiFp = function(configuration?: Configuration) {
1295
1402
  return {
1403
+ /**
1404
+ *
1405
+ * @summary Create a Shippo managed account for the store
1406
+ * @param {CreateShippoAccountDto} body
1407
+ * @param {string} storeId
1408
+ * @param {*} [options] Override http request option.
1409
+ * @throws {RequiredError}
1410
+ */
1411
+ async createShippoAccount(body: CreateShippoAccountDto, storeId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<ShippoAccountResponseDto>>> {
1412
+ const localVarAxiosArgs = await StoresApiAxiosParamCreator(configuration).createShippoAccount(body, storeId, options);
1413
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1414
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1415
+ return axios.request(axiosRequestArgs);
1416
+ };
1417
+ },
1296
1418
  /**
1297
1419
  *
1298
1420
  * @summary Create a new store
@@ -1390,6 +1512,20 @@ export const StoresApiFp = function(configuration?: Configuration) {
1390
1512
  return axios.request(axiosRequestArgs);
1391
1513
  };
1392
1514
  },
1515
+ /**
1516
+ *
1517
+ * @summary Check if store has a Shippo platform account
1518
+ * @param {string} storeId
1519
+ * @param {*} [options] Override http request option.
1520
+ * @throws {RequiredError}
1521
+ */
1522
+ async getShippoAccount(storeId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
1523
+ const localVarAxiosArgs = await StoresApiAxiosParamCreator(configuration).getShippoAccount(storeId, options);
1524
+ return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
1525
+ const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
1526
+ return axios.request(axiosRequestArgs);
1527
+ };
1528
+ },
1393
1529
  /**
1394
1530
  *
1395
1531
  * @summary Get store by id
@@ -1654,6 +1790,17 @@ export const StoresApiFp = function(configuration?: Configuration) {
1654
1790
  */
1655
1791
  export const StoresApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
1656
1792
  return {
1793
+ /**
1794
+ *
1795
+ * @summary Create a Shippo managed account for the store
1796
+ * @param {CreateShippoAccountDto} body
1797
+ * @param {string} storeId
1798
+ * @param {*} [options] Override http request option.
1799
+ * @throws {RequiredError}
1800
+ */
1801
+ async createShippoAccount(body: CreateShippoAccountDto, storeId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<ShippoAccountResponseDto>> {
1802
+ return StoresApiFp(configuration).createShippoAccount(body, storeId, options).then((request) => request(axios, basePath));
1803
+ },
1657
1804
  /**
1658
1805
  *
1659
1806
  * @summary Create a new store
@@ -1723,6 +1870,16 @@ export const StoresApiFactory = function (configuration?: Configuration, basePat
1723
1870
  async getRefillRequests(storeId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<Array<RefillRequest>>> {
1724
1871
  return StoresApiFp(configuration).getRefillRequests(storeId, options).then((request) => request(axios, basePath));
1725
1872
  },
1873
+ /**
1874
+ *
1875
+ * @summary Check if store has a Shippo platform account
1876
+ * @param {string} storeId
1877
+ * @param {*} [options] Override http request option.
1878
+ * @throws {RequiredError}
1879
+ */
1880
+ async getShippoAccount(storeId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
1881
+ return StoresApiFp(configuration).getShippoAccount(storeId, options).then((request) => request(axios, basePath));
1882
+ },
1726
1883
  /**
1727
1884
  *
1728
1885
  * @summary Get store by id
@@ -1912,6 +2069,18 @@ export const StoresApiFactory = function (configuration?: Configuration, basePat
1912
2069
  * @extends {BaseAPI}
1913
2070
  */
1914
2071
  export class StoresApi extends BaseAPI {
2072
+ /**
2073
+ *
2074
+ * @summary Create a Shippo managed account for the store
2075
+ * @param {CreateShippoAccountDto} body
2076
+ * @param {string} storeId
2077
+ * @param {*} [options] Override http request option.
2078
+ * @throws {RequiredError}
2079
+ * @memberof StoresApi
2080
+ */
2081
+ public async createShippoAccount(body: CreateShippoAccountDto, storeId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<ShippoAccountResponseDto>> {
2082
+ return StoresApiFp(this.configuration).createShippoAccount(body, storeId, options).then((request) => request(this.axios, this.basePath));
2083
+ }
1915
2084
  /**
1916
2085
  *
1917
2086
  * @summary Create a new store
@@ -1988,6 +2157,17 @@ export class StoresApi extends BaseAPI {
1988
2157
  public async getRefillRequests(storeId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<Array<RefillRequest>>> {
1989
2158
  return StoresApiFp(this.configuration).getRefillRequests(storeId, options).then((request) => request(this.axios, this.basePath));
1990
2159
  }
2160
+ /**
2161
+ *
2162
+ * @summary Check if store has a Shippo platform account
2163
+ * @param {string} storeId
2164
+ * @param {*} [options] Override http request option.
2165
+ * @throws {RequiredError}
2166
+ * @memberof StoresApi
2167
+ */
2168
+ public async getShippoAccount(storeId: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
2169
+ return StoresApiFp(this.configuration).getShippoAccount(storeId, options).then((request) => request(this.axios, this.basePath));
2170
+ }
1991
2171
  /**
1992
2172
  *
1993
2173
  * @summary Get store by id
@@ -0,0 +1,52 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Hey Pharamcist API
5
+ * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
6
+ *
7
+ * OpenAPI spec version: 1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by the swagger code generator program.
11
+ * https://github.com/swagger-api/swagger-codegen.git
12
+ * Do not edit the class manually.
13
+ */
14
+ /**
15
+ *
16
+ * @export
17
+ * @interface BulkChannelToggleDto
18
+ */
19
+ export interface BulkChannelToggleDto {
20
+ _id?: string;
21
+ /**
22
+ * Channel to toggle: email, push, or inApp
23
+ * @type {string}
24
+ * @memberof BulkChannelToggleDto
25
+ */
26
+ channel: string;
27
+ /**
28
+ * Enable or disable this channel for all notification types
29
+ * @type {boolean}
30
+ * @memberof BulkChannelToggleDto
31
+ */
32
+ enabled: boolean;
33
+ /**
34
+ * Optional category filter to only toggle specific notification categories
35
+ * @type {string}
36
+ * @memberof BulkChannelToggleDto
37
+ */
38
+ category?: BulkChannelToggleDtoCategoryEnum;
39
+ }
40
+
41
+ /**
42
+ * @export
43
+ * @enum {string}
44
+ */
45
+ export enum BulkChannelToggleDtoCategoryEnum {
46
+ Transactional = 'transactional',
47
+ Marketing = 'marketing',
48
+ Security = 'security',
49
+ Operational = 'operational',
50
+ Financial = 'financial'
51
+ }
52
+
@@ -12,7 +12,7 @@
12
12
  * Do not edit the class manually.
13
13
  */
14
14
  import { CartItemPopulated } from './cart-item-populated';
15
- import { ManualDiscount } from './manual-discount';
15
+ import { ManualDiscountDto } from './manual-discount-dto';
16
16
  /**
17
17
  *
18
18
  * @export
@@ -34,10 +34,10 @@ export interface CartBodyPopulated {
34
34
  discountsApplied: Array<string>;
35
35
  /**
36
36
  *
37
- * @type {ManualDiscount}
37
+ * @type {ManualDiscountDto}
38
38
  * @memberof CartBodyPopulated
39
39
  */
40
- manualDiscount: ManualDiscount;
40
+ manualDiscount: ManualDiscountDto;
41
41
  /**
42
42
  *
43
43
  * @type {Array<string>}
@@ -0,0 +1,39 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Hey Pharamcist API
5
+ * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
6
+ *
7
+ * OpenAPI spec version: 1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by the swagger code generator program.
11
+ * https://github.com/swagger-api/swagger-codegen.git
12
+ * Do not edit the class manually.
13
+ */
14
+ /**
15
+ *
16
+ * @export
17
+ * @interface ChannelSettingsDto
18
+ */
19
+ export interface ChannelSettingsDto {
20
+ _id?: string;
21
+ /**
22
+ * Enable email notifications for this type
23
+ * @type {boolean}
24
+ * @memberof ChannelSettingsDto
25
+ */
26
+ email?: boolean;
27
+ /**
28
+ * Enable push notifications for this type
29
+ * @type {boolean}
30
+ * @memberof ChannelSettingsDto
31
+ */
32
+ push?: boolean;
33
+ /**
34
+ * Enable in-app notifications for this type
35
+ * @type {boolean}
36
+ * @memberof ChannelSettingsDto
37
+ */
38
+ inApp?: boolean;
39
+ }
@@ -11,42 +11,47 @@
11
11
  * https://github.com/swagger-api/swagger-codegen.git
12
12
  * Do not edit the class manually.
13
13
  */
14
- import { PopulatedDiscount } from './populated-discount';
15
14
  /**
16
15
  *
17
16
  * @export
18
- * @interface DiscountPaginatedResponse
17
+ * @interface CompletedOrderDto
19
18
  */
20
- export interface DiscountPaginatedResponse {
19
+ export interface CompletedOrderDto {
21
20
  _id?: string;
22
21
  /**
23
22
  *
24
- * @type {Array<PopulatedDiscount>}
25
- * @memberof DiscountPaginatedResponse
23
+ * @type {string}
24
+ * @memberof CompletedOrderDto
26
25
  */
27
- data: Array<PopulatedDiscount>;
26
+ orderId: string;
28
27
  /**
29
28
  *
30
- * @type {number}
31
- * @memberof DiscountPaginatedResponse
29
+ * @type {string}
30
+ * @memberof CompletedOrderDto
32
31
  */
33
- total: number;
32
+ orderStatus: string;
34
33
  /**
35
34
  *
36
- * @type {number}
37
- * @memberof DiscountPaginatedResponse
35
+ * @type {Date}
36
+ * @memberof CompletedOrderDto
38
37
  */
39
- totalPages: number;
38
+ createdAt: Date;
40
39
  /**
41
40
  *
42
41
  * @type {number}
43
- * @memberof DiscountPaginatedResponse
42
+ * @memberof CompletedOrderDto
44
43
  */
45
- page: number;
44
+ totalItems: number;
46
45
  /**
47
46
  *
48
47
  * @type {number}
49
- * @memberof DiscountPaginatedResponse
48
+ * @memberof CompletedOrderDto
49
+ */
50
+ reviewedItems: number;
51
+ /**
52
+ *
53
+ * @type {boolean}
54
+ * @memberof CompletedOrderDto
50
55
  */
51
- limit: number;
56
+ hasUnreviewedItems: boolean;
52
57
  }
@@ -19,155 +19,112 @@
19
19
  export interface CreateDiscountDto {
20
20
  _id?: string;
21
21
  /**
22
- *
22
+ * Display name for the discount
23
23
  * @type {string}
24
24
  * @memberof CreateDiscountDto
25
25
  */
26
- discountName?: string;
26
+ name?: string;
27
27
  /**
28
- *
28
+ * Optional description for internal use
29
29
  * @type {string}
30
30
  * @memberof CreateDiscountDto
31
31
  */
32
32
  description?: string;
33
33
  /**
34
- *
34
+ * ITEM_DISCOUNT: Shows on products automatically. COUPON_CODE: Requires code at checkout
35
35
  * @type {string}
36
36
  * @memberof CreateDiscountDto
37
37
  */
38
- discountType?: CreateDiscountDtoDiscountTypeEnum;
38
+ type?: CreateDiscountDtoTypeEnum;
39
39
  /**
40
- *
40
+ * PERCENTAGE or FIXED_AMOUNT
41
41
  * @type {string}
42
42
  * @memberof CreateDiscountDto
43
43
  */
44
- decreasePriceBy?: CreateDiscountDtoDecreasePriceByEnum;
44
+ valueType?: CreateDiscountDtoValueTypeEnum;
45
45
  /**
46
- *
47
- * @type {string}
48
- * @memberof CreateDiscountDto
49
- */
50
- code?: string;
51
- /**
52
- *
53
- * @type {boolean}
46
+ * The discount value (percentage 1-100 or fixed dollar amount)
47
+ * @type {number}
54
48
  * @memberof CreateDiscountDto
55
49
  */
56
- automatic?: boolean;
50
+ value?: number;
57
51
  /**
58
- *
52
+ * Maximum discount amount for percentage discounts (optional, mainly for COUPON_CODE)
59
53
  * @type {number}
60
54
  * @memberof CreateDiscountDto
61
55
  */
62
56
  cappedAt?: number;
63
57
  /**
64
- *
65
- * @type {number}
58
+ * Coupon code (required for COUPON_CODE type)
59
+ * @type {string}
66
60
  * @memberof CreateDiscountDto
67
61
  */
68
- amount?: number;
62
+ code?: string;
69
63
  /**
70
- *
64
+ * When the discount becomes active
71
65
  * @type {Date}
72
66
  * @memberof CreateDiscountDto
73
67
  */
74
68
  startsAt?: Date;
75
69
  /**
76
- *
70
+ * When the discount expires
77
71
  * @type {Date}
78
72
  * @memberof CreateDiscountDto
79
73
  */
80
74
  expiresAt?: Date;
81
75
  /**
82
- *
83
- * @type {number}
84
- * @memberof CreateDiscountDto
85
- */
86
- maxUses?: number;
87
- /**
88
- *
76
+ * Current lifecycle state
89
77
  * @type {string}
90
78
  * @memberof CreateDiscountDto
91
79
  */
92
80
  state?: CreateDiscountDtoStateEnum;
93
81
  /**
94
- *
95
- * @type {Array<string>}
82
+ * Quick toggle to enable/disable the discount
83
+ * @type {boolean}
96
84
  * @memberof CreateDiscountDto
97
85
  */
98
- categoriesEligible?: Array<string>;
86
+ isActive?: boolean;
99
87
  /**
100
- *
88
+ * Products to apply discount to (all their variants will be discounted)
101
89
  * @type {Array<string>}
102
90
  * @memberof CreateDiscountDto
103
91
  */
104
92
  productsEligible?: Array<string>;
105
93
  /**
106
- *
94
+ * Specific variants to apply discount to
107
95
  * @type {Array<string>}
108
96
  * @memberof CreateDiscountDto
109
97
  */
110
98
  variantsEligible?: Array<string>;
111
99
  /**
112
- *
113
- * @type {number}
114
- * @memberof CreateDiscountDto
115
- */
116
- maxUsesPerUser?: number;
117
- /**
118
- *
119
- * @type {string}
120
- * @memberof CreateDiscountDto
121
- */
122
- minPurchaseRequired?: CreateDiscountDtoMinPurchaseRequiredEnum;
123
- /**
124
- *
100
+ * Maximum total times this discount can be used (optional)
125
101
  * @type {number}
126
102
  * @memberof CreateDiscountDto
127
103
  */
128
- minPurchaseAmount?: number;
104
+ maxUses?: number;
129
105
  /**
130
- *
106
+ * Maximum times a single user can use this discount (optional)
131
107
  * @type {number}
132
108
  * @memberof CreateDiscountDto
133
109
  */
134
- minPurchaseQuantity?: number;
135
- /**
136
- *
137
- * @type {string}
138
- * @memberof CreateDiscountDto
139
- */
140
- customerEligibility?: CreateDiscountDtoCustomerEligibilityEnum;
141
- /**
142
- *
143
- * @type {Array<string>}
144
- * @memberof CreateDiscountDto
145
- */
146
- usersEligible?: Array<string>;
147
- /**
148
- *
149
- * @type {Array<string>}
150
- * @memberof CreateDiscountDto
151
- */
152
- groupsEligible?: Array<string>;
110
+ maxUsesPerUser?: number;
153
111
  }
154
112
 
155
113
  /**
156
114
  * @export
157
115
  * @enum {string}
158
116
  */
159
- export enum CreateDiscountDtoDiscountTypeEnum {
160
- PRODUCT = 'PRODUCT',
161
- CATEGORY = 'CATEGORY',
162
- VARIANT = 'VARIANT'
117
+ export enum CreateDiscountDtoTypeEnum {
118
+ ITEMDISCOUNT = 'ITEM_DISCOUNT',
119
+ COUPONCODE = 'COUPON_CODE'
163
120
  }
164
121
  /**
165
122
  * @export
166
123
  * @enum {string}
167
124
  */
168
- export enum CreateDiscountDtoDecreasePriceByEnum {
125
+ export enum CreateDiscountDtoValueTypeEnum {
169
126
  PERCENTAGE = 'PERCENTAGE',
170
- AMOUNT = 'AMOUNT'
127
+ FIXEDAMOUNT = 'FIXED_AMOUNT'
171
128
  }
172
129
  /**
173
130
  * @export
@@ -179,22 +136,4 @@ export enum CreateDiscountDtoStateEnum {
179
136
  EXPIRED = 'EXPIRED',
180
137
  SCHEDULED = 'SCHEDULED'
181
138
  }
182
- /**
183
- * @export
184
- * @enum {string}
185
- */
186
- export enum CreateDiscountDtoMinPurchaseRequiredEnum {
187
- NOREQUIREMENT = 'NO_REQUIREMENT',
188
- MINIMUMAMOUNT = 'MINIMUM_AMOUNT',
189
- MINIMUMQUANTITY = 'MINIMUM_QUANTITY'
190
- }
191
- /**
192
- * @export
193
- * @enum {string}
194
- */
195
- export enum CreateDiscountDtoCustomerEligibilityEnum {
196
- ALL = 'ALL',
197
- SPECIFICUSERS = 'SPECIFIC_USERS',
198
- SPECIFICGROUPS = 'SPECIFIC_GROUPS'
199
- }
200
139
 
@@ -23,13 +23,13 @@ export interface CreateReviewDto {
23
23
  * @type {string}
24
24
  * @memberof CreateReviewDto
25
25
  */
26
- userId?: string;
26
+ productId?: string;
27
27
  /**
28
28
  *
29
29
  * @type {string}
30
30
  * @memberof CreateReviewDto
31
31
  */
32
- productId?: string;
32
+ productVariantId?: string;
33
33
  /**
34
34
  *
35
35
  * @type {string}
@@ -56,8 +56,8 @@ export interface CreateReviewDto {
56
56
  reply?: string;
57
57
  /**
58
58
  *
59
- * @type {string}
59
+ * @type {Date}
60
60
  * @memberof CreateReviewDto
61
61
  */
62
- replyDate?: string;
62
+ replyDate?: Date;
63
63
  }