@timardex/cluemart-shared 1.0.28 → 1.0.29

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 (43) hide show
  1. package/dist/{chunk-GMCWFVU5.mjs → chunk-BDJVSBRT.mjs} +2 -2
  2. package/dist/{chunk-GMOTXE7A.mjs → chunk-OXXSIU3M.mjs} +1 -7
  3. package/dist/chunk-OXXSIU3M.mjs.map +1 -0
  4. package/dist/enums/index.cjs +0 -7
  5. package/dist/enums/index.cjs.map +1 -1
  6. package/dist/enums/index.d.mts +1 -5
  7. package/dist/enums/index.d.ts +1 -5
  8. package/dist/enums/index.mjs +1 -3
  9. package/dist/formFields/index.cjs +97 -16
  10. package/dist/formFields/index.cjs.map +1 -1
  11. package/dist/formFields/index.d.mts +3 -3
  12. package/dist/formFields/index.d.ts +3 -3
  13. package/dist/formFields/index.mjs +98 -14
  14. package/dist/formFields/index.mjs.map +1 -1
  15. package/dist/{global-DwhGi-4q.d.mts → global-BwS9p10K.d.mts} +11 -4
  16. package/dist/{global-BRfKKan0.d.ts → global-lB32aPz_.d.ts} +11 -4
  17. package/dist/graphql/index.cjs +7 -1
  18. package/dist/graphql/index.cjs.map +1 -1
  19. package/dist/graphql/index.d.mts +1 -1
  20. package/dist/graphql/index.d.ts +1 -1
  21. package/dist/graphql/index.mjs +7 -1
  22. package/dist/graphql/index.mjs.map +1 -1
  23. package/dist/hooks/index.cjs +62 -57
  24. package/dist/hooks/index.cjs.map +1 -1
  25. package/dist/hooks/index.d.mts +1 -1
  26. package/dist/hooks/index.d.ts +1 -1
  27. package/dist/hooks/index.mjs +57 -48
  28. package/dist/hooks/index.mjs.map +1 -1
  29. package/dist/index.cjs +166 -71
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.d.mts +11 -8
  32. package/dist/index.d.ts +11 -8
  33. package/dist/index.mjs +165 -69
  34. package/dist/index.mjs.map +1 -1
  35. package/dist/types/index.d.mts +1 -1
  36. package/dist/types/index.d.ts +1 -1
  37. package/dist/utils/index.cjs.map +1 -1
  38. package/dist/utils/index.d.mts +1 -1
  39. package/dist/utils/index.d.ts +1 -1
  40. package/dist/utils/index.mjs +2 -2
  41. package/package.json +1 -1
  42. package/dist/chunk-GMOTXE7A.mjs.map +0 -1
  43. /package/dist/{chunk-GMCWFVU5.mjs.map → chunk-BDJVSBRT.mjs.map} +0 -0
