@timardex/cluemart-shared 1.0.27 → 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-DOcZmtHl.d.ts → global-BwS9p10K.d.mts} +12 -5
  16. package/dist/{global-BEyKhYx9.d.mts → global-lB32aPz_.d.ts} +12 -5
  17. package/dist/graphql/index.cjs +8 -2
  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 +8 -2
  22. package/dist/graphql/index.mjs.map +1 -1
  23. package/dist/hooks/index.cjs +63 -60
  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 +58 -51
  28. package/dist/hooks/index.mjs.map +1 -1
  29. package/dist/index.cjs +168 -75
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.d.mts +12 -9
  32. package/dist/index.d.ts +12 -9
  33. package/dist/index.mjs +167 -73
  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";
@@ -571,45 +565,53 @@ var marketSchema = globalResourceSchema.shape({
571
565
  provider: yup2.string().trim().min(3).required("Provider is required"),
572
566
  tags: yup2.array().of(yup2.string().defined()).min(1, "Tags are required").required("Tags are required")
573
567
  });
574
- var paymentTargetSchema = yup2.object().when("paymentMethod", (paymentMethod, schema) => {
575
- const isBankTransfer = paymentMethod.includes(
576
- "bank_transfer" /* BANK_TRANSFER */
577
- );
578
- if (!isBankTransfer) {
579
- return schema.shape({
580
- accountHolderName: yup2.string().notRequired(),
581
- accountNumber: yup2.string().notRequired(),
582
- link: yup2.string().trim().url("Link must be a valid URL").transform(
583
- (value) => typeof value === "string" ? value.toLowerCase() : value
584
- ).required("Link is required for PayPal/Stripe")
585
- });
586
- } else if (isBankTransfer) {
587
- return schema.shape({
588
- accountHolderName: yup2.string().trim().required("Account holder name is required for bank transfer"),
589
- accountNumber: yup2.string().trim().required("Account number is required for bank transfer").matches(
590
- nzBankAccountRegex,
591
- "Account number must be in format: XX-XXXX-XXXXXXX-XX"
592
- ),
593
- link: yup2.string().transform(
594
- (value) => typeof value === "string" ? value.toLowerCase() : value
595
- ).notRequired()
596
- });
597
- } else {
598
- return schema.shape({
599
- accountHolderName: yup2.string().notRequired(),
600
- accountNumber: yup2.string().notRequired(),
601
- link: yup2.string().notRequired()
602
- });
603
- }
568
+ var paymentTargetSchema = yup2.object({
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
+ })
604
590
  });
605
591
  var marketInfoSchema = yup2.object().shape({
606
- 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")),
607
593
  dateTime: yup2.array().of(dateTimeWithPriceSchema).required("DateTime is required"),
608
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"), */
609
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")),
610
- paymentMethod: yup2.mixed().oneOf(Object.values(EnumPaymentMethod)).required("Please select a Payment method"),
611
614
  paymentTarget: yup2.array().of(paymentTargetSchema).min(1, "At least one payment target is required").required("Payment target is required"),
612
- rejectionPolicy: yup2.mixed().oneOf(Object.values(EnumRejectionPolicy)).required("Rejection policy is required"),
613
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"))
614
616
  });
615
617
 
@@ -787,16 +789,13 @@ var defaultMarketInfoFormValues = {
787
789
  }
788
790
  ],
789
791
  marketId: "",
792
+ packInTime: 0,
793
+ // e.g., 2 hours before market opens
794
+ packOutTime: 0,
795
+ // e.g., 1 hour after market closes
790
796
  paymentDueHours: 0,
791
- paymentMethod: "",
792
- paymentTarget: [
793
- {
794
- accountHolderName: "",
795
- accountNumber: "",
796
- link: ""
797
- }
798
- ],
799
- rejectionPolicy: "multi_date_allowed" /* MULTI_DATE_ALLOWED */,
797
+ paymentTarget: [],
798
+ requirements: [],
800
799
  stallCapacity: 0
801
800
  };
802
801
  var defaultStallholderFormValues = {
@@ -1093,10 +1092,11 @@ function useMarketInfoForm(data) {
1093
1092
  applicationDeadlineHours: data.applicationDeadlineHours,
1094
1093
  dateTime: data.dateTime,
1095
1094
  marketId: data.marketId,
1095
+ packInTime: data.packInTime,
1096
+ packOutTime: data.packOutTime,
1096
1097
  paymentDueHours: data.paymentDueHours,
1097
- paymentMethod: data.paymentMethod,
1098
1098
  paymentTarget: data.paymentTarget,
1099
- rejectionPolicy: data.rejectionPolicy,
1099
+ requirements: data.requirements,
1100
1100
  stallCapacity: data.stallCapacity
1101
1101
  });
