@timardex/cluemart-shared 1.4.37 → 1.4.38

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 (41) hide show
  1. package/dist/{auth-HbXNMRIh.d.mts → auth-DUBji9Ck.d.mts} +1 -1
  2. package/dist/{auth-B_WKc68t.d.ts → auth-DlfrrfXs.d.ts} +1 -1
  3. package/dist/{chunk-JKQ4GVSJ.mjs → chunk-M35ZHJPQ.mjs} +31 -1
  4. package/dist/chunk-M35ZHJPQ.mjs.map +1 -0
  5. package/dist/{chunk-LGLQLG47.mjs → chunk-PZUKAO6K.mjs} +5 -1
  6. package/dist/chunk-PZUKAO6K.mjs.map +1 -0
  7. package/dist/formFields/index.cjs +32 -0
  8. package/dist/formFields/index.cjs.map +1 -1
  9. package/dist/formFields/index.d.mts +4 -2
  10. package/dist/formFields/index.d.ts +4 -2
  11. package/dist/formFields/index.mjs +5 -1
  12. package/dist/{global-DgA-5e-O.d.ts → global-B07TrIzO.d.ts} +8 -4
  13. package/dist/{global-V7YaFCJR.d.mts → global-DgdaY28O.d.mts} +8 -4
  14. package/dist/graphql/index.cjs +4 -0
  15. package/dist/graphql/index.cjs.map +1 -1
  16. package/dist/graphql/index.d.mts +3 -3
  17. package/dist/graphql/index.d.ts +3 -3
  18. package/dist/graphql/index.mjs +1 -1
  19. package/dist/hooks/index.cjs +57 -8
  20. package/dist/hooks/index.cjs.map +1 -1
  21. package/dist/hooks/index.d.mts +3 -3
  22. package/dist/hooks/index.d.ts +3 -3
  23. package/dist/hooks/index.mjs +55 -10
  24. package/dist/hooks/index.mjs.map +1 -1
  25. package/dist/index.cjs +89 -8
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.d.mts +11 -5
  28. package/dist/index.d.ts +11 -5
  29. package/dist/index.mjs +87 -8
  30. package/dist/index.mjs.map +1 -1
  31. package/dist/{post-DklGTzDA.d.mts → post-75KGk2Nr.d.mts} +1 -1
  32. package/dist/{post-vmmaQ9XX.d.ts → post-Bt32gXMn.d.ts} +1 -1
  33. package/dist/{resourceActivities-BtWfy0kk.d.mts → resourceActivities-B2Yp2GKt.d.mts} +1 -1
  34. package/dist/{resourceActivities-fgwhRy0j.d.ts → resourceActivities-PNcgmHGK.d.ts} +1 -1
  35. package/dist/types/index.d.mts +5 -5
  36. package/dist/types/index.d.ts +5 -5
  37. package/dist/utils/index.d.mts +1 -1
  38. package/dist/utils/index.d.ts +1 -1
  39. package/package.json +1 -1
  40. package/dist/chunk-JKQ4GVSJ.mjs.map +0 -1
  41. package/dist/chunk-LGLQLG47.mjs.map +0 -1
@@ -1,8 +1,8 @@
1
1
  import * as _apollo_client from '@apollo/client';
2
2
  import { EnumResourceType } from '../enums/index.mjs';
3
- import { C as ChatType, R as ReportChatUser, N as NotificationCount, a as NotificationType, b as ResourceActivityType } from '../resourceActivities-BtWfy0kk.mjs';
4
- import { E as EventType, b as EventListItemType, c as EventInfoType, d as RelationType, e as ResourceConnectionsType, U as UnregisteredVendorType, V as VendorType, f as VendorInfoType, g as UserLicenceType } from '../global-V7YaFCJR.mjs';
5
- import { T as TesterType, U as UserType, P as PartnerType, A as AdType, E as EnumAdStatus, S as SubscriptionPlansResponse, a as SubscriptionStatusData, b as PostType, c as EnumPostType, d as AppSettingsType } from '../post-DklGTzDA.mjs';
3
+ import { C as ChatType, R as ReportChatUser, N as NotificationCount, a as NotificationType, b as ResourceActivityType } from '../resourceActivities-B2Yp2GKt.mjs';
4
+ import { E as EventType, b as EventListItemType, c as EventInfoType, d as RelationType, e as ResourceConnectionsType, U as UnregisteredVendorType, V as VendorType, f as VendorInfoType, g as UserLicenceType } from '../global-DgdaY28O.mjs';
5
+ import { T as TesterType, U as UserType, P as PartnerType, A as AdType, E as EnumAdStatus, S as SubscriptionPlansResponse, a as SubscriptionStatusData, b as PostType, c as EnumPostType, d as AppSettingsType } from '../post-75KGk2Nr.mjs';
6
6
  import 'react-hook-form';
