@timardex/cluemart-shared 1.0.29 → 1.0.30
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/{chunk-BDJVSBRT.mjs → chunk-NWMPRKZ7.mjs} +9 -2
- package/dist/{chunk-BDJVSBRT.mjs.map → chunk-NWMPRKZ7.mjs.map} +1 -1
- package/dist/formFields/index.cjs +117 -37
- package/dist/formFields/index.cjs.map +1 -1
- package/dist/formFields/index.d.mts +1 -1
- package/dist/formFields/index.d.ts +1 -1
- package/dist/formFields/index.mjs +118 -38
- package/dist/formFields/index.mjs.map +1 -1
- package/dist/{global-lB32aPz_.d.ts → global-BPTHVdhZ.d.ts} +3 -3
- package/dist/{global-BwS9p10K.d.mts → global-BXE1MTDE.d.mts} +3 -3
- package/dist/graphql/index.d.mts +1 -1
- package/dist/graphql/index.d.ts +1 -1
- package/dist/hooks/index.cjs +37 -27
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.mjs +20 -21
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.cjs +142 -57
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.mjs +141 -57
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/utils/index.cjs +8 -0
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.mts +3 -2
- package/dist/utils/index.d.ts +3 -2
- package/dist/utils/index.mjs +3 -1
- package/package.json +1 -1
package/dist/hooks/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hooks/useLocationSearch.ts","../../src/hooks/stallholder/useStallholderForm.ts","../../src/yupSchema/global.ts","../../src/yupSchema/market.ts","../../src/yupSchema/stallholder.ts","../../src/yupSchema/user.ts","../../src/yupSchema/auth.ts","../../src/hooks/utils.ts","../../src/hooks/stallholder/useStallholderApplyForm.ts","../../src/hooks/market/useMarketForm.ts","../../src/hooks/market/useMarketInfoForm.ts","../../src/hooks/useUserForm.ts","../../src/hooks/auth/useLoginForm.ts","../../src/hooks/auth/useRegisterForm.ts","../../src/hooks/auth/useRequestPasswordResetForm.ts","../../src/hooks/auth/useValidateTokenForm.ts","../../src/hooks/auth/useResetPasswordForm.ts"],"sourcesContent":["/* eslint-disable camelcase */\nimport { LocationType } from \"../types/global\";\n\nexport interface PlacePrediction {\n place_id: string;\n description: string;\n}\n\ninterface PlaceDetails {\n address_components: {\n long_name: string;\n short_name: string;\n types: string[];\n }[];\n formatted_address: string;\n geometry: {\n location: {\n lat: number;\n lng: number;\n };\n };\n url: string;\n}\n\ninterface UseLocation {\n getPredictions: (text: string) => Promise<PlacePrediction[] | undefined>;\n getPlaceDetails: (placeId: string) => Promise<LocationType | undefined>;\n}\n\n/** Handles API request errors */\nconst handleApiError = (error: unknown, message: string) => {\n console.error(message, error);\n};\n\n/**\n * Custom hook to manage location search functionality.\n *\n * @returns {UseLocation} - The functions to get predictions and place details.\n */\nexport const useLocationSearch = (googleApi: string): UseLocation => {\n const getPredictions = async (\n text: string,\n ): Promise<PlacePrediction[] | undefined> => {\n try {\n const response = await fetch(\n `https://maps.googleapis.com/maps/api/place/autocomplete/json?input=${text}&components=country:nz&key=${googleApi}`,\n );\n\n if (!response.ok) {\n throw new Error(`HTTP error! Status: ${response.status}`);\n }\n\n const data = await response.json();\n return data.predictions;\n } catch (error) {\n console.error(\"Error fetching predictions:\", error);\n handleApiError(error, \"Failed to fetch address predictions.\");\n }\n };\n\n const getPlaceDetails = async (\n placeId: string,\n ): Promise<LocationType | undefined> => {\n try {\n const response = await fetch(\n `https://maps.googleapis.com/maps/api/place/details/json?place_id=${placeId}&key=${googleApi}`,\n );\n\n if (!response.ok) {\n throw new Error(`HTTP error! Status: ${response.status}`);\n }\n\n const data = (await response.json()) as { result: PlaceDetails };\n const { result } = data;\n const { lat, lng } = result.geometry.location;\n const { address_components, formatted_address } = result;\n\n const address = address_components.reduce((acc, item) => {\n if (item.types.includes(\"street_number\")) {\n return { ...acc, streetNumber: item.long_name };\n }\n if (item.types.includes(\"route\")) {\n return { ...acc, streetName: item.long_name };\n }\n if (item.types.includes(\"locality\")) {\n return { ...acc, city: item.long_name };\n }\n if (item.types.includes(\"administrative_area_level_1\")) {\n return { ...acc, region: item.long_name };\n }\n if (item.types.includes(\"country\")) {\n return { ...acc, country: item.long_name };\n }\n return acc;\n }, {} as LocationType);\n\n const newLocation = {\n city: address.city.toLowerCase(),\n coordinates: [lng, lat], // [longitude, latitude]\n country: address.country,\n fullAddress: formatted_address,\n latitude: lat,\n longitude: lng,\n region: address.region.replace(/ Region$/, \"\"), // Remove \" Region\" suffix\n type: \"Point\" as const, // Mongoose GeoJSON type\n };\n\n return newLocation;\n } catch (error) {\n handleApiError(error, \"Failed to fetch place details.\");\n }\n };\n\n return {\n getPlaceDetails,\n getPredictions,\n };\n};\n","import { yupResolver } from \"@hookform/resolvers/yup\";\nimport * as React from \"react\";\nimport { useForm } from \"react-hook-form\";\n\nimport {\n CreateStallholderFormData,\n StallholderFormData,\n} from \"../../types/stallholder\";\nimport { stallHolderSchema } from \"../../yupSchema\";\nimport {\n defaultStallholderFormValues,\n mapBaseResourceTypeToFormData,\n} from \"../utils\";\n\n/**\n * Custom hook to manage the stallholder form state and validation.\n *\n * @param {StallholderFormData} data - The initial form data.\n * @returns {CreateStallholderFormData} - The form methods and state.\n */\nexport function useStallholderForm(\n data?: StallholderFormData,\n): CreateStallholderFormData {\n const {\n control,\n formState: { errors },\n getValues,\n handleSubmit,\n reset,\n setValue,\n watch,\n } = useForm<StallholderFormData>({\n defaultValues: defaultStallholderFormValues,\n resolver: yupResolver(stallHolderSchema),\n });\n\n React.useEffect(() => {\n if (data) {\n reset({\n ...mapBaseResourceTypeToFormData(data),\n categories: data.categories,\n locations: data.locations,\n multiLocation: data.multiLocation,\n products: data.products,\n specialities: data.specialities,\n });\n } else {\n reset(defaultStallholderFormValues);\n }\n }, [data]);\n\n const {\n _id,\n active,\n categories,\n cover,\n coverUpload,\n description,\n images,\n imagesUpload,\n locations,\n logo,\n logoUpload,\n multiLocation,\n name,\n products,\n promoCode,\n socialMedia,\n region,\n specialities,\n } = getValues();\n\n return {\n control,\n fields: {\n _id,\n active,\n categories,\n cover,\n coverUpload,\n description,\n images,\n imagesUpload,\n locations,\n logo,\n logoUpload,\n multiLocation,\n name,\n products,\n promoCode,\n region,\n socialMedia,\n specialities,\n },\n formState: { errors },\n handleSubmit,\n reset,\n setValue,\n watch,\n };\n}\n","import dayjs, { extend } from \"dayjs\";\nimport customParseFormat from \"dayjs/plugin/customParseFormat\";\nimport isSameOrAfter from \"dayjs/plugin/isSameOrAfter\";\nimport * as yup from \"yup\";\nimport { TestFunction } from \"yup\";\n\nimport { dateFormat, timeFormat } from \"../utils\";\n\ntype NoLeadingZerosOptions = {\n allowDecimal?: boolean;\n};\n\nexport const noLeadingZeros = (\n fieldName: string,\n options: NoLeadingZerosOptions = {},\n): TestFunction<number | undefined> => {\n return function (value, context) {\n const original = context.originalValue?.toString() ?? \"\";\n\n const regex = options.allowDecimal\n ? /^0\\d+(\\.\\d+)?$/ // e.g. \"03\", \"03.5\", \"0002.75\"\n : /^0\\d+$/; // e.g. \"01\", \"0001\"\n\n if (regex.test(original)) {\n return context.createError({\n message: `${fieldName} must not have leading zeros`,\n });\n }\n\n return true;\n };\n};\n\nextend(isSameOrAfter);\nextend(customParseFormat);\n\nconst now = dayjs(); // Current date and time\n\n// DATE AND TIME SCHEMA\nexport const endDateNotInPastTest = yup\n .string()\n .test(\"not-in-past\", \"End date cannot be in the past\", (value) => {\n return value\n ? dayjs(value, dateFormat, true).isSameOrAfter(now, \"day\")\n : false;\n });\n\nexport const startDateNotInPastTest = yup\n .string()\n .test(\"not-in-past\", \"Start date cannot be in the past\", (value) => {\n return value\n ? dayjs(value, dateFormat, true).isSameOrAfter(now, \"day\")\n : false;\n });\n\nexport const endDateAfterStartDateTest = yup\n .string()\n .test(\n \"end-after-start\",\n \"End date cannot be before start date\",\n function (value) {\n const { startDate } = this.parent;\n if (!startDate || !value) return false;\n return dayjs(value, dateFormat, true).isSameOrAfter(\n dayjs(startDate, dateFormat, true),\n \"day\",\n );\n },\n );\n\nexport const endTimeMustBeAfterStartTimeTest = yup\n .string()\n .test(\n \"valid-end-time\",\n \"End time must be after start time\",\n function (value) {\n const { startDate, endDate, startTime } = this.parent;\n if (!startDate || !endDate || !startTime || !value) return false;\n\n const startDateTime = dayjs(\n `${startDate} ${startTime}`,\n `${dateFormat} ${timeFormat}`,\n true,\n );\n const endDateTime = dayjs(\n `${endDate} ${value}`,\n `${dateFormat} ${timeFormat}`,\n true,\n );\n\n return endDateTime.isAfter(startDateTime);\n },\n );\n\nexport const startTimeCannotBeInPastTest = yup\n .string()\n .test(\n \"valid-start-time\",\n \"Start time cannot be in the past\",\n function (value) {\n const { startDate } = this.parent;\n if (!startDate || !value) return false;\n const startDateTime = dayjs(\n `${startDate} ${value}`,\n `${dateFormat} ${timeFormat}`,\n true,\n );\n return startDateTime.isSameOrAfter(now);\n },\n );\n\nexport const dateTimeSchema = yup.object().shape({\n endDate: yup\n .string()\n .concat(endDateNotInPastTest)\n .concat(endDateAfterStartDateTest)\n .required(\"End date is required\"),\n endTime: yup\n .string()\n .concat(endTimeMustBeAfterStartTimeTest)\n .required(\"End time is required\"),\n startDate: yup\n .string()\n .concat(startDateNotInPastTest)\n .required(\"Start date is required\"),\n startTime: yup\n .string()\n .concat(startTimeCannotBeInPastTest)\n .required(\"Start time is required\"),\n});\n\nexport const dateTimeWithPriceSchema = dateTimeSchema.shape({\n marketPrice: yup\n .number()\n .typeError(\"Market price must be a number\")\n .min(0.1, \"Market price must be at least 0.1\")\n .required(\"Market price is required\")\n .test(\n \"no-leading-zeros\",\n \"\",\n noLeadingZeros(\"Market price\", { allowDecimal: true }),\n ),\n});\n\nexport const locationSchema = yup.object().shape({\n city: yup.string().required(\"City is required\"),\n coordinates: yup\n .array()\n .of(yup.number().required(\"Coordinates must be numbers\"))\n .length(\n 2,\n \"Coordinates must contain exactly two numbers (longitude, latitude)\",\n )\n .required(\"Coordinates are required\"),\n country: yup.string().required(\"Country is required\"),\n fullAddress: yup.string().required(\"Address is required\"),\n latitude: yup.number().required(\"Latitude is required\"),\n longitude: yup.number().required(\"Longitude is required\"),\n region: yup.string().required(\"Region is required\"),\n type: yup\n .string()\n .oneOf([\"Point\"], \"Type must be 'Point'\")\n .default(\"Point\")\n .required(\"Type is required\"),\n});\n\n// ✅ Reusable Email Schema\nexport const emailSchema = yup\n .string()\n .email(\"Invalid email address\")\n .required(\"Email is required\")\n .transform((value) =>\n typeof value === \"string\" ? value.toLowerCase() : value,\n );\n\n// ✅ Reusable Password Schema\nexport const passwordSchema = yup\n .string()\n .trim()\n .min(8, \"Password must be at least 8 characters long\")\n .required(\"Password is required\");\n\nexport const globalResourceSchema = yup.object().shape({\n active: yup.boolean().required(\"Active is required\"),\n cover: yup.object({\n source: yup.string().required(\"Cover is required\"),\n title: yup.string().required(\"Cover is required\"),\n }),\n description: yup.string().trim().min(3).required(\"Description is required\"),\n name: yup.string().trim().min(3).required(\"Name is required\"),\n region: yup.string().required(\"Region is required\"),\n});\n","/* eslint-disable sort-keys */\nimport * as yup from \"yup\";\n\nimport { EnumPaymentMethod } from \"../enums\";\n\nimport {\n dateTimeSchema,\n dateTimeWithPriceSchema,\n globalResourceSchema,\n locationSchema,\n noLeadingZeros,\n} from \"./global\";\n\nconst nzBankAccountRegex = /^\\d{2}-\\d{4}-\\d{7}-\\d{2}$/;\n\nexport const marketSchema = globalResourceSchema.shape({\n dateTime: yup.array().of(dateTimeSchema).required(\"DateTime is required\"),\n location: locationSchema,\n provider: yup.string().trim().min(3).required(\"Provider is required\"),\n tags: yup\n .array()\n .of(yup.string().defined())\n .min(1, \"Tags are required\")\n .required(\"Tags are required\"),\n});\n\nconst paymentTargetSchema = yup.object({\n paymentMethod: yup\n .mixed<EnumPaymentMethod>()\n .oneOf(Object.values(EnumPaymentMethod))\n .required(\"Please select a Payment method\"),\n\n accountHolderName: yup.string().when(\"paymentMethod\", {\n is: EnumPaymentMethod.BANK_TRANSFER,\n then: (schema) =>\n schema\n .required(\"Account holder name is required for bank transfer\")\n .trim(),\n otherwise: (schema) => schema.notRequired(),\n }),\n\n accountNumber: yup.string().when(\"paymentMethod\", {\n is: EnumPaymentMethod.BANK_TRANSFER,\n then: (schema) =>\n schema\n .required(\"Account number is required for bank transfer\")\n .matches(\n nzBankAccountRegex,\n \"Account number must be in format: XX-XXXX-XXXXXXX-XX\",\n )\n .trim(),\n otherwise: (schema) => schema.notRequired(),\n }),\n\n link: yup.string().when(\"paymentMethod\", {\n is: (val: EnumPaymentMethod) => val !== EnumPaymentMethod.BANK_TRANSFER,\n then: (schema) =>\n schema\n .trim()\n .url(\"Link must be a valid URL\")\n .required(\"Link is required for PayPal/Stripe\")\n .transform((value) =>\n typeof value === \"string\" ? value.toLowerCase() : value,\n ),\n otherwise: (schema) => schema.notRequired(),\n }),\n});\n\nexport const marketInfoSchema = yup.object().shape({\n applicationDeadlineHours: yup\n .number()\n .nullable()\n .transform((value, originalValue) => (originalValue === \"\" ? null : value))\n .typeError(\"Application deadline hours must be a number\")\n .min(1, \"Application deadline hours must be at least 1\")\n .required(\"Application deadline hours is required\")\n .test(\"no-leading-zeros\", \"\", noLeadingZeros(\"Application deadline hours\")),\n dateTime: yup\n .array()\n .of(dateTimeWithPriceSchema)\n .required(\"DateTime is required\"),\n marketId: yup.string().trim().required(\"Market ID is required\"),\n packInTime: yup\n .number()\n .typeError(\"Pack in time must be a number\")\n .min(1, \"Pack in time must be at least 1\")\n .required(\"Pack in time is required\")\n .test(\"no-leading-zeros\", \"\", noLeadingZeros(\"Pack in time\")),\n packOutTime: yup\n .number()\n .typeError(\"Pack out time must be a number\")\n .min(1, \"Pack out time must be at least 1\")\n .required(\"Pack out time is required\")\n .test(\"no-leading-zeros\", \"\", noLeadingZeros(\"Pack out time\")),\n /* requirements: yup\n .array()\n .of(\n yup.object({\n category: yup\n .mixed<\n \"Food Safety\" | \"Environment\" | \"Operations\" | \"Legal & Safety\"\n >()\n .oneOf([\"Food Safety\", \"Environment\", \"Operations\", \"Legal & Safety\"])\n .required(\"Category is required\"),\n label: yup.string().trim().required(\"Label is required\"),\n value: yup.string().trim().required(\"Value is required\"),\n }),\n )\n .min(1, \"At least one requirement is required\")\n .required(\"Requirements are required\"), */\n paymentDueHours: yup\n .number()\n .typeError(\"Payment due hours must be a number\")\n .min(1, \"Payment due hours must be at least 1\")\n .required(\"Payment due hours is required\")\n .test(\"no-leading-zeros\", \"\", noLeadingZeros(\"Payment due hours\")),\n paymentTarget: yup\n .array()\n .of(paymentTargetSchema)\n .min(1, \"At least one payment target is required\")\n .required(\"Payment target is required\"),\n stallCapacity: yup\n .number()\n .typeError(\"Stall capacity must be a number\")\n .min(1, \"Stall capacity must be at least 1\")\n .integer(\"Stall capacity must be a whole number\")\n .required(\"Stall capacity is required\")\n .test(\"no-leading-zeros\", \"\", noLeadingZeros(\"Stall capacity\")),\n});\n","import * as yup from \"yup\";\n\nimport { EnumPaymentMethod } from \"../enums\";\n\nimport { globalResourceSchema } from \"./global\";\n\nexport const stallHolderSchema = globalResourceSchema.shape({\n categories: yup\n .array()\n .of(\n yup.object().shape({\n id: yup.string().required(\"Category id is required\"),\n name: yup.string().required(\"Category name is required\"),\n subcategories: yup\n .array()\n .of(\n yup.object().shape({\n id: yup.string().defined(),\n items: yup.array().of(yup.string().defined()).nullable(),\n name: yup.string().defined(),\n }),\n )\n .nullable(),\n }),\n )\n .min(1, \"Category list must contain at least one item\")\n .required(\"Categories are required\"),\n multiLocation: yup.boolean().required(\"Multi location is required\"),\n products: yup\n .array()\n .of(yup.string().defined())\n .min(1, \"Product list must contain at least one item\")\n .required(\"Products are required\"),\n});\n\nexport const stallholderApplyFormSchema = yup.object().shape({\n electricity: yup.object().shape({\n details: yup\n .string()\n .trim()\n .test(\"details-required\", \"Please add details\", function (value) {\n return !this.parent?.isRequired || (value?.trim().length ?? 0) > 0;\n })\n .nullable(),\n isRequired: yup.boolean().required(\"Electricity requirement is required\"),\n }),\n foodSafetyGradeFiles: yup.array().of(yup.string().defined()).nullable(),\n foodSafetyGradeFilesUpload: yup.array().of(yup.string().defined()).nullable(),\n gazebo: yup.object().shape({\n details: yup\n .string()\n .trim()\n .test(\"details-required\", \"Please add details\", function (value) {\n return !this.parent?.isRequired || (value?.trim().length ?? 0) > 0;\n })\n .nullable(),\n isRequired: yup.boolean().required(\"Gazebo requirement is required\"),\n }),\n packaging: yup\n .array()\n .of(yup.string().defined())\n .min(1, \"Packaging list must contain at least one item\")\n .required(\"Packaging is required\"),\n paymentMethod: yup\n .mixed<EnumPaymentMethod>()\n .oneOf(Object.values(EnumPaymentMethod))\n .required(\"Please select a Payment method\"),\n priceRange: yup.object().shape({\n max: yup\n .number()\n .min(1)\n .required(\"Max price is required\")\n .test(\n \"is-greater\",\n \"Max price must be greater than or equal to Min price\",\n function (max) {\n const { min } = this.parent;\n return max >= min;\n },\n ),\n min: yup.number().min(1).required(\"Min price is required\"),\n }),\n producedIn: yup\n .array()\n .of(yup.string().defined())\n .min(1, \"Produced in list must contain at least one item\")\n .required(\"Produced in is required\"),\n stallholderId: yup.string().trim().required(\"Stallholder ID is required\"),\n stallSize: yup.object().shape({\n depth: yup.number().min(1).required(\"Depth is required\"),\n width: yup.number().min(1).required(\"Width is required\"),\n }),\n table: yup.object().shape({\n details: yup\n .string()\n .trim()\n .test(\"details-required\", \"Please add details\", function (value) {\n return !this.parent?.isRequired || (value?.trim().length ?? 0) > 0;\n })\n .nullable(),\n isRequired: yup.boolean().required(\"Table requirement is required\"),\n }),\n});\n","import * as yup from \"yup\";\n\nimport { EnumUserRole } from \"../enums\";\n\nimport { emailSchema, passwordSchema } from \"./global\";\n\nexport const userSchema = yup.object().shape({\n active: yup.boolean().required(\"Active is required\"),\n email: emailSchema,\n firstName: yup.string().required(\"First name is required\"),\n lastName: yup.string().required(\"Last name is required\"),\n password: passwordSchema,\n preferredRegion: yup.string().required(\"Preferred region is required\"),\n // eslint-disable-next-line sort-keys\n confirmPassword: yup\n .string()\n .oneOf([yup.ref(\"password\")], \"Passwords must match\")\n .required(\"Confirm Password is required\"),\n role: yup\n .mixed<EnumUserRole>()\n .oneOf(Object.values(EnumUserRole))\n .required(\"Role is required\"),\n});\n","import * as yup from \"yup\";\n\nimport { EnumUserRole } from \"../enums\";\n\nimport { emailSchema, passwordSchema } from \"./global\";\n\nexport const loginSchema = yup.object().shape({\n email: emailSchema,\n password: passwordSchema,\n});\n\nexport const registerSchema = yup.object().shape({\n email: emailSchema,\n firstName: yup.string().required(\"First Name is required\"),\n lastName: yup.string().required(\"Last Name is required\"),\n password: passwordSchema,\n preferredRegion: yup.string().required(\"Preferred Region is required\"),\n role: yup\n .mixed<EnumUserRole>()\n .oneOf(Object.values(EnumUserRole))\n .required(\"Role is required\"),\n});\n\nexport const requestPasswordResetSchema = yup.object().shape({\n email: emailSchema,\n});\n\nexport const resetPasswordSchema = yup.object().shape({\n email: emailSchema,\n password: passwordSchema,\n // eslint-disable-next-line sort-keys\n confirmPassword: yup\n .string()\n .oneOf([yup.ref(\"password\")], \"Passwords must match\")\n .required(\"Confirm Password is required\"),\n});\n\nexport const validateTokenSchema = yup.object().shape({\n email: emailSchema,\n token: yup\n .string()\n .required(\"Verification code is required\")\n .matches(/^\\d{5}$/, \"Verification code must be exactly 5 digits\"),\n});\n","import { EnumPaymentMethod } from \"../enums\";\nimport {\n BaseResourceTypeFormData,\n MarketFormData,\n MarketInfoFormData,\n StallholderApplyFormFormData,\n StallholderFormData,\n} from \"../types\";\n\nexport const globalDefaultValues: BaseResourceTypeFormData = {\n active: false,\n cover: {\n source: \"\",\n title: \"\",\n },\n coverUpload: {\n source: \"\",\n title: \"\",\n },\n description:\n \"Lorem Ipsum is a placeholder text commonly used in design and publishing to represent the visual form of a document without relying on meaningful content. It's a jumbled Latin text, not intended to be read or understood, and is used to show the layout and typography before actual content is added.\",\n images: null,\n imagesUpload: null,\n logo: null,\n logoUpload: null,\n name: \"Resource name\",\n promoCode: \"\",\n region: \"\",\n socialMedia: [],\n};\n\nexport const defaultMarketFormValues: MarketFormData = {\n ...globalDefaultValues,\n dateTime: [\n {\n endDate: \"04-07-2025\",\n endTime: \"15:00\",\n startDate: \"04-07-2025\",\n startTime: \"09:00\",\n },\n {\n endDate: \"05-07-2025\",\n endTime: \"15:00\",\n startDate: \"05-07-2025\",\n startTime: \"09:00\",\n },\n ],\n location: {\n city: \"\",\n coordinates: [0, 0], // [longitude, latitude]\n country: \"\",\n fullAddress: \"\",\n latitude: 0,\n longitude: 0,\n region: \"\",\n type: \"Point\", // Default type for GeoJSON\n },\n provider: \"Provider name\",\n tags: [],\n};\n\nexport const defaultMarketInfoFormValues: MarketInfoFormData = {\n applicationDeadlineHours: 0,\n dateTime: [\n {\n endDate: \"04-05-2025\",\n endTime: \"15:00\",\n marketPrice: 0.0,\n startDate: \"04-05-2025\",\n startTime: \"09:00\",\n },\n {\n endDate: \"05-05-2025\",\n endTime: \"15:00\",\n marketPrice: 0.0,\n startDate: \"05-05-2025\",\n startTime: \"09:00\",\n },\n ],\n marketId: \"\",\n packInTime: 0, // e.g., 2 hours before market opens\n packOutTime: 0, // e.g., 1 hour after market closes\n paymentDueHours: 0,\n paymentTarget: [],\n requirements: [],\n stallCapacity: 0,\n};\n\nexport const defaultStallholderFormValues: StallholderFormData = {\n ...globalDefaultValues,\n categories: [],\n locations: null,\n multiLocation: false,\n products: [],\n specialities: null,\n};\n\nexport const defaultStallholderApplyFormValues: StallholderApplyFormFormData = {\n electricity: { details: null, isRequired: false },\n foodSafetyGradeFiles: null,\n foodSafetyGradeFilesUpload: null,\n gazebo: { details: null, isRequired: false },\n packaging: [],\n paymentMethod: \"\" as EnumPaymentMethod,\n priceRange: { max: 0, min: 0 },\n producedIn: [],\n stallholderId: \"\",\n stallSize: { depth: 0, width: 0 },\n table: { details: null, isRequired: false },\n};\n\nexport function mapBaseResourceTypeToFormData(\n data: MarketFormData | StallholderFormData,\n): BaseResourceTypeFormData {\n return {\n _id: data._id,\n active: data.active,\n cover: data.cover,\n coverUpload: data.coverUpload,\n description: data.description,\n images: data.images,\n imagesUpload: data.imagesUpload,\n logo: data.logo,\n logoUpload: data.logoUpload,\n name: data.name,\n promoCode: data.promoCode,\n region: data.region,\n socialMedia: data.socialMedia,\n };\n}\n","import { yupResolver } from \"@hookform/resolvers/yup\";\nimport * as React from \"react\";\nimport { useForm } from \"react-hook-form\";\n\nimport {\n CreateStallholderApplyFormFormData,\n StallholderApplyFormFormData,\n} from \"../../types/stallholder\";\nimport { stallholderApplyFormSchema } from \"../../yupSchema\";\nimport { defaultStallholderApplyFormValues } from \"../utils\";\n\n/**\n * Custom hook to manage the stallholder apply form state and validation.\n *\n * @param {StallholderApplyFormFormData} data - The initial form data.\n * @returns {CreateStallholderApplyFormFormData} - The form methods and state.\n */\nexport function useStallholderApplyForm(\n data?: StallholderApplyFormFormData,\n): CreateStallholderApplyFormFormData {\n const {\n control,\n formState: { errors },\n getValues,\n handleSubmit,\n reset,\n setValue,\n watch,\n } = useForm<StallholderApplyFormFormData>({\n defaultValues: defaultStallholderApplyFormValues,\n resolver: yupResolver(stallholderApplyFormSchema),\n });\n\n React.useEffect(() => {\n if (data) {\n reset({\n _id: data._id,\n electricity: data.electricity,\n foodSafetyGradeFiles: data.foodSafetyGradeFiles,\n foodSafetyGradeFilesUpload: data.foodSafetyGradeFilesUpload,\n gazebo: data.gazebo,\n packaging: data.packaging,\n paymentMethod: data.paymentMethod,\n priceRange: data.priceRange,\n producedIn: data.producedIn,\n stallholderId: data.stallholderId,\n stallSize: data.stallSize,\n table: data.table,\n });\n } else {\n reset(defaultStallholderApplyFormValues);\n }\n }, [data]);\n\n const {\n _id,\n electricity,\n foodSafetyGradeFiles,\n foodSafetyGradeFilesUpload,\n gazebo,\n packaging,\n paymentMethod,\n priceRange,\n producedIn,\n stallholderId,\n stallSize,\n table,\n } = getValues();\n\n return {\n control,\n fields: {\n _id,\n electricity,\n foodSafetyGradeFiles,\n foodSafetyGradeFilesUpload,\n gazebo,\n packaging,\n paymentMethod,\n priceRange,\n producedIn,\n stallholderId,\n stallSize,\n table,\n },\n formState: { errors },\n handleSubmit,\n reset,\n setValue,\n watch,\n };\n}\n","import { yupResolver } from \"@hookform/resolvers/yup\";\nimport * as React from \"react\";\nimport { useForm } from \"react-hook-form\";\n\nimport { CreateMarketFormData, MarketFormData } from \"../../types/market\";\nimport { marketSchema } from \"../../yupSchema\";\nimport {\n defaultMarketFormValues,\n mapBaseResourceTypeToFormData,\n} from \"../utils\";\n\n/**\n * Custom hook to manage the market form state and validation.\n *\n * @param {MarketFormData} data - The initial form data.\n * @returns {CreateMarketFormData} - The form methods and state.\n */\nexport function useMarketForm(data?: MarketFormData): CreateMarketFormData {\n const {\n control,\n formState: { errors },\n getValues,\n handleSubmit,\n reset,\n setValue,\n watch,\n } = useForm<MarketFormData>({\n defaultValues: defaultMarketFormValues,\n resolver: yupResolver(marketSchema),\n });\n\n React.useEffect(() => {\n if (data) {\n reset({\n ...mapBaseResourceTypeToFormData(data),\n dateTime: data.dateTime,\n location: data.location,\n provider: data.provider,\n tags: data.tags,\n });\n } else {\n reset(defaultMarketFormValues);\n }\n }, [data]);\n\n const {\n _id,\n active,\n cover,\n coverUpload,\n dateTime,\n description,\n images,\n imagesUpload,\n location,\n logo,\n logoUpload,\n name,\n provider,\n region,\n tags,\n promoCode,\n socialMedia,\n } = getValues();\n\n return {\n control,\n fields: {\n _id,\n active,\n cover,\n coverUpload,\n dateTime,\n description,\n images,\n imagesUpload,\n location,\n logo,\n logoUpload,\n name,\n promoCode,\n provider,\n region,\n socialMedia,\n tags,\n },\n formState: { errors },\n handleSubmit,\n reset,\n setValue,\n watch,\n };\n}\n","import { yupResolver } from \"@hookform/resolvers/yup\";\nimport * as React from \"react\";\nimport { useForm } from \"react-hook-form\";\n\nimport {\n CreateMarketInfoFormData,\n MarketInfoFormData,\n} from \"../../types/market\";\nimport { marketInfoSchema } from \"../../yupSchema\";\nimport { defaultMarketInfoFormValues } from \"../utils\";\n\n/**\n * Custom hook to manage the market form state and validation.\n *\n * @param {MarketInfoFormData} data - The initial form data.\n * @returns {CreateMarketInfoFormData} - The form methods and state.\n */\nexport function useMarketInfoForm(\n data?: MarketInfoFormData,\n): CreateMarketInfoFormData {\n const {\n control,\n formState: { errors },\n getValues,\n handleSubmit,\n reset,\n setValue,\n watch,\n } = useForm<MarketInfoFormData>({\n defaultValues: defaultMarketInfoFormValues,\n resolver: yupResolver(marketInfoSchema),\n });\n\n React.useEffect(() => {\n if (data) {\n reset({\n _id: data._id,\n applicationDeadlineHours: data.applicationDeadlineHours,\n dateTime: data.dateTime,\n marketId: data.marketId,\n packInTime: data.packInTime,\n packOutTime: data.packOutTime,\n paymentDueHours: data.paymentDueHours,\n paymentTarget: data.paymentTarget,\n requirements: data.requirements,\n stallCapacity: data.stallCapacity,\n });\n } else {\n reset(defaultMarketInfoFormValues);\n }\n }, [data]);\n\n const {\n _id,\n applicationDeadlineHours,\n dateTime,\n marketId,\n packInTime,\n packOutTime,\n paymentDueHours,\n paymentTarget,\n requirements,\n stallCapacity,\n } = getValues();\n\n return {\n control,\n fields: {\n _id,\n applicationDeadlineHours,\n dateTime,\n marketId,\n packInTime,\n packOutTime,\n paymentDueHours,\n paymentTarget,\n requirements,\n stallCapacity,\n },\n formState: { errors },\n handleSubmit,\n reset,\n setValue,\n watch,\n };\n}\n","import { yupResolver } from \"@hookform/resolvers/yup\";\nimport * as React from \"react\";\nimport { useForm } from \"react-hook-form\";\n\nimport { EnumUserRole } from \"../enums\";\nimport { CreateUserFormData, UserFormData } from \"../types/user\";\nimport { userSchema } from \"../yupSchema/user\";\n\nconst defaultValues: UserFormData = {\n active: false,\n avatar: null,\n avatarUpload: null,\n confirmPassword: \"\",\n email: \"\",\n firstName: \"\",\n lastName: \"\",\n password: \"\",\n preferredRegion: \"\",\n role: EnumUserRole.CUSTOMER,\n};\n\n/**\n * Custom hook to manage the user form state and validation.\n *\n * @param {UserFormData} data - The initial form data.\n * @returns {CreateUserFormData} - The form methods and state.\n */\nexport function useUserForm(data?: UserFormData): CreateUserFormData {\n const {\n control,\n formState: { errors },\n getValues,\n handleSubmit,\n reset,\n setValue,\n watch,\n } = useForm<UserFormData>({\n defaultValues,\n resolver: yupResolver(userSchema),\n });\n\n React.useEffect(() => {\n if (data) {\n reset({\n _id: data._id,\n active: data.active,\n avatar: data.avatar,\n avatarUpload: data.avatarUpload,\n confirmPassword: data.confirmPassword,\n email: data.email,\n firstName: data.firstName,\n lastName: data.lastName,\n password: data.password,\n preferredRegion: data.preferredRegion,\n role: data.role,\n });\n } else {\n reset(defaultValues);\n }\n }, [data]);\n\n const {\n _id,\n active,\n avatar,\n avatarUpload,\n confirmPassword,\n email,\n firstName,\n lastName,\n password,\n preferredRegion,\n role,\n } = getValues();\n\n return {\n control,\n fields: {\n _id,\n active,\n avatar,\n avatarUpload,\n confirmPassword,\n email,\n firstName,\n lastName,\n password,\n preferredRegion,\n role,\n },\n formState: { errors },\n handleSubmit,\n reset,\n setValue,\n watch,\n };\n}\n","import { yupResolver } from \"@hookform/resolvers/yup\";\nimport { useForm } from \"react-hook-form\";\n\nimport { CreateLoginFormData, LoginFormData } from \"../../types/auth\";\nimport { loginSchema } from \"../../yupSchema/auth\";\n\nconst defaultValues: LoginFormData = {\n email: \"\",\n password: \"\",\n};\n\n/**\n * Custom hook to manage the login form state and validation.\n *\n * @returns {CreateLoginFormData} - The form methods and state.\n */\nexport function useLoginForm(): CreateLoginFormData {\n const {\n control,\n formState: { errors },\n getValues,\n handleSubmit,\n reset,\n setValue,\n watch,\n } = useForm<LoginFormData>({\n defaultValues,\n resolver: yupResolver(loginSchema),\n });\n\n const { email, password } = getValues();\n\n return {\n control,\n fields: {\n email,\n password,\n },\n formState: { errors },\n handleSubmit,\n reset,\n setValue,\n watch,\n };\n}\n","import { yupResolver } from \"@hookform/resolvers/yup\";\nimport { useForm } from \"react-hook-form\";\n\nimport { EnumRegions, EnumUserRole } from \"../../enums\";\nimport { CreateRegisterFormData, RegisterFormData } from \"../../types/auth\";\nimport { registerSchema } from \"../../yupSchema/auth\";\n\nconst defaultValues: RegisterFormData = {\n email: \"\",\n firstName: \"\",\n lastName: \"\",\n password: \"\",\n preferredRegion: \"\",\n role: EnumUserRole.CUSTOMER,\n};\n\n/**\n * Custom hook to manage the register form state and validation.\n *\n * @returns {CreateRegisterFormData} - The form methods and state.\n */\nexport function useRegisterForm(): CreateRegisterFormData {\n const {\n control,\n formState: { errors },\n getValues,\n handleSubmit,\n reset,\n setValue,\n watch,\n } = useForm<RegisterFormData>({\n defaultValues,\n resolver: yupResolver(registerSchema),\n });\n\n const { email, firstName, lastName, password, preferredRegion, role } =\n getValues();\n\n return {\n control,\n fields: {\n email,\n firstName,\n lastName,\n password,\n preferredRegion,\n role,\n },\n formState: { errors },\n handleSubmit,\n reset,\n setValue,\n watch,\n };\n}\n","import { yupResolver } from \"@hookform/resolvers/yup\";\nimport { useForm } from \"react-hook-form\";\n\nimport {\n CreateRequestPasswordResetFormData,\n RequestPasswordResetFormData,\n} from \"../../types/auth\";\nimport { requestPasswordResetSchema } from \"../../yupSchema/auth\";\n\nconst defaultValues: RequestPasswordResetFormData = {\n email: \"\",\n};\n\nexport function useRequestPasswordResetForm(): CreateRequestPasswordResetFormData {\n const {\n control,\n formState: { errors },\n getValues,\n handleSubmit,\n reset,\n setValue,\n watch,\n } = useForm<RequestPasswordResetFormData>({\n defaultValues,\n resolver: yupResolver(requestPasswordResetSchema),\n });\n\n const { email } = getValues();\n\n return {\n control,\n fields: {\n email,\n },\n formState: { errors },\n handleSubmit,\n reset,\n setValue,\n watch,\n };\n}\n","import { yupResolver } from \"@hookform/resolvers/yup\";\nimport { useForm } from \"react-hook-form\";\n\nimport {\n CreateValidateTokenFormData,\n ValidateTokenFormData,\n} from \"../../types/auth\";\nimport { validateTokenSchema } from \"../../yupSchema/auth\";\n\nconst defaultValues: ValidateTokenFormData = {\n email: \"\",\n token: \"\",\n};\n\nexport function useValidateTokenForm(): CreateValidateTokenFormData {\n const {\n control,\n formState: { errors },\n getValues,\n handleSubmit,\n reset,\n setValue,\n watch,\n } = useForm<ValidateTokenFormData>({\n defaultValues,\n resolver: yupResolver(validateTokenSchema),\n });\n\n const { email, token } = getValues();\n\n return {\n control,\n fields: {\n email,\n token,\n },\n formState: { errors },\n handleSubmit,\n reset,\n setValue,\n watch,\n };\n}\n","import { yupResolver } from \"@hookform/resolvers/yup\";\nimport { useForm } from \"react-hook-form\";\n\nimport {\n CreateResetPasswordFormData,\n ResetPasswordFormData,\n} from \"../../types/auth\";\nimport { resetPasswordSchema } from \"../../yupSchema/auth\";\n\nconst defaultValues: ResetPasswordFormData = {\n confirmPassword: \"\",\n email: \"\",\n password: \"\",\n};\n\nexport function useResetPasswordForm(): CreateResetPasswordFormData {\n const {\n control,\n formState: { errors },\n getValues,\n handleSubmit,\n reset,\n setValue,\n watch,\n } = useForm<ResetPasswordFormData>({\n defaultValues,\n resolver: yupResolver(resetPasswordSchema),\n });\n\n const { confirmPassword, email, password } = getValues();\n\n return {\n control,\n fields: {\n confirmPassword,\n email,\n password,\n },\n formState: { errors },\n handleSubmit,\n reset,\n setValue,\n watch,\n };\n}\n"],"mappings":";;;;;;;;;;AA8BA,IAAM,iBAAiB,CAAC,OAAgB,YAAoB;AAC1D,UAAQ,MAAM,SAAS,KAAK;AAC9B;AAOO,IAAM,oBAAoB,CAAC,cAAmC;AACnE,QAAM,iBAAiB,OACrB,SAC2C;AAC3C,QAAI;AACF,YAAM,WAAW,MAAM;AAAA,QACrB,sEAAsE,IAAI,8BAA8B,SAAS;AAAA,MACnH;AAEA,UAAI,CAAC,SAAS,IAAI;AAChB,cAAM,IAAI,MAAM,uBAAuB,SAAS,MAAM,EAAE;AAAA,MAC1D;AAEA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useForm","yupResolver","yupResolver","React","useForm","useForm","yupResolver","yupResolver","React","useForm","useForm","yupResolver","yupResolver","React","useForm","useForm","yupResolver","yupResolver","useForm","defaultValues","useForm","yupResolver","yupResolver","useForm","defaultValues","useForm","yupResolver","yupResolver","useForm","defaultValues","useForm","yupResolver","yupResolver","useForm","defaultValues","useForm","yupResolver","yupResolver","useForm","defaultValues","useForm","yupResolver"]}
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/useLocationSearch.ts","../../src/hooks/stallholder/useStallholderForm.ts","../../src/yupSchema/global.ts","../../src/yupSchema/market.ts","../../src/yupSchema/stallholder.ts","../../src/yupSchema/user.ts","../../src/yupSchema/auth.ts","../../src/hooks/utils.ts","../../src/hooks/stallholder/useStallholderApplyForm.ts","../../src/hooks/market/useMarketForm.ts","../../src/hooks/market/useMarketInfoForm.ts","../../src/hooks/useUserForm.ts","../../src/hooks/auth/useLoginForm.ts","../../src/hooks/auth/useRegisterForm.ts","../../src/hooks/auth/useRequestPasswordResetForm.ts","../../src/hooks/auth/useValidateTokenForm.ts","../../src/hooks/auth/useResetPasswordForm.ts"],"sourcesContent":["/* eslint-disable camelcase */\nimport { LocationType } from \"../types/global\";\n\nexport interface PlacePrediction {\n place_id: string;\n description: string;\n}\n\ninterface PlaceDetails {\n address_components: {\n long_name: string;\n short_name: string;\n types: string[];\n }[];\n formatted_address: string;\n geometry: {\n location: {\n lat: number;\n lng: number;\n };\n };\n url: string;\n}\n\ninterface UseLocation {\n getPredictions: (text: string) => Promise<PlacePrediction[] | undefined>;\n getPlaceDetails: (placeId: string) => Promise<LocationType | undefined>;\n}\n\n/** Handles API request errors */\nconst handleApiError = (error: unknown, message: string) => {\n console.error(message, error);\n};\n\n/**\n * Custom hook to manage location search functionality.\n *\n * @returns {UseLocation} - The functions to get predictions and place details.\n */\nexport const useLocationSearch = (googleApi: string): UseLocation => {\n const getPredictions = async (\n text: string,\n ): Promise<PlacePrediction[] | undefined> => {\n try {\n const response = await fetch(\n `https://maps.googleapis.com/maps/api/place/autocomplete/json?input=${text}&components=country:nz&key=${googleApi}`,\n );\n\n if (!response.ok) {\n throw new Error(`HTTP error! Status: ${response.status}`);\n }\n\n const data = await response.json();\n return data.predictions;\n } catch (error) {\n console.error(\"Error fetching predictions:\", error);\n handleApiError(error, \"Failed to fetch address predictions.\");\n }\n };\n\n const getPlaceDetails = async (\n placeId: string,\n ): Promise<LocationType | undefined> => {\n try {\n const response = await fetch(\n `https://maps.googleapis.com/maps/api/place/details/json?place_id=${placeId}&key=${googleApi}`,\n );\n\n if (!response.ok) {\n throw new Error(`HTTP error! Status: ${response.status}`);\n }\n\n const data = (await response.json()) as { result: PlaceDetails };\n const { result } = data;\n const { lat, lng } = result.geometry.location;\n const { address_components, formatted_address } = result;\n\n const address = address_components.reduce((acc, item) => {\n if (item.types.includes(\"street_number\")) {\n return { ...acc, streetNumber: item.long_name };\n }\n if (item.types.includes(\"route\")) {\n return { ...acc, streetName: item.long_name };\n }\n if (item.types.includes(\"locality\")) {\n return { ...acc, city: item.long_name };\n }\n if (item.types.includes(\"administrative_area_level_1\")) {\n return { ...acc, region: item.long_name };\n }\n if (item.types.includes(\"country\")) {\n return { ...acc, country: item.long_name };\n }\n return acc;\n }, {} as LocationType);\n\n const newLocation = {\n city: address.city.toLowerCase(),\n coordinates: [lng, lat], // [longitude, latitude]\n country: address.country,\n fullAddress: formatted_address,\n latitude: lat,\n longitude: lng,\n region: address.region.replace(/ Region$/, \"\"), // Remove \" Region\" suffix\n type: \"Point\" as const, // Mongoose GeoJSON type\n };\n\n return newLocation;\n } catch (error) {\n handleApiError(error, \"Failed to fetch place details.\");\n }\n };\n\n return {\n getPlaceDetails,\n getPredictions,\n };\n};\n","import { yupResolver } from \"@hookform/resolvers/yup\";\nimport * as React from \"react\";\nimport { useForm } from \"react-hook-form\";\n\nimport {\n CreateStallholderFormData,\n StallholderFormData,\n} from \"../../types/stallholder\";\nimport { stallHolderSchema } from \"../../yupSchema\";\nimport {\n defaultStallholderFormValues,\n mapBaseResourceTypeToFormData,\n} from \"../utils\";\n\n/**\n * Custom hook to manage the stallholder form state and validation.\n *\n * @param {StallholderFormData} data - The initial form data.\n * @returns {CreateStallholderFormData} - The form methods and state.\n */\nexport function useStallholderForm(\n data?: StallholderFormData,\n): CreateStallholderFormData {\n const {\n control,\n formState: { errors },\n getValues,\n handleSubmit,\n reset,\n setValue,\n watch,\n } = useForm<StallholderFormData>({\n defaultValues: defaultStallholderFormValues,\n resolver: yupResolver(stallHolderSchema),\n });\n\n React.useEffect(() => {\n if (data) {\n reset({\n ...mapBaseResourceTypeToFormData(data),\n categories: data.categories,\n locations: data.locations,\n multiLocation: data.multiLocation,\n products: data.products,\n specialities: data.specialities,\n });\n } else {\n reset(defaultStallholderFormValues);\n }\n }, [data]);\n\n const {\n _id,\n active,\n categories,\n cover,\n coverUpload,\n description,\n images,\n imagesUpload,\n locations,\n logo,\n logoUpload,\n multiLocation,\n name,\n products,\n promoCode,\n socialMedia,\n region,\n specialities,\n } = getValues();\n\n return {\n control,\n fields: {\n _id,\n active,\n categories,\n cover,\n coverUpload,\n description,\n images,\n imagesUpload,\n locations,\n logo,\n logoUpload,\n multiLocation,\n name,\n products,\n promoCode,\n region,\n socialMedia,\n specialities,\n },\n formState: { errors },\n handleSubmit,\n reset,\n setValue,\n watch,\n };\n}\n","/* eslint-disable sort-keys */\nimport dayjs, { extend } from \"dayjs\";\nimport customParseFormat from \"dayjs/plugin/customParseFormat\";\nimport isSameOrAfter from \"dayjs/plugin/isSameOrAfter\";\nimport * as yup from \"yup\";\nimport { TestFunction } from \"yup\";\n\nimport { EnumSocialMedia } from \"src/enums\";\n\nimport { dateFormat, normalizeUrl, timeFormat } from \"../utils\";\n\ntype NoLeadingZerosOptions = {\n allowDecimal?: boolean;\n};\n\nexport const normalizedUrlTransform = () =>\n yup\n .string()\n .trim()\n .transform((value) =>\n typeof value === \"string\" ? value.toLowerCase() : value,\n )\n .transform((value) =>\n typeof value === \"string\" ? normalizeUrl(value) : value,\n );\n\nexport const noLeadingZeros = (\n fieldName: string,\n options: NoLeadingZerosOptions = {},\n): TestFunction<number | undefined> => {\n return function (value, context) {\n const original = context.originalValue?.toString() ?? \"\";\n\n const regex = options.allowDecimal\n ? /^0\\d+(\\.\\d+)?$/ // e.g. \"03\", \"03.5\", \"0002.75\"\n : /^0\\d+$/; // e.g. \"01\", \"0001\"\n\n if (regex.test(original)) {\n return context.createError({\n message: `${fieldName} must not have leading zeros`,\n });\n }\n\n return true;\n };\n};\n\nextend(isSameOrAfter);\nextend(customParseFormat);\n\nconst now = dayjs(); // Current date and time\n\n// DATE AND TIME SCHEMA\nexport const endDateNotInPastTest = yup\n .string()\n .test(\"not-in-past\", \"End date cannot be in the past\", (value) => {\n return value\n ? dayjs(value, dateFormat, true).isSameOrAfter(now, \"day\")\n : false;\n });\n\nexport const startDateNotInPastTest = yup\n .string()\n .test(\"not-in-past\", \"Start date cannot be in the past\", (value) => {\n return value\n ? dayjs(value, dateFormat, true).isSameOrAfter(now, \"day\")\n : false;\n });\n\nexport const endDateAfterStartDateTest = yup\n .string()\n .test(\n \"end-after-start\",\n \"End date cannot be before start date\",\n function (value) {\n const { startDate } = this.parent;\n if (!startDate || !value) return false;\n return dayjs(value, dateFormat, true).isSameOrAfter(\n dayjs(startDate, dateFormat, true),\n \"day\",\n );\n },\n );\n\nexport const endTimeMustBeAfterStartTimeTest = yup\n .string()\n .test(\n \"valid-end-time\",\n \"End time must be after start time\",\n function (value) {\n const { startDate, endDate, startTime } = this.parent;\n if (!startDate || !endDate || !startTime || !value) return false;\n\n const startDateTime = dayjs(\n `${startDate} ${startTime}`,\n `${dateFormat} ${timeFormat}`,\n true,\n );\n const endDateTime = dayjs(\n `${endDate} ${value}`,\n `${dateFormat} ${timeFormat}`,\n true,\n );\n\n return endDateTime.isAfter(startDateTime);\n },\n );\n\nexport const startTimeCannotBeInPastTest = yup\n .string()\n .test(\n \"valid-start-time\",\n \"Start time cannot be in the past\",\n function (value) {\n const { startDate } = this.parent;\n if (!startDate || !value) return false;\n const startDateTime = dayjs(\n `${startDate} ${value}`,\n `${dateFormat} ${timeFormat}`,\n true,\n );\n return startDateTime.isSameOrAfter(now);\n },\n );\n\nexport const dateTimeSchema = yup.object().shape({\n endDate: yup\n .string()\n .concat(endDateNotInPastTest)\n .concat(endDateAfterStartDateTest)\n .required(\"End date is required\"),\n endTime: yup\n .string()\n .concat(endTimeMustBeAfterStartTimeTest)\n .required(\"End time is required\"),\n startDate: yup\n .string()\n .concat(startDateNotInPastTest)\n .required(\"Start date is required\"),\n startTime: yup\n .string()\n .concat(startTimeCannotBeInPastTest)\n .required(\"Start time is required\"),\n});\n\nexport const dateTimeWithPriceSchema = dateTimeSchema.shape({\n marketPrice: yup\n .number()\n .typeError(\"Market price must be a number\")\n .min(0.1, \"Market price must be at least 0.1\")\n .required(\"Market price is required\")\n .test(\n \"no-leading-zeros\",\n \"\",\n noLeadingZeros(\"Market price\", { allowDecimal: true }),\n ),\n});\n\nexport const locationSchema = yup.object().shape({\n city: yup.string().required(\"City is required\"),\n coordinates: yup\n .array()\n .of(yup.number().required(\"Coordinates must be numbers\"))\n .length(\n 2,\n \"Coordinates must contain exactly two numbers (longitude, latitude)\",\n )\n .required(\"Coordinates are required\"),\n country: yup.string().required(\"Country is required\"),\n fullAddress: yup.string().required(\"Address is required\"),\n latitude: yup.number().required(\"Latitude is required\"),\n longitude: yup.number().required(\"Longitude is required\"),\n region: yup.string().required(\"Region is required\"),\n type: yup\n .string()\n .oneOf([\"Point\"], \"Type must be 'Point'\")\n .default(\"Point\")\n .required(\"Type is required\"),\n});\n\n// ✅ Reusable Email Schema\nexport const emailSchema = yup\n .string()\n .email(\"Invalid email address\")\n .required(\"Email is required\")\n .transform((value) =>\n typeof value === \"string\" ? value.toLowerCase() : value,\n );\n\n// ✅ Reusable Password Schema\nexport const passwordSchema = yup\n .string()\n .trim()\n .min(8, \"Password must be at least 8 characters long\")\n .required(\"Password is required\");\n\nconst socialMediaSchema = yup.object({\n name: yup\n .mixed<EnumSocialMedia>()\n .oneOf(Object.values(EnumSocialMedia))\n .optional(),\n link: yup.string().when(\"name\", {\n is: (name: EnumSocialMedia | undefined) => !!name, // If name has a value\n then: () =>\n normalizedUrlTransform()\n .required(\"Link is required when name is set\")\n .url(\"Link must be a valid URL\"),\n otherwise: (schema) => schema.notRequired(),\n }),\n});\n\nexport const globalResourceSchema = yup.object().shape({\n active: yup.boolean().required(\"Active is required\"),\n cover: yup.object({\n source: yup.string().required(\"Cover is required\"),\n title: yup.string().required(\"Cover is required\"),\n }),\n description: yup.string().trim().min(3).required(\"Description is required\"),\n name: yup.string().trim().min(3).required(\"Name is required\"),\n region: yup.string().required(\"Region is required\"),\n socialMedia: yup.array().of(socialMediaSchema).nullable().optional(),\n});\n","/* eslint-disable sort-keys */\nimport * as yup from \"yup\";\n\nimport { EnumPaymentMethod } from \"../enums\";\n\nimport {\n dateTimeSchema,\n dateTimeWithPriceSchema,\n globalResourceSchema,\n locationSchema,\n noLeadingZeros,\n normalizedUrlTransform,\n} from \"./global\";\n\nconst nzBankAccountRegex = /^\\d{2}-\\d{4}-\\d{7}-\\d{2}$/;\n\nexport const marketSchema = globalResourceSchema.shape({\n dateTime: yup.array().of(dateTimeSchema).required(\"DateTime is required\"),\n location: locationSchema,\n provider: yup.string().trim().min(3).required(\"Provider is required\"),\n tags: yup\n .array()\n .of(yup.string().defined())\n .min(1, \"Tags are required\")\n .required(\"Tags are required\"),\n});\n\nconst paymentTargetSchema = yup.object({\n paymentMethod: yup\n .mixed<EnumPaymentMethod>()\n .oneOf(Object.values(EnumPaymentMethod))\n .required(\"Please select a Payment method\"),\n\n accountHolderName: yup.string().when(\"paymentMethod\", {\n is: EnumPaymentMethod.BANK_TRANSFER,\n then: (schema) =>\n schema\n .required(\"Account holder name is required for bank transfer\")\n .trim(),\n otherwise: (schema) => schema.notRequired(),\n }),\n\n accountNumber: yup.string().when(\"paymentMethod\", {\n is: EnumPaymentMethod.BANK_TRANSFER,\n then: (schema) =>\n schema\n .required(\"Account number is required for bank transfer\")\n .matches(\n nzBankAccountRegex,\n \"Account number must be in format: XX-XXXX-XXXXXXX-XX\",\n )\n .trim(),\n otherwise: (schema) => schema.notRequired(),\n }),\n\n link: yup.string().when(\"paymentMethod\", {\n is: (val: EnumPaymentMethod) => val !== EnumPaymentMethod.BANK_TRANSFER,\n then: () =>\n normalizedUrlTransform()\n .url(\"Link must be a valid URL\")\n .required(\"Link is required for PayPal/Stripe\"),\n otherwise: (schema) => schema.notRequired(),\n }),\n});\n\nexport const marketInfoSchema = yup.object().shape({\n applicationDeadlineHours: yup\n .number()\n .nullable()\n .transform((value, originalValue) => (originalValue === \"\" ? null : value))\n .typeError(\"Application deadline hours must be a number\")\n .min(1, \"Application deadline hours must be at least 1\")\n .required(\"Application deadline hours is required\")\n .test(\"no-leading-zeros\", \"\", noLeadingZeros(\"Application deadline hours\")),\n dateTime: yup\n .array()\n .of(dateTimeWithPriceSchema)\n .required(\"DateTime is required\"),\n marketId: yup.string().trim().required(\"Market ID is required\"),\n packInTime: yup\n .number()\n .typeError(\"Pack in time must be a number\")\n .min(1, \"Pack in time must be at least 1\")\n .required(\"Pack in time is required\")\n .test(\"no-leading-zeros\", \"\", noLeadingZeros(\"Pack in time\")),\n packOutTime: yup\n .number()\n .typeError(\"Pack out time must be a number\")\n .min(1, \"Pack out time must be at least 1\")\n .required(\"Pack out time is required\")\n .test(\"no-leading-zeros\", \"\", noLeadingZeros(\"Pack out time\")),\n paymentDueHours: yup\n .number()\n .typeError(\"Payment due hours must be a number\")\n .min(1, \"Payment due hours must be at least 1\")\n .required(\"Payment due hours is required\")\n .test(\"no-leading-zeros\", \"\", noLeadingZeros(\"Payment due hours\")),\n paymentTarget: yup\n .array()\n .of(paymentTargetSchema)\n .min(1, \"At least one payment target is required\")\n .required(\"Payment target is required\"),\n stallCapacity: yup\n .number()\n .typeError(\"Stall capacity must be a number\")\n .min(1, \"Stall capacity must be at least 1\")\n .integer(\"Stall capacity must be a whole number\")\n .required(\"Stall capacity is required\")\n .test(\"no-leading-zeros\", \"\", noLeadingZeros(\"Stall capacity\")),\n});\n","import * as yup from \"yup\";\n\nimport { EnumPaymentMethod } from \"../enums\";\n\nimport { globalResourceSchema } from \"./global\";\n\nexport const stallHolderSchema = globalResourceSchema.shape({\n categories: yup\n .array()\n .of(\n yup.object().shape({\n id: yup.string().required(\"Category id is required\"),\n name: yup.string().required(\"Category name is required\"),\n subcategories: yup\n .array()\n .of(\n yup.object().shape({\n id: yup.string().defined(),\n items: yup.array().of(yup.string().defined()).nullable(),\n name: yup.string().defined(),\n }),\n )\n .nullable(),\n }),\n )\n .min(1, \"Category list must contain at least one item\")\n .required(\"Categories are required\"),\n multiLocation: yup.boolean().required(\"Multi location is required\"),\n products: yup\n .array()\n .of(yup.string().defined())\n .min(1, \"Product list must contain at least one item\")\n .required(\"Products are required\"),\n});\n\nexport const stallholderApplyFormSchema = yup.object().shape({\n electricity: yup.object().shape({\n details: yup\n .string()\n .trim()\n .test(\"details-required\", \"Please add details\", function (value) {\n return !this.parent?.isRequired || (value?.trim().length ?? 0) > 0;\n })\n .nullable(),\n isRequired: yup.boolean().required(\"Electricity requirement is required\"),\n }),\n foodSafetyGradeFiles: yup.array().of(yup.string().defined()).nullable(),\n foodSafetyGradeFilesUpload: yup.array().of(yup.string().defined()).nullable(),\n gazebo: yup.object().shape({\n details: yup\n .string()\n .trim()\n .test(\"details-required\", \"Please add details\", function (value) {\n return !this.parent?.isRequired || (value?.trim().length ?? 0) > 0;\n })\n .nullable(),\n isRequired: yup.boolean().required(\"Gazebo requirement is required\"),\n }),\n packaging: yup\n .array()\n .of(yup.string().defined())\n .min(1, \"Packaging list must contain at least one item\")\n .required(\"Packaging is required\"),\n paymentMethod: yup\n .mixed<EnumPaymentMethod>()\n .oneOf(Object.values(EnumPaymentMethod))\n .required(\"Please select a Payment method\"),\n priceRange: yup.object().shape({\n max: yup\n .number()\n .min(1)\n .required(\"Max price is required\")\n .test(\n \"is-greater\",\n \"Max price must be greater than or equal to Min price\",\n function (max) {\n const { min } = this.parent;\n return max >= min;\n },\n ),\n min: yup.number().min(1).required(\"Min price is required\"),\n }),\n producedIn: yup\n .array()\n .of(yup.string().defined())\n .min(1, \"Produced in list must contain at least one item\")\n .required(\"Produced in is required\"),\n stallholderId: yup.string().trim().required(\"Stallholder ID is required\"),\n stallSize: yup.object().shape({\n depth: yup.number().min(1).required(\"Depth is required\"),\n width: yup.number().min(1).required(\"Width is required\"),\n }),\n table: yup.object().shape({\n details: yup\n .string()\n .trim()\n .test(\"details-required\", \"Please add details\", function (value) {\n return !this.parent?.isRequired || (value?.trim().length ?? 0) > 0;\n })\n .nullable(),\n isRequired: yup.boolean().required(\"Table requirement is required\"),\n }),\n});\n","import * as yup from \"yup\";\n\nimport { EnumUserRole } from \"../enums\";\n\nimport { emailSchema, passwordSchema } from \"./global\";\n\nexport const userSchema = yup.object().shape({\n active: yup.boolean().required(\"Active is required\"),\n email: emailSchema,\n firstName: yup.string().required(\"First name is required\"),\n lastName: yup.string().required(\"Last name is required\"),\n password: passwordSchema,\n preferredRegion: yup.string().required(\"Preferred region is required\"),\n // eslint-disable-next-line sort-keys\n confirmPassword: yup\n .string()\n .oneOf([yup.ref(\"password\")], \"Passwords must match\")\n .required(\"Confirm Password is required\"),\n role: yup\n .mixed<EnumUserRole>()\n .oneOf(Object.values(EnumUserRole))\n .required(\"Role is required\"),\n});\n","import * as yup from \"yup\";\n\nimport { EnumUserRole } from \"../enums\";\n\nimport { emailSchema, passwordSchema } from \"./global\";\n\nexport const loginSchema = yup.object().shape({\n email: emailSchema,\n password: passwordSchema,\n});\n\nexport const registerSchema = yup.object().shape({\n email: emailSchema,\n firstName: yup.string().required(\"First Name is required\"),\n lastName: yup.string().required(\"Last Name is required\"),\n password: passwordSchema,\n preferredRegion: yup.string().required(\"Preferred Region is required\"),\n role: yup\n .mixed<EnumUserRole>()\n .oneOf(Object.values(EnumUserRole))\n .required(\"Role is required\"),\n});\n\nexport const requestPasswordResetSchema = yup.object().shape({\n email: emailSchema,\n});\n\nexport const resetPasswordSchema = yup.object().shape({\n email: emailSchema,\n password: passwordSchema,\n // eslint-disable-next-line sort-keys\n confirmPassword: yup\n .string()\n .oneOf([yup.ref(\"password\")], \"Passwords must match\")\n .required(\"Confirm Password is required\"),\n});\n\nexport const validateTokenSchema = yup.object().shape({\n email: emailSchema,\n token: yup\n .string()\n .required(\"Verification code is required\")\n .matches(/^\\d{5}$/, \"Verification code must be exactly 5 digits\"),\n});\n","import { EnumPaymentMethod } from \"../enums\";\nimport { requirementsOptions } from \"../formFields\";\nimport {\n BaseResourceTypeFormData,\n MarketFormData,\n MarketInfoFormData,\n StallholderApplyFormFormData,\n StallholderFormData,\n} from \"../types\";\n\nexport const globalDefaultValues: BaseResourceTypeFormData = {\n active: false,\n cover: {\n source: \"\",\n title: \"\",\n },\n coverUpload: {\n source: \"\",\n title: \"\",\n },\n description:\n \"Lorem Ipsum is a placeholder text commonly used in design and publishing to represent the visual form of a document without relying on meaningful content. It's a jumbled Latin text, not intended to be read or understood, and is used to show the layout and typography before actual content is added.\",\n images: null,\n imagesUpload: null,\n logo: null,\n logoUpload: null,\n name: \"Resource name\",\n promoCode: \"\",\n region: \"\",\n socialMedia: [],\n};\n\nexport const defaultMarketFormValues: MarketFormData = {\n ...globalDefaultValues,\n dateTime: [\n {\n endDate: \"04-07-2025\",\n endTime: \"15:00\",\n startDate: \"04-07-2025\",\n startTime: \"09:00\",\n },\n {\n endDate: \"05-07-2025\",\n endTime: \"15:00\",\n startDate: \"05-07-2025\",\n startTime: \"09:00\",\n },\n ],\n location: {\n city: \"\",\n coordinates: [0, 0], // [longitude, latitude]\n country: \"\",\n fullAddress: \"\",\n latitude: 0,\n longitude: 0,\n region: \"\",\n type: \"Point\", // Default type for GeoJSON\n },\n provider: \"Provider name\",\n tags: [],\n};\n\nexport const defaultMarketInfoFormValues: MarketInfoFormData = {\n applicationDeadlineHours: 0,\n dateTime: [\n {\n endDate: \"04-05-2025\",\n endTime: \"15:00\",\n marketPrice: 0.0,\n startDate: \"04-05-2025\",\n startTime: \"09:00\",\n },\n {\n endDate: \"05-05-2025\",\n endTime: \"15:00\",\n marketPrice: 0.0,\n startDate: \"05-05-2025\",\n startTime: \"09:00\",\n },\n ],\n marketId: \"\",\n packInTime: 0, // e.g., 2 hours before market opens\n packOutTime: 0, // e.g., 1 hour after market closes\n paymentDueHours: 0,\n paymentTarget: [],\n requirements: [],\n stallCapacity: 0,\n};\n\nexport const defaultStallholderFormValues: StallholderFormData = {\n ...globalDefaultValues,\n categories: [],\n locations: null,\n multiLocation: false,\n products: [],\n specialities: null,\n};\n\nexport const defaultStallholderApplyFormValues: StallholderApplyFormFormData = {\n electricity: { details: null, isRequired: false },\n foodSafetyGradeFiles: null,\n foodSafetyGradeFilesUpload: null,\n gazebo: { details: null, isRequired: false },\n packaging: [],\n paymentMethod: \"\" as EnumPaymentMethod,\n priceRange: { max: 0, min: 0 },\n producedIn: [],\n stallholderId: \"\",\n stallSize: { depth: 0, width: 0 },\n table: { details: null, isRequired: false },\n};\n\nexport function mapBaseResourceTypeToFormData(\n data: MarketFormData | StallholderFormData,\n): BaseResourceTypeFormData {\n return {\n _id: data._id,\n active: data.active,\n cover: data.cover,\n coverUpload: data.coverUpload,\n description: data.description,\n images: data.images,\n imagesUpload: data.imagesUpload,\n logo: data.logo,\n logoUpload: data.logoUpload,\n name: data.name,\n promoCode: data.promoCode,\n region: data.region,\n socialMedia: data.socialMedia,\n };\n}\n","import { yupResolver } from \"@hookform/resolvers/yup\";\nimport * as React from \"react\";\nimport { useForm } from \"react-hook-form\";\n\nimport {\n CreateStallholderApplyFormFormData,\n StallholderApplyFormFormData,\n} from \"../../types/stallholder\";\nimport { stallholderApplyFormSchema } from \"../../yupSchema\";\nimport { defaultStallholderApplyFormValues } from \"../utils\";\n\n/**\n * Custom hook to manage the stallholder apply form state and validation.\n *\n * @param {StallholderApplyFormFormData} data - The initial form data.\n * @returns {CreateStallholderApplyFormFormData} - The form methods and state.\n */\nexport function useStallholderApplyForm(\n data?: StallholderApplyFormFormData,\n): CreateStallholderApplyFormFormData {\n const {\n control,\n formState: { errors },\n getValues,\n handleSubmit,\n reset,\n setValue,\n watch,\n } = useForm<StallholderApplyFormFormData>({\n defaultValues: defaultStallholderApplyFormValues,\n resolver: yupResolver(stallholderApplyFormSchema),\n });\n\n React.useEffect(() => {\n if (data) {\n reset({\n _id: data._id,\n electricity: data.electricity,\n foodSafetyGradeFiles: data.foodSafetyGradeFiles,\n foodSafetyGradeFilesUpload: data.foodSafetyGradeFilesUpload,\n gazebo: data.gazebo,\n packaging: data.packaging,\n paymentMethod: data.paymentMethod,\n priceRange: data.priceRange,\n producedIn: data.producedIn,\n stallholderId: data.stallholderId,\n stallSize: data.stallSize,\n table: data.table,\n });\n } else {\n reset(defaultStallholderApplyFormValues);\n }\n }, [data]);\n\n const {\n _id,\n electricity,\n foodSafetyGradeFiles,\n foodSafetyGradeFilesUpload,\n gazebo,\n packaging,\n paymentMethod,\n priceRange,\n producedIn,\n stallholderId,\n stallSize,\n table,\n } = getValues();\n\n return {\n control,\n fields: {\n _id,\n electricity,\n foodSafetyGradeFiles,\n foodSafetyGradeFilesUpload,\n gazebo,\n packaging,\n paymentMethod,\n priceRange,\n producedIn,\n stallholderId,\n stallSize,\n table,\n },\n formState: { errors },\n handleSubmit,\n reset,\n setValue,\n watch,\n };\n}\n","import { yupResolver } from \"@hookform/resolvers/yup\";\nimport * as React from \"react\";\nimport { useForm } from \"react-hook-form\";\n\nimport { CreateMarketFormData, MarketFormData } from \"../../types/market\";\nimport { marketSchema } from \"../../yupSchema\";\nimport {\n defaultMarketFormValues,\n mapBaseResourceTypeToFormData,\n} from \"../utils\";\n\n/**\n * Custom hook to manage the market form state and validation.\n *\n * @param {MarketFormData} data - The initial form data.\n * @returns {CreateMarketFormData} - The form methods and state.\n */\nexport function useMarketForm(data?: MarketFormData): CreateMarketFormData {\n const {\n control,\n formState: { errors },\n getValues,\n handleSubmit,\n reset,\n setValue,\n watch,\n } = useForm<MarketFormData>({\n defaultValues: defaultMarketFormValues,\n resolver: yupResolver(marketSchema),\n });\n\n React.useEffect(() => {\n if (data) {\n reset({\n ...mapBaseResourceTypeToFormData(data),\n dateTime: data.dateTime,\n location: data.location,\n provider: data.provider,\n tags: data.tags,\n });\n } else {\n reset(defaultMarketFormValues);\n }\n }, [data]);\n\n const {\n _id,\n active,\n cover,\n coverUpload,\n dateTime,\n description,\n images,\n imagesUpload,\n location,\n logo,\n logoUpload,\n name,\n provider,\n region,\n tags,\n promoCode,\n socialMedia,\n } = getValues();\n\n return {\n control,\n fields: {\n _id,\n active,\n cover,\n coverUpload,\n dateTime,\n description,\n images,\n imagesUpload,\n location,\n logo,\n logoUpload,\n name,\n promoCode,\n provider,\n region,\n socialMedia,\n tags,\n },\n formState: { errors },\n handleSubmit,\n reset,\n setValue,\n watch,\n };\n}\n","import { yupResolver } from \"@hookform/resolvers/yup\";\nimport * as React from \"react\";\nimport { useForm } from \"react-hook-form\";\n\nimport {\n CreateMarketInfoFormData,\n MarketInfoFormData,\n} from \"../../types/market\";\nimport { marketInfoSchema } from \"../../yupSchema\";\nimport { defaultMarketInfoFormValues } from \"../utils\";\n\n/**\n * Custom hook to manage the market form state and validation.\n *\n * @param {MarketInfoFormData} data - The initial form data.\n * @returns {CreateMarketInfoFormData} - The form methods and state.\n */\nexport function useMarketInfoForm(\n data?: MarketInfoFormData,\n): CreateMarketInfoFormData {\n const {\n control,\n formState: { errors },\n getValues,\n handleSubmit,\n reset,\n setValue,\n watch,\n } = useForm<MarketInfoFormData>({\n defaultValues: defaultMarketInfoFormValues,\n resolver: yupResolver(marketInfoSchema),\n });\n\n React.useEffect(() => {\n if (data) {\n reset({\n _id: data._id,\n applicationDeadlineHours: data.applicationDeadlineHours,\n dateTime: data.dateTime,\n marketId: data.marketId,\n packInTime: data.packInTime,\n packOutTime: data.packOutTime,\n paymentDueHours: data.paymentDueHours,\n paymentTarget: data.paymentTarget,\n requirements: data.requirements,\n stallCapacity: data.stallCapacity,\n });\n } else {\n reset(defaultMarketInfoFormValues);\n }\n }, [data]);\n\n const {\n _id,\n applicationDeadlineHours,\n dateTime,\n marketId,\n packInTime,\n packOutTime,\n paymentDueHours,\n paymentTarget,\n requirements,\n stallCapacity,\n } = getValues();\n\n return {\n control,\n fields: {\n _id,\n applicationDeadlineHours,\n dateTime,\n marketId,\n packInTime,\n packOutTime,\n paymentDueHours,\n paymentTarget,\n requirements,\n stallCapacity,\n },\n formState: { errors },\n handleSubmit,\n reset,\n setValue,\n watch,\n };\n}\n","import { yupResolver } from \"@hookform/resolvers/yup\";\nimport * as React from \"react\";\nimport { useForm } from \"react-hook-form\";\n\nimport { EnumUserRole } from \"../enums\";\nimport { CreateUserFormData, UserFormData } from \"../types/user\";\nimport { userSchema } from \"../yupSchema/user\";\n\nconst defaultValues: UserFormData = {\n active: false,\n avatar: null,\n avatarUpload: null,\n confirmPassword: \"\",\n email: \"\",\n firstName: \"\",\n lastName: \"\",\n password: \"\",\n preferredRegion: \"\",\n role: EnumUserRole.CUSTOMER,\n};\n\n/**\n * Custom hook to manage the user form state and validation.\n *\n * @param {UserFormData} data - The initial form data.\n * @returns {CreateUserFormData} - The form methods and state.\n */\nexport function useUserForm(data?: UserFormData): CreateUserFormData {\n const {\n control,\n formState: { errors },\n getValues,\n handleSubmit,\n reset,\n setValue,\n watch,\n } = useForm<UserFormData>({\n defaultValues,\n resolver: yupResolver(userSchema),\n });\n\n React.useEffect(() => {\n if (data) {\n reset({\n _id: data._id,\n active: data.active,\n avatar: data.avatar,\n avatarUpload: data.avatarUpload,\n confirmPassword: data.confirmPassword,\n email: data.email,\n firstName: data.firstName,\n lastName: data.lastName,\n password: data.password,\n preferredRegion: data.preferredRegion,\n role: data.role,\n });\n } else {\n reset(defaultValues);\n }\n }, [data]);\n\n const {\n _id,\n active,\n avatar,\n avatarUpload,\n confirmPassword,\n email,\n firstName,\n lastName,\n password,\n preferredRegion,\n role,\n } = getValues();\n\n return {\n control,\n fields: {\n _id,\n active,\n avatar,\n avatarUpload,\n confirmPassword,\n email,\n firstName,\n lastName,\n password,\n preferredRegion,\n role,\n },\n formState: { errors },\n handleSubmit,\n reset,\n setValue,\n watch,\n };\n}\n","import { yupResolver } from \"@hookform/resolvers/yup\";\nimport { useForm } from \"react-hook-form\";\n\nimport { CreateLoginFormData, LoginFormData } from \"../../types/auth\";\nimport { loginSchema } from \"../../yupSchema/auth\";\n\nconst defaultValues: LoginFormData = {\n email: \"\",\n password: \"\",\n};\n\n/**\n * Custom hook to manage the login form state and validation.\n *\n * @returns {CreateLoginFormData} - The form methods and state.\n */\nexport function useLoginForm(): CreateLoginFormData {\n const {\n control,\n formState: { errors },\n getValues,\n handleSubmit,\n reset,\n setValue,\n watch,\n } = useForm<LoginFormData>({\n defaultValues,\n resolver: yupResolver(loginSchema),\n });\n\n const { email, password } = getValues();\n\n return {\n control,\n fields: {\n email,\n password,\n },\n formState: { errors },\n handleSubmit,\n reset,\n setValue,\n watch,\n };\n}\n","import { yupResolver } from \"@hookform/resolvers/yup\";\nimport { useForm } from \"react-hook-form\";\n\nimport { EnumRegions, EnumUserRole } from \"../../enums\";\nimport { CreateRegisterFormData, RegisterFormData } from \"../../types/auth\";\nimport { registerSchema } from \"../../yupSchema/auth\";\n\nconst defaultValues: RegisterFormData = {\n email: \"\",\n firstName: \"\",\n lastName: \"\",\n password: \"\",\n preferredRegion: \"\",\n role: EnumUserRole.CUSTOMER,\n};\n\n/**\n * Custom hook to manage the register form state and validation.\n *\n * @returns {CreateRegisterFormData} - The form methods and state.\n */\nexport function useRegisterForm(): CreateRegisterFormData {\n const {\n control,\n formState: { errors },\n getValues,\n handleSubmit,\n reset,\n setValue,\n watch,\n } = useForm<RegisterFormData>({\n defaultValues,\n resolver: yupResolver(registerSchema),\n });\n\n const { email, firstName, lastName, password, preferredRegion, role } =\n getValues();\n\n return {\n control,\n fields: {\n email,\n firstName,\n lastName,\n password,\n preferredRegion,\n role,\n },\n formState: { errors },\n handleSubmit,\n reset,\n setValue,\n watch,\n };\n}\n","import { yupResolver } from \"@hookform/resolvers/yup\";\nimport { useForm } from \"react-hook-form\";\n\nimport {\n CreateRequestPasswordResetFormData,\n RequestPasswordResetFormData,\n} from \"../../types/auth\";\nimport { requestPasswordResetSchema } from \"../../yupSchema/auth\";\n\nconst defaultValues: RequestPasswordResetFormData = {\n email: \"\",\n};\n\nexport function useRequestPasswordResetForm(): CreateRequestPasswordResetFormData {\n const {\n control,\n formState: { errors },\n getValues,\n handleSubmit,\n reset,\n setValue,\n watch,\n } = useForm<RequestPasswordResetFormData>({\n defaultValues,\n resolver: yupResolver(requestPasswordResetSchema),\n });\n\n const { email } = getValues();\n\n return {\n control,\n fields: {\n email,\n },\n formState: { errors },\n handleSubmit,\n reset,\n setValue,\n watch,\n };\n}\n","import { yupResolver } from \"@hookform/resolvers/yup\";\nimport { useForm } from \"react-hook-form\";\n\nimport {\n CreateValidateTokenFormData,\n ValidateTokenFormData,\n} from \"../../types/auth\";\nimport { validateTokenSchema } from \"../../yupSchema/auth\";\n\nconst defaultValues: ValidateTokenFormData = {\n email: \"\",\n token: \"\",\n};\n\nexport function useValidateTokenForm(): CreateValidateTokenFormData {\n const {\n control,\n formState: { errors },\n getValues,\n handleSubmit,\n reset,\n setValue,\n watch,\n } = useForm<ValidateTokenFormData>({\n defaultValues,\n resolver: yupResolver(validateTokenSchema),\n });\n\n const { email, token } = getValues();\n\n return {\n control,\n fields: {\n email,\n token,\n },\n formState: { errors },\n handleSubmit,\n reset,\n setValue,\n watch,\n };\n}\n","import { yupResolver } from \"@hookform/resolvers/yup\";\nimport { useForm } from \"react-hook-form\";\n\nimport {\n CreateResetPasswordFormData,\n ResetPasswordFormData,\n} from \"../../types/auth\";\nimport { resetPasswordSchema } from \"../../yupSchema/auth\";\n\nconst defaultValues: ResetPasswordFormData = {\n confirmPassword: \"\",\n email: \"\",\n password: \"\",\n};\n\nexport function useResetPasswordForm(): CreateResetPasswordFormData {\n const {\n control,\n formState: { errors },\n getValues,\n handleSubmit,\n reset,\n setValue,\n watch,\n } = useForm<ResetPasswordFormData>({\n defaultValues,\n resolver: yupResolver(resetPasswordSchema),\n });\n\n const { confirmPassword, email, password } = getValues();\n\n return {\n control,\n fields: {\n confirmPassword,\n email,\n password,\n },\n formState: { errors },\n handleSubmit,\n reset,\n setValue,\n watch,\n };\n}\n"],"mappings":";;;;;;;;;;;;AA8BA,IAAM,iBAAiB,CAAC,OAAgB,YAAoB;AAC1D,UAAQ,MAAM,SAAS,KAAK;AAC9B;AAOO,IAAM,oBAAoB,CAAC,cAAmC;AACnE,QAAM,iBAAiB,OACrB,SAC2C;AAC3C,QAAI;AACF,YAAM,WAAW,MAAM;AAAA,QACrB,sEAAsE,IAAI,8BAA8B,SAAS;AAAA,MACnH;AAEA,UAAI,CAAC,SAAS,IAAI;AAChB,cAAM,IAAI,MAAM,uBAAuB,SAAS,MAAM,EAAE;AAAA,MAC1D;AAEA,YAAM,OAAO,MAAM,SAAS,KAAK;AACjC,aAAO,KAAK;AAAA,IACd,SAAS,OAAO;AACd,cAAQ,MAAM,+BAA+B,KAAK;AAClD,qBAAe,OAAO,sCAAsC;AAAA,IAC9D;AAAA,EACF;AAEA,QAAM,kBAAkB,OACtB,YACsC;AACtC,QAAI;AACF,YAAM,WAAW,MAAM;AAAA,QACrB,oEAAoE,OAAO,QAAQ,SAAS;AAAA,MAC9F;AAEA,UAAI,CAAC,SAAS,IAAI;AAChB,cAAM,IAAI,MAAM,uBAAuB,SAAS,MAAM,EAAE;AAAA,MAC1D;AAEA,YAAM,OAAQ,MAAM,SAAS,KAAK;AAClC,YAAM,EAAE,OAAO,IAAI;AACnB,YAAM,EAAE,KAAK,IAAI,IAAI,OAAO,SAAS;AACrC,YAAM,EAAE,oBAAoB,kBAAkB,IAAI;AAElD,YAAM,UAAU,mBAAmB,OAAO,CAAC,KAAK,SAAS;AACvD,YAAI,KAAK,MAAM,SAAS,eAAe,GAA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QAAM;AAAA,IACJ;AAAA,IACA,WAAW,EAAE,OAAO;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAIC,SAA+B;AAAA,IACjC,eAAAD;AAAA,IACA,UAAUE,aAAY,mBAAmB;AAAA,EAC3C,CAAC;AAED,QAAM,EAAE,OAAO,MAAM,IAAI,UAAU;AAEnC,SAAO;AAAA,IACL;AAAA,IACA,QAAQ;AAAA,MACN;AAAA,MACA;AAAA,IACF;AAAA,IACA,WAAW,EAAE,OAAO;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;;;AC1CA,SAAS,eAAAC,qBAAmB;AAC5B,SAAS,WAAAC,iBAAe;AAQxB,IAAMC,iBAAuC;AAAA,EAC3C,iBAAiB;AAAA,EACjB,OAAO;AAAA,EACP,UAAU;AACZ;AAEO,SAAS,uBAAoD;AAClE,QAAM;AAAA,IACJ;AAAA,IACA,WAAW,EAAE,OAAO;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAIC,UAA+B;AAAA,IACjC,eAAAD;AAAA,IACA,UAAUE,cAAY,mBAAmB;AAAA,EAC3C,CAAC;AAED,QAAM,EAAE,iBAAiB,OAAO,SAAS,IAAI,UAAU;AAEvD,SAAO;AAAA,IACL;AAAA,IACA,QAAQ;AAAA,MACN;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,WAAW,EAAE,OAAO;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["yup","yup","yup","yup","yupResolver","React","useForm","useForm","yupResolver","yupResolver","React","useForm","useForm","yupResolver","yupResolver","React","useForm","useForm","yupResolver","yupResolver","React","useForm","useForm","yupResolver","yupResolver","useForm","defaultValues","useForm","yupResolver","yupResolver","useForm","defaultValues","useForm","yupResolver","yupResolver","useForm","defaultValues","useForm","yupResolver","yupResolver","useForm","defaultValues","useForm","yupResolver","yupResolver","useForm","defaultValues","useForm","yupResolver"]}
|
package/dist/index.cjs
CHANGED
|
@@ -68,6 +68,7 @@ __export(index_exports, {
|
|
|
68
68
|
marketInfoPaymentTarget: () => marketInfoPaymentTarget,
|
|
69
69
|
marketPriceByDateFields: () => marketPriceByDateFields,
|
|
70
70
|
marketStartDateFields: () => marketStartDateFields,
|
|
71
|
+
normalizeUrl: () => normalizeUrl,
|
|
71
72
|
packagingOptions: () => packagingOptions,
|
|
72
73
|
paymentMethodOptions: () => paymentMethodOptions,
|
|
73
74
|
producedIngOptions: () => producedIngOptions,
|
|
@@ -364,6 +365,12 @@ var availableRegionOptions = mapArrayToOptions(availableRegionTypes);
|
|
|
364
365
|
var paymentMethodOptions = mapArrayToOptions(
|
|
365
366
|
Object.values(EnumPaymentMethod)
|
|
366
367
|
);
|
|
368
|
+
function normalizeUrl(url) {
|
|
369
|
+
if (!url.startsWith("http://") && !url.startsWith("https://")) {
|
|
370
|
+
return `https://${url}`;
|
|
371
|
+
}
|
|
372
|
+
return url;
|
|
373
|
+
}
|
|
367
374
|
|
|
368
375
|
// src/hooks/useLocationSearch.ts
|
|
369
376
|
var handleApiError = (error, message) => {
|
|
@@ -449,6 +456,11 @@ var import_dayjs2 = __toESM(require("dayjs"));
|
|
|
449
456
|
var import_customParseFormat2 = __toESM(require("dayjs/plugin/customParseFormat"));
|
|
450
457
|
var import_isSameOrAfter2 = __toESM(require("dayjs/plugin/isSameOrAfter"));
|
|
451
458
|
var yup = __toESM(require("yup"));
|
|
459
|
+
var normalizedUrlTransform = () => yup.string().trim().transform(
|
|
460
|
+
(value) => typeof value === "string" ? value.toLowerCase() : value
|
|
461
|
+
).transform(
|
|
462
|
+
(value) => typeof value === "string" ? normalizeUrl(value) : value
|
|
463
|
+
);
|
|
452
464
|
var noLeadingZeros = (fieldName, options = {}) => {
|
|
453
465
|
return function(value, context) {
|
|
454
466
|
const original = context.originalValue?.toString() ?? "";
|
|
@@ -545,6 +557,15 @@ var emailSchema = yup.string().email("Invalid email address").required("Email is
|
|
|
545
557
|
(value) => typeof value === "string" ? value.toLowerCase() : value
|
|
546
558
|
);
|
|
547
559
|
var passwordSchema = yup.string().trim().min(8, "Password must be at least 8 characters long").required("Password is required");
|
|
560
|
+
var socialMediaSchema = yup.object({
|
|
561
|
+
name: yup.mixed().oneOf(Object.values(EnumSocialMedia)).optional(),
|
|
562
|
+
link: yup.string().when("name", {
|
|
563
|
+
is: (name) => !!name,
|
|
564
|
+
// If name has a value
|
|
565
|
+
then: () => normalizedUrlTransform().required("Link is required when name is set").url("Link must be a valid URL"),
|
|
566
|
+
otherwise: (schema) => schema.notRequired()
|
|
567
|
+
})
|
|
568
|
+
});
|
|
548
569
|
var globalResourceSchema = yup.object().shape({
|
|
549
570
|
active: yup.boolean().required("Active is required"),
|
|
550
571
|
cover: yup.object({
|
|
@@ -553,7 +574,8 @@ var globalResourceSchema = yup.object().shape({
|
|
|
553
574
|
}),
|
|
554
575
|
description: yup.string().trim().min(3).required("Description is required"),
|
|
555
576
|
name: yup.string().trim().min(3).required("Name is required"),
|
|
556
|
-
region: yup.string().required("Region is required")
|
|
577
|
+
region: yup.string().required("Region is required"),
|
|
578
|
+
socialMedia: yup.array().of(socialMediaSchema).nullable().optional()
|
|
557
579
|
});
|
|
558
580
|
|
|
559
581
|
// src/yupSchema/market.ts
|
|
@@ -582,9 +604,7 @@ var paymentTargetSchema = yup2.object({
|
|
|
582
604
|
}),
|
|
583
605
|
link: yup2.string().when("paymentMethod", {
|
|
584
606
|
is: (val) => val !== "bank_transfer" /* BANK_TRANSFER */,
|
|
585
|
-
then: (
|
|
586
|
-
(value) => typeof value === "string" ? value.toLowerCase() : value
|
|
587
|
-
),
|
|
607
|
+
then: () => normalizedUrlTransform().url("Link must be a valid URL").required("Link is required for PayPal/Stripe"),
|
|
588
608
|
otherwise: (schema) => schema.notRequired()
|
|
589
609
|
})
|
|
590
610
|
});
|
|
@@ -594,22 +614,6 @@ var marketInfoSchema = yup2.object().shape({
|
|
|
594
614
|
marketId: yup2.string().trim().required("Market ID is required"),
|
|
595
615
|
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
616
|
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"), */
|
|
613
617
|
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")),
|
|
614
618
|
paymentTarget: yup2.array().of(paymentTargetSchema).min(1, "At least one payment target is required").required("Payment target is required"),
|
|
615
619
|
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"))
|
|
@@ -3321,80 +3325,160 @@ var marketPriceByDateFields = [
|
|
|
3321
3325
|
}
|
|
3322
3326
|
];
|
|
3323
3327
|
var requirementsOptions = [
|
|
3328
|
+
{
|
|
3329
|
+
category: "Environment",
|
|
3330
|
+
label: "All packaging must be eco-friendly or recyclable where possible.",
|
|
3331
|
+
value: false
|
|
3332
|
+
},
|
|
3333
|
+
{
|
|
3334
|
+
category: "Environment",
|
|
3335
|
+
label: "No single-use plastic bags are to be handed out.",
|
|
3336
|
+
value: false
|
|
3337
|
+
},
|
|
3338
|
+
{
|
|
3339
|
+
category: "Environment",
|
|
3340
|
+
label: "Stall area must be left clean with no trace of activity after pack-down.",
|
|
3341
|
+
value: false
|
|
3342
|
+
},
|
|
3343
|
+
{
|
|
3344
|
+
category: "Environment",
|
|
3345
|
+
label: "No disposal of oils, fats, or chemicals in public drains or on grassed areas.",
|
|
3346
|
+
value: false
|
|
3347
|
+
},
|
|
3348
|
+
{
|
|
3349
|
+
category: "Environment",
|
|
3350
|
+
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.",
|
|
3351
|
+
value: false
|
|
3352
|
+
},
|
|
3353
|
+
{
|
|
3354
|
+
category: "Food Safety",
|
|
3355
|
+
label: "Food must be prepared and stored according to your food regulation.",
|
|
3356
|
+
value: false
|
|
3357
|
+
},
|
|
3358
|
+
{
|
|
3359
|
+
category: "Food Safety",
|
|
3360
|
+
label: "The stallholder must display a current food grade certificate.",
|
|
3361
|
+
value: false
|
|
3362
|
+
},
|
|
3363
|
+
{
|
|
3364
|
+
category: "Food Safety",
|
|
3365
|
+
label: "Only licensed food vendors may sell ready-to-eat food items.",
|
|
3366
|
+
value: false
|
|
3367
|
+
},
|
|
3368
|
+
{
|
|
3369
|
+
category: "Food Safety",
|
|
3370
|
+
label: "Handwashing facilities must be available at your stall if preparing food.",
|
|
3371
|
+
value: false
|
|
3372
|
+
},
|
|
3324
3373
|
{
|
|
3325
3374
|
category: "Food Safety",
|
|
3326
|
-
label: "
|
|
3327
|
-
value:
|
|
3375
|
+
label: "You must have a food safety plan in place for your stall.",
|
|
3376
|
+
value: false
|
|
3328
3377
|
},
|
|
3329
3378
|
{
|
|
3330
3379
|
category: "Food Safety",
|
|
3331
|
-
label: "
|
|
3332
|
-
value:
|
|
3380
|
+
label: "Allergens must be clearly listed on packaged and unpackaged food items.",
|
|
3381
|
+
value: false
|
|
3333
3382
|
},
|
|
3334
3383
|
{
|
|
3335
3384
|
category: "Legal & Safety",
|
|
3336
|
-
label: "All
|
|
3337
|
-
value:
|
|
3385
|
+
label: "All stallholders must comply with local council regulations.",
|
|
3386
|
+
value: false
|
|
3338
3387
|
},
|
|
3339
3388
|
{
|
|
3340
|
-
category: "
|
|
3341
|
-
label: "
|
|
3342
|
-
value:
|
|
3389
|
+
category: "Legal & Safety",
|
|
3390
|
+
label: "No unauthorised subletting of stall space to other vendors.",
|
|
3391
|
+
value: false
|
|
3343
3392
|
},
|
|
3344
3393
|
{
|
|
3345
|
-
category: "
|
|
3346
|
-
label: "
|
|
3347
|
-
value:
|
|
3394
|
+
category: "Legal & Safety",
|
|
3395
|
+
label: "Gas bottles and fuel containers must be secured and in good condition if applicable.",
|
|
3396
|
+
value: false
|
|
3348
3397
|
},
|
|
3349
3398
|
{
|
|
3350
3399
|
category: "Legal & Safety",
|
|
3351
|
-
label: "
|
|
3352
|
-
value:
|
|
3400
|
+
label: "Fire extinguishers must be available for stalls using cooking or heating equipment.",
|
|
3401
|
+
value: false
|
|
3353
3402
|
},
|
|
3354
3403
|
{
|
|
3355
3404
|
category: "Legal & Safety",
|
|
3356
|
-
label: "
|
|
3357
|
-
value:
|
|
3405
|
+
label: "Stallholders must not sell items that are illegal or prohibited by law.",
|
|
3406
|
+
value: false
|
|
3358
3407
|
},
|
|
3359
3408
|
{
|
|
3360
|
-
category: "
|
|
3361
|
-
label: "
|
|
3362
|
-
value:
|
|
3409
|
+
category: "Legal & Safety",
|
|
3410
|
+
label: "All electrical equipment must be tested and tagged.",
|
|
3411
|
+
value: false
|
|
3363
3412
|
},
|
|
3364
3413
|
{
|
|
3365
|
-
category: "
|
|
3366
|
-
label: "
|
|
3367
|
-
value:
|
|
3414
|
+
category: "Legal & Safety",
|
|
3415
|
+
label: "Noise levels must be kept to a minimum unless part of a permitted performance.",
|
|
3416
|
+
value: false
|
|
3368
3417
|
},
|
|
3369
3418
|
{
|
|
3370
|
-
category: "
|
|
3371
|
-
label: "
|
|
3372
|
-
value:
|
|
3419
|
+
category: "Legal & Safety",
|
|
3420
|
+
label: "Pets at the stall must be secured and well-behaved at all times.",
|
|
3421
|
+
value: false
|
|
3373
3422
|
},
|
|
3374
3423
|
{
|
|
3375
3424
|
category: "Legal & Safety",
|
|
3376
|
-
label: "
|
|
3377
|
-
value:
|
|
3425
|
+
label: "Cables must be secured and not create tripping hazards.",
|
|
3426
|
+
value: false
|
|
3378
3427
|
},
|
|
3379
3428
|
{
|
|
3380
|
-
category: "
|
|
3381
|
-
label: "
|
|
3382
|
-
value:
|
|
3429
|
+
category: "Legal & Safety",
|
|
3430
|
+
label: "Stalls must not obstruct emergency access routes.",
|
|
3431
|
+
value: false
|
|
3383
3432
|
},
|
|
3384
3433
|
{
|
|
3385
3434
|
category: "Legal & Safety",
|
|
3386
|
-
label: "
|
|
3387
|
-
value:
|
|
3435
|
+
label: "First aid kit must be available at the stall for minor injuries.",
|
|
3436
|
+
value: false
|
|
3388
3437
|
},
|
|
3389
3438
|
{
|
|
3390
|
-
category: "
|
|
3391
|
-
label: "
|
|
3392
|
-
value:
|
|
3439
|
+
category: "Legal & Safety",
|
|
3440
|
+
label: "Stallholders must hold valid liability insurance where required.",
|
|
3441
|
+
value: false
|
|
3393
3442
|
},
|
|
3394
3443
|
{
|
|
3395
3444
|
category: "Legal & Safety",
|
|
3396
|
-
label: "
|
|
3397
|
-
value:
|
|
3445
|
+
label: "You must secure your gazebo and equipment to withstand wind or bad weather.",
|
|
3446
|
+
value: false
|
|
3447
|
+
},
|
|
3448
|
+
{
|
|
3449
|
+
category: "Legal & Safety",
|
|
3450
|
+
label: "You are responsible for the safety of your setup and any potential hazards.",
|
|
3451
|
+
value: false
|
|
3452
|
+
},
|
|
3453
|
+
{
|
|
3454
|
+
category: "Operations",
|
|
3455
|
+
label: "Generators must be quiet and pre-approved by the event organiser.",
|
|
3456
|
+
value: false
|
|
3457
|
+
},
|
|
3458
|
+
{
|
|
3459
|
+
category: "Operations",
|
|
3460
|
+
label: "Only approved products or services may be sold \u2014 no last-minute changes.",
|
|
3461
|
+
value: false
|
|
3462
|
+
},
|
|
3463
|
+
{
|
|
3464
|
+
category: "Operations",
|
|
3465
|
+
label: "Stallholders must arrive and be fully set up by the designated opening time.",
|
|
3466
|
+
value: false
|
|
3467
|
+
},
|
|
3468
|
+
{
|
|
3469
|
+
category: "Operations",
|
|
3470
|
+
label: "You may not pack down your stall before the event officially ends.",
|
|
3471
|
+
value: false
|
|
3472
|
+
},
|
|
3473
|
+
{
|
|
3474
|
+
category: "Operations",
|
|
3475
|
+
label: "You must be self-sufficient in all operations.",
|
|
3476
|
+
value: false
|
|
3477
|
+
},
|
|
3478
|
+
{
|
|
3479
|
+
category: "Operations",
|
|
3480
|
+
label: "Stall layout must be kept within your allocated space.",
|
|
3481
|
+
value: false
|
|
3398
3482
|
}
|
|
3399
3483
|
];
|
|
3400
3484
|
|
|
@@ -3899,6 +3983,7 @@ var socialMediaFields = socialMedia.map((link) => ({
|
|
|
3899
3983
|
marketInfoPaymentTarget,
|
|
3900
3984
|
marketPriceByDateFields,
|
|
3901
3985
|
marketStartDateFields,
|
|
3986
|
+
normalizeUrl,
|
|
3902
3987
|
packagingOptions,
|
|
3903
3988
|
paymentMethodOptions,
|
|
3904
3989
|
producedIngOptions,
|