1102
1102
  } else {
@@ -1108,10 +1108,11 @@ function useMarketInfoForm(data) {
1108
1108
  applicationDeadlineHours,
1109
1109
  dateTime,
1110
1110
  marketId,
1111
+ packInTime,
1112
+ packOutTime,
1111
1113
  paymentDueHours,
1112
- paymentMethod,
1113
1114
  paymentTarget,
1114
- rejectionPolicy,
1115
+ requirements,
1115
1116
  stallCapacity
1116
1117
  } = getValues();
1117
1118
  return {
@@ -1121,10 +1122,11 @@ function useMarketInfoForm(data) {
1121
1122
  applicationDeadlineHours,
1122
1123
  dateTime,
1123
1124
  marketId,
1125
+ packInTime,
1126
+ packOutTime,
1124
1127
  paymentDueHours,
1125
- paymentMethod,
1126
1128
  paymentTarget,
1127
- rejectionPolicy,
1129
+ requirements,
1128
1130
  stallCapacity
1129
1131
  },
1130
1132
  formState: { errors },
@@ -1768,15 +1770,21 @@ var MARKET_INFO = import_client8.gql`
1768
1770
  startTime
1769
1771
  }
1770
1772
  marketId
1773
+ packInTime
1774
+ packOutTime
1771
1775
  paymentDueHours
1772
- paymentMethod
1773
1776
  paymentTarget {
1774
1777
  accountHolderName
1775
1778
  accountNumber
1776
1779
  link
1780
+ paymentMethod
1777
1781
  }
1778
- rejectionPolicy
1779
1782
  stallCapacity
1783
+ requirements {
1784
+ category
1785
+ label
1786
+ value
1787
+ }
1780
1788
  }
1781
1789
  `;
1782
1790
  var MARKET = import_client8.gql`
@@ -3256,22 +3264,34 @@ var tagOptions = availableTagTypes.map((tag) => ({
3256
3264
  // src/formFields/market/marketInfo.ts
3257
3265
  var marketInfo = [
3258
3266
  {
3259
- helperText: "Application Deadline of the Market *",
3267
+ helperText: "Application Deadline *",
3260
3268
  keyboardType: "number-pad",
3261
3269
  name: "applicationDeadlineHours",
3262
- placeholder: "Application Deadline Hours"
3270
+ placeholder: "Application Deadline (in hours)"
3263
3271
  },
3264
3272
  {
3265
- helperText: "Stall Capacity of the Market *",
3273
+ helperText: "Stall Capacity *",
3266
3274
  keyboardType: "number-pad",
3267
3275
  name: "stallCapacity",
3268
3276
  placeholder: "Stall Capacity"
3269
3277
  },
3270
3278
  {
3271
- helperText: "Payment Due Hours of the Market *",
3279
+ helperText: "Payment Due Hours *",
3272
3280
  keyboardType: "number-pad",
3273
3281
  name: "paymentDueHours",
3274
- 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)"
3275
3295
  }
3276
3296
  ];
3277
3297
  var marketInfoPaymentTarget = [
@@ -3295,14 +3315,88 @@ var marketInfoPaymentTarget = [
3295
3315
  var marketPriceByDateFields = [
3296
3316
  {
3297
3317
  helperText: "Market Price for this date *",
3298
- keyboardType: "number-pad",
3318
+ keyboardType: "decimal-pad",
3299
3319
  name: "marketPrice",
3300
3320
  placeholder: "Market Price"
3301
3321
  }
3302
3322
  ];
3303
- var rejectionPolicyOptions = mapArrayToOptions(
3304
- Object.values(EnumRejectionPolicy)
3305
- );
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
+ ];
3306
3400
 
3307
3401
  // src/formFields/auth.ts
3308
3402
  var loginFields = [
@@ -3771,7 +3865,6 @@ var socialMediaFields = socialMedia.map((link) => ({
3771
3865
  EnumNotification,
3772
3866
  EnumPaymentMethod,
3773
3867
  EnumRegions,
3774
- EnumRejectionPolicy,
3775
3868
  EnumRelationResource,
3776
3869
  EnumResourceType,
3777
3870
  EnumResourceTypeIcon,
@@ -3811,9 +3904,9 @@ var socialMediaFields = socialMedia.map((link) => ({
3811
3904
  producedIngOptions,
3812
3905
  profileFields,
3813
3906
  registerFields,
3814
- rejectionPolicyOptions,
3815
3907
  removeTypename,
3816
3908
  requestPasswordResetFields,
3909
+ requirementsOptions,
3817
3910
  resetPasswordFields,
3818
3911
  socialMediaFields,
3819
3912
  sortDatesByProximity,