@timardex/cluemart-shared 1.0.32 → 1.0.34
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/{auth-CFZ3I1a4.d.ts → auth-DmkwZu5m.d.mts} +0 -2
- package/dist/{auth-DyTQ50tf.d.mts → auth-DmkwZu5m.d.ts} +0 -2
- package/dist/formFields/index.cjs +1 -0
- package/dist/formFields/index.cjs.map +1 -1
- package/dist/formFields/index.mjs +1 -0
- package/dist/formFields/index.mjs.map +1 -1
- package/dist/graphql/index.cjs +17 -5
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +7 -1
- package/dist/graphql/index.d.ts +7 -1
- package/dist/graphql/index.mjs +16 -5
- package/dist/graphql/index.mjs.map +1 -1
- package/dist/hooks/index.cjs +45 -48
- 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 +29 -32
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.cjs +63 -53
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +85 -80
- package/dist/index.d.ts +85 -80
- package/dist/index.mjs +62 -53
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -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/useValidateVerificationTokenForm.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\nconst siteTypesSchema = yup.object({\n label: yup.string().trim().optional(),\n price: yup.number().when(\"label\", {\n is: (label: string | undefined) => !!label,\n then: (schema) =>\n schema\n .typeError(\"Site price must be a number\")\n .min(0.1, \"Site price must be at least 0.1\")\n .required(\"Site price is required\")\n .test(\n \"no-leading-zeros\",\n \"\",\n noLeadingZeros(\"Site price\", { allowDecimal: true }),\n ),\n otherwise: (schema) => schema.notRequired(),\n }),\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 siteTypes: yup.array().of(siteTypesSchema).nullable().optional(),\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 validateVerificationTokenSchema = yup.object().shape({\n email: emailSchema,\n verificationToken: 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 siteTypes: [],\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 siteTypes: [],\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 CreateValidateVerificationTokenFormData,\n ValidateVerificationTokenFormData,\n} from \"../../types/auth\";\nimport { validateVerificationTokenSchema } from \"../../yupSchema/auth\";\n\nconst defaultValues: ValidateVerificationTokenFormData = {\n email: \"\",\n verificationToken: \"\",\n};\n\nexport function useValidateVerificationTokenForm(): CreateValidateVerificationTokenFormData {\n const {\n control,\n formState: { errors },\n getValues,\n handleSubmit,\n reset,\n setValue,\n watch,\n } = useForm<ValidateVerificationTokenFormData>({\n defaultValues,\n resolver: yupResolver(validateVerificationTokenSchema),\n });\n\n const { email, verificationToken } = getValues();\n\n return {\n control,\n fields: {\n email,\n verificationToken,\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 confirmP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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"]}
|
|
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/useValidateVerificationTokenForm.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 .label(\"End Date\")\n .concat(endDateNotInPastTest)\n .concat(endDateAfterStartDateTest)\n .required(\"End date is required\"),\n endTime: yup\n .string()\n .label(\"End Time\")\n .concat(endTimeMustBeAfterStartTimeTest)\n .required(\"End time is required\"),\n startDate: yup\n .string()\n .label(\"Start Date\")\n .concat(startDateNotInPastTest)\n .required(\"Start date is required\"),\n startTime: yup\n .string()\n .label(\"Start Time\")\n .concat(startTimeCannotBeInPastTest)\n .required(\"Start time is required\"),\n});\n\nconst siteTypesSchema = yup.object({\n label: yup.string().trim().label(\"Site Label\").optional(),\n price: yup.number().when(\"label\", {\n is: (label: string | undefined) => !!label,\n then: (schema) =>\n schema\n .typeError(\"Site price must be a number\")\n .label(\"Site Price\")\n .min(0.1, \"Site price must be at least 0.1\")\n .required(\"Site price is required\")\n .test(\n \"no-leading-zeros\",\n \"\",\n noLeadingZeros(\"Site price\", { allowDecimal: true }),\n ),\n otherwise: (schema) => schema.notRequired(),\n }),\n});\n\nexport const dateTimeWithPriceSchema = dateTimeSchema.shape({\n marketPrice: yup\n .number()\n .typeError(\"Market price must be a number\")\n .label(\"Market Price\")\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 siteTypes: yup.array().of(siteTypesSchema).nullable().optional(),\n});\n\nexport const locationSchema = yup.object().shape({\n city: yup.string().label(\"City\").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().label(\"Country\").required(\"Country is required\"),\n fullAddress: yup.string().label(\"Address\").required(\"Address is required\"),\n latitude: yup.number().label(\"Latitude\").required(\"Latitude is required\"),\n longitude: yup.number().label(\"Longitude\").required(\"Longitude is required\"),\n region: yup.string().label(\"Region\").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 .label(\"Email\")\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 .label(\"Password\")\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 .label(\"Social Media Name\")\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 .label(\"Social Media Link\"),\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().label(\"Cover\").required(\"Cover is required\"),\n title: yup.string().label(\"Cover Title\").required(\"Cover is required\"),\n }),\n description: yup\n .string()\n .label(\"Description\")\n .trim()\n .min(3)\n .required(\"Description is required\"),\n name: yup.string().label(\"Name\").trim().min(3).required(\"Name is required\"),\n region: yup.string().label(\"Region\").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\n .string()\n .label(\"Provider\")\n .trim()\n .min(3)\n .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 { 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\n .string()\n .label(\"First Name\")\n .required(\"First Name is required\"),\n lastName: yup.string().label(\"Last Name\").required(\"Last Name is required\"),\n password: passwordSchema,\n preferredRegion: yup\n .string()\n .label(\"Preferred Region\")\n .required(\"Preferred Region 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 validateVerificationTokenSchema = yup.object().shape({\n email: emailSchema,\n verificationToken: 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 siteTypes: [],\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 siteTypes: [],\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 { 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};\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 } = getValues();\n\n return {\n control,\n fields: {\n email,\n firstName,\n lastName,\n password,\n preferredRegion,\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 CreateValidateVerificationTokenFormData,\n ValidateVerificationTokenFormData,\n} from \"../../types/auth\";\nimport { validateVerificationTokenSchema } from \"../../yupSchema/auth\";\n\nconst defaultValues: ValidateVerificationTokenFormData = {\n email: \"\",\n verificationToken: \"\",\n};\n\nexport function useValidateVerificationTokenForm(): CreateValidateVerificationTokenFormData {\n const {\n control,\n formState: { errors },\n getValues,\n handleSubmit,\n reset,\n setValue,\n watch,\n } = useForm<ValidateVerificationTokenFormData>({\n defaultValues,\n resolver: yupResolver(validateVerificationTokenSchema),\n });\n\n const { email, verificationToken } = getValues();\n\n return {\n control,\n fields: {\n email,\n verificationToken,\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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AI,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
|
@@ -135,6 +135,7 @@ __export(index_exports, {
|
|
|
135
135
|
useGetUserFavourites: () => useGetUserFavourites,
|
|
136
136
|
useGetUserMarkets: () => useGetUserMarkets,
|
|
137
137
|
useGetUserNotifications: () => useGetUserNotifications,
|
|
138
|
+
useGetUserStallholder: () => useGetUserStallholder,
|
|
138
139
|
useGetUsers: () => useGetUsers,
|
|
139
140
|
useLocationSearch: () => useLocationSearch,
|
|
140
141
|
useLogin: () => useLogin,
|
|
@@ -218,22 +219,22 @@ var EnumResourceTypeIcon = /* @__PURE__ */ ((EnumResourceTypeIcon2) => {
|
|
|
218
219
|
EnumResourceTypeIcon2["STALLHOLDER"] = "store";
|
|
219
220
|
return EnumResourceTypeIcon2;
|
|
220
221
|
})(EnumResourceTypeIcon || {});
|
|
221
|
-
var EnumRegions = /* @__PURE__ */ ((
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
return
|
|
222
|
+
var EnumRegions = /* @__PURE__ */ ((EnumRegions2) => {
|
|
223
|
+
EnumRegions2["Auckland"] = "Auckland";
|
|
224
|
+
EnumRegions2["BayOfPlenty"] = "Bay of Plenty";
|
|
225
|
+
EnumRegions2["Canterbury"] = "Canterbury";
|
|
226
|
+
EnumRegions2["Gisborne"] = "Gisborne";
|
|
227
|
+
EnumRegions2["HawkesBay"] = "Hawke's Bay";
|
|
228
|
+
EnumRegions2["ManawatuWanganui"] = "Manawatu-Wanganui";
|
|
229
|
+
EnumRegions2["Marlborough"] = "Marlborough";
|
|
230
|
+
EnumRegions2["Nelson"] = "Nelson";
|
|
231
|
+
EnumRegions2["Northland"] = "Northland";
|
|
232
|
+
EnumRegions2["Otago"] = "Otago";
|
|
233
|
+
EnumRegions2["Southland"] = "Southland";
|
|
234
|
+
EnumRegions2["Taranaki"] = "Taranaki";
|
|
235
|
+
EnumRegions2["Waikato"] = "Waikato";
|
|
236
|
+
EnumRegions2["Wellington"] = "Wellington";
|
|
237
|
+
return EnumRegions2;
|
|
237
238
|
})(EnumRegions || {});
|
|
238
239
|
var ImageTypeEnum = /* @__PURE__ */ ((ImageTypeEnum2) => {
|
|
239
240
|
ImageTypeEnum2["AVATAR"] = "avatar";
|
|
@@ -531,16 +532,16 @@ var startTimeCannotBeInPastTest = yup.string().test(
|
|
|
531
532
|
}
|
|
532
533
|
);
|
|
533
534
|
var dateTimeSchema = yup.object().shape({
|
|
534
|
-
endDate: yup.string().concat(endDateNotInPastTest).concat(endDateAfterStartDateTest).required("End date is required"),
|
|
535
|
-
endTime: yup.string().concat(endTimeMustBeAfterStartTimeTest).required("End time is required"),
|
|
536
|
-
startDate: yup.string().concat(startDateNotInPastTest).required("Start date is required"),
|
|
537
|
-
startTime: yup.string().concat(startTimeCannotBeInPastTest).required("Start time is required")
|
|
535
|
+
endDate: yup.string().label("End Date").concat(endDateNotInPastTest).concat(endDateAfterStartDateTest).required("End date is required"),
|
|
536
|
+
endTime: yup.string().label("End Time").concat(endTimeMustBeAfterStartTimeTest).required("End time is required"),
|
|
537
|
+
startDate: yup.string().label("Start Date").concat(startDateNotInPastTest).required("Start date is required"),
|
|
538
|
+
startTime: yup.string().label("Start Time").concat(startTimeCannotBeInPastTest).required("Start time is required")
|
|
538
539
|
});
|
|
539
540
|
var siteTypesSchema = yup.object({
|
|
540
|
-
label: yup.string().trim().optional(),
|
|
541
|
+
label: yup.string().trim().label("Site Label").optional(),
|
|
541
542
|
price: yup.number().when("label", {
|
|
542
543
|
is: (label) => !!label,
|
|
543
|
-
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(
|
|
544
|
+
then: (schema) => schema.typeError("Site price must be a number").label("Site Price").min(0.1, "Site price must be at least 0.1").required("Site price is required").test(
|
|
544
545
|
"no-leading-zeros",
|
|
545
546
|
"",
|
|
546
547
|
noLeadingZeros("Site price", { allowDecimal: true })
|
|
@@ -549,7 +550,7 @@ var siteTypesSchema = yup.object({
|
|
|
549
550
|
})
|
|
550
551
|
});
|
|
551
552
|
var dateTimeWithPriceSchema = dateTimeSchema.shape({
|
|
552
|
-
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(
|
|
553
|
+
marketPrice: yup.number().typeError("Market price must be a number").label("Market Price").min(0.1, "Market price must be at least 0.1").required("Market price is required").test(
|
|
553
554
|
"no-leading-zeros",
|
|
554
555
|
"",
|
|
555
556
|
noLeadingZeros("Market price", { allowDecimal: true })
|
|
@@ -557,40 +558,40 @@ var dateTimeWithPriceSchema = dateTimeSchema.shape({
|
|
|
557
558
|
siteTypes: yup.array().of(siteTypesSchema).nullable().optional()
|
|
558
559
|
});
|
|
559
560
|
var locationSchema = yup.object().shape({
|
|
560
|
-
city: yup.string().required("City is required"),
|
|
561
|
+
city: yup.string().label("City").required("City is required"),
|
|
561
562
|
coordinates: yup.array().of(yup.number().required("Coordinates must be numbers")).length(
|
|
562
563
|
2,
|
|
563
564
|
"Coordinates must contain exactly two numbers (longitude, latitude)"
|
|
564
565
|
).required("Coordinates are required"),
|
|
565
|
-
country: yup.string().required("Country is required"),
|
|
566
|
-
fullAddress: yup.string().required("Address is required"),
|
|
567
|
-
latitude: yup.number().required("Latitude is required"),
|
|
568
|
-
longitude: yup.number().required("Longitude is required"),
|
|
569
|
-
region: yup.string().required("Region is required"),
|
|
566
|
+
country: yup.string().label("Country").required("Country is required"),
|
|
567
|
+
fullAddress: yup.string().label("Address").required("Address is required"),
|
|
568
|
+
latitude: yup.number().label("Latitude").required("Latitude is required"),
|
|
569
|
+
longitude: yup.number().label("Longitude").required("Longitude is required"),
|
|
570
|
+
region: yup.string().label("Region").required("Region is required"),
|
|
570
571
|
type: yup.string().oneOf(["Point"], "Type must be 'Point'").default("Point").required("Type is required")
|
|
571
572
|
});
|
|
572
|
-
var emailSchema = yup.string().email("Invalid email address").required("Email is required").transform(
|
|
573
|
+
var emailSchema = yup.string().email("Invalid email address").required("Email is required").label("Email").transform(
|
|
573
574
|
(value) => typeof value === "string" ? value.toLowerCase() : value
|
|
574
575
|
);
|
|
575
|
-
var passwordSchema = yup.string().trim().min(8, "Password must be at least 8 characters long").required("Password is required");
|
|
576
|
+
var passwordSchema = yup.string().trim().label("Password").min(8, "Password must be at least 8 characters long").required("Password is required");
|
|
576
577
|
var socialMediaSchema = yup.object({
|
|
577
|
-
name: yup.mixed().oneOf(Object.values(EnumSocialMedia)).optional(),
|
|
578
|
+
name: yup.mixed().oneOf(Object.values(EnumSocialMedia)).label("Social Media Name").optional(),
|
|
578
579
|
link: yup.string().when("name", {
|
|
579
580
|
is: (name) => !!name,
|
|
580
581
|
// If name has a value
|
|
581
|
-
then: () => normalizedUrlTransform().required("Link is required when name is set").url("Link must be a valid URL"),
|
|
582
|
+
then: () => normalizedUrlTransform().required("Link is required when name is set").url("Link must be a valid URL").label("Social Media Link"),
|
|
582
583
|
otherwise: (schema) => schema.notRequired()
|
|
583
584
|
})
|
|
584
585
|
});
|
|
585
586
|
var globalResourceSchema = yup.object().shape({
|
|
586
587
|
active: yup.boolean().required("Active is required"),
|
|
587
588
|
cover: yup.object({
|
|
588
|
-
source: yup.string().required("Cover is required"),
|
|
589
|
-
title: yup.string().required("Cover is required")
|
|
589
|
+
source: yup.string().label("Cover").required("Cover is required"),
|
|
590
|
+
title: yup.string().label("Cover Title").required("Cover is required")
|
|
590
591
|
}),
|
|
591
|
-
description: yup.string().trim().min(3).required("Description is required"),
|
|
592
|
-
name: yup.string().trim().min(3).required("Name is required"),
|
|
593
|
-
region: yup.string().required("Region is required"),
|
|
592
|
+
description: yup.string().label("Description").trim().min(3).required("Description is required"),
|
|
593
|
+
name: yup.string().label("Name").trim().min(3).required("Name is required"),
|
|
594
|
+
region: yup.string().label("Region").required("Region is required"),
|
|
594
595
|
socialMedia: yup.array().of(socialMediaSchema).nullable().optional()
|
|
595
596
|
});
|
|
596
597
|
|
|
@@ -600,7 +601,7 @@ var nzBankAccountRegex = /^\d{2}-\d{4}-\d{7}-\d{2}$/;
|
|
|
600
601
|
var marketSchema = globalResourceSchema.shape({
|
|
601
602
|
dateTime: yup2.array().of(dateTimeSchema).required("DateTime is required"),
|
|
602
603
|
location: locationSchema,
|
|
603
|
-
provider: yup2.string().trim().min(3).required("Provider is required"),
|
|
604
|
+
provider: yup2.string().label("Provider").trim().min(3).required("Provider is required"),
|
|
604
605
|
tags: yup2.array().of(yup2.string().defined()).min(1, "Tags are required").required("Tags are required")
|
|
605
606
|
});
|
|
606
607
|
var paymentTargetSchema = yup2.object({
|
|
@@ -718,11 +719,10 @@ var loginSchema = yup5.object().shape({
|
|
|
718
719
|
});
|
|
719
720
|
var registerSchema = yup5.object().shape({
|
|
720
721
|
email: emailSchema,
|
|
721
|
-
firstName: yup5.string().required("First Name is required"),
|
|
722
|
-
lastName: yup5.string().required("Last Name is required"),
|
|
722
|
+
firstName: yup5.string().label("First Name").required("First Name is required"),
|
|
723
|
+
lastName: yup5.string().label("Last Name").required("Last Name is required"),
|
|
723
724
|
password: passwordSchema,
|
|
724
|
-
preferredRegion: yup5.string().required("Preferred Region is required")
|
|
725
|
-
role: yup5.mixed().oneOf(Object.values(EnumUserRole)).required("Role is required")
|
|
725
|
+
preferredRegion: yup5.string().label("Preferred Region").required("Preferred Region is required")
|
|
726
726
|
});
|
|
727
727
|
var requestPasswordResetSchema = yup5.object().shape({
|
|
728
728
|
email: emailSchema
|
|
@@ -1286,8 +1286,7 @@ var defaultValues3 = {
|
|
|
1286
1286
|
firstName: "",
|
|
1287
1287
|
lastName: "",
|
|
1288
1288
|
password: "",
|
|
1289
|
-
preferredRegion: ""
|
|
1290
|
-
role: "customer" /* CUSTOMER */
|
|
1289
|
+
preferredRegion: ""
|
|
1291
1290
|
};
|
|
1292
1291
|
function useRegisterForm() {
|
|
1293
1292
|
const {
|
|
@@ -1302,7 +1301,7 @@ function useRegisterForm() {
|
|
|
1302
1301
|
defaultValues: defaultValues3,
|
|
1303
1302
|
resolver: (0, import_yup7.yupResolver)(registerSchema)
|
|
1304
1303
|
});
|
|
1305
|
-
const { email, firstName, lastName, password, preferredRegion
|
|
1304
|
+
const { email, firstName, lastName, password, preferredRegion } = getValues();
|
|
1306
1305
|
return {
|
|
1307
1306
|
control,
|
|
1308
1307
|
fields: {
|
|
@@ -1310,8 +1309,7 @@ function useRegisterForm() {
|
|
|
1310
1309
|
firstName,
|
|
1311
1310
|
lastName,
|
|
1312
1311
|
password,
|
|
1313
|
-
preferredRegion
|
|
1314
|
-
role
|
|
1312
|
+
preferredRegion
|
|
1315
1313
|
},
|
|
1316
1314
|
formState: { errors },
|
|
1317
1315
|
handleSubmit,
|
|
@@ -1527,15 +1525,10 @@ var LOGOUT_MUTATION = import_client2.gql`
|
|
|
1527
1525
|
var REFRESH_TOKEN_MUTATION = import_client2.gql`
|
|
1528
1526
|
mutation refreshToken($input: RefreshTokenInputType!) {
|
|
1529
1527
|
refreshToken(input: $input) {
|
|
1530
|
-
message
|
|
1531
1528
|
refreshToken
|
|
1532
1529
|
token
|
|
1533
|
-
user {
|
|
1534
|
-
...UserFields
|
|
1535
|
-
}
|
|
1536
1530
|
}
|
|
1537
1531
|
}
|
|
1538
|
-
${USER_FIELDS_FRAGMENT}
|
|
1539
1532
|
`;
|
|
1540
1533
|
var RESET_PASSWORD_MUTATION = import_client2.gql`
|
|
1541
1534
|
mutation resetPassword($input: ResetPasswordInputType!) {
|
|
@@ -2149,6 +2142,14 @@ var GET_USER_MARKETS = import_client11.gql`
|
|
|
2149
2142
|
}
|
|
2150
2143
|
${MARKET}
|
|
2151
2144
|
`;
|
|
2145
|
+
var GET_USER_STALLHOLDER = import_client11.gql`
|
|
2146
|
+
query getUserStallholder {
|
|
2147
|
+
userStallholder {
|
|
2148
|
+
...StallholderFields
|
|
2149
|
+
}
|
|
2150
|
+
}
|
|
2151
|
+
${STALLHOLDER}
|
|
2152
|
+
`;
|
|
2152
2153
|
var GET_USER_FAVOURITES = import_client11.gql`
|
|
2153
2154
|
query getUserFavourites {
|
|
2154
2155
|
userFavourites {
|
|
@@ -3058,6 +3059,13 @@ var useGetUserMarkets = () => {
|
|
|
3058
3059
|
const userMarkets = data?.userMarkets;
|
|
3059
3060
|
return { error, loading, refetch, userMarkets };
|
|
3060
3061
|
};
|
|
3062
|
+
var useGetUserStallholder = () => {
|
|
3063
|
+
const { loading, error, data, refetch } = (0, import_client28.useQuery)(GET_USER_STALLHOLDER, {
|
|
3064
|
+
fetchPolicy: "network-only"
|
|
3065
|
+
});
|
|
3066
|
+
const userStallholder = data?.userStallholder;
|
|
3067
|
+
return { error, loading, refetch, userStallholder };
|
|
3068
|
+
};
|
|
3061
3069
|
var useGetUserFavourites = () => {
|
|
3062
3070
|
const { loading, error, data, refetch } = (0, import_client28.useQuery)(GET_USER_FAVOURITES, {
|
|
3063
3071
|
fetchPolicy: "network-only"
|
|
@@ -3363,6 +3371,7 @@ var marketInfoPaymentTarget = [
|
|
|
3363
3371
|
},
|
|
3364
3372
|
{
|
|
3365
3373
|
helperText: "Account number *",
|
|
3374
|
+
keyboardType: "number-pad",
|
|
3366
3375
|
name: "accountNumber",
|
|
3367
3376
|
placeholder: "Account number"
|
|
3368
3377
|
},
|
|
@@ -4153,6 +4162,7 @@ var socialMediaFields = socialMedia.map((link) => ({
|
|
|
4153
4162
|
useGetUserFavourites,
|
|
4154
4163
|
useGetUserMarkets,
|
|
4155
4164
|
useGetUserNotifications,
|
|
4165
|
+
useGetUserStallholder,
|
|
4156
4166
|
useGetUsers,
|
|
4157
4167
|
useLocationSearch,
|
|
4158
4168
|
useLogin,
|