hey-pharmacist-ecommerce 1.1.25 → 1.1.26

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 (62) hide show
  1. package/dist/index.d.mts +1 -206
  2. package/dist/index.d.ts +1 -206
  3. package/dist/index.js +47 -233
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +47 -233
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +1 -1
  8. package/src/components/CartItem.tsx +0 -10
  9. package/src/components/ProductCard.tsx +4 -5
  10. package/src/lib/Apis/api.ts +0 -8
  11. package/src/lib/Apis/apis/product-variants-api.ts +0 -96
  12. package/src/lib/Apis/apis/products-api.ts +7 -15
  13. package/src/lib/Apis/apis/shipping-api.ts +12 -214
  14. package/src/lib/Apis/models/category-filters.ts +0 -6
  15. package/src/lib/Apis/models/create-variant-dto.ts +0 -6
  16. package/src/lib/Apis/models/discounts-insights-dto.ts +0 -6
  17. package/src/lib/Apis/models/index.ts +0 -29
  18. package/src/lib/Apis/models/orders-insights-dto.ts +0 -6
  19. package/src/lib/Apis/models/payment.ts +0 -7
  20. package/src/lib/Apis/models/product-variant.ts +0 -6
  21. package/src/lib/Apis/models/products-insights-dto.ts +0 -6
  22. package/src/lib/Apis/models/rate-dto.ts +0 -6
  23. package/src/lib/Apis/models/update-product-variant-dto.ts +0 -6
  24. package/src/providers/WishlistProvider.tsx +2 -3
  25. package/src/screens/CheckoutScreen.tsx +25 -73
  26. package/src/lib/Apis/apis/chats-api.ts +0 -1101
  27. package/src/lib/Apis/apis/drafts-api.ts +0 -448
  28. package/src/lib/Apis/apis/open-aiapi.ts +0 -513
  29. package/src/lib/Apis/apis/payment-methods-api.ts +0 -411
  30. package/src/lib/Apis/apis/product-attributes-api.ts +0 -538
  31. package/src/lib/Apis/apis/product-favorite-list-api.ts +0 -321
  32. package/src/lib/Apis/apis/roles-api.ts +0 -614
  33. package/src/lib/Apis/apis/statistics-api.ts +0 -234
  34. package/src/lib/Apis/models/add-message-dto.ts +0 -56
  35. package/src/lib/Apis/models/chat.ts +0 -33
  36. package/src/lib/Apis/models/create-chat-dto.ts +0 -39
  37. package/src/lib/Apis/models/create-draft-dto.ts +0 -67
  38. package/src/lib/Apis/models/create-product-attribute-dto.ts +0 -33
  39. package/src/lib/Apis/models/create-role-dto.ts +0 -57
  40. package/src/lib/Apis/models/create-zone-dto.ts +0 -82
  41. package/src/lib/Apis/models/default-payment-method-request-dto.ts +0 -27
  42. package/src/lib/Apis/models/draft.ts +0 -79
  43. package/src/lib/Apis/models/google-analytics-request-dto.ts +0 -55
  44. package/src/lib/Apis/models/google-analytics-response-dto.ts +0 -39
  45. package/src/lib/Apis/models/my-favorite-list-dto.ts +0 -52
  46. package/src/lib/Apis/models/open-api.ts +0 -33
  47. package/src/lib/Apis/models/payment-method-data.ts +0 -34
  48. package/src/lib/Apis/models/payment-method.ts +0 -51
  49. package/src/lib/Apis/models/populated-chat-dto.ts +0 -95
  50. package/src/lib/Apis/models/product-attribute.ts +0 -57
  51. package/src/lib/Apis/models/product.ts +0 -142
  52. package/src/lib/Apis/models/role.ts +0 -69
  53. package/src/lib/Apis/models/single-message-populated.ts +0 -59
  54. package/src/lib/Apis/models/single-suggest-attribute.ts +0 -33
  55. package/src/lib/Apis/models/statistic-dto.ts +0 -171
  56. package/src/lib/Apis/models/suggest-attributes.ts +0 -28
  57. package/src/lib/Apis/models/update-product-attribute-dto.ts +0 -33
  58. package/src/lib/Apis/models/update-role-dto.ts +0 -57
  59. package/src/lib/Apis/models/update-zone-dto.ts +0 -82
  60. package/src/lib/Apis/models/user.ts +0 -232
  61. package/src/lib/Apis/models/zone-single-size.ts +0 -51
  62. package/src/lib/Apis/models/zone.ts +0 -106