7
7
 
8
8
  declare const useAdminUpdateResourceType: () => {
@@ -1,8 +1,8 @@
1
1
  import * as _apollo_client from '@apollo/client';
2
2
  import { EnumResourceType } from '../enums/index.js';
3
- import { C as ChatType, R as ReportChatUser, N as NotificationCount, a as NotificationType, b as ResourceActivityType } from '../resourceActivities-fgwhRy0j.js';
4
- import { E as EventType, b as EventListItemType, c as EventInfoType, d as RelationType, e as ResourceConnectionsType, U as UnregisteredVendorType, V as VendorType, f as VendorInfoType, g as UserLicenceType } from '../global-DgA-5e-O.js';
5
- import { T as TesterType, U as UserType, P as PartnerType, A as AdType, E as EnumAdStatus, S as SubscriptionPlansResponse, a as SubscriptionStatusData, b as PostType, c as EnumPostType, d as AppSettingsType } from '../post-vmmaQ9XX.js';
3
+ import { C as ChatType, R as ReportChatUser, N as NotificationCount, a as NotificationType, b as ResourceActivityType } from '../resourceActivities-PNcgmHGK.js';
4
+ import { E as EventType, b as EventListItemType, c as EventInfoType, d as RelationType, e as ResourceConnectionsType, U as UnregisteredVendorType, V as VendorType, f as VendorInfoType, g as UserLicenceType } from '../global-B07TrIzO.js';
5
+ import { T as TesterType, U as UserType, P as PartnerType, A as AdType, E as EnumAdStatus, S as SubscriptionPlansResponse, a as SubscriptionStatusData, b as PostType, c as EnumPostType, d as AppSettingsType } from '../post-Bt32gXMn.js';
6
6
  import 'react-hook-form';
7
7
 
8
8
  declare const useAdminUpdateResourceType: () => {
@@ -123,7 +123,7 @@ import {
123
123
  useUpdateVendor,
124
124
  useUpdateVendorInfo,
125
125
  useValidateVerificationToken
126
- } from "../chunk-LGLQLG47.mjs";
126
+ } from "../chunk-PZUKAO6K.mjs";
127
127
  import "../chunk-Z6FJKHRH.mjs";
128
128
  export {
129
129
  useAddParticipantToChat,
@@ -619,7 +619,17 @@ var eventInfoSchema = yup2.object().shape({
619
619
  return value < applicationDeadlineHours;
620
620
  }
621
621
  ),
622
- paymentInfo: yup2.array().of(paymentInfoSchema).min(1, "At least one payment method is required").required("Payment info is required")
622
+ paymentInfo: yup2.array().of(paymentInfoSchema).min(1, "At least one payment method is required").required("Payment info is required"),
623
+ refundPolicy: yup2.object({
624
+ cancelledByOrganiser: yup2.array().of(yup2.string().defined()).min(
625
+ 1,
626
+ "At least one refund policy for cancellations by organiser is required"
627
+ ).required("Refund policy for cancellations by organiser is required"),
628
+ cancelledByVendor: yup2.array().of(yup2.string().defined()).min(
629
+ 1,
630
+ "At least one refund policy for cancellations by vendor is required"
631
+ ).required("Refund policy for cancellations by vendor is required")
632
+ })
623
633
  });
624
634
 
625
635
  // src/yupSchema/vendor.ts
@@ -675,15 +685,27 @@ var vendorInfoSchema = yup3.object().shape({
675
685
  ).min(1, "Food flavors list must contain at least one item").required("Food flavors are required"),
676
686
  packaging: yup3.array().of(yup3.string().defined()).min(1, "Packaging list must contain at least one item").required("Packaging is required"),
677
687
  priceRange: yup3.object().shape({
678
- max: yup3.number().min(1).required("Max price is required").test(
688
+ max: yup3.string().required("Max price is required").test(
689
+ "is-number",
690
+ "Max price must be a valid number",
691
+ (value) => value !== void 0 && value !== "" && !isNaN(Number(value))
692
+ ).test(
679
693
  "is-greater",
680
694
  "Max price must be greater than or equal to Min price",
681
695
  function(max) {
682
696
  const { min } = this.parent;
683
- return max >= min;
697
+ if (!max || !min) return true;
698
+ const maxNum = Number(max);
699
+ const minNum = Number(min);
700
+ if (isNaN(maxNum) || isNaN(minNum)) return true;
701
+ return maxNum >= minNum;
684
702
  }
685
703
  ),
686
- min: yup3.number().min(1).required("Min price is required")
704
+ min: yup3.string().required("Min price is required").test(
705
+ "is-number",
706
+ "Min price must be a valid number",
707
+ (value) => value !== void 0 && value !== "" && !isNaN(Number(value))
708
+ )
687
709
  }),
688
710
  producedIn: yup3.array().of(yup3.string().defined()).min(1, "Produced in list must contain at least one item").required("Produced in is required")
689
711
  }),
