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
@@ -0,0 +1,45 @@
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 CreateShippoAccountDto
18
+ */
19
+ export interface CreateShippoAccountDto {
20
+ _id?: string;
21
+ /**
22
+ * Email for shipping notifications
23
+ * @type {string}
24
+ * @memberof CreateShippoAccountDto
25
+ */
26
+ email: string;
27
+ /**
28
+ * First name of store owner
29
+ * @type {string}
30
+ * @memberof CreateShippoAccountDto
31
+ */
32
+ firstName: string;
33
+ /**
34
+ * Last name of store owner
35
+ * @type {string}
36
+ * @memberof CreateShippoAccountDto
37
+ */
38
+ lastName: string;
39
+ /**
40
+ * Company/store name
41
+ * @type {string}
42
+ * @memberof CreateShippoAccountDto
43
+ */
44
+ companyName: string;
45
+ }
@@ -49,6 +49,12 @@ export interface CreateStoreDto {
49
49
  * @memberof CreateStoreDto
50
50
  */
51
51
  adminUrl?: string;
52
+ /**
53
+ * Shippo Platform managed account ID
54
+ * @type {string}
55
+ * @memberof CreateStoreDto
56
+ */
57
+ shippoAccountId?: string;
52
58
  /**
53
59
  *
54
60
  * @type {string}
@@ -38,173 +38,130 @@ export interface Discount {
38
38
  */
39
39
  id: string;
40
40
  /**
41
- *
41
+ * Display name for the discount
42
42
  * @type {string}
43
43
  * @memberof Discount
44
44
  */
45
- discountName: string;
45
+ name: string;
46
46
  /**
47
- *
47
+ * Optional description for internal use
48
48
  * @type {string}
49
49
  * @memberof Discount
50
50
  */
51
51
  description: string;
52
52
  /**
53
- *
53
+ * ITEM_DISCOUNT: Shows on products automatically. COUPON_CODE: Requires code at checkout
54
54
  * @type {string}
55
55
  * @memberof Discount
56
56
  */
57
- discountType: DiscountDiscountTypeEnum;
57
+ type: DiscountTypeEnum;
58
58
  /**
59
- *
59
+ * PERCENTAGE or FIXED_AMOUNT
60
60
  * @type {string}
61
61
  * @memberof Discount
62
62
  */
63
- decreasePriceBy: DiscountDecreasePriceByEnum;
63
+ valueType: DiscountValueTypeEnum;
64
64
  /**
65
- *
66
- * @type {string}
67
- * @memberof Discount
68
- */
69
- code: string;
70
- /**
71
- *
72
- * @type {boolean}
65
+ * The discount value (percentage 1-100 or fixed dollar amount)
66
+ * @type {number}
73
67
  * @memberof Discount
74
68
  */
75
- automatic: boolean;
69
+ value: number;
76
70
  /**
77
- *
71
+ * Maximum discount amount for percentage discounts (optional, mainly for COUPON_CODE)
78
72
  * @type {number}
79
73
  * @memberof Discount
80
74
  */
81
75
  cappedAt: number;
82
76
  /**
83
- *
84
- * @type {number}
77
+ * Coupon code (required for COUPON_CODE type)
78
+ * @type {string}
85
79
  * @memberof Discount
86
80
  */
87
- amount: number;
81
+ code: string;
88
82
  /**
89
- *
83
+ * When the discount becomes active
90
84
  * @type {Date}
91
85
  * @memberof Discount
92
86
  */
93
87
  startsAt: Date;
94
88
  /**
95
- *
89
+ * When the discount expires
96
90
  * @type {Date}
97
91
  * @memberof Discount
98
92
  */
99
93
  expiresAt: Date;
100
94
  /**
101
- *
102
- * @type {number}
103
- * @memberof Discount
104
- */
105
- maxUses: number;
106
- /**
107
- *
108
- * @type {number}
109
- * @memberof Discount
110
- */
111
- numberOfUses: number;
112
- /**
113
- *
95
+ * Current lifecycle state
114
96
  * @type {string}
115
97
  * @memberof Discount
116
98
  */
117
99
  state: DiscountStateEnum;
118
100
  /**
119
- *
120
- * @type {Array<string>}
101
+ * Quick toggle to enable/disable the discount
102
+ * @type {boolean}
121
103
  * @memberof Discount
122
104
  */
123
- categoriesEligible: Array<string>;
105
+ isActive: boolean;
124
106
  /**
125
- *
107
+ * Products to apply discount to (all their variants will be discounted)
126
108
  * @type {Array<string>}
127
109
  * @memberof Discount
128
110
  */
129
111
  productsEligible: Array<string>;
130
112
  /**
131
- *
113
+ * Specific variants to apply discount to
132
114
  * @type {Array<string>}
133
115
  * @memberof Discount
134
116
  */
135
117
  variantsEligible: Array<string>;
136
118
  /**
137
- *
138
- * @type {string}
139
- * @memberof Discount
140
- */
141
- storeId: string;
142
- /**
143
- *
144
- * @type {Array<UsedBy>}
119
+ * Maximum total times this discount can be used (optional)
120
+ * @type {number}
145
121
  * @memberof Discount
146
122
  */
147
- usedBy: Array<UsedBy>;
123
+ maxUses: number;
148
124
  /**
149
- *
125
+ * Maximum times a single user can use this discount (optional)
150
126
  * @type {number}
151
127
  * @memberof Discount
152
128
  */
153
129
  maxUsesPerUser: number;
154
130
  /**
155
- *
156
- * @type {string}
157
- * @memberof Discount
158
- */
159
- minPurchaseRequired: DiscountMinPurchaseRequiredEnum;
160
- /**
161
- *
131
+ * Current total usage count
162
132
  * @type {number}
163
133
  * @memberof Discount
164
134
  */
165
- minPurchaseAmount: number;
135
+ numberOfUses: number;
166
136
  /**
167
- *
168
- * @type {number}
137
+ * Usage history
138
+ * @type {Array<UsedBy>}
169
139
  * @memberof Discount
170
140
  */
171
- minPurchaseQuantity: number;
141
+ usedBy: Array<UsedBy>;
172
142
  /**
173
143
  *
174
144
  * @type {string}
175
145
  * @memberof Discount
176
146
  */
177
- customerEligibility: DiscountCustomerEligibilityEnum;
178
- /**
179
- *
180
- * @type {Array<string>}
181
- * @memberof Discount
182
- */
183
- usersEligible: Array<string>;
184
- /**
185
- *
186
- * @type {Array<string>}
187
- * @memberof Discount
188
- */
189
- groupsEligible: Array<string>;
147
+ storeId: string;
190
148
  }