@@ -1,5 +1,4 @@
1
1
  export * from './add-contact-to-list-dto';
2
- export * from './add-message-dto';
3
2
  export * from './address';
4
3
  export * from './address-created-request';
5
4
  export * from './allow-user-credit-dto';
@@ -29,7 +28,6 @@ export * from './category-populated';
29
28
  export * from './category-sub-category-populated';
30
29
  export * from './categorys-headlines-response-dto';
31
30
  export * from './change-user-email-dto';
32
- export * from './chat';
33
31
  export * from './check-notifications-response-dto';
34
32
  export * from './contact-aggregated-stats-response-dto';
35
33
  export * from './contact-full-dto';
@@ -41,20 +39,16 @@ export * from './country-stats-response-dto';
41
39
  export * from './create-address-dto';
42
40
  export * from './create-blog-dto';
43
41
  export * from './create-category-dto';
44
- export * from './create-chat-dto';
45
42
  export * from './create-contact-dto';
46
43
  export * from './create-contact-list-dto';
47
44
  export * from './create-discount-dto';
48
- export * from './create-draft-dto';
49
45
  export * from './create-email-template-dto';
50
46
  export * from './create-event-dto';
51
47
  export * from './create-marketing-campaign-dto';
52
48
  export * from './create-message-dto';
53
49
  export * from './create-notification-dto';
54
- export * from './create-product-attribute-dto';
55
50
  export * from './create-product-dto';
56
51
  export * from './create-review-dto';
57
- export * from './create-role-dto';
58
52
  export * from './create-single-variant-product-dto';
59
53
  export * from './create-store-address-dto';
60
54
  export * from './create-store-dto';
@@ -62,15 +56,12 @@ export * from './create-sub-category-dto';
62
56
  export * from './create-user-dto';
63
57
  export * from './create-user-group-dto';
64
58
  export * from './create-variant-dto';
65
- export * from './create-zone-dto';
66
59
  export * from './custom-product-dto';
67
- export * from './default-payment-method-request-dto';
68
60
  export * from './delete-file-dto';
69
61
  export * from './delete-many-files-dto';
70
62
  export * from './discount';
71
63
  export * from './discount-paginated-response';
72
64
  export * from './discounts-insights-dto';
73
- export * from './draft';
74
65
  export * from './email-invoice-dto';
75
66
  export * from './email-template-response-dto';
76
67
  export * from './event';
@@ -82,8 +73,6 @@ export * from './general-stats-response-dto';
82
73
  export * from './generate-day-slots-dto';
83
74
  export * from './generate-month-slots-dto';
84
75
  export * from './generate-week-slots-dto';
85
- export * from './google-analytics-request-dto';
86
- export * from './google-analytics-response-dto';
87
76
  export * from './group-with-no-users-dto';
88
77
  export * from './group-with-users-dto';
89
78
  export * from './images-upload-body';
@@ -95,30 +84,23 @@ export * from './manual-shipping-dto';
95
84
  export * from './marketing-campaign-content-dto';
96
85
  export * from './marketing-list-contact-dto';
97
86
  export * from './move-subcategory-dto';
98
- export * from './my-favorite-list-dto';
99
87
  export * from './new-client-email-dto';
100
88
  export * from './notification';
101
89
  export * from './object-id';
102
- export * from './open-api';
103
90
  export * from './order';
104
91
  export * from './order-paginated-response';
105
92
  export * from './order-time-line-dto';