package/dist/index.cjs CHANGED
@@ -34,7 +34,6 @@ __export(index_exports, {
34
34
  EnumNotification: () => EnumNotification,
35
35
  EnumPaymentMethod: () => EnumPaymentMethod,
36
36
  EnumRegions: () => EnumRegions,
37
- EnumRejectionPolicy: () => EnumRejectionPolicy,
38
37
  EnumRelationResource: () => EnumRelationResource,
39
38
  EnumResourceType: () => EnumResourceType,
40
39
  EnumResourceTypeIcon: () => EnumResourceTypeIcon,
@@ -74,9 +73,9 @@ __export(index_exports, {
74
73
  producedIngOptions: () => producedIngOptions,
75
74
  profileFields: () => profileFields,
76
75
  registerFields: () => registerFields,
77
- rejectionPolicyOptions: () => rejectionPolicyOptions,
78
76
  removeTypename: () => removeTypename,
79
77
  requestPasswordResetFields: () => requestPasswordResetFields,
78
+ requirementsOptions: () => requirementsOptions,
80
79
  resetPasswordFields: () => resetPasswordFields,
81
80
  socialMediaFields: () => socialMediaFields,
82
81
  sortDatesByProximity: () => sortDatesByProximity,
@@ -184,18 +183,13 @@ var EnumInviteStatus = /* @__PURE__ */ ((EnumInviteStatus2) => {
184
183
  EnumInviteStatus2["WAITING"] = "Waiting";
185
184
  return EnumInviteStatus2;
186
185
  })(EnumInviteStatus || {});
187
- var EnumRejectionPolicy = /* @__PURE__ */ ((EnumRejectionPolicy2) => {
188
- EnumRejectionPolicy2["SINGLE_DATE_ALLOWED"] = "single_date_allowed";
189
- EnumRejectionPolicy2["MULTI_DATE_ALLOWED"] = "multi_date_allowed";
190
- return EnumRejectionPolicy2;
191
- })(EnumRejectionPolicy || {});
192
- var EnumPaymentMethod = /* @__PURE__ */ ((EnumPaymentMethod3) => {
193
- EnumPaymentMethod3["CASH"] = "cash";
194
- EnumPaymentMethod3["EFTPOS"] = "eftpos";
195
- EnumPaymentMethod3["BANK_TRANSFER"] = "bank_transfer";
196
- EnumPaymentMethod3["PAYPAL"] = "paypal";
197
- EnumPaymentMethod3["STRIPE"] = "stripe";
198
- return EnumPaymentMethod3;
186
+ var EnumPaymentMethod = /* @__PURE__ */ ((EnumPaymentMethod2) => {
187
+ EnumPaymentMethod2["CASH"] = "cash";
188
+ EnumPaymentMethod2["EFTPOS"] = "eftpos";
189
+ EnumPaymentMethod2["BANK_TRANSFER"] = "bank_transfer";
190
+ EnumPaymentMethod2["PAYPAL"] = "paypal";
191
+ EnumPaymentMethod2["STRIPE"] = "stripe";
192
+ return EnumPaymentMethod2;
199
193
  })(EnumPaymentMethod || {});
200
194
  var EnumResourceType = /* @__PURE__ */ ((EnumResourceType2) => {
201
195
  EnumResourceType2["MARKET"] = "market";
@@ -572,45 +566,52 @@ var marketSchema = globalResourceSchema.shape({
572
566
  tags: yup2.array().of(yup2.string().defined()).min(1, "Tags are required").required("Tags are required")
573
567
  });
574
568
  var paymentTargetSchema = yup2.object({
575
- paymentMethod: yup2.mixed().oneOf(Object.values(EnumPaymentMethod)).required("Please select a Payment method")
576
- }).when("paymentMethod", (paymentMethod, schema) => {
577
- const isBankTransfer = paymentMethod.includes(
578
- "bank_transfer" /* BANK_TRANSFER */
579
- );
580
- if (!isBankTransfer) {
581
- return schema.shape({
582
- accountHolderName: yup2.string().notRequired(),
583
- accountNumber: yup2.string().notRequired(),
584
- link: yup2.string().trim().url("Link must be a valid URL").transform(
585
- (value) => typeof value === "string" ? value.toLowerCase() : value
586
- ).required("Link is required for PayPal/Stripe")
587
- });
588
- } else if (isBankTransfer) {
589
- return schema.shape({
590
- accountHolderName: yup2.string().trim().required("Account holder name is required for bank transfer"),
591
- accountNumber: yup2.string().trim().required("Account number is required for bank transfer").matches(
592
- nzBankAccountRegex,
593
- "Account number must be in format: XX-XXXX-XXXXXXX-XX"
594
- ),
595
- link: yup2.string().transform(
596
- (value) => typeof value === "string" ? value.toLowerCase() : value
597
- ).notRequired()
598
- });
599
- } else {
600
- return schema.shape({
601
- accountHolderName: yup2.string().notRequired(),
602
- accountNumber: yup2.string().notRequired(),
603
- link: yup2.string().notRequired()
604
- });
605
- }
569
+ paymentMethod: yup2.mixed().oneOf(Object.values(EnumPaymentMethod)).required("Please select a Payment method"),
570
+ accountHolderName: yup2.string().when("paymentMethod", {
571
+ is: "bank_transfer" /* BANK_TRANSFER */,
572
+ then: (schema) => schema.required("Account holder name is required for bank transfer").trim(),
573
+ otherwise: (schema) => schema.notRequired()
574
+ }),
575
+ accountNumber: yup2.string().when("paymentMethod", {
576
+ is: "bank_transfer" /* BANK_TRANSFER */,
577
+ then: (schema) => schema.required("Account number is required for bank transfer").matches(
578
+ nzBankAccountRegex,
579
+ "Account number must be in format: XX-XXXX-XXXXXXX-XX"
580
+ ).trim(),
581
+ otherwise: (schema) => schema.notRequired()
582
+ }),
583
+ link: yup2.string().when("paymentMethod", {
584
+ is: (val) => val !== "bank_transfer" /* BANK_TRANSFER */,
585
+ then: (schema) => schema.trim().url("Link must be a valid URL").required("Link is required for PayPal/Stripe").transform(
586
+ (value) => typeof value === "string" ? value.toLowerCase() : value
587
+ ),
588
+ otherwise: (schema) => schema.notRequired()
589
+ })
606
590
  });
607
591
  var marketInfoSchema = yup2.object().shape({
608
- applicationDeadlineHours: yup2.number().typeError("Application deadline hours must be a number").min(1, "Application deadline hours must be at least 1").required("Application deadline hours is required").test("no-leading-zeros", "", noLeadingZeros("Application deadline hours")),
592
+ applicationDeadlineHours: yup2.number().nullable().transform((value, originalValue) => originalValue === "" ? null : value).typeError("Application deadline hours must be a number").min(1, "Application deadline hours must be at least 1").required("Application deadline hours is required").test("no-leading-zeros", "", noLeadingZeros("Application deadline hours")),
609
593
  dateTime: yup2.array().of(dateTimeWithPriceSchema).required("DateTime is required"),
610
594
  marketId: yup2.string().trim().required("Market ID is required"),
595
+ packInTime: yup2.number().typeError("Pack in time must be a number").min(1, "Pack in time must be at least 1").required("Pack in time is required").test("no-leading-zeros", "", noLeadingZeros("Pack in time")),
596
+ packOutTime: yup2.number().typeError("Pack out time must be a number").min(1, "Pack out time must be at least 1").required("Pack out time is required").test("no-leading-zeros", "", noLeadingZeros("Pack out time")),
597
+ /* requirements: yup
598
+ .array()
599
+ .of(
600
+ yup.object({
601
+ category: yup
602
+ .mixed<
603
+ "Food Safety" | "Environment" | "Operations" | "Legal & Safety"
604
+ >()
605
+ .oneOf(["Food Safety", "Environment", "Operations", "Legal & Safety"])
606
+ .required("Category is required"),
607
+ label: yup.string().trim().required("Label is required"),
608
+ value: yup.string().trim().required("Value is required"),
609
+ }),
610
+ )
611
+ .min(1, "At least one requirement is required")
612
+ .required("Requirements are required"), */
611
613
  paymentDueHours: yup2.number().typeError("Payment due hours must be a number").min(1, "Payment due hours must be at least 1").required("Payment due hours is required").test("no-leading-zeros", "", noLeadingZeros("Payment due hours")),
612
614
  paymentTarget: yup2.array().of(paymentTargetSchema).min(1, "At least one payment target is required").required("Payment target is required"),
613
- rejectionPolicy: yup2.mixed().oneOf(Object.values(EnumRejectionPolicy)).required("Rejection policy is required"),
614
615
  stallCapacity: yup2.number().typeError("Stall capacity must be a number").min(1, "Stall capacity must be at least 1").integer("Stall capacity must be a whole number").required("Stall capacity is required").test("no-leading-zeros", "", noLeadingZeros("Stall capacity"))
615
616
  });
616
617
 
@@ -788,16 +789,13 @@ var defaultMarketInfoFormValues = {
788
789
  }
789
790
  ],
790
791
  marketId: "",
792
+ packInTime: 0,
793
+ // e.g., 2 hours before market opens
794
+ packOutTime: 0,
795
+ // e.g., 1 hour after market closes
791
796
  paymentDueHours: 0,
792
- paymentTarget: [
793
- {
794
- accountHolderName: "",
795
- accountNumber: "",
796
- link: "",
797
- paymentMethod: ""
798
- }
799
- ],
800
- rejectionPolicy: "multi_date_allowed" /* MULTI_DATE_ALLOWED */,
797
+ paymentTarget: [],
798
+ requirements: [],
801
799
  stallCapacity: 0
802
800
  };
803
801
  var defaultStallholderFormValues = {
@@ -1094,9 +1092,11 @@ function useMarketInfoForm(data) {
1094
1092
  applicationDeadlineHours: data.applicationDeadlineHours,
1095
1093
  dateTime: data.dateTime,
1096
1094
  marketId: data.marketId,
1095
+ packInTime: data.packInTime,
1096
+ packOutTime: data.packOutTime,
1097
1097
  paymentDueHours: data.paymentDueHours,
1098
1098
  paymentTarget: data.paymentTarget,
1099
- rejectionPolicy: data.rejectionPolicy,
1099
+ requirements: data.requirements,
1100
1100
  stallCapacity: data.stallCapacity
1101
1101
  });
1102
1102
  } else {
@@ -1108,9 +1108,11 @@ function useMarketInfoForm(data) {
1108
1108
  applicationDeadlineHours,
1109
1109
  dateTime,
1110
1110
  marketId,
1111
+ packInTime,
1112
+ packOutTime,
1111
1113
  paymentDueHours,
1112
1114
  paymentTarget,
1113
- rejectionPolicy,
1115
+ requirements,
1114
1116
  stallCapacity
1115
1117
  } = getValues();
1116
1118
  return {
@@ -1120,9 +1122,11 @@ function useMarketInfoForm(data) {
1120
1122
  applicationDeadlineHours,
1121
1123
  dateTime,
1122
1124
  marketId,
1125
+ packInTime,
1126
+ packOutTime,
1123
1127
  paymentDueHours,
1124
1128
  paymentTarget,
1125
- rejectionPolicy,
1129
+ requirements,
1126
1130
  stallCapacity
1127
1131
  },
1128
1132
  formState: { errors },
@@ -1766,6 +1770,8 @@ var MARKET_INFO = import_client8.gql`
1766
1770
  startTime
1767
1771
  }
1768
1772
  marketId
1773
+ packInTime
1774
+ packOutTime
1769
1775
  paymentDueHours
1770
1776
  paymentTarget {
1771
1777
  accountHolderName
@@ -1773,8 +1779,12 @@ var MARKET_INFO = import_client8.gql`
1773
1779
  link
1774
1780
  paymentMethod
1775
1781
  }
1776
- rejectionPolicy
1777
1782
  stallCapacity
1783
+ requirements {
1784
+ category
1785
+ label
1786
+ value
1787
+ }
1778
1788
  }
1779
1789
  `;
1780
1790
  var MARKET = import_client8.gql`
@@ -3254,22 +3264,34 @@ var tagOptions = availableTagTypes.map((tag) => ({
3254
3264
  // src/formFields/market/marketInfo.ts
3255
3265
  var marketInfo = [
3256
3266
  {
3257
- helperText: "Application Deadline of the Market *",
3267
+ helperText: "Application Deadline *",
3258
3268
  keyboardType: "number-pad",
3259
3269
  name: "applicationDeadlineHours",
3260
- placeholder: "Application Deadline Hours"
3270
+ placeholder: "Application Deadline (in hours)"
3261
3271
  },
3262
3272
  {
3263
- helperText: "Stall Capacity of the Market *",
3273
+ helperText: "Stall Capacity *",
3264
3274
  keyboardType: "number-pad",
3265
3275
  name: "stallCapacity",
3266
3276
  placeholder: "Stall Capacity"
3267
3277
  },
3268
3278
  {
3269
- helperText: "Payment Due Hours of the Market *",
3279
+ helperText: "Payment Due Hours *",
3270
3280
  keyboardType: "number-pad",
3271
3281
  name: "paymentDueHours",
3272
- placeholder: "Payment Due Hours"
3282
+ placeholder: "Payment Due (in hours)"
3283
+ },
3284
+ {
3285
+ helperText: "Pack In Time *",
3286
+ keyboardType: "number-pad",
3287
+ name: "packInTime",
3288
+ placeholder: "Pack In Time (in hours)"
3289
+ },
3290
+ {
3291
+ helperText: "Pack Out Time *",
3292
+ keyboardType: "number-pad",
3293
+ name: "packOutTime",
3294
+ placeholder: "Pack Out Time (in hours)"
3273
3295
  }
3274
3296
  ];
3275
3297
  var marketInfoPaymentTarget = [
@@ -3293,14 +3315,88 @@ var marketInfoPaymentTarget = [
3293
3315
  var marketPriceByDateFields = [
3294
3316
  {
3295
3317
  helperText: "Market Price for this date *",
3296
- keyboardType: "number-pad",
3318
+ keyboardType: "decimal-pad",
3297
3319
  name: "marketPrice",
3298
3320
  placeholder: "Market Price"
3299
3321
  }
3300
3322
  ];
3301
- var rejectionPolicyOptions = mapArrayToOptions(
3302
- Object.values(EnumRejectionPolicy)
3303
- );
3323
+ var requirementsOptions = [
3324
+ {
3325
+ category: "Food Safety",
3326
+ label: "The stallholder must display a current food grade certificate",
3327
+ value: "food_grade_certificate"
3328
+ },
3329
+ {
3330
+ category: "Food Safety",
3331
+ label: "Food must be prepared and stored according to your food regulation",
3332
+ value: "food_preparation_regulations"
3333
+ },
3334
+ {
3335
+ category: "Legal & Safety",
3336
+ label: "All electrical equipment must be tested and tagged",
3337
+ value: "electrical_safety"
3338
+ },
3339
+ {
3340
+ category: "Operations",
3341
+ label: "You must be self-sufficient in all operations",
3342
+ value: "self_sufficient_operations"
3343
+ },
3344
+ {
3345
+ category: "Environment",
3346
+ label: "You must provide bins at your site for rubbish and recycling, and take away all bins including rubbish, to dispose of outside of the town centre",
3347
+ value: "rubbish_and_recycling_responsibility"
3348
+ },
3349
+ {
3350
+ category: "Legal & Safety",
3351
+ label: "You must secure your gazebo and equipment to withstand wind or bad weather",
3352
+ value: "stall_safety_and_weather_protection"
3353
+ },
3354
+ {
3355
+ category: "Legal & Safety",
3356
+ label: "You are responsible for the safety of your setup and any potential hazards",
3357
+ value: "stallholder_safety_responsibility"
3358
+ },
3359
+ {
3360
+ category: "Operations",
3361
+ label: "Stallholders must arrive and be fully set up by the designated opening time",
3362
+ value: "setup_on_time"
3363
+ },
3364
+ {
3365
+ category: "Operations",
3366
+ label: "You may not pack down your stall before the event officially ends",
3367
+ value: "no_early_packdown"
3368
+ },
3369
+ {
3370
+ category: "Environment",
3371
+ label: "All packaging must be eco-friendly or recyclable where possible",
3372
+ value: "eco_friendly_packaging"
3373
+ },
3374
+ {
3375
+ category: "Legal & Safety",
3376
+ label: "Stallholders must hold valid liability insurance where required",
3377
+ value: "liability_insurance_required"
3378
+ },
3379
+ {
3380
+ category: "Environment",
3381
+ label: "No single-use plastic bags are to be handed out",
3382
+ value: "no_single_use_plastics"
3383
+ },
3384
+ {
3385
+ category: "Legal & Safety",
3386
+ label: "Noise levels must be kept to a minimum unless part of a permitted performance",
3387
+ value: "noise_restrictions"
3388
+ },
3389
+ {
3390
+ category: "Operations",
3391
+ label: "Generators must be quiet and pre-approved by the event organiser",
3392
+ value: "generator_policy"
3393
+ },
3394
+ {
3395
+ category: "Legal & Safety",
3396
+ label: "Pets at the stall must be secured and well-behaved at all times",
3397
+ value: "pets_policy"
3398
+ }
3399
+ ];
3304
3400
 
3305
3401
  // src/formFields/auth.ts
3306
3402
  var loginFields = [
@@ -3769,7 +3865,6 @@ var socialMediaFields = socialMedia.map((link) => ({
3769
3865
  EnumNotification,
3770
3866
  EnumPaymentMethod,
3771
3867
  EnumRegions,
3772
- EnumRejectionPolicy,
3773
3868
  EnumRelationResource,
3774
3869
  EnumResourceType,
3775
3870
  EnumResourceTypeIcon,
@@ -3809,9 +3904,9 @@ var socialMediaFields = socialMedia.map((link) => ({
3809
3904
  producedIngOptions,
3810
3905
  profileFields,
3811
3906
  registerFields,
3812
- rejectionPolicyOptions,
3813
3907
  removeTypename,
3814
3908
  requestPasswordResetFields,
3909
+ requirementsOptions,
3815
3910
  resetPasswordFields,
3816
3911
  socialMediaFields,
3817
3912
  sortDatesByProximity,