@timardex/cluemart-shared 1.0.29 → 1.0.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.
package/dist/index.d.mts CHANGED
@@ -214,8 +214,13 @@ interface RelationType {
214
214
  updatedAt?: string;
215
215
  }
216
216
 
217
+ type SiteType = {
218
+ label?: string;
219
+ price?: number;
220
+ };
217
221
  interface DateTimeWithPriceType extends DateTimeType {
218
222
  marketPrice: number;
223
+ siteTypes?: SiteType[] | null;
219
224
  }
220
225
  type PaymentTargetType = {
221
226
  accountHolderName?: string;
@@ -226,7 +231,7 @@ type PaymentTargetType = {
226
231
  type Requirement = {
227
232
  category: "Food Safety" | "Environment" | "Operations" | "Legal & Safety";
228
233
  label: string;
229
- value: string;
234
+ value: boolean;
230
235
  };
231
236
  interface MarketInfoFormData {
232
237
  _id?: string;
@@ -411,8 +416,8 @@ type ResourceImageType = {
411
416
  title: string;
412
417
  };
413
418
  type SocialMediaType = {
414
- name: EnumSocialMedia;
415
- link: string;
419
+ name?: EnumSocialMedia;
420
+ link?: string;
416
421
  };
417
422
  interface BaseResourceTypeFormData {
418
423
  _id?: string;
@@ -578,6 +583,7 @@ declare function sortDatesByProximity<T extends {
578
583
  declare const availableRegionTypes: EnumRegions[];
579
584
  declare const availableRegionOptions: OptionItem[];
580
585
  declare const paymentMethodOptions: OptionItem[];
586
+ declare function normalizeUrl(url: string): string;
581
587
 
582
588
  interface PlacePrediction {
583
589
  place_id: string;
@@ -1016,6 +1022,7 @@ declare const marketInfo: FormField[];
1016
1022
  declare const marketInfoPaymentTarget: FormField[];
1017
1023
  declare const marketPriceByDateFields: FormField[];
1018
1024
  declare const requirementsOptions: Requirement[];
1025
+ declare const siteTypeOptions: SiteType[];
1019
1026
 
1020
1027
  declare const loginFields: FormField[];
1021
1028
  declare const registerFields: FormField[];
@@ -1030,4 +1037,4 @@ declare const categoryColors: Record<string, string>;
1030
1037
 
1031
1038
  declare const socialMediaFields: FormField[];
1032
1039
 
1033
- export { type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatInput, type ChatMessageInput, type ChatMessageType, type ChatType, type CreateLoginFormData, type CreateMarketFormData, type CreateMarketInfoFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateStallholderApplyFormFormData, type CreateStallholderFormData, type CreateUserFormData, type CreateValidateTokenFormData, type DateTimeType, type DateTimeWithPriceType, EnumInviteStatus, EnumNotification, EnumPaymentMethod, EnumRegions, EnumRelationResource, EnumResourceType, EnumResourceTypeIcon, EnumSocialMedia, EnumUserLicence, EnumUserRole, type FormDateField, type FormField, type GeocodeLocation, type ImageObjectType, ImageTypeEnum, type LocationType, type LoginFormData, type MapMultiLocation, type MarketFormData, type MarketInfoFormData, type MarketInfoType, type MarketType, type MarketWithConnectionDatesType, type NotificationType, type Nullable, type OptionItem, type PaymentTargetType, type PlacePrediction, type PosterInputType, type Region, type RegisterFormData, type RelationDate, type RelationLog, type RelationType, type RequestPasswordResetFormData, type Requirement, type ResetPasswordFormData, type ResourceConnectionsType, type ResourceImageType, type SatllholderWithConnectionDatesType, type SocialMediaType, type StallholderApplyFormFormData, type StallholderApplyFormType, type StallholderAttributes, type StallholderFormData, type StallholderLocation, type StallholderType, type Subcategory, type UserFormData, type UserType, type ValidateTokenFormData, availableCategories, availableCityOptions, availableRegionOptions, availableRegionTypes, availableTagTypes, capitalizeFirstLetter, categoryColors, dateFormat, defaultMarketFormValues, defaultMarketInfoFormValues, defaultRegion, defaultStallholderApplyFormValues, defaultStallholderFormValues, formatDate, formatTimestamp, getCurrentAndFutureDates, getFutureDatesAfterThreshold, globalDefaultValues, loginFields, mapArrayToOptions, mapBaseResourceTypeToFormData, marketBasicInfoFields, marketEndDateFields, marketInfo, marketInfoPaymentTarget, marketPriceByDateFields, marketStartDateFields, packagingOptions, paymentMethodOptions, producedIngOptions, profileFields, registerFields, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, socialMediaFields, sortDatesByProximity, stallholderBasicInfoFields, stallholderElectricity, stallholderEndDateFields, stallholderFullAddress, stallholderGazebo, stallholderLocationDescription, stallholderMultiLocation, stallholderPackaging, stallholderPaymentMethod, stallholderPriceRange, stallholderProducedIn, stallholderStallSize, stallholderStartDateFields, stallholderTable, statusOptions, tagOptions, timeFormat, truncateText, useAddParticipantToChat, useAddUserFavouriteResource, useCreateChat, useCreateMarket, useCreateMarketInfo, useCreatePoster, useCreateRelation, useCreateStallholder, useCreateStallholderApplyForm, useCreateUser, useDeleteChat, useDeleteMarket, useDeleteRelation, useDeleteStallholder, useGetChat, useGetChatSubscription, useGetMarket, useGetMarketInfo, useGetMarketRelations, useGetMarkets, useGetMarketsByRegion, useGetMarketsNearMe, useGetNotification, useGetRelation, useGetRelationByMarketAndStallholder, useGetResourceConnections, useGetStallholder, useGetStallholderApplyForm, useGetStallholderRelations, useGetStallholders, useGetStallholdersByRegion, useGetUser, useGetUserChats, useGetUserFavourites, useGetUserMarkets, useGetUserNotifications, useGetUsers, useLocationSearch, useLogin, useLoginForm, useMarketForm, useMarketInfoForm, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSearchMarkets, useSearchStallholders, useSendChatMessage, useStallholderApplyForm, useStallholderForm, useUpdateMarket, useUpdateMarketInfo, useUpdateRelation, useUpdateStallholder, useUpdateStallholderApplyForm, useUpdateUser, useUserForm, useValidateToken, useValidateTokenForm, validateTokenFields };
1040
+ export { type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatInput, type ChatMessageInput, type ChatMessageType, type ChatType, type CreateLoginFormData, type CreateMarketFormData, type CreateMarketInfoFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateStallholderApplyFormFormData, type CreateStallholderFormData, type CreateUserFormData, type CreateValidateTokenFormData, type DateTimeType, type DateTimeWithPriceType, EnumInviteStatus, EnumNotification, EnumPaymentMethod, EnumRegions, EnumRelationResource, EnumResourceType, EnumResourceTypeIcon, EnumSocialMedia, EnumUserLicence, EnumUserRole, type FormDateField, type FormField, type GeocodeLocation, type ImageObjectType, ImageTypeEnum, type LocationType, type LoginFormData, type MapMultiLocation, type MarketFormData, type MarketInfoFormData, type MarketInfoType, type MarketType, type MarketWithConnectionDatesType, type NotificationType, type Nullable, type OptionItem, type PaymentTargetType, type PlacePrediction, type PosterInputType, type Region, type RegisterFormData, type RelationDate, type RelationLog, type RelationType, type RequestPasswordResetFormData, type Requirement, type ResetPasswordFormData, type ResourceConnectionsType, type ResourceImageType, type SatllholderWithConnectionDatesType, type SiteType, type SocialMediaType, type StallholderApplyFormFormData, type StallholderApplyFormType, type StallholderAttributes, type StallholderFormData, type StallholderLocation, type StallholderType, type Subcategory, type UserFormData, type UserType, type ValidateTokenFormData, availableCategories, availableCityOptions, availableRegionOptions, availableRegionTypes, availableTagTypes, capitalizeFirstLetter, categoryColors, dateFormat, defaultMarketFormValues, defaultMarketInfoFormValues, defaultRegion, defaultStallholderApplyFormValues, defaultStallholderFormValues, formatDate, formatTimestamp, getCurrentAndFutureDates, getFutureDatesAfterThreshold, globalDefaultValues, loginFields, mapArrayToOptions, mapBaseResourceTypeToFormData, marketBasicInfoFields, marketEndDateFields, marketInfo, marketInfoPaymentTarget, marketPriceByDateFields, marketStartDateFields, normalizeUrl, packagingOptions, paymentMethodOptions, producedIngOptions, profileFields, registerFields, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, siteTypeOptions, socialMediaFields, sortDatesByProximity, stallholderBasicInfoFields, stallholderElectricity, stallholderEndDateFields, stallholderFullAddress, stallholderGazebo, stallholderLocationDescription, stallholderMultiLocation, stallholderPackaging, stallholderPaymentMethod, stallholderPriceRange, stallholderProducedIn, stallholderStallSize, stallholderStartDateFields, stallholderTable, statusOptions, tagOptions, timeFormat, truncateText, useAddParticipantToChat, useAddUserFavouriteResource, useCreateChat, useCreateMarket, useCreateMarketInfo, useCreatePoster, useCreateRelation, useCreateStallholder, useCreateStallholderApplyForm, useCreateUser, useDeleteChat, useDeleteMarket, useDeleteRelation, useDeleteStallholder, useGetChat, useGetChatSubscription, useGetMarket, useGetMarketInfo, useGetMarketRelations, useGetMarkets, useGetMarketsByRegion, useGetMarketsNearMe, useGetNotification, useGetRelation, useGetRelationByMarketAndStallholder, useGetResourceConnections, useGetStallholder, useGetStallholderApplyForm, useGetStallholderRelations, useGetStallholders, useGetStallholdersByRegion, useGetUser, useGetUserChats, useGetUserFavourites, useGetUserMarkets, useGetUserNotifications, useGetUsers, useLocationSearch, useLogin, useLoginForm, useMarketForm, useMarketInfoForm, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSearchMarkets, useSearchStallholders, useSendChatMessage, useStallholderApplyForm, useStallholderForm, useUpdateMarket, useUpdateMarketInfo, useUpdateRelation, useUpdateStallholder, useUpdateStallholderApplyForm, useUpdateUser, useUserForm, useValidateToken, useValidateTokenForm, validateTokenFields };
package/dist/index.d.ts CHANGED
@@ -214,8 +214,13 @@ interface RelationType {
214
214
  updatedAt?: string;
215
215
  }
216
216
 
217
+ type SiteType = {
218
+ label?: string;
219
+ price?: number;
220
+ };
217
221
  interface DateTimeWithPriceType extends DateTimeType {
218
222
  marketPrice: number;
223
+ siteTypes?: SiteType[] | null;
219
224
  }
220
225
  type PaymentTargetType = {
221
226
  accountHolderName?: string;
@@ -226,7 +231,7 @@ type PaymentTargetType = {
226
231
  type Requirement = {
227
232
  category: "Food Safety" | "Environment" | "Operations" | "Legal & Safety";
228
233
  label: string;
229
- value: string;
234
+ value: boolean;
230
235
  };
231
236
  interface MarketInfoFormData {
232
237
  _id?: string;
@@ -411,8 +416,8 @@ type ResourceImageType = {
411
416
  title: string;
412
417
  };
413
418
  type SocialMediaType = {
414
- name: EnumSocialMedia;
415
- link: string;
419
+ name?: EnumSocialMedia;
420
+ link?: string;
416
421
  };
417
422
  interface BaseResourceTypeFormData {
418
423
  _id?: string;
@@ -578,6 +583,7 @@ declare function sortDatesByProximity<T extends {
578
583
  declare const availableRegionTypes: EnumRegions[];
579
584
  declare const availableRegionOptions: OptionItem[];
580
585
  declare const paymentMethodOptions: OptionItem[];
586
+ declare function normalizeUrl(url: string): string;
581
587
 
582
588
  interface PlacePrediction {
583
589
  place_id: string;
@@ -1016,6 +1022,7 @@ declare const marketInfo: FormField[];
1016
1022
  declare const marketInfoPaymentTarget: FormField[];
1017
1023
  declare const marketPriceByDateFields: FormField[];
1018
1024
  declare const requirementsOptions: Requirement[];
1025
+ declare const siteTypeOptions: SiteType[];
1019
1026
 
1020
1027
  declare const loginFields: FormField[];
1021
1028
  declare const registerFields: FormField[];
@@ -1030,4 +1037,4 @@ declare const categoryColors: Record<string, string>;
1030
1037
 
1031
1038
  declare const socialMediaFields: FormField[];
1032
1039
 
1033
- export { type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatInput, type ChatMessageInput, type ChatMessageType, type ChatType, type CreateLoginFormData, type CreateMarketFormData, type CreateMarketInfoFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateStallholderApplyFormFormData, type CreateStallholderFormData, type CreateUserFormData, type CreateValidateTokenFormData, type DateTimeType, type DateTimeWithPriceType, EnumInviteStatus, EnumNotification, EnumPaymentMethod, EnumRegions, EnumRelationResource, EnumResourceType, EnumResourceTypeIcon, EnumSocialMedia, EnumUserLicence, EnumUserRole, type FormDateField, type FormField, type GeocodeLocation, type ImageObjectType, ImageTypeEnum, type LocationType, type LoginFormData, type MapMultiLocation, type MarketFormData, type MarketInfoFormData, type MarketInfoType, type MarketType, type MarketWithConnectionDatesType, type NotificationType, type Nullable, type OptionItem, type PaymentTargetType, type PlacePrediction, type PosterInputType, type Region, type RegisterFormData, type RelationDate, type RelationLog, type RelationType, type RequestPasswordResetFormData, type Requirement, type ResetPasswordFormData, type ResourceConnectionsType, type ResourceImageType, type SatllholderWithConnectionDatesType, type SocialMediaType, type StallholderApplyFormFormData, type StallholderApplyFormType, type StallholderAttributes, type StallholderFormData, type StallholderLocation, type StallholderType, type Subcategory, type UserFormData, type UserType, type ValidateTokenFormData, availableCategories, availableCityOptions, availableRegionOptions, availableRegionTypes, availableTagTypes, capitalizeFirstLetter, categoryColors, dateFormat, defaultMarketFormValues, defaultMarketInfoFormValues, defaultRegion, defaultStallholderApplyFormValues, defaultStallholderFormValues, formatDate, formatTimestamp, getCurrentAndFutureDates, getFutureDatesAfterThreshold, globalDefaultValues, loginFields, mapArrayToOptions, mapBaseResourceTypeToFormData, marketBasicInfoFields, marketEndDateFields, marketInfo, marketInfoPaymentTarget, marketPriceByDateFields, marketStartDateFields, packagingOptions, paymentMethodOptions, producedIngOptions, profileFields, registerFields, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, socialMediaFields, sortDatesByProximity, stallholderBasicInfoFields, stallholderElectricity, stallholderEndDateFields, stallholderFullAddress, stallholderGazebo, stallholderLocationDescription, stallholderMultiLocation, stallholderPackaging, stallholderPaymentMethod, stallholderPriceRange, stallholderProducedIn, stallholderStallSize, stallholderStartDateFields, stallholderTable, statusOptions, tagOptions, timeFormat, truncateText, useAddParticipantToChat, useAddUserFavouriteResource, useCreateChat, useCreateMarket, useCreateMarketInfo, useCreatePoster, useCreateRelation, useCreateStallholder, useCreateStallholderApplyForm, useCreateUser, useDeleteChat, useDeleteMarket, useDeleteRelation, useDeleteStallholder, useGetChat, useGetChatSubscription, useGetMarket, useGetMarketInfo, useGetMarketRelations, useGetMarkets, useGetMarketsByRegion, useGetMarketsNearMe, useGetNotification, useGetRelation, useGetRelationByMarketAndStallholder, useGetResourceConnections, useGetStallholder, useGetStallholderApplyForm, useGetStallholderRelations, useGetStallholders, useGetStallholdersByRegion, useGetUser, useGetUserChats, useGetUserFavourites, useGetUserMarkets, useGetUserNotifications, useGetUsers, useLocationSearch, useLogin, useLoginForm, useMarketForm, useMarketInfoForm, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSearchMarkets, useSearchStallholders, useSendChatMessage, useStallholderApplyForm, useStallholderForm, useUpdateMarket, useUpdateMarketInfo, useUpdateRelation, useUpdateStallholder, useUpdateStallholderApplyForm, useUpdateUser, useUserForm, useValidateToken, useValidateTokenForm, validateTokenFields };
1040
+ export { type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatInput, type ChatMessageInput, type ChatMessageType, type ChatType, type CreateLoginFormData, type CreateMarketFormData, type CreateMarketInfoFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateStallholderApplyFormFormData, type CreateStallholderFormData, type CreateUserFormData, type CreateValidateTokenFormData, type DateTimeType, type DateTimeWithPriceType, EnumInviteStatus, EnumNotification, EnumPaymentMethod, EnumRegions, EnumRelationResource, EnumResourceType, EnumResourceTypeIcon, EnumSocialMedia, EnumUserLicence, EnumUserRole, type FormDateField, type FormField, type GeocodeLocation, type ImageObjectType, ImageTypeEnum, type LocationType, type LoginFormData, type MapMultiLocation, type MarketFormData, type MarketInfoFormData, type MarketInfoType, type MarketType, type MarketWithConnectionDatesType, type NotificationType, type Nullable, type OptionItem, type PaymentTargetType, type PlacePrediction, type PosterInputType, type Region, type RegisterFormData, type RelationDate, type RelationLog, type RelationType, type RequestPasswordResetFormData, type Requirement, type ResetPasswordFormData, type ResourceConnectionsType, type ResourceImageType, type SatllholderWithConnectionDatesType, type SiteType, type SocialMediaType, type StallholderApplyFormFormData, type StallholderApplyFormType, type StallholderAttributes, type StallholderFormData, type StallholderLocation, type StallholderType, type Subcategory, type UserFormData, type UserType, type ValidateTokenFormData, availableCategories, availableCityOptions, availableRegionOptions, availableRegionTypes, availableTagTypes, capitalizeFirstLetter, categoryColors, dateFormat, defaultMarketFormValues, defaultMarketInfoFormValues, defaultRegion, defaultStallholderApplyFormValues, defaultStallholderFormValues, formatDate, formatTimestamp, getCurrentAndFutureDates, getFutureDatesAfterThreshold, globalDefaultValues, loginFields, mapArrayToOptions, mapBaseResourceTypeToFormData, marketBasicInfoFields, marketEndDateFields, marketInfo, marketInfoPaymentTarget, marketPriceByDateFields, marketStartDateFields, normalizeUrl, packagingOptions, paymentMethodOptions, producedIngOptions, profileFields, registerFields, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, siteTypeOptions, socialMediaFields, sortDatesByProximity, stallholderBasicInfoFields, stallholderElectricity, stallholderEndDateFields, stallholderFullAddress, stallholderGazebo, stallholderLocationDescription, stallholderMultiLocation, stallholderPackaging, stallholderPaymentMethod, stallholderPriceRange, stallholderProducedIn, stallholderStallSize, stallholderStartDateFields, stallholderTable, statusOptions, tagOptions, timeFormat, truncateText, useAddParticipantToChat, useAddUserFavouriteResource, useCreateChat, useCreateMarket, useCreateMarketInfo, useCreatePoster, useCreateRelation, useCreateStallholder, useCreateStallholderApplyForm, useCreateUser, useDeleteChat, useDeleteMarket, useDeleteRelation, useDeleteStallholder, useGetChat, useGetChatSubscription, useGetMarket, useGetMarketInfo, useGetMarketRelations, useGetMarkets, useGetMarketsByRegion, useGetMarketsNearMe, useGetNotification, useGetRelation, useGetRelationByMarketAndStallholder, useGetResourceConnections, useGetStallholder, useGetStallholderApplyForm, useGetStallholderRelations, useGetStallholders, useGetStallholdersByRegion, useGetUser, useGetUserChats, useGetUserFavourites, useGetUserMarkets, useGetUserNotifications, useGetUsers, useLocationSearch, useLogin, useLoginForm, useMarketForm, useMarketInfoForm, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSearchMarkets, useSearchStallholders, useSendChatMessage, useStallholderApplyForm, useStallholderForm, useUpdateMarket, useUpdateMarketInfo, useUpdateRelation, useUpdateStallholder, useUpdateStallholderApplyForm, useUpdateUser, useUserForm, useValidateToken, useValidateTokenForm, validateTokenFields };
package/dist/index.mjs CHANGED
@@ -197,6 +197,12 @@ var availableRegionOptions = mapArrayToOptions(availableRegionTypes);
197
197
  var paymentMethodOptions = mapArrayToOptions(
198
198
  Object.values(EnumPaymentMethod)
199
199
  );
200
+ function normalizeUrl(url) {
201
+ if (!url.startsWith("http://") && !url.startsWith("https://")) {
202
+ return `https://${url}`;
203
+ }
204
+ return url;
205
+ }
200
206
 
201
207
  // src/hooks/useLocationSearch.ts
202
208
  var handleApiError = (error, message) => {
@@ -282,6 +288,11 @@ import dayjs2, { extend as extend2 } from "dayjs";
282
288
  import customParseFormat2 from "dayjs/plugin/customParseFormat";
283
289
  import isSameOrAfter2 from "dayjs/plugin/isSameOrAfter";
284
290
  import * as yup from "yup";
291
+ var normalizedUrlTransform = () => yup.string().trim().transform(
292
+ (value) => typeof value === "string" ? value.toLowerCase() : value
293
+ ).transform(
294
+ (value) => typeof value === "string" ? normalizeUrl(value) : value
295
+ );
285
296
  var noLeadingZeros = (fieldName, options = {}) => {
286
297
  return function(value, context) {
287
298
  const original = context.originalValue?.toString() ?? "";
@@ -354,12 +365,25 @@ var dateTimeSchema = yup.object().shape({
354
365
  startDate: yup.string().concat(startDateNotInPastTest).required("Start date is required"),
355
366
  startTime: yup.string().concat(startTimeCannotBeInPastTest).required("Start time is required")
356
367
  });
368
+ var siteTypesSchema = yup.object({
369
+ label: yup.string().trim().optional(),
370
+ price: yup.number().when("label", {
371
+ is: (label) => !!label,
372
+ then: (schema) => schema.typeError("Site price must be a number").min(0.1, "Site price must be at least 0.1").required("Site price is required").test(
373
+ "no-leading-zeros",
374
+ "",
375
+ noLeadingZeros("Site price", { allowDecimal: true })
376
+ ),
377
+ otherwise: (schema) => schema.notRequired()
378
+ })
379
+ });
357
380
  var dateTimeWithPriceSchema = dateTimeSchema.shape({
358
381
  marketPrice: yup.number().typeError("Market price must be a number").min(0.1, "Market price must be at least 0.1").required("Market price is required").test(
359
382
  "no-leading-zeros",
360
383
  "",
361
384
  noLeadingZeros("Market price", { allowDecimal: true })
362
- )
385
+ ),
386
+ siteTypes: yup.array().of(siteTypesSchema).nullable().optional()
363
387
  });
364
388
  var locationSchema = yup.object().shape({
365
389
  city: yup.string().required("City is required"),
@@ -378,6 +402,15 @@ var emailSchema = yup.string().email("Invalid email address").required("Email is
378
402
  (value) => typeof value === "string" ? value.toLowerCase() : value
379
403
  );
380
404
  var passwordSchema = yup.string().trim().min(8, "Password must be at least 8 characters long").required("Password is required");
405
+ var socialMediaSchema = yup.object({
406
+ name: yup.mixed().oneOf(Object.values(EnumSocialMedia)).optional(),
407
+ link: yup.string().when("name", {
408
+ is: (name) => !!name,
409
+ // If name has a value
410
+ then: () => normalizedUrlTransform().required("Link is required when name is set").url("Link must be a valid URL"),
411
+ otherwise: (schema) => schema.notRequired()
412
+ })
413
+ });
381
414
  var globalResourceSchema = yup.object().shape({
382
415
  active: yup.boolean().required("Active is required"),
383
416
  cover: yup.object({
@@ -386,7 +419,8 @@ var globalResourceSchema = yup.object().shape({
386
419
  }),
387
420
  description: yup.string().trim().min(3).required("Description is required"),
388
421
  name: yup.string().trim().min(3).required("Name is required"),
389
- region: yup.string().required("Region is required")
422
+ region: yup.string().required("Region is required"),
423
+ socialMedia: yup.array().of(socialMediaSchema).nullable().optional()
390
424
  });
391
425
 
392
426
  // src/yupSchema/market.ts
@@ -415,9 +449,7 @@ var paymentTargetSchema = yup2.object({
415
449
  }),
416
450
  link: yup2.string().when("paymentMethod", {
417
451
  is: (val) => val !== "bank_transfer" /* BANK_TRANSFER */,
418
- then: (schema) => schema.trim().url("Link must be a valid URL").required("Link is required for PayPal/Stripe").transform(
419
- (value) => typeof value === "string" ? value.toLowerCase() : value
420
- ),
452
+ then: () => normalizedUrlTransform().url("Link must be a valid URL").required("Link is required for PayPal/Stripe"),
421
453
  otherwise: (schema) => schema.notRequired()
422
454
  })
423
455
  });
@@ -427,22 +459,6 @@ var marketInfoSchema = yup2.object().shape({
427
459
  marketId: yup2.string().trim().required("Market ID is required"),
428
460
  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")),
429
461
  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")),
430
- /* requirements: yup
431
- .array()
432
- .of(
433
- yup.object({
434
- category: yup
435
- .mixed<
436
- "Food Safety" | "Environment" | "Operations" | "Legal & Safety"
437
- >()
438
- .oneOf(["Food Safety", "Environment", "Operations", "Legal & Safety"])
439
- .required("Category is required"),
440
- label: yup.string().trim().required("Label is required"),
441
- value: yup.string().trim().required("Value is required"),
442
- }),
443
- )
444
- .min(1, "At least one requirement is required")
445
- .required("Requirements are required"), */
446
462
  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")),
447
463
  paymentTarget: yup2.array().of(paymentTargetSchema).min(1, "At least one payment target is required").required("Payment target is required"),
448
464
  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"))
@@ -610,6 +626,7 @@ var defaultMarketInfoFormValues = {
610
626
  endDate: "04-05-2025",
611
627
  endTime: "15:00",
612
628
  marketPrice: 0,
629
+ siteTypes: [],
613
630
  startDate: "04-05-2025",
614
631
  startTime: "09:00"
615
632
  },
@@ -617,6 +634,7 @@ var defaultMarketInfoFormValues = {
617
634
  endDate: "05-05-2025",
618
635
  endTime: "15:00",
619
636
  marketPrice: 0,
637
+ siteTypes: [],
620
638
  startDate: "05-05-2025",
621
639
  startTime: "09:00"
622
640
  }
@@ -1599,6 +1617,10 @@ var MARKET_INFO = gql5`
1599
1617
  endDate
1600
1618
  endTime
1601
1619
  marketPrice
1620
+ siteTypes {
1621
+ label
1622
+ price
1623
+ }
1602
1624
  startDate
1603
1625
  startTime
1604
1626
  }
@@ -3154,80 +3176,206 @@ var marketPriceByDateFields = [
3154
3176
  }
3155
3177
  ];
3156
3178
  var requirementsOptions = [
3179
+ {
3180
+ category: "Environment",
3181
+ label: "All packaging must be eco-friendly or recyclable where possible.",
3182
+ value: false
3183
+ },
3184
+ {
3185
+ category: "Environment",
3186
+ label: "No single-use plastic bags are to be handed out.",
3187
+ value: false
3188
+ },
3189
+ {
3190
+ category: "Environment",
3191
+ label: "Stall area must be left clean with no trace of activity after pack-down.",
3192
+ value: false
3193
+ },
3194
+ {
3195
+ category: "Environment",
3196
+ label: "No disposal of oils, fats, or chemicals in public drains or on grassed areas.",
3197
+ value: false
3198
+ },
3199
+ {
3200
+ category: "Environment",
3201
+ 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.",
3202
+ value: false
3203
+ },
3204
+ {
3205
+ category: "Food Safety",
3206
+ label: "Food must be prepared and stored according to your food regulation.",
3207
+ value: false
3208
+ },
3209
+ {
3210
+ category: "Food Safety",
3211
+ label: "The stallholder must display a current food grade certificate.",
3212
+ value: false
3213
+ },
3214
+ {
3215
+ category: "Food Safety",
3216
+ label: "Only licensed food vendors may sell ready-to-eat food items.",
3217
+ value: false
3218
+ },
3157
3219
  {
3158
3220
  category: "Food Safety",
3159
- label: "The stallholder must display a current food grade certificate",
3160
- value: "food_grade_certificate"
3221
+ label: "Handwashing facilities must be available at your stall if preparing food.",
3222
+ value: false
3161
3223
  },
3162
3224
  {
3163
3225
  category: "Food Safety",
3164
- label: "Food must be prepared and stored according to your food regulation",
3165
- value: "food_preparation_regulations"
3226
+ label: "You must have a food safety plan in place for your stall.",
3227
+ value: false
3228
+ },
3229
+ {
3230
+ category: "Food Safety",
3231
+ label: "Allergens must be clearly listed on packaged and unpackaged food items.",
3232
+ value: false
3166
3233
  },
3167
3234
  {
3168
3235
  category: "Legal & Safety",
3169
- label: "All electrical equipment must be tested and tagged",
3170
- value: "electrical_safety"
3236
+ label: "All stallholders must comply with local council regulations.",
3237
+ value: false
3171
3238
  },
3172
3239
  {
3173
- category: "Operations",
3174
- label: "You must be self-sufficient in all operations",
3175
- value: "self_sufficient_operations"
3240
+ category: "Legal & Safety",
3241
+ label: "No unauthorised subletting of stall space to other vendors.",
3242
+ value: false
3176
3243
  },
3177
3244
  {
3178
- category: "Environment",
3179
- 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",
3180
- value: "rubbish_and_recycling_responsibility"
3245
+ category: "Legal & Safety",
3246
+ label: "Gas bottles and fuel containers must be secured and in good condition if applicable.",
3247
+ value: false
3181
3248
  },
3182
3249
  {
3183
3250
  category: "Legal & Safety",
3184
- label: "You must secure your gazebo and equipment to withstand wind or bad weather",
3185
- value: "stall_safety_and_weather_protection"
3251
+ label: "Fire extinguishers must be available for stalls using cooking or heating equipment.",
3252
+ value: false
3186
3253
  },
3187
3254
  {
3188
3255
  category: "Legal & Safety",
3189
- label: "You are responsible for the safety of your setup and any potential hazards",
3190
- value: "stallholder_safety_responsibility"
3256
+ label: "Stallholders must not sell items that are illegal or prohibited by law.",
3257
+ value: false
3191
3258
  },
3192
3259
  {
3193
- category: "Operations",
3194
- label: "Stallholders must arrive and be fully set up by the designated opening time",
3195
- value: "setup_on_time"
3260
+ category: "Legal & Safety",
3261
+ label: "All electrical equipment must be tested and tagged.",
3262
+ value: false
3196
3263
  },
3197
3264
  {
3198
- category: "Operations",
3199
- label: "You may not pack down your stall before the event officially ends",
3200
- value: "no_early_packdown"
3265
+ category: "Legal & Safety",
3266
+ label: "Noise levels must be kept to a minimum unless part of a permitted performance.",
3267
+ value: false
3201
3268
  },
3202
3269
  {
3203
- category: "Environment",
3204
- label: "All packaging must be eco-friendly or recyclable where possible",
3205
- value: "eco_friendly_packaging"
3270
+ category: "Legal & Safety",
3271
+ label: "Pets at the stall must be secured and well-behaved at all times.",
3272
+ value: false
3206
3273
  },
3207
3274
  {
3208
3275
  category: "Legal & Safety",
3209
- label: "Stallholders must hold valid liability insurance where required",
3210
- value: "liability_insurance_required"
3276
+ label: "Cables must be secured and not create tripping hazards.",
3277
+ value: false
3211
3278
  },
3212
3279
  {
3213
- category: "Environment",
3214
- label: "No single-use plastic bags are to be handed out",
3215
- value: "no_single_use_plastics"
3280
+ category: "Legal & Safety",
3281
+ label: "Stalls must not obstruct emergency access routes.",
3282
+ value: false
3216
3283
  },
3217
3284
  {
3218
3285
  category: "Legal & Safety",
3219
- label: "Noise levels must be kept to a minimum unless part of a permitted performance",
3220
- value: "noise_restrictions"
3286
+ label: "First aid kit must be available at the stall for minor injuries.",
3287
+ value: false
3221
3288
  },
3222
3289
  {
3223
- category: "Operations",
3224
- label: "Generators must be quiet and pre-approved by the event organiser",
3225
- value: "generator_policy"
3290
+ category: "Legal & Safety",
3291
+ label: "Stallholders must hold valid liability insurance where required.",
3292
+ value: false
3226
3293
  },
3227
3294
  {
3228
3295
  category: "Legal & Safety",
3229
- label: "Pets at the stall must be secured and well-behaved at all times",
3230
- value: "pets_policy"
3296
+ label: "You must secure your gazebo and equipment to withstand wind or bad weather.",
3297
+ value: false
3298
+ },
3299
+ {
3300
+ category: "Legal & Safety",
3301
+ label: "You are responsible for the safety of your setup and any potential hazards.",
3302
+ value: false
3303
+ },
3304
+ {
3305
+ category: "Operations",
3306
+ label: "Generators must be quiet and pre-approved by the event organiser.",
3307
+ value: false
3308
+ },
3309
+ {
3310
+ category: "Operations",
3311
+ label: "Only approved products or services may be sold \u2014 no last-minute changes.",
3312
+ value: false
3313
+ },
3314
+ {
3315
+ category: "Operations",
3316
+ label: "Stallholders must arrive and be fully set up by the designated opening time.",
3317
+ value: false
3318
+ },
3319
+ {
3320
+ category: "Operations",
3321
+ label: "You may not pack down your stall before the event officially ends.",
3322
+ value: false
3323
+ },
3324
+ {
3325
+ category: "Operations",
3326
+ label: "You must be self-sufficient in all operations.",
3327
+ value: false
3328
+ },
3329
+ {
3330
+ category: "Operations",
3331
+ label: "Stall layout must be kept within your allocated space.",
3332
+ value: false
3333
+ }
3334
+ ];
3335
+ var siteTypeOptions = [
3336
+ {
3337
+ label: "3x3m tent site",
3338
+ price: 0
3339
+ },
3340
+ {
3341
+ label: "2x2m mini stall",
3342
+ price: 0
3343
+ },
3344
+ {
3345
+ label: "1.8m table only",
3346
+ price: 0
3347
+ },
3348
+ {
3349
+ label: "Food truck site",
3350
+ price: 0
3351
+ },
3352
+ {
3353
+ label: "Wall-based vendor",
3354
+ price: 0
3355
+ },
3356
+ {
3357
+ label: "Workshop/seating area",
3358
+ price: 0
3359
+ },
3360
+ {
3361
+ label: "Shared table space",
3362
+ price: 0
3363
+ },
3364
+ {
3365
+ label: "Corner stall",
3366
+ price: 0
3367
+ },
3368
+ {
3369
+ label: "Double stall (6x3m)",
3370
+ price: 0
3371
+ },
3372
+ {
3373
+ label: "Inside hall stall",
3374
+ price: 0
3375
+ },
3376
+ {
3377
+ label: "Outdoor open area",
3378
+ price: 0
3231
3379
  }
3232
3380
  ];
3233
3381
 
@@ -3731,6 +3879,7 @@ export {
3731
3879
  marketInfoPaymentTarget,
3732
3880
  marketPriceByDateFields,
3733
3881
  marketStartDateFields,
3882
+ normalizeUrl,
3734
3883
  packagingOptions,
3735
3884
  paymentMethodOptions,
3736
3885
  producedIngOptions,
@@ -3740,6 +3889,7 @@ export {
3740
3889
  requestPasswordResetFields,
3741
3890
  requirementsOptions,
3742
3891
  resetPasswordFields,
3892
+ siteTypeOptions,
3743
3893
  socialMediaFields,
3744
3894
  sortDatesByProximity,
3745
3895
  stallholderBasicInfoFields,