106
93
  export * from './orders-insights-dto';
107
94
  export * from './paginated-products-dto';
108
95
  export * from './payment';
109
- export * from './payment-method';
110
- export * from './payment-method-data';
111
96
  export * from './payment-time-line-dto';
112
97
  export * from './payments-insights-dto';
113
98
  export * from './payments-paginated-response';
114
99
  export * from './pick-type-class';
115
- export * from './populated-chat-dto';
116
100
  export * from './populated-discount';
117
101
  export * from './populated-order';
118
102
  export * from './prefered-pick-or-delivery-time-dto';
119
103
  export * from './price-range';
120
- export * from './product';
121
- export * from './product-attribute';
122
104
  export * from './product-variant';
123
105
  export * from './products-insights-dto';
124
106
  export * from './rate-dto';
@@ -127,7 +109,6 @@ export * from './refill-request-dto';
127
109
  export * from './register-or-login-with-gmail';
128
110
  export * from './reserve-appointment';
129
111
  export * from './review';
130
- export * from './role';
131
112
  export * from './schedule-campaign-draft-dto';
132
113
  export * from './schedule-tour-email-dto';
133
114
  export * from './send-test-email-dto';
@@ -143,17 +124,13 @@ export * from './single-contact-list-stats-dto';
143
124
  export * from './single-country-stats-dto';
144
125
  export * from './single-general-stats';
145
126
  export * from './single-link-stats-dto';
146
- export * from './single-message-populated';
147
127
  export * from './single-notification-dto';
148
128
  export * from './single-product-media';
149
129
  export * from './single-recipient-dto';
150
- export * from './single-suggest-attribute';
151
- export * from './statistic-dto';
152
130
  export * from './store';
153
131
  export * from './store-entity';
154
132
  export * from './sub-category';
155
133
  export * from './sub-category-headlines-only-response-dto';
156
- export * from './suggest-attributes';
157
134
  export * from './suggested-slot';
158
135
  export * from './tadmin-session-data';
159
136
  export * from './tuser-session-data';
@@ -174,21 +151,17 @@ export * from './update-event-dto';
174
151
  export * from './update-items-order-dto';
175
152
  export * from './update-marketing-camp-draft-dto';
176
153
  export * from './update-message-dto';
177
- export * from './update-product-attribute-dto';
178
154
  export * from './update-product-dto';
179
155
  export * from './update-product-variant-dto';
180
156
  export * from './update-refill-request-dto';
181
157
  export * from './update-review-dto';
182
- export * from './update-role-dto';
183
158
  export * from './update-store-dto';
184
159
  export * from './update-sub-category-dto';
185
160
  export * from './update-transfere-patients-request-dto';
186
161
  export * from './update-user-dto';
187
162
  export * from './update-user-group-dto';
188
- export * from './update-zone-dto';
189
163
  export * from './upload-pdf-body';
190
164
  export * from './used-by';
191
- export * from './user';
192
165
  export * from './user-entity';
193
166
  export * from './user-group';
194
167
  export * from './user-insights-dto';
@@ -196,5 +169,3 @@ export * from './user-with-no-id';
196
169
  export * from './users-paginated-response';
197
170
  export * from './verify-email-dto';
198
171
  export * from './wishlist';
199
- export * from './zone';
200
- export * from './zone-single-size';
@@ -60,10 +60,4 @@ export interface OrdersInsightsDto {
60
60
  * @memberof OrdersInsightsDto
61
61
  */
62
62
  totalOutForDeliveryOrders: number;
63
- /**
64
- *
65
- * @type {number}
66
- * @memberof OrdersInsightsDto
67
- */
68
- draftsCount: number;
69
63
  }
@@ -11,7 +11,6 @@
11
11
  * https://github.com/swagger-api/swagger-codegen.git
12
12
  * Do not edit the class manually.
13
13
  */
14
- import { PaymentMethod } from './payment-method';
15
14
  import { PaymentTimeLineDTO } from './payment-time-line-dto';
