@timardex/cluemart-shared 1.0.28 → 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-GMCWFVU5.mjs → chunk-NWMPRKZ7.mjs} +10 -3
- package/dist/{chunk-GMCWFVU5.mjs.map → chunk-NWMPRKZ7.mjs.map} +1 -1
- package/dist/{chunk-GMOTXE7A.mjs → chunk-OXXSIU3M.mjs} +1 -7
- package/dist/chunk-OXXSIU3M.mjs.map +1 -0
- package/dist/enums/index.cjs +0 -7
- package/dist/enums/index.cjs.map +1 -1
- package/dist/enums/index.d.mts +1 -5
- package/dist/enums/index.d.ts +1 -5
- package/dist/enums/index.mjs +1 -3
- package/dist/formFields/index.cjs +177 -16
- package/dist/formFields/index.cjs.map +1 -1
- package/dist/formFields/index.d.mts +3 -3
- package/dist/formFields/index.d.ts +3 -3
- package/dist/formFields/index.mjs +178 -14
- package/dist/formFields/index.mjs.map +1 -1
- package/dist/{global-BRfKKan0.d.ts → global-BPTHVdhZ.d.ts} +13 -6
- package/dist/{global-DwhGi-4q.d.mts → global-BXE1MTDE.d.mts} +13 -6
- package/dist/graphql/index.cjs +7 -1
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +1 -1
- package/dist/graphql/index.d.ts +1 -1
- package/dist/graphql/index.mjs +7 -1
- package/dist/graphql/index.mjs.map +1 -1
- package/dist/hooks/index.cjs +80 -65
- 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 +57 -49
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.cjs +252 -72
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +14 -10
- package/dist/index.d.ts +14 -10
- package/dist/index.mjs +250 -70
- 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 +4 -2
- package/package.json +1 -1
- package/dist/chunk-GMOTXE7A.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -10,10 +10,6 @@ declare enum EnumInviteStatus {
|
|
|
10
10
|
REJECTED = "Rejected",
|
|
11
11
|
WAITING = "Waiting"
|
|
12
12
|
}
|
|
13
|
-
declare enum EnumRejectionPolicy {
|
|
14
|
-
SINGLE_DATE_ALLOWED = "single_date_allowed",
|
|
15
|
-
MULTI_DATE_ALLOWED = "multi_date_allowed"
|
|
16
|
-
}
|
|
17
13
|
declare enum EnumPaymentMethod {
|
|
18
14
|
CASH = "cash",
|
|
19
15
|
EFTPOS = "eftpos",
|
|
@@ -227,14 +223,21 @@ type PaymentTargetType = {
|
|
|
227
223
|
link?: string;
|
|
228
224
|
paymentMethod: EnumPaymentMethod;
|
|
229
225
|
};
|
|
226
|
+
type Requirement = {
|
|
227
|
+
category: "Food Safety" | "Environment" | "Operations" | "Legal & Safety";
|
|
228
|
+
label: string;
|
|
229
|
+
value: boolean;
|
|
230
|
+
};
|
|
230
231
|
interface MarketInfoFormData {
|
|
231
232
|
_id?: string;
|
|
232
233
|
applicationDeadlineHours: number;
|
|
233
234
|
dateTime: DateTimeWithPriceType[];
|
|
234
235
|
marketId: string;
|
|
236
|
+
packInTime: number;
|
|
237
|
+
packOutTime: number;
|
|
235
238
|
paymentDueHours: number;
|
|
236
239
|
paymentTarget: PaymentTargetType[];
|
|
237
|
-
|
|
240
|
+
requirements?: Requirement[];
|
|
238
241
|
stallCapacity: number;
|
|
239
242
|
}
|
|
240
243
|
interface MarketFormData extends BaseResourceTypeFormData {
|
|
@@ -408,8 +411,8 @@ type ResourceImageType = {
|
|
|
408
411
|
title: string;
|
|
409
412
|
};
|
|
410
413
|
type SocialMediaType = {
|
|
411
|
-
name
|
|
412
|
-
link
|
|
414
|
+
name?: EnumSocialMedia;
|
|
415
|
+
link?: string;
|
|
413
416
|
};
|
|
414
417
|
interface BaseResourceTypeFormData {
|
|
415
418
|
_id?: string;
|
|
@@ -467,7 +470,7 @@ interface FormField {
|
|
|
467
470
|
disabled?: boolean;
|
|
468
471
|
helperText?: string;
|
|
469
472
|
isTextArea?: boolean;
|
|
470
|
-
keyboardType?: "default" | "email-address" | "number-pad" | "url";
|
|
473
|
+
keyboardType?: "default" | "email-address" | "number-pad" | "url" | "decimal-pad";
|
|
471
474
|
name: string;
|
|
472
475
|
placeholder: string;
|
|
473
476
|
secureTextEntry?: boolean;
|
|
@@ -575,6 +578,7 @@ declare function sortDatesByProximity<T extends {
|
|
|
575
578
|
declare const availableRegionTypes: EnumRegions[];
|
|
576
579
|
declare const availableRegionOptions: OptionItem[];
|
|
577
580
|
declare const paymentMethodOptions: OptionItem[];
|
|
581
|
+
declare function normalizeUrl(url: string): string;
|
|
578
582
|
|
|
579
583
|
interface PlacePrediction {
|
|
580
584
|
place_id: string;
|
|
@@ -1012,7 +1016,7 @@ declare const tagOptions: OptionItem[];
|
|
|
1012
1016
|
declare const marketInfo: FormField[];
|
|
1013
1017
|
declare const marketInfoPaymentTarget: FormField[];
|
|
1014
1018
|
declare const marketPriceByDateFields: FormField[];
|
|
1015
|
-
declare const
|
|
1019
|
+
declare const requirementsOptions: Requirement[];
|
|
1016
1020
|
|
|
1017
1021
|
declare const loginFields: FormField[];
|
|
1018
1022
|
declare const registerFields: FormField[];
|
|
@@ -1027,4 +1031,4 @@ declare const categoryColors: Record<string, string>;
|
|
|
1027
1031
|
|
|
1028
1032
|
declare const socialMediaFields: FormField[];
|
|
1029
1033
|
|
|
1030
|
-
export { type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatInput, type ChatMessageInput, type ChatMessageType, type ChatType, type CreateLoginFormData, type CreateMarketFormData, type CreateMarketInfoFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateStallholderApplyFormFormData, type CreateStallholderFormData, type CreateUserFormData, type CreateValidateTokenFormData, type DateTimeType, type DateTimeWithPriceType, EnumInviteStatus, EnumNotification, EnumPaymentMethod, EnumRegions,
|
|
1034
|
+
export { type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatInput, type ChatMessageInput, type ChatMessageType, type ChatType, type CreateLoginFormData, type CreateMarketFormData, type CreateMarketInfoFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateStallholderApplyFormFormData, type CreateStallholderFormData, type CreateUserFormData, type CreateValidateTokenFormData, type DateTimeType, type DateTimeWithPriceType, EnumInviteStatus, EnumNotification, EnumPaymentMethod, EnumRegions, EnumRelationResource, EnumResourceType, EnumResourceTypeIcon, EnumSocialMedia, EnumUserLicence, EnumUserRole, type FormDateField, type FormField, type GeocodeLocation, type ImageObjectType, ImageTypeEnum, type LocationType, type LoginFormData, type MapMultiLocation, type MarketFormData, type MarketInfoFormData, type MarketInfoType, type MarketType, type MarketWithConnectionDatesType, type NotificationType, type Nullable, type OptionItem, type PaymentTargetType, type PlacePrediction, type PosterInputType, type Region, type RegisterFormData, type RelationDate, type RelationLog, type RelationType, type RequestPasswordResetFormData, type Requirement, type ResetPasswordFormData, type ResourceConnectionsType, type ResourceImageType, type SatllholderWithConnectionDatesType, type SocialMediaType, type StallholderApplyFormFormData, type StallholderApplyFormType, type StallholderAttributes, type StallholderFormData, type StallholderLocation, type StallholderType, type Subcategory, type UserFormData, type UserType, type ValidateTokenFormData, availableCategories, availableCityOptions, availableRegionOptions, availableRegionTypes, availableTagTypes, capitalizeFirstLetter, categoryColors, dateFormat, defaultMarketFormValues, defaultMarketInfoFormValues, defaultRegion, defaultStallholderApplyFormValues, defaultStallholderFormValues, formatDate, formatTimestamp, getCurrentAndFutureDates, getFutureDatesAfterThreshold, globalDefaultValues, loginFields, mapArrayToOptions, mapBaseResourceTypeToFormData, marketBasicInfoFields, marketEndDateFields, marketInfo, marketInfoPaymentTarget, marketPriceByDateFields, marketStartDateFields, normalizeUrl, packagingOptions, paymentMethodOptions, producedIngOptions, profileFields, registerFields, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, socialMediaFields, sortDatesByProximity, stallholderBasicInfoFields, stallholderElectricity, stallholderEndDateFields, stallholderFullAddress, stallholderGazebo, stallholderLocationDescription, stallholderMultiLocation, stallholderPackaging, stallholderPaymentMethod, stallholderPriceRange, stallholderProducedIn, stallholderStallSize, stallholderStartDateFields, stallholderTable, statusOptions, tagOptions, timeFormat, truncateText, useAddParticipantToChat, useAddUserFavouriteResource, useCreateChat, useCreateMarket, useCreateMarketInfo, useCreatePoster, useCreateRelation, useCreateStallholder, useCreateStallholderApplyForm, useCreateUser, useDeleteChat, useDeleteMarket, useDeleteRelation, useDeleteStallholder, useGetChat, useGetChatSubscription, useGetMarket, useGetMarketInfo, useGetMarketRelations, useGetMarkets, useGetMarketsByRegion, useGetMarketsNearMe, useGetNotification, useGetRelation, useGetRelationByMarketAndStallholder, useGetResourceConnections, useGetStallholder, useGetStallholderApplyForm, useGetStallholderRelations, useGetStallholders, useGetStallholdersByRegion, useGetUser, useGetUserChats, useGetUserFavourites, useGetUserMarkets, useGetUserNotifications, useGetUsers, useLocationSearch, useLogin, useLoginForm, useMarketForm, useMarketInfoForm, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSearchMarkets, useSearchStallholders, useSendChatMessage, useStallholderApplyForm, useStallholderForm, useUpdateMarket, useUpdateMarketInfo, useUpdateRelation, useUpdateStallholder, useUpdateStallholderApplyForm, useUpdateUser, useUserForm, useValidateToken, useValidateTokenForm, validateTokenFields };
|
package/dist/index.d.ts
CHANGED
|
@@ -10,10 +10,6 @@ declare enum EnumInviteStatus {
|
|
|
10
10
|
REJECTED = "Rejected",
|
|
11
11
|
WAITING = "Waiting"
|
|
12
12
|
}
|
|
13
|
-
declare enum EnumRejectionPolicy {
|
|
14
|
-
SINGLE_DATE_ALLOWED = "single_date_allowed",
|
|
15
|
-
MULTI_DATE_ALLOWED = "multi_date_allowed"
|
|
16
|
-
}
|
|
17
13
|
declare enum EnumPaymentMethod {
|
|
18
14
|
CASH = "cash",
|
|
19
15
|
EFTPOS = "eftpos",
|
|
@@ -227,14 +223,21 @@ type PaymentTargetType = {
|
|
|
227
223
|
link?: string;
|
|
228
224
|
paymentMethod: EnumPaymentMethod;
|
|
229
225
|
};
|
|
226
|
+
type Requirement = {
|
|
227
|
+
category: "Food Safety" | "Environment" | "Operations" | "Legal & Safety";
|
|
228
|
+
label: string;
|
|
229
|
+
value: boolean;
|
|
230
|
+
};
|
|
230
231
|
interface MarketInfoFormData {
|
|
231
232
|
_id?: string;
|
|
232
233
|
applicationDeadlineHours: number;
|
|
233
234
|
dateTime: DateTimeWithPriceType[];
|
|
234
235
|
marketId: string;
|
|
236
|
+
packInTime: number;
|
|
237
|
+
packOutTime: number;
|
|
235
238
|
paymentDueHours: number;
|
|
236
239
|
paymentTarget: PaymentTargetType[];
|
|
237
|
-
|
|
240
|
+
requirements?: Requirement[];
|
|
238
241
|
stallCapacity: number;
|
|
239
242
|
}
|
|
240
243
|
interface MarketFormData extends BaseResourceTypeFormData {
|
|
@@ -408,8 +411,8 @@ type ResourceImageType = {
|
|
|
408
411
|
title: string;
|
|
409
412
|
};
|
|
410
413
|
type SocialMediaType = {
|
|
411
|
-
name
|
|
412
|
-
link
|
|
414
|
+
name?: EnumSocialMedia;
|
|
415
|
+
link?: string;
|
|
413
416
|
};
|
|
414
417
|
interface BaseResourceTypeFormData {
|
|
415
418
|
_id?: string;
|
|
@@ -467,7 +470,7 @@ interface FormField {
|
|
|
467
470
|
disabled?: boolean;
|
|
468
471
|
helperText?: string;
|
|
469
472
|
isTextArea?: boolean;
|
|
470
|
-
keyboardType?: "default" | "email-address" | "number-pad" | "url";
|
|
473
|
+
keyboardType?: "default" | "email-address" | "number-pad" | "url" | "decimal-pad";
|
|
471
474
|
name: string;
|
|
472
475
|
placeholder: string;
|
|
473
476
|
secureTextEntry?: boolean;
|
|
@@ -575,6 +578,7 @@ declare function sortDatesByProximity<T extends {
|
|
|
575
578
|
declare const availableRegionTypes: EnumRegions[];
|
|
576
579
|
declare const availableRegionOptions: OptionItem[];
|
|
577
580
|
declare const paymentMethodOptions: OptionItem[];
|
|
581
|
+
declare function normalizeUrl(url: string): string;
|
|
578
582
|
|
|
579
583
|
interface PlacePrediction {
|
|
580
584
|
place_id: string;
|
|
@@ -1012,7 +1016,7 @@ declare const tagOptions: OptionItem[];
|
|
|
1012
1016
|
declare const marketInfo: FormField[];
|
|
1013
1017
|
declare const marketInfoPaymentTarget: FormField[];
|
|
1014
1018
|
declare const marketPriceByDateFields: FormField[];
|
|
1015
|
-
declare const
|
|
1019
|
+
declare const requirementsOptions: Requirement[];
|
|
1016
1020
|
|
|
1017
1021
|
declare const loginFields: FormField[];
|
|
1018
1022
|
declare const registerFields: FormField[];
|
|
@@ -1027,4 +1031,4 @@ declare const categoryColors: Record<string, string>;
|
|
|
1027
1031
|
|
|
1028
1032
|
declare const socialMediaFields: FormField[];
|
|
1029
1033
|
|
|
1030
|
-
export { type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatInput, type ChatMessageInput, type ChatMessageType, type ChatType, type CreateLoginFormData, type CreateMarketFormData, type CreateMarketInfoFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateStallholderApplyFormFormData, type CreateStallholderFormData, type CreateUserFormData, type CreateValidateTokenFormData, type DateTimeType, type DateTimeWithPriceType, EnumInviteStatus, EnumNotification, EnumPaymentMethod, EnumRegions,
|
|
1034
|
+
export { type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatInput, type ChatMessageInput, type ChatMessageType, type ChatType, type CreateLoginFormData, type CreateMarketFormData, type CreateMarketInfoFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateStallholderApplyFormFormData, type CreateStallholderFormData, type CreateUserFormData, type CreateValidateTokenFormData, type DateTimeType, type DateTimeWithPriceType, EnumInviteStatus, EnumNotification, EnumPaymentMethod, EnumRegions, EnumRelationResource, EnumResourceType, EnumResourceTypeIcon, EnumSocialMedia, EnumUserLicence, EnumUserRole, type FormDateField, type FormField, type GeocodeLocation, type ImageObjectType, ImageTypeEnum, type LocationType, type LoginFormData, type MapMultiLocation, type MarketFormData, type MarketInfoFormData, type MarketInfoType, type MarketType, type MarketWithConnectionDatesType, type NotificationType, type Nullable, type OptionItem, type PaymentTargetType, type PlacePrediction, type PosterInputType, type Region, type RegisterFormData, type RelationDate, type RelationLog, type RelationType, type RequestPasswordResetFormData, type Requirement, type ResetPasswordFormData, type ResourceConnectionsType, type ResourceImageType, type SatllholderWithConnectionDatesType, type SocialMediaType, type StallholderApplyFormFormData, type StallholderApplyFormType, type StallholderAttributes, type StallholderFormData, type StallholderLocation, type StallholderType, type Subcategory, type UserFormData, type UserType, type ValidateTokenFormData, availableCategories, availableCityOptions, availableRegionOptions, availableRegionTypes, availableTagTypes, capitalizeFirstLetter, categoryColors, dateFormat, defaultMarketFormValues, defaultMarketInfoFormValues, defaultRegion, defaultStallholderApplyFormValues, defaultStallholderFormValues, formatDate, formatTimestamp, getCurrentAndFutureDates, getFutureDatesAfterThreshold, globalDefaultValues, loginFields, mapArrayToOptions, mapBaseResourceTypeToFormData, marketBasicInfoFields, marketEndDateFields, marketInfo, marketInfoPaymentTarget, marketPriceByDateFields, marketStartDateFields, normalizeUrl, packagingOptions, paymentMethodOptions, producedIngOptions, profileFields, registerFields, removeTypename, requestPasswordResetFields, requirementsOptions, resetPasswordFields, socialMediaFields, sortDatesByProximity, stallholderBasicInfoFields, stallholderElectricity, stallholderEndDateFields, stallholderFullAddress, stallholderGazebo, stallholderLocationDescription, stallholderMultiLocation, stallholderPackaging, stallholderPaymentMethod, stallholderPriceRange, stallholderProducedIn, stallholderStallSize, stallholderStartDateFields, stallholderTable, statusOptions, tagOptions, timeFormat, truncateText, useAddParticipantToChat, useAddUserFavouriteResource, useCreateChat, useCreateMarket, useCreateMarketInfo, useCreatePoster, useCreateRelation, useCreateStallholder, useCreateStallholderApplyForm, useCreateUser, useDeleteChat, useDeleteMarket, useDeleteRelation, useDeleteStallholder, useGetChat, useGetChatSubscription, useGetMarket, useGetMarketInfo, useGetMarketRelations, useGetMarkets, useGetMarketsByRegion, useGetMarketsNearMe, useGetNotification, useGetRelation, useGetRelationByMarketAndStallholder, useGetResourceConnections, useGetStallholder, useGetStallholderApplyForm, useGetStallholderRelations, useGetStallholders, useGetStallholdersByRegion, useGetUser, useGetUserChats, useGetUserFavourites, useGetUserMarkets, useGetUserNotifications, useGetUsers, useLocationSearch, useLogin, useLoginForm, useMarketForm, useMarketInfoForm, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSearchMarkets, useSearchStallholders, useSendChatMessage, useStallholderApplyForm, useStallholderForm, useUpdateMarket, useUpdateMarketInfo, useUpdateRelation, useUpdateStallholder, useUpdateStallholderApplyForm, useUpdateUser, useUserForm, useValidateToken, useValidateTokenForm, validateTokenFields };
|
package/dist/index.mjs
CHANGED
|
@@ -16,18 +16,13 @@ var EnumInviteStatus = /* @__PURE__ */ ((EnumInviteStatus2) => {
|
|
|
16
16
|
EnumInviteStatus2["WAITING"] = "Waiting";
|
|
17
17
|
return EnumInviteStatus2;
|
|
18
18
|
})(EnumInviteStatus || {});
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
EnumPaymentMethod3["EFTPOS"] = "eftpos";
|
|
27
|
-
EnumPaymentMethod3["BANK_TRANSFER"] = "bank_transfer";
|
|
28
|
-
EnumPaymentMethod3["PAYPAL"] = "paypal";
|
|
29
|
-
EnumPaymentMethod3["STRIPE"] = "stripe";
|
|
30
|
-
return EnumPaymentMethod3;
|
|
19
|
+
var EnumPaymentMethod = /* @__PURE__ */ ((EnumPaymentMethod2) => {
|
|
20
|
+
EnumPaymentMethod2["CASH"] = "cash";
|
|
21
|
+
EnumPaymentMethod2["EFTPOS"] = "eftpos";
|
|
22
|
+
EnumPaymentMethod2["BANK_TRANSFER"] = "bank_transfer";
|
|
23
|
+
EnumPaymentMethod2["PAYPAL"] = "paypal";
|
|
24
|
+
EnumPaymentMethod2["STRIPE"] = "stripe";
|
|
25
|
+
return EnumPaymentMethod2;
|
|
31
26
|
})(EnumPaymentMethod || {});
|
|
32
27
|
var EnumResourceType = /* @__PURE__ */ ((EnumResourceType2) => {
|
|
33
28
|
EnumResourceType2["MARKET"] = "market";
|
|
@@ -202,6 +197,12 @@ var availableRegionOptions = mapArrayToOptions(availableRegionTypes);
|
|
|
202
197
|
var paymentMethodOptions = mapArrayToOptions(
|
|
203
198
|
Object.values(EnumPaymentMethod)
|
|
204
199
|
);
|
|
200
|
+
function normalizeUrl(url) {
|
|
201
|
+
if (!url.startsWith("http://") && !url.startsWith("https://")) {
|
|
202
|
+
return `https://${url}`;
|
|
203
|
+
}
|
|
204
|
+
return url;
|
|
205
|
+
}
|
|
205
206
|
|
|
206
207
|
// src/hooks/useLocationSearch.ts
|
|
207
208
|
var handleApiError = (error, message) => {
|
|
@@ -287,6 +288,11 @@ import dayjs2, { extend as extend2 } from "dayjs";
|
|
|
287
288
|
import customParseFormat2 from "dayjs/plugin/customParseFormat";
|
|
288
289
|
import isSameOrAfter2 from "dayjs/plugin/isSameOrAfter";
|
|
289
290
|
import * as yup from "yup";
|
|
291
|
+
var normalizedUrlTransform = () => yup.string().trim().transform(
|
|
292
|
+
(value) => typeof value === "string" ? value.toLowerCase() : value
|
|
293
|
+
).transform(
|
|
294
|
+
(value) => typeof value === "string" ? normalizeUrl(value) : value
|
|
295
|
+
);
|
|
290
296
|
var noLeadingZeros = (fieldName, options = {}) => {
|
|
291
297
|
return function(value, context) {
|
|
292
298
|
const original = context.originalValue?.toString() ?? "";
|
|
@@ -383,6 +389,15 @@ var emailSchema = yup.string().email("Invalid email address").required("Email is
|
|
|
383
389
|
(value) => typeof value === "string" ? value.toLowerCase() : value
|
|
384
390
|
);
|
|
385
391
|
var passwordSchema = yup.string().trim().min(8, "Password must be at least 8 characters long").required("Password is required");
|
|
392
|
+
var socialMediaSchema = yup.object({
|
|
393
|
+
name: yup.mixed().oneOf(Object.values(EnumSocialMedia)).optional(),
|
|
394
|
+
link: yup.string().when("name", {
|
|
395
|
+
is: (name) => !!name,
|
|
396
|
+
// If name has a value
|
|
397
|
+
then: () => normalizedUrlTransform().required("Link is required when name is set").url("Link must be a valid URL"),
|
|
398
|
+
otherwise: (schema) => schema.notRequired()
|
|
399
|
+
})
|
|
400
|
+
});
|
|
386
401
|
var globalResourceSchema = yup.object().shape({
|
|
387
402
|
active: yup.boolean().required("Active is required"),
|
|
388
403
|
cover: yup.object({
|
|
@@ -391,7 +406,8 @@ var globalResourceSchema = yup.object().shape({
|
|
|
391
406
|
}),
|
|
392
407
|
description: yup.string().trim().min(3).required("Description is required"),
|
|
393
408
|
name: yup.string().trim().min(3).required("Name is required"),
|
|
394
|
-
region: yup.string().required("Region is required")
|
|
409
|
+
region: yup.string().required("Region is required"),
|
|
410
|
+
socialMedia: yup.array().of(socialMediaSchema).nullable().optional()
|
|
395
411
|
});
|
|
396
412
|
|
|
397
413
|
// src/yupSchema/market.ts
|
|
@@ -404,45 +420,34 @@ var marketSchema = globalResourceSchema.shape({
|
|
|
404
420
|
tags: yup2.array().of(yup2.string().defined()).min(1, "Tags are required").required("Tags are required")
|
|
405
421
|
});
|
|
406
422
|
var paymentTargetSchema = yup2.object({
|
|
407
|
-
paymentMethod: yup2.mixed().oneOf(Object.values(EnumPaymentMethod)).required("Please select a Payment method")
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
"
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
),
|
|
427
|
-
link: yup2.string().transform(
|
|
428
|
-
(value) => typeof value === "string" ? value.toLowerCase() : value
|
|
429
|
-
).notRequired()
|
|
430
|
-
});
|
|
431
|
-
} else {
|
|
432
|
-
return schema.shape({
|
|
433
|
-
accountHolderName: yup2.string().notRequired(),
|
|
434
|
-
accountNumber: yup2.string().notRequired(),
|
|
435
|
-
link: yup2.string().notRequired()
|
|
436
|
-
});
|
|
437
|
-
}
|
|
423
|
+
paymentMethod: yup2.mixed().oneOf(Object.values(EnumPaymentMethod)).required("Please select a Payment method"),
|
|
424
|
+
accountHolderName: yup2.string().when("paymentMethod", {
|
|
425
|
+
is: "bank_transfer" /* BANK_TRANSFER */,
|
|
426
|
+
then: (schema) => schema.required("Account holder name is required for bank transfer").trim(),
|
|
427
|
+
otherwise: (schema) => schema.notRequired()
|
|
428
|
+
}),
|
|
429
|
+
accountNumber: yup2.string().when("paymentMethod", {
|
|
430
|
+
is: "bank_transfer" /* BANK_TRANSFER */,
|
|
431
|
+
then: (schema) => schema.required("Account number is required for bank transfer").matches(
|
|
432
|
+
nzBankAccountRegex,
|
|
433
|
+
"Account number must be in format: XX-XXXX-XXXXXXX-XX"
|
|
434
|
+
).trim(),
|
|
435
|
+
otherwise: (schema) => schema.notRequired()
|
|
436
|
+
}),
|
|
437
|
+
link: yup2.string().when("paymentMethod", {
|
|
438
|
+
is: (val) => val !== "bank_transfer" /* BANK_TRANSFER */,
|
|
439
|
+
then: () => normalizedUrlTransform().url("Link must be a valid URL").required("Link is required for PayPal/Stripe"),
|
|
440
|
+
otherwise: (schema) => schema.notRequired()
|
|
441
|
+
})
|
|
438
442
|
});
|
|
439
443
|
var marketInfoSchema = yup2.object().shape({
|
|
440
|
-
applicationDeadlineHours: yup2.number().typeError("Application deadline hours must be a number").min(1, "Application deadline hours must be at least 1").required("Application deadline hours is required").test("no-leading-zeros", "", noLeadingZeros("Application deadline hours")),
|
|
444
|
+
applicationDeadlineHours: yup2.number().nullable().transform((value, originalValue) => originalValue === "" ? null : value).typeError("Application deadline hours must be a number").min(1, "Application deadline hours must be at least 1").required("Application deadline hours is required").test("no-leading-zeros", "", noLeadingZeros("Application deadline hours")),
|
|
441
445
|
dateTime: yup2.array().of(dateTimeWithPriceSchema).required("DateTime is required"),
|
|
442
446
|
marketId: yup2.string().trim().required("Market ID is required"),
|
|
447
|
+
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")),
|
|
448
|
+
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")),
|
|
443
449
|
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")),
|
|
444
450
|
paymentTarget: yup2.array().of(paymentTargetSchema).min(1, "At least one payment target is required").required("Payment target is required"),
|
|
445
|
-
rejectionPolicy: yup2.mixed().oneOf(Object.values(EnumRejectionPolicy)).required("Rejection policy is required"),
|
|
446
451
|
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"))
|
|
447
452
|
});
|
|
448
453
|
|
|
@@ -620,16 +625,13 @@ var defaultMarketInfoFormValues = {
|
|
|
620
625
|
}
|
|
621
626
|
],
|
|
622
627
|
marketId: "",
|
|
628
|
+
packInTime: 0,
|
|
629
|
+
// e.g., 2 hours before market opens
|
|
630
|
+
packOutTime: 0,
|
|
631
|
+
// e.g., 1 hour after market closes
|
|
623
632
|
paymentDueHours: 0,
|
|
624
|
-
paymentTarget: [
|
|
625
|
-
|
|
626
|
-
accountHolderName: "",
|
|
627
|
-
accountNumber: "",
|
|
628
|
-
link: "",
|
|
629
|
-
paymentMethod: ""
|
|
630
|
-
}
|
|
631
|
-
],
|
|
632
|
-
rejectionPolicy: "multi_date_allowed" /* MULTI_DATE_ALLOWED */,
|
|
633
|
+
paymentTarget: [],
|
|
634
|
+
requirements: [],
|
|
633
635
|
stallCapacity: 0
|
|
634
636
|
};
|
|
635
637
|
var defaultStallholderFormValues = {
|
|
@@ -926,9 +928,11 @@ function useMarketInfoForm(data) {
|
|
|
926
928
|
applicationDeadlineHours: data.applicationDeadlineHours,
|
|
927
929
|
dateTime: data.dateTime,
|
|
928
930
|
marketId: data.marketId,
|
|
931
|
+
packInTime: data.packInTime,
|
|
932
|
+
packOutTime: data.packOutTime,
|
|
929
933
|
paymentDueHours: data.paymentDueHours,
|
|
930
934
|
paymentTarget: data.paymentTarget,
|
|
931
|
-
|
|
935
|
+
requirements: data.requirements,
|
|
932
936
|
stallCapacity: data.stallCapacity
|
|
933
937
|
});
|
|
934
938
|
} else {
|
|
@@ -940,9 +944,11 @@ function useMarketInfoForm(data) {
|
|
|
940
944
|
applicationDeadlineHours,
|
|
941
945
|
dateTime,
|
|
942
946
|
marketId,
|
|
947
|
+
packInTime,
|
|
948
|
+
packOutTime,
|
|
943
949
|
paymentDueHours,
|
|
944
950
|
paymentTarget,
|
|
945
|
-
|
|
951
|
+
requirements,
|
|
946
952
|
stallCapacity
|
|
947
953
|
} = getValues();
|
|
948
954
|
return {
|
|
@@ -952,9 +958,11 @@ function useMarketInfoForm(data) {
|
|
|
952
958
|
applicationDeadlineHours,
|
|
953
959
|
dateTime,
|
|
954
960
|
marketId,
|
|
961
|
+
packInTime,
|
|
962
|
+
packOutTime,
|
|
955
963
|
paymentDueHours,
|
|
956
964
|
paymentTarget,
|
|
957
|
-
|
|
965
|
+
requirements,
|
|
958
966
|
stallCapacity
|
|
959
967
|
},
|
|
960
968
|
formState: { errors },
|
|
@@ -1598,6 +1606,8 @@ var MARKET_INFO = gql5`
|
|
|
1598
1606
|
startTime
|
|
1599
1607
|
}
|
|
1600
1608
|
marketId
|
|
1609
|
+
packInTime
|
|
1610
|
+
packOutTime
|
|
1601
1611
|
paymentDueHours
|
|
1602
1612
|
paymentTarget {
|
|
1603
1613
|
accountHolderName
|
|
@@ -1605,8 +1615,12 @@ var MARKET_INFO = gql5`
|
|
|
1605
1615
|
link
|
|
1606
1616
|
paymentMethod
|
|
1607
1617
|
}
|
|
1608
|
-
rejectionPolicy
|
|
1609
1618
|
stallCapacity
|
|
1619
|
+
requirements {
|
|
1620
|
+
category
|
|
1621
|
+
label
|
|
1622
|
+
value
|
|
1623
|
+
}
|
|
1610
1624
|
}
|
|
1611
1625
|
`;
|
|
1612
1626
|
var MARKET = gql5`
|
|
@@ -3086,22 +3100,34 @@ var tagOptions = availableTagTypes.map((tag) => ({
|
|
|
3086
3100
|
// src/formFields/market/marketInfo.ts
|
|
3087
3101
|
var marketInfo = [
|
|
3088
3102
|
{
|
|
3089
|
-
helperText: "Application Deadline
|
|
3103
|
+
helperText: "Application Deadline *",
|
|
3090
3104
|
keyboardType: "number-pad",
|
|
3091
3105
|
name: "applicationDeadlineHours",
|
|
3092
|
-
placeholder: "Application Deadline
|
|
3106
|
+
placeholder: "Application Deadline (in hours)"
|
|
3093
3107
|
},
|
|
3094
3108
|
{
|
|
3095
|
-
helperText: "Stall Capacity
|
|
3109
|
+
helperText: "Stall Capacity *",
|
|
3096
3110
|
keyboardType: "number-pad",
|
|
3097
3111
|
name: "stallCapacity",
|
|
3098
3112
|
placeholder: "Stall Capacity"
|
|
3099
3113
|
},
|
|
3100
3114
|
{
|
|
3101
|
-
helperText: "Payment Due Hours
|
|
3115
|
+
helperText: "Payment Due Hours *",
|
|
3102
3116
|
keyboardType: "number-pad",
|
|
3103
3117
|
name: "paymentDueHours",
|
|
3104
|
-
placeholder: "Payment Due
|
|
3118
|
+
placeholder: "Payment Due (in hours)"
|
|
3119
|
+
},
|
|
3120
|
+
{
|
|
3121
|
+
helperText: "Pack In Time *",
|
|
3122
|
+
keyboardType: "number-pad",
|
|
3123
|
+
name: "packInTime",
|
|
3124
|
+
placeholder: "Pack In Time (in hours)"
|
|
3125
|
+
},
|
|
3126
|
+
{
|
|
3127
|
+
helperText: "Pack Out Time *",
|
|
3128
|
+
keyboardType: "number-pad",
|
|
3129
|
+
name: "packOutTime",
|
|
3130
|
+
placeholder: "Pack Out Time (in hours)"
|
|
3105
3131
|
}
|
|
3106
3132
|
];
|
|
3107
3133
|
var marketInfoPaymentTarget = [
|
|
@@ -3125,14 +3151,168 @@ var marketInfoPaymentTarget = [
|
|
|
3125
3151
|
var marketPriceByDateFields = [
|
|
3126
3152
|
{
|
|
3127
3153
|
helperText: "Market Price for this date *",
|
|
3128
|
-
keyboardType: "
|
|
3154
|
+
keyboardType: "decimal-pad",
|
|
3129
3155
|
name: "marketPrice",
|
|
3130
3156
|
placeholder: "Market Price"
|
|
3131
3157
|
}
|
|
3132
3158
|
];
|
|
3133
|
-
var
|
|
3134
|
-
|
|
3135
|
-
|
|
3159
|
+
var requirementsOptions = [
|
|
3160
|
+
{
|
|
3161
|
+
category: "Environment",
|
|
3162
|
+
label: "All packaging must be eco-friendly or recyclable where possible.",
|
|
3163
|
+
value: false
|
|
3164
|
+
},
|
|
3165
|
+
{
|
|
3166
|
+
category: "Environment",
|
|
3167
|
+
label: "No single-use plastic bags are to be handed out.",
|
|
3168
|
+
value: false
|
|
3169
|
+
},
|
|
3170
|
+
{
|
|
3171
|
+
category: "Environment",
|
|
3172
|
+
label: "Stall area must be left clean with no trace of activity after pack-down.",
|
|
3173
|
+
value: false
|
|
3174
|
+
},
|
|
3175
|
+
{
|
|
3176
|
+
category: "Environment",
|
|
3177
|
+
label: "No disposal of oils, fats, or chemicals in public drains or on grassed areas.",
|
|
3178
|
+
value: false
|
|
3179
|
+
},
|
|
3180
|
+
{
|
|
3181
|
+
category: "Environment",
|
|
3182
|
+
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.",
|
|
3183
|
+
value: false
|
|
3184
|
+
},
|
|
3185
|
+
{
|
|
3186
|
+
category: "Food Safety",
|
|
3187
|
+
label: "Food must be prepared and stored according to your food regulation.",
|
|
3188
|
+
value: false
|
|
3189
|
+
},
|
|
3190
|
+
{
|
|
3191
|
+
category: "Food Safety",
|
|
3192
|
+
label: "The stallholder must display a current food grade certificate.",
|
|
3193
|
+
value: false
|
|
3194
|
+
},
|
|
3195
|
+
{
|
|
3196
|
+
category: "Food Safety",
|
|
3197
|
+
label: "Only licensed food vendors may sell ready-to-eat food items.",
|
|
3198
|
+
value: false
|
|
3199
|
+
},
|
|
3200
|
+
{
|
|
3201
|
+
category: "Food Safety",
|
|
3202
|
+
label: "Handwashing facilities must be available at your stall if preparing food.",
|
|
3203
|
+
value: false
|
|
3204
|
+
},
|
|
3205
|
+
{
|
|
3206
|
+
category: "Food Safety",
|
|
3207
|
+
label: "You must have a food safety plan in place for your stall.",
|
|
3208
|
+
value: false
|
|
3209
|
+
},
|
|
3210
|
+
{
|
|
3211
|
+
category: "Food Safety",
|
|
3212
|
+
label: "Allergens must be clearly listed on packaged and unpackaged food items.",
|
|
3213
|
+
value: false
|
|
3214
|
+
},
|
|
3215
|
+
{
|
|
3216
|
+
category: "Legal & Safety",
|
|
3217
|
+
label: "All stallholders must comply with local council regulations.",
|
|
3218
|
+
value: false
|
|
3219
|
+
},
|
|
3220
|
+
{
|
|
3221
|
+
category: "Legal & Safety",
|
|
3222
|
+
label: "No unauthorised subletting of stall space to other vendors.",
|
|
3223
|
+
value: false
|
|
3224
|
+
},
|
|
3225
|
+
{
|
|
3226
|
+
category: "Legal & Safety",
|
|
3227
|
+
label: "Gas bottles and fuel containers must be secured and in good condition if applicable.",
|
|
3228
|
+
value: false
|
|
3229
|
+
},
|
|
3230
|
+
{
|
|
3231
|
+
category: "Legal & Safety",
|
|
3232
|
+
label: "Fire extinguishers must be available for stalls using cooking or heating equipment.",
|
|
3233
|
+
value: false
|
|
3234
|
+
},
|
|
3235
|
+
{
|
|
3236
|
+
category: "Legal & Safety",
|
|
3237
|
+
label: "Stallholders must not sell items that are illegal or prohibited by law.",
|
|
3238
|
+
value: false
|
|
3239
|
+
},
|
|
3240
|
+
{
|
|
3241
|
+
category: "Legal & Safety",
|
|
3242
|
+
label: "All electrical equipment must be tested and tagged.",
|
|
3243
|
+
value: false
|
|
3244
|
+
},
|
|
3245
|
+
{
|
|
3246
|
+
category: "Legal & Safety",
|
|
3247
|
+
label: "Noise levels must be kept to a minimum unless part of a permitted performance.",
|
|
3248
|
+
value: false
|
|
3249
|
+
},
|
|
3250
|
+
{
|
|
3251
|
+
category: "Legal & Safety",
|
|
3252
|
+
label: "Pets at the stall must be secured and well-behaved at all times.",
|
|
3253
|
+
value: false
|
|
3254
|
+
},
|
|
3255
|
+
{
|
|
3256
|
+
category: "Legal & Safety",
|
|
3257
|
+
label: "Cables must be secured and not create tripping hazards.",
|
|
3258
|
+
value: false
|
|
3259
|
+
},
|
|
3260
|
+
{
|
|
3261
|
+
category: "Legal & Safety",
|
|
3262
|
+
label: "Stalls must not obstruct emergency access routes.",
|
|
3263
|
+
value: false
|
|
3264
|
+
},
|
|
3265
|
+
{
|
|
3266
|
+
category: "Legal & Safety",
|
|
3267
|
+
label: "First aid kit must be available at the stall for minor injuries.",
|
|
3268
|
+
value: false
|
|
3269
|
+
},
|
|
3270
|
+
{
|
|
3271
|
+
category: "Legal & Safety",
|
|
3272
|
+
label: "Stallholders must hold valid liability insurance where required.",
|
|
3273
|
+
value: false
|
|
3274
|
+
},
|
|
3275
|
+
{
|
|
3276
|
+
category: "Legal & Safety",
|
|
3277
|
+
label: "You must secure your gazebo and equipment to withstand wind or bad weather.",
|
|
3278
|
+
value: false
|
|
3279
|
+
},
|
|
3280
|
+
{
|
|
3281
|
+
category: "Legal & Safety",
|
|
3282
|
+
label: "You are responsible for the safety of your setup and any potential hazards.",
|
|
3283
|
+
value: false
|
|
3284
|
+
},
|
|
3285
|
+
{
|
|
3286
|
+
category: "Operations",
|
|
3287
|
+
label: "Generators must be quiet and pre-approved by the event organiser.",
|
|
3288
|
+
value: false
|
|
3289
|
+
},
|
|
3290
|
+
{
|
|
3291
|
+
category: "Operations",
|
|
3292
|
+
label: "Only approved products or services may be sold \u2014 no last-minute changes.",
|
|
3293
|
+
value: false
|
|
3294
|
+
},
|
|
3295
|
+
{
|
|
3296
|
+
category: "Operations",
|
|
3297
|
+
label: "Stallholders must arrive and be fully set up by the designated opening time.",
|
|
3298
|
+
value: false
|
|
3299
|
+
},
|
|
3300
|
+
{
|
|
3301
|
+
category: "Operations",
|
|
3302
|
+
label: "You may not pack down your stall before the event officially ends.",
|
|
3303
|
+
value: false
|
|
3304
|
+
},
|
|
3305
|
+
{
|
|
3306
|
+
category: "Operations",
|
|
3307
|
+
label: "You must be self-sufficient in all operations.",
|
|
3308
|
+
value: false
|
|
3309
|
+
},
|
|
3310
|
+
{
|
|
3311
|
+
category: "Operations",
|
|
3312
|
+
label: "Stall layout must be kept within your allocated space.",
|
|
3313
|
+
value: false
|
|
3314
|
+
}
|
|
3315
|
+
];
|
|
3136
3316
|
|
|
3137
3317
|
// src/formFields/auth.ts
|
|
3138
3318
|
var loginFields = [
|
|
@@ -3600,7 +3780,6 @@ export {
|
|
|
3600
3780
|
EnumNotification,
|
|
3601
3781
|
EnumPaymentMethod,
|
|
3602
3782
|
EnumRegions,
|
|
3603
|
-
EnumRejectionPolicy,
|
|
3604
3783
|
EnumRelationResource,
|
|
3605
3784
|
EnumResourceType,
|
|
3606
3785
|
EnumResourceTypeIcon,
|
|
@@ -3635,14 +3814,15 @@ export {
|
|
|
3635
3814
|
marketInfoPaymentTarget,
|
|
3636
3815
|
marketPriceByDateFields,
|
|
3637
3816
|
marketStartDateFields,
|
|
3817
|
+
normalizeUrl,
|
|
3638
3818
|
packagingOptions,
|
|
3639
3819
|
paymentMethodOptions,
|
|
3640
3820
|
producedIngOptions,
|
|
3641
3821
|
profileFields,
|
|
3642
3822
|
registerFields,
|
|
3643
|
-
rejectionPolicyOptions,
|
|
3644
3823
|
removeTypename,
|
|
3645
3824
|
requestPasswordResetFields,
|
|
3825
|
+
requirementsOptions,
|
|
3646
3826
|
resetPasswordFields,
|
|
3647
3827
|
socialMediaFields,
|
|
3648
3828
|
sortDatesByProximity,
|