@@ -721,8 +743,24 @@ var vendorInfoSchema = yup3.object().shape({
721
743
  }).optional(),
722
744
  stallInfo: yup3.object().shape({
723
745
  size: yup3.object().shape({
724
- depth: yup3.number().min(1).required("Depth is required"),
725
- width: yup3.number().min(1).required("Width is required")
746
+ depth: yup3.string().required("Depth is required").test(
747
+ "is-number",
748
+ "Depth must be a valid number",
749
+ (value) => value !== void 0 && value !== "" && !isNaN(Number(value))
750
+ ).test(
751
+ "is-positive",
752
+ "Depth must be greater than 0",
753
+ (value) => value !== void 0 && value !== "" && Number(value) > 0
754
+ ),
755
+ width: yup3.string().required("Width is required").test(
756
+ "is-number",
757
+ "Width must be a valid number",
758
+ (value) => value !== void 0 && value !== "" && !isNaN(Number(value))
759
+ ).test(
760
+ "is-positive",
761
+ "Width must be greater than 0",
762
+ (value) => value !== void 0 && value !== "" && Number(value) > 0
763
+ )
726
764
  })
727
765
  }),
728
766
  vendorId: yup3.string().trim().required("Vendor ID is required")
@@ -2595,6 +2633,10 @@ var EVENT_INFO = import_client3.gql`
2595
2633
  link
2596
2634
  paymentMethod
2597
2635
  }
2636
+ refundPolicy {
2637
+ cancelledByOrganiser
2638
+ cancelledByVendor
2639
+ }
2598
2640
  requirements {
2599
2641
  category
2600
2642
  label
@@ -4539,6 +4581,10 @@ var defaultEventInfoFormValues = {
4539
4581
  // e.g., 2 hours before event opens
4540
4582
  paymentDueHours: 12,
4541
4583
  paymentInfo: [],
4584
+ refundPolicy: {
4585
+ cancelledByOrganiser: [],
4586
+ cancelledByVendor: []
4587
+ },
4542
4588
  requirements: []
4543
4589
  };
4544
4590
  var defaultVendorFormValues = {
@@ -4569,7 +4615,7 @@ var defaultVendorInfoFormValues = {
4569
4615
  product: {
4570
4616
  foodFlavors: [],
4571
4617
  packaging: [],
4572
- priceRange: { max: 0, min: 0 },
4618
+ priceRange: { max: "0", min: "0" },
4573
4619
  producedIn: []
4574
4620
  },
4575
4621
  requirements: {
@@ -4578,7 +4624,7 @@ var defaultVendorInfoFormValues = {
4578
4624
  table: { details: null, isRequired: false }
4579
4625
  },
4580
4626
  stallInfo: {
4581
- size: { depth: 0, width: 0 }
4627
+ size: { depth: "0", width: "0" }
4582
4628
  },
4583
4629
  vendorId: ""
4584
4630
  };
@@ -4887,6 +4933,7 @@ function useEventInfoForm(data) {
4887
4933
  packInTime: data.packInTime,
4888
4934
  paymentDueHours: data.paymentDueHours,
4889
4935
  paymentInfo: data.paymentInfo,
4936
+ refundPolicy: data.refundPolicy,
4890
4937
  requirements: data.requirements
4891
4938
  });
4892
4939
  } else {
@@ -4901,6 +4948,7 @@ function useEventInfoForm(data) {
4901
4948
  packInTime,
4902
4949
  paymentDueHours,
4903
4950
  paymentInfo,
4951
+ refundPolicy,
4904
4952
  requirements
4905
4953
  } = getValues();
4906
4954
  return {
@@ -4913,6 +4961,7 @@ function useEventInfoForm(data) {
4913
4961
  packInTime,
4914
4962
  paymentDueHours,
4915
4963
  paymentInfo,
4964
+ refundPolicy,
4916
4965
  requirements
4917
4966
  },
4918
4967
  formState,