16
15
  import { UserWithNoId } from './user-with-no-id';
17
16
  /**
@@ -63,12 +62,6 @@ export interface Payment {
63
62
  * @memberof Payment
64
63
  */
65
64
  orderId: string;
66
- /**
67
- *
68
- * @type {PaymentMethod}
69
- * @memberof Payment
70
- */
71
- paymentCardDetails: PaymentMethod;
72
65
  /**
73
66
  *
74
67
  * @type {UserWithNoId}
@@ -116,12 +116,6 @@ export interface ProductVariant {
116
116
  * @memberof ProductVariant
117
117
  */
118
118
  sku: string;
119
- /**
120
- *
121
- * @type {{ [key: string]: string; }}
122
- * @memberof ProductVariant
123
- */
124
- attribute: { [key: string]: string; };
125
119
  /**
126
120
  *
127
121
  * @type {boolean}
@@ -36,10 +36,4 @@ export interface ProductsInsightsDto {
36
36
  * @memberof ProductsInsightsDto
37
37
  */
38
38
  totalInactiveProducts: number;
39
- /**
40
- *
41
- * @type {number}
42
- * @memberof ProductsInsightsDto
43
- */
44
- totalDrafts: number;
45
39
  }
@@ -42,12 +42,6 @@ export interface RateDto {
42
42
  * @memberof RateDto
43
43
  */
44
44
  currencyLocal: string;
45
- /**
46
- *
47
- * @type {Array<string>}
48
- * @memberof RateDto
49
- */
50
- attributes: Array<string>;
51
45
  /**
52
46
  *
53
47
  * @type {string}
@@ -37,12 +37,6 @@ export interface UpdateProductVariantDto {
37
37
  * @memberof UpdateProductVariantDto
38
38
  */
39
39
  description?: string;
40
- /**
41
- *
42
- * @type {{ [key: string]: string; }}
43
- * @memberof UpdateProductVariantDto
44
- */
45
- attribute?: { [key: string]: string; };
46
40
  /**
47
41
  *
48
42
  * @type {number}
@@ -6,12 +6,11 @@ import { AXIOS_CONFIG } from '@/lib/Apis/wrapper';
6
6
  import { useAuth } from './AuthProvider';
7
7
  import { useMemo } from 'react';
8
8
  import { Wishlist } from '@/lib/Apis';
9
- import { Product } from '@/lib/Apis/models';
10
9
  import { useNotification } from './NotificationProvider';
11
10
 
12
11
 
13
12
  interface WishlistContextType extends Wishlist {
14
- addToWishlist: (product: Product) => Promise<void>;
13
+ addToWishlist: (product: any) => Promise<void>;
15
14
  removeFromWishlist: (productId: string) => Promise<void>;
16
15
  isInWishlist: (productId: string) => boolean;
17
16
  getWishlistCount: () => number;
@@ -73,7 +72,7 @@ export function WishlistProvider({ children }: { children: ReactNode }) {
73
72
  fetchWishlist();
74
73
  }, [fetchWishlist]);
75
74
 
76
- const addToWishlist = async (product: Product) => {
75
+ const addToWishlist = async (product: any) => {
77
76
  if (!isAuthenticated) {
78
77
  notification.error(
79
78
  'Sign-in required',
@@ -66,14 +66,14 @@ const PAYMENT_METHODS = [
66
66
  className: 'border-amber-500 hover:bg-amber-50',
67
67
  activeClass: 'bg-amber-50 border-amber-500 text-amber-700',
68
68
  },
69
- {
70
- label: 'Credit',
71
- value: 'Credit',
72
- icon: <ShieldCheck className="w-5 h-5" />,
73
- description: 'Use your account credit',
74
- className: 'border-emerald-500 hover:bg-emerald-50',
75
- activeClass: 'bg-emerald-50 border-emerald-500 text-emerald-700',
76
- },
69
+ // {
70
+ // label: 'Credit',
71
+ // value: 'Credit',
72
+ // icon: <ShieldCheck className="w-5 h-5" />,
73
+ // description: 'Use your account credit',
74
+ // className: 'border-emerald-500 hover:bg-emerald-50',
75
+ // activeClass: 'bg-emerald-50 border-emerald-500 text-emerald-700',
76
+ // },
77
77
  ];
78
78
 
79
79
  export function CheckoutScreen() {
@@ -86,7 +86,6 @@ export function CheckoutScreen() {
86
86
  const [paymentMethod, setPaymentMethod] = useState('Card');
87
87
  const [error, setError] = useState<string | null>(null);
88
88
  const [selectedAddressId, setSelectedAddressId] = useState<string | null>(null);
89
- const [selectedStoreAddressId, setSelectedStoreAddressId] = useState<string | null>(null);
90
89
  const [storeAddresses, setStoreAddresses] = useState<any[]>([]); // For pickup selection
91
90
  const [isAddressModalOpen, setIsAddressModalOpen] = useState(false);
92
91
  const [editingAddress, setEditingAddress] = useState<any | null>(null);
@@ -220,19 +219,9 @@ export function CheckoutScreen() {
220
219
  durationTerms?: string;
221
220
  estimatedDays?: number;
222
221
  providerImage75?: string;
223
- attributes?: string[];
224
222
  test?: boolean;
225
223
  }
226
224
 
227
- interface ShippingResponse {
228
- data?: {
229
- messages: ShippingMessage[];
230
- rates: ShippingRate[];
231
- status: string;
232
- };
233
- }
234
-
235
-
236
225
  useEffect(() => {
237
226
  if (!isDelivery || !selectedAddressId || !cart || cart?.cartBody?.items?.length === 0 || !cart?.cartBody?.items) {
238
227
  setShippingRates([]);
@@ -265,24 +254,18 @@ export function CheckoutScreen() {
265
254
 
266
255
  useEffect(() => {
267
256
  if (!isDelivery) {
268
- const stores = [
269
- { id: 'store1', name: 'Main Pharmacy', street1: '123 Main St', city: 'Seattle' },
270
- { id: 'store2', name: 'Eastside Pickup', street1: '456 East Ave', city: 'Bellevue' },
271
- ];
272
- setStoreAddresses(stores);
273
- setSelectedStoreAddressId(stores[0].id);
274
- setShippingPrice(0);
275
- } else {
276
- setStoreAddresses([]);
277
- setSelectedStoreAddressId(null);
257
+ (async () => {
258
+ const api = new ShippingApi(AXIOS_CONFIG);
259
+ const res = await api.getStoreAddress();
260
+ if (res.data) {
261
+ setStoreAddresses([res.data]);
262
+ setShippingPrice(0);
263
+ }
264
+ })();
278
265
  }
266
+ // eslint-disable-next-line react-hooks/exhaustive-deps
279
267
  }, [isDelivery]);
280
268
 
281
- const checkoutSteps = [
282
- { id: 1, label: 'Cart', status: 'complete' as const },
283
- { id: 2, label: 'Details', status: 'current' as const },
284
- { id: 3, label: 'Payment', status: 'upcoming' as const },
285
- ];
286
269
 
287
270
  const onSubmit = async (data: CheckoutFormData) => {
288
271
  setError(null);
@@ -319,10 +302,6 @@ export function CheckoutScreen() {
319
302
  }
320
303
  }
321
304
  } else {
322
- if (!selectedStoreAddressId) {
323
- setError('Please select a pickup location.');
324
- return;
325
- }
326
305
  if (storeAddresses.length === 0) {
327
306
  setError('Store pickup location is not available.');
328
307
  return;
@@ -367,7 +346,6 @@ export function CheckoutScreen() {
367
346
  orderRemindingDates: [],
368
347
  shippingAddress: data.shipping,
369
348
  billingAddress: sameAsShipping ? data.shipping : data.billing,
370
- pickupStoreId: !isDelivery ? selectedStoreAddressId : undefined,
371
349
  };
372
350
 
373
351
  const api = new OrdersApi(AXIOS_CONFIG);
@@ -594,15 +572,13 @@ export function CheckoutScreen() {
594
572
  {!isDelivery && storeAddresses.length > 0 && (
595
573
  <div className="md:col-span-2">
596
574
  <label className="block mb-2 font-semibold">Select Pickup Location</label>
597
- <select
598
- className="w-full border rounded-sm p-2"
599
- value={selectedStoreAddressId || ''}
600
- onChange={e => setSelectedStoreAddressId(e.target.value)}
601
- >
575
+ <div className="flex items-center gap-2">
602
576
  {storeAddresses.map(addr => (
603
- <option key={addr.id} value={addr.id}>{addr.name} - {addr.street1}, {addr.city}</option>
577
+ <div key={addr.id} className="w-full border rounded-sm p-2">
578
+ <p>{addr.name} - {addr.street1}, {addr.city}, {addr.state} {addr.zip}</p>
579
+ </div>
604
580
  ))}
605
- </select>
581
+ </div>
606
582
  </div>
607
583
  )}
608
584
  </div>
@@ -612,7 +588,7 @@ export function CheckoutScreen() {
612
588
  {isDelivery && selectedAddressId && (
613
589
  <div className="bg-white border-2 border-gray-100 rounded-[24px] p-8 text-[#2B4B7C]">
614
590
  <div className="flex items-center gap-3 text-xl font-semibold text-gray-900 pb-4 mb-8 border-b">
615
- <Truck className="text-accent w-8 h-8 flex items-center justify-center text-[#2B4B7C]" />
591
+ <Truck className="w-8 h-8 flex items-center justify-center text-[#2B4B7C]" />
616
592
  <h2 className="font-['Poppins',sans-serif] font-semibold text-[#2B4B7C] text-2xl">Shipping Options</h2>
617
593
  </div>
618
594
 
@@ -638,8 +614,6 @@ export function CheckoutScreen() {
638
614
  {shippingRates.map((rate) => {
639
615
  const isSelected = !!selectedShippingRateId && selectedShippingRateId === rate.objectId;
640
616
  const isTest = rate.test;
641
- const hasAttributes = rate.attributes && rate.attributes.length > 0;
642
-
643
617
  return (
644
618
  <div
645
619
  key={rate.objectId}
@@ -681,28 +655,6 @@ export function CheckoutScreen() {
681
655
  </span>
682
656
  )}
683
657
  </div>
684
-
685
- {/* Attributes */}
686
- {hasAttributes && (
687
- <div className="flex flex-wrap gap-2 mb-3">
688
- {rate.attributes.map((attr: string) => (
689
- <span
690
- key={attr}
691
- className={`px-2 py-1 text-xs font-medium rounded-full ${attr === 'FASTEST'
692
- ? 'bg-green-100 text-green-800'
693
- : attr === 'BESTVALUE'
694
- ? 'bg-blue-100 text-blue-800'
695
- : attr === 'CHEAPEST'
696
- ? 'bg-purple-100 text-purple-800'
697
- : 'bg-gray-100 text-gray-800'
698
- }`}
699
- >
700
- {attr}
701
- </span>
702
- ))}
703
- </div>
704
- )}
705
-
706
658
  {/* Delivery Info */}
707
659
  <div className="space-y-1 text-sm text-gray-600">
708
660
  {rate.durationTerms && (
@@ -906,8 +858,8 @@ export function CheckoutScreen() {
906
858
  'You will be redirected to a secure payment page.'}
907
859
  {paymentMethod === 'Cash' &&
908
860
  'Pay with cash at the time of delivery or pickup.'}
909
- {paymentMethod === 'Credit' &&
910
- 'Use your available account credit for this order.'}
861
+ {/* {paymentMethod === 'Credit' &&
862
+ 'Use your available account credit for this order.'} */}
911
863
  </p>
912
864
  </div>
913
865
  </div>