191
149
 
192
150
  /**
193
151
  * @export
194
152
  * @enum {string}
195
153
  */
196
- export enum DiscountDiscountTypeEnum {
197
- PRODUCT = 'PRODUCT',
198
- CATEGORY = 'CATEGORY',
199
- VARIANT = 'VARIANT'
154
+ export enum DiscountTypeEnum {
155
+ ITEMDISCOUNT = 'ITEM_DISCOUNT',
156
+ COUPONCODE = 'COUPON_CODE'
200
157
  }
201
158
  /**
202
159
  * @export
203
160
  * @enum {string}
204
161
  */
205
- export enum DiscountDecreasePriceByEnum {
162
+ export enum DiscountValueTypeEnum {
206
163
  PERCENTAGE = 'PERCENTAGE',
207
- AMOUNT = 'AMOUNT'
164
+ FIXEDAMOUNT = 'FIXED_AMOUNT'
208
165
  }
209
166
  /**
210
167
  * @export
@@ -216,22 +173,4 @@ export enum DiscountStateEnum {
216
173
  EXPIRED = 'EXPIRED',
217
174
  SCHEDULED = 'SCHEDULED'
218
175
  }
219
- /**
220
- * @export
221
- * @enum {string}
222
- */
223
- export enum DiscountMinPurchaseRequiredEnum {
224
- NOREQUIREMENT = 'NO_REQUIREMENT',
225
- MINIMUMAMOUNT = 'MINIMUM_AMOUNT',
226
- MINIMUMQUANTITY = 'MINIMUM_QUANTITY'
227
- }
228
- /**
229
- * @export
230
- * @enum {string}
231
- */
232
- export enum DiscountCustomerEligibilityEnum {
233
- ALL = 'ALL',
234
- SPECIFICUSERS = 'SPECIFIC_USERS',
235
- SPECIFICGROUPS = 'SPECIFIC_GROUPS'
236
- }
237
176
 
@@ -48,4 +48,16 @@ export interface DiscountsInsightsDto {
48
48
  * @memberof DiscountsInsightsDto
49
49
  */
50
50
  totalScheduled: number;
51
+ /**
52
+ *
53
+ * @type {number}
54
+ * @memberof DiscountsInsightsDto
55
+ */
56
+ totalItemDiscounts: number;
57
+ /**
58
+ *
59
+ * @type {number}
60
+ * @memberof DiscountsInsightsDto
61
+ */
62
+ totalCouponCodes: number;
51
63
  }
@@ -8,6 +8,7 @@ export * from './available-dates-dto';
8
8
  export * from './available-suggested-dates-dto';
9
9
  export * from './blog';
10
10
  export * from './browser-stats-response-dto';
11
+ export * from './bulk-channel-toggle-dto';
11
12
  export * from './bulk-move-subcategories-dto';
12
13
  export * from './bulk-unassign-subcategories-dto';
13
14
  export * from './campaign-content-response-dto';
@@ -30,7 +31,8 @@ export * from './category-sub-category-populated';
30
31
  export * from './categorys-headlines-response-dto';
31
32
  export * from './change-password-dto';
32
33
  export * from './change-user-email-dto';
33
- export * from './check-notifications-response-dto';
34
+ export * from './channel-settings-dto';
35
+ export * from './completed-order-dto';
34
36
  export * from './contact-aggregated-stats-response-dto';
35
37
  export * from './contact-full-dto';
36
38
  export * from './contact-full-response-dto';
@@ -48,9 +50,9 @@ export * from './create-email-template-dto';
48
50
  export * from './create-event-dto';
49
51
  export * from './create-marketing-campaign-dto';
50
52
  export * from './create-message-dto';
51
- export * from './create-notification-dto';
52
53
  export * from './create-product-dto';
53
54
  export * from './create-review-dto';
55
+ export * from './create-shippo-account-dto';
54
56
  export * from './create-store-address-dto';
55
57
  export * from './create-store-dto';
56
58
  export * from './create-store-dto-settings';
@@ -62,7 +64,6 @@ export * from './custom-product-dto';
62
64
  export * from './delete-file-dto';
63
65
  export * from './delete-many-files-dto';
64
66
  export * from './discount';
65
- export * from './discount-paginated-response';
66
67
  export * from './discounts-insights-dto';
67
68
  export * from './email-invoice-dto';
68
69
  export * from './email-template-response-dto';
@@ -78,14 +79,13 @@ export * from './group-with-users-dto';
78
79
  export * from './images-upload-body';
79
80
  export * from './link-stats-response-dto';
80
81
  export * from './login-dto';
81
- export * from './manual-discount';
82
+ export * from './manual-discount-dto';
82
83
  export * from './manual-order-dto';
83
84
  export * from './manual-shipping-dto';
84
85
  export * from './marketing-campaign-content-dto';
85
86
  export * from './marketing-list-contact-dto';
86
87
  export * from './move-subcategory-dto';
87
88
  export * from './new-client-email-dto';
88
- export * from './notification';
89
89
  export * from './object-id';
90
90
  export * from './order';
91
91
  export * from './order-paginated-response';
@@ -96,12 +96,13 @@ export * from './payment';
96
96
  export * from './payment-time-line-dto';
97
97
  export * from './payments-insights-dto';
98
98
  export * from './payments-paginated-response';
99
- export * from './pick-type-class';
100
99
  export * from './populated-discount';
101
100
  export * from './populated-order';
102
101
  export * from './prefered-pick-or-delivery-time-dto';
102
+ export * from './preference-update-item';
103
103
  export * from './price-range';
104
104
  export * from './product';
105
+ export * from './product-light-dto';
105
106
  export * from './product-summary';
106
107
  export * from './product-variant';
107
108
  export * from './products-insights-dto';
@@ -116,6 +117,9 @@ export * from './reorder-subcategories-dto';
116
117
  export * from './reorder-success-response-dto';
117
118
  export * from './reserve-appointment';
118
119
  export * from './review';
120
+ export * from './review-status-dto';
121
+ export * from './reviewable-order-dto';
122
+ export * from './reviewable-product-dto';
119
123
  export * from './schedule-campaign-draft-dto';
120
124
  export * from './schedule-tour-email-dto';
121
125
  export * from './send-test-email-dto';
@@ -124,13 +128,13 @@ export * from './shipment-details-dto';
124
128
  export * from './shipment-status-dto';
125
129
  export * from './shipment-with-order';
126
130
  export * from './shipping-info';
131
+ export * from './shippo-account-response-dto';
127
132
  export * from './single-browser-stats-dto';
128
133
  export * from './single-contact-aggregated-stats-dto';
129
134
  export * from './single-contact-list-stats-dto';
130
135
  export * from './single-country-stats-dto';
131
136
  export * from './single-general-stats';
132
137
  export * from './single-link-stats-dto';
133
- export * from './single-notification-dto';
134
138
  export * from './single-product-media';
135
139
  export * from './single-recipient-dto';
136
140
  export * from './store';
@@ -159,6 +163,7 @@ export * from './update-items-order-dto';
159
163
  export * from './update-manual-shipment-status-dto';
160
164
  export * from './update-marketing-camp-draft-dto';
161
165
  export * from './update-message-dto';
166
+ export * from './update-notification-settings-dto';
162
167
  export * from './update-product-dto';
163
168
  export * from './update-refill-request-dto';
164
169
  export * from './update-review-dto';
@@ -176,5 +181,6 @@ export * from './user-insights-dto';
176
181
  export * from './user-with-no-id';
177
182
  export * from './users-paginated-response';
178
183
  export * from './variant-id-inventory-body';
184
+ export * from './variant-light-dto';
179
185
  export * from './verify-email-dto';
180
186
  export * from './wishlist';
@@ -14,36 +14,36 @@
14
14
  /**
15
15
  *
16
16
  * @export
17
- * @interface ManualDiscount
17
+ * @interface ManualDiscountDto
18
18
  */
19
- export interface ManualDiscount {
19
+ export interface ManualDiscountDto {
20
20
  _id?: string;
21
21
  /**
22
22
  *
23
23
  * @type {string}
24
- * @memberof ManualDiscount
24
+ * @memberof ManualDiscountDto
25
25
  */
26
- decreasePriceBy?: ManualDiscountDecreasePriceByEnum;
26
+ valueType: ManualDiscountDtoValueTypeEnum;
27
27
  /**
28
28
  *
29
29
  * @type {number}
30
- * @memberof ManualDiscount
30
+ * @memberof ManualDiscountDto
31
31
  */
32
- amount?: number;
32
+ value: number;
33
33
  /**
34
34
  *
35
35
  * @type {string}
36
- * @memberof ManualDiscount
36
+ * @memberof ManualDiscountDto
37
37
  */
38
- reason: string;
38
+ reason?: string;
39
39
  }
40
40
 
41
41
  /**
42
42
  * @export
43
43
  * @enum {string}
44
44
  */
45
- export enum ManualDiscountDecreasePriceByEnum {
45
+ export enum ManualDiscountDtoValueTypeEnum {
46
46
  PERCENTAGE = 'PERCENTAGE',
47
- AMOUNT = 'AMOUNT'
47
+ FIXEDAMOUNT = 'FIXED_AMOUNT'
48
48
  }
49
49
 
@@ -13,7 +13,7 @@
13
13
  */
14
14
  import { CartItem } from './cart-item';
15
15
  import { CustomProductDto } from './custom-product-dto';
16
- import { ManualDiscount } from './manual-discount';
16
+ import { ManualDiscountDto } from './manual-discount-dto';
17
17
  import { ManualShippingDto } from './manual-shipping-dto';
18
18
  /**
19
19
  *
@@ -36,10 +36,10 @@ export interface ManualOrderDTO {
36
36
  notes?: string;
37
37
  /**
38
38
  *
39
- * @type {ManualDiscount}
39
+ * @type {ManualDiscountDto}
40
40
  * @memberof ManualOrderDTO
41
41
  */
42
- manualDiscount: ManualDiscount;
42
+ manualDiscount: ManualDiscountDto;
43
43
  /**
44
44
  *
45
45
  * @type {string}