@timardex/cluemart-shared 1.0.11 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +40 -4
- package/dist/index.d.mts +19 -28
- package/dist/index.d.ts +19 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -69,6 +69,7 @@ __export(index_exports, {
|
|
|
69
69
|
mapArrayToOptions: () => mapArrayToOptions,
|
|
70
70
|
marketBasicInfoFields: () => marketBasicInfoFields,
|
|
71
71
|
marketEndDateFields: () => marketEndDateFields,
|
|
72
|
+
marketPriceByDateFields: () => marketPriceByDateFields,
|
|
72
73
|
marketSchema: () => marketSchema,
|
|
73
74
|
marketStartDateFields: () => marketStartDateFields,
|
|
74
75
|
packagingOptions: () => packagingOptions,
|
|
@@ -495,6 +496,14 @@ var startTimeCannotBeInPastTest = yup.string().test(
|
|
|
495
496
|
var dateTimeSchema = yup.object().shape({
|
|
496
497
|
endDate: yup.string().concat(endDateNotInPastTest).concat(endDateAfterStartDateTest).required("End date is required"),
|
|
497
498
|
endTime: yup.string().concat(endTimeMustBeAfterStartTimeTest).required("End time is required"),
|
|
499
|
+
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(
|
|
500
|
+
"no-leading-zeros",
|
|
501
|
+
"Market price must not have leading zeros",
|
|
502
|
+
(value, context) => {
|
|
503
|
+
const original = context.originalValue?.toString() ?? "";
|
|
504
|
+
return !/^0\d+(\.\d+)?$/.test(original);
|
|
505
|
+
}
|
|
506
|
+
),
|
|
498
507
|
startDate: yup.string().concat(startDateNotInPastTest).required("Start date is required"),
|
|
499
508
|
startTime: yup.string().concat(startTimeCannotBeInPastTest).required("Start time is required")
|
|
500
509
|
});
|
|
@@ -533,9 +542,23 @@ var marketSchema = globalResourceSchema.shape({
|
|
|
533
542
|
location: locationSchema,
|
|
534
543
|
provider: yup2.string().trim().min(3).required("Provider is required"),
|
|
535
544
|
stallApplicationInfo: yup2.object().shape({
|
|
536
|
-
applicationDeadlineHours: yup2.number().min(1).required("Application deadline hours is required")
|
|
545
|
+
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(
|
|
546
|
+
"no-leading-zeros",
|
|
547
|
+
"Application deadline hours must not start with leading zeros",
|
|
548
|
+
(value, context) => {
|
|
549
|
+
const original = context.originalValue?.toString() ?? "";
|
|
550
|
+
return !/^0\d+$/.test(original);
|
|
551
|
+
}
|
|
552
|
+
),
|
|
537
553
|
rejectionPolicy: yup2.mixed().oneOf(Object.values(EnumRejectionPolicy)).required("Rejection policy is required"),
|
|
538
|
-
stallCapacity: yup2.number().min(1).required("Stall capacity is required")
|
|
554
|
+
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(
|
|
555
|
+
"no-leading-zeros",
|
|
556
|
+
"Stall capacity must not have leading zeros",
|
|
557
|
+
(value, context) => {
|
|
558
|
+
const original = context.originalValue?.toString() ?? "";
|
|
559
|
+
return !/^0\d+$/.test(original);
|
|
560
|
+
}
|
|
561
|
+
)
|
|
539
562
|
}),
|
|
540
563
|
tags: yup2.array().of(yup2.string().defined()).nullable()
|
|
541
564
|
});
|
|
@@ -669,12 +692,14 @@ var defaultMarketFormValues = {
|
|
|
669
692
|
{
|
|
670
693
|
endDate: "04-05-2025",
|
|
671
694
|
endTime: "15:00",
|
|
695
|
+
marketPrice: 0,
|
|
672
696
|
startDate: "04-05-2025",
|
|
673
697
|
startTime: "09:00"
|
|
674
698
|
},
|
|
675
699
|
{
|
|
676
700
|
endDate: "05-05-2025",
|
|
677
701
|
endTime: "15:00",
|
|
702
|
+
marketPrice: 0,
|
|
678
703
|
startDate: "05-05-2025",
|
|
679
704
|
startTime: "09:00"
|
|
680
705
|
}
|
|
@@ -693,9 +718,9 @@ var defaultMarketFormValues = {
|
|
|
693
718
|
},
|
|
694
719
|
provider: "Provider name",
|
|
695
720
|
stallApplicationInfo: {
|
|
696
|
-
applicationDeadlineHours:
|
|
721
|
+
applicationDeadlineHours: 0,
|
|
697
722
|
rejectionPolicy: "multi_date_allowed" /* MULTI_DATE_ALLOWED */,
|
|
698
|
-
stallCapacity:
|
|
723
|
+
stallCapacity: 0
|
|
699
724
|
},
|
|
700
725
|
tags: null
|
|
701
726
|
};
|
|
@@ -1570,6 +1595,7 @@ var MARKET_DATETIME_FIELDS_FRAGMENT = import_client8.gql`
|
|
|
1570
1595
|
fragment MarketDateTimeFields on MarketDateTimeType {
|
|
1571
1596
|
endDate
|
|
1572
1597
|
endTime
|
|
1598
|
+
marketPrice
|
|
1573
1599
|
startDate
|
|
1574
1600
|
startTime
|
|
1575
1601
|
}
|
|
@@ -1993,6 +2019,7 @@ var RELATION_LOGS_FRAGMENT = import_client14.gql`
|
|
|
1993
2019
|
var RELATION_DATES_FRAGMENT = import_client14.gql`
|
|
1994
2020
|
fragment RelationDates on RelationDateType {
|
|
1995
2021
|
lastUpdateBy
|
|
2022
|
+
marketPrice
|
|
1996
2023
|
startDate
|
|
1997
2024
|
status
|
|
1998
2025
|
}
|
|
@@ -2924,6 +2951,14 @@ var marketStartDateFields = [
|
|
|
2924
2951
|
placeholder: "Start Time"
|
|
2925
2952
|
}
|
|
2926
2953
|
];
|
|
2954
|
+
var marketPriceByDateFields = [
|
|
2955
|
+
{
|
|
2956
|
+
helperText: "Market Price for this date *",
|
|
2957
|
+
keyboardType: "number-pad",
|
|
2958
|
+
name: "marketPrice",
|
|
2959
|
+
placeholder: "Market Price"
|
|
2960
|
+
}
|
|
2961
|
+
];
|
|
2927
2962
|
var marketEndDateFields = [
|
|
2928
2963
|
{
|
|
2929
2964
|
dateMode: "date",
|
|
@@ -3422,6 +3457,7 @@ var categoryColors = {
|
|
|
3422
3457
|
mapArrayToOptions,
|
|
3423
3458
|
marketBasicInfoFields,
|
|
3424
3459
|
marketEndDateFields,
|
|
3460
|
+
marketPriceByDateFields,
|
|
3425
3461
|
marketSchema,
|
|
3426
3462
|
marketStartDateFields,
|
|
3427
3463
|
packagingOptions,
|
package/dist/index.d.mts
CHANGED
|
@@ -186,6 +186,7 @@ type RelationLog = {
|
|
|
186
186
|
};
|
|
187
187
|
type RelationDate = {
|
|
188
188
|
lastUpdateBy: string;
|
|
189
|
+
marketPrice: number;
|
|
189
190
|
startDate: string;
|
|
190
191
|
status: EnumInviteStatus;
|
|
191
192
|
};
|
|
@@ -201,8 +202,11 @@ interface RelationType {
|
|
|
201
202
|
updatedAt?: string;
|
|
202
203
|
}
|
|
203
204
|
|
|
205
|
+
type DateTimeWithPrice = DateTimeType & {
|
|
206
|
+
marketPrice: number;
|
|
207
|
+
};
|
|
204
208
|
interface MarketFormData extends BaseResourceTypeFormData {
|
|
205
|
-
dateTime:
|
|
209
|
+
dateTime: DateTimeWithPrice[];
|
|
206
210
|
location: LocationType;
|
|
207
211
|
provider: string;
|
|
208
212
|
stallApplicationInfo: {
|
|
@@ -235,23 +239,9 @@ interface MarketWithConnectionDatesType extends MarketType {
|
|
|
235
239
|
}
|
|
236
240
|
|
|
237
241
|
type StallholderLocation = {
|
|
238
|
-
dateTime:
|
|
239
|
-
startDate?: string | null;
|
|
240
|
-
startTime?: string | null;
|
|
241
|
-
endDate?: string | null;
|
|
242
|
-
endTime?: string | null;
|
|
243
|
-
} | null;
|
|
242
|
+
dateTime: Nullable<DateTimeType> | null;
|
|
244
243
|
description?: string | null;
|
|
245
|
-
location:
|
|
246
|
-
city?: string | null;
|
|
247
|
-
coordinates?: number[] | null;
|
|
248
|
-
country?: string | null;
|
|
249
|
-
fullAddress?: string | null;
|
|
250
|
-
latitude?: number | null;
|
|
251
|
-
longitude?: number | null;
|
|
252
|
-
region?: string | null;
|
|
253
|
-
type?: "Point" | null;
|
|
254
|
-
} | null;
|
|
244
|
+
location: Nullable<LocationType> | null;
|
|
255
245
|
resourceId?: MapMultiLocation["resourceId"];
|
|
256
246
|
resourceName?: MapMultiLocation["resourceName"];
|
|
257
247
|
resourceType?: MapMultiLocation["resourceType"];
|
|
@@ -395,6 +385,9 @@ interface UserType {
|
|
|
395
385
|
updatedAt: string;
|
|
396
386
|
}
|
|
397
387
|
|
|
388
|
+
type Nullable<T> = {
|
|
389
|
+
[K in keyof T]: T[K] | null | undefined;
|
|
390
|
+
};
|
|
398
391
|
type ResourceImageType = {
|
|
399
392
|
source: string;
|
|
400
393
|
title: string;
|
|
@@ -516,13 +509,10 @@ type DateFormat = "date" | "time" | "datetime";
|
|
|
516
509
|
* @returns formatted string based on display option
|
|
517
510
|
*/
|
|
518
511
|
declare const formatDate: (dateStr: string, display?: DateFormat, timeStr?: string) => string;
|
|
519
|
-
declare const getCurrentAndFutureDates:
|
|
520
|
-
startDate: string;
|
|
521
|
-
startTime: string;
|
|
522
|
-
}[]) => {
|
|
512
|
+
declare const getCurrentAndFutureDates: <T extends {
|
|
523
513
|
startDate: string;
|
|
524
514
|
startTime: string;
|
|
525
|
-
}[];
|
|
515
|
+
}>(dates: T[]) => T[];
|
|
526
516
|
declare const getFutureDatesAfterThreshold: (dates: {
|
|
527
517
|
startDate: string;
|
|
528
518
|
startTime: string;
|
|
@@ -561,13 +551,10 @@ declare const statusOptions: {
|
|
|
561
551
|
* @param dates - The array of date strings to sort.
|
|
562
552
|
* @returns - The sorted array of date strings.
|
|
563
553
|
*/
|
|
564
|
-
declare function sortDatesByProximity
|
|
554
|
+
declare function sortDatesByProximity<T extends {
|
|
565
555
|
startDate: string;
|
|
566
556
|
startTime: string;
|
|
567
|
-
}[]):
|
|
568
|
-
startDate: string;
|
|
569
|
-
startTime: string;
|
|
570
|
-
}[];
|
|
557
|
+
}>(dates: T[]): T[];
|
|
571
558
|
declare const availableRegionTypes: EnumRegions[];
|
|
572
559
|
declare const availableRegionOptions: OptionItem[];
|
|
573
560
|
|
|
@@ -651,11 +638,13 @@ declare const startTimeCannotBeInPastTest: yup.StringSchema<string | undefined,
|
|
|
651
638
|
declare const dateTimeSchema: yup.ObjectSchema<{
|
|
652
639
|
endDate: string;
|
|
653
640
|
endTime: string;
|
|
641
|
+
marketPrice: number;
|
|
654
642
|
startDate: string;
|
|
655
643
|
startTime: string;
|
|
656
644
|
}, yup.AnyObject, {
|
|
657
645
|
endDate: undefined;
|
|
658
646
|
endTime: undefined;
|
|
647
|
+
marketPrice: undefined;
|
|
659
648
|
startDate: undefined;
|
|
660
649
|
startTime: undefined;
|
|
661
650
|
}, "">;
|
|
@@ -714,6 +703,7 @@ declare const marketSchema: yup.ObjectSchema<{
|
|
|
714
703
|
endTime: string;
|
|
715
704
|
startDate: string;
|
|
716
705
|
startTime: string;
|
|
706
|
+
marketPrice: number;
|
|
717
707
|
}[];
|
|
718
708
|
location: {
|
|
719
709
|
region: string;
|
|
@@ -1238,6 +1228,7 @@ declare const paymentMethodOptions: OptionItem[];
|
|
|
1238
1228
|
declare const marketBasicInfoFields: FormField[];
|
|
1239
1229
|
declare const stallApplicationInfo: FormField[];
|
|
1240
1230
|
declare const marketStartDateFields: FormDateField[];
|
|
1231
|
+
declare const marketPriceByDateFields: FormField[];
|
|
1241
1232
|
declare const marketEndDateFields: FormDateField[];
|
|
1242
1233
|
declare const availableTagTypes: string[];
|
|
1243
1234
|
declare const tagOptions: OptionItem[];
|
|
@@ -1254,4 +1245,4 @@ declare const profileFields: FormField[];
|
|
|
1254
1245
|
declare const availableCategories: Category[];
|
|
1255
1246
|
declare const categoryColors: Record<string, string>;
|
|
1256
1247
|
|
|
1257
|
-
export { type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatInput, type ChatMessageInput, type ChatMessageType, type ChatType, type CreateLoginFormData, type CreateMarketFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateStallholderApplyFormFormData, type CreateStallholderFormData, type CreateUserFormData, type CreateValidateTokenFormData, type DateTimeType, EnumInviteStatus, EnumNotification, EnumRegions, EnumRejectionPolicy, EnumRelationResource, EnumResourceType, EnumResourceTypeIcon, EnumUserLicence, EnumUserRole, type FormDateField, type FormField, type GeocodeLocation, type ImageObjectType, ImageTypeEnum, type LocationType, type LoginFormData, type MapMultiLocation, type MarketFormData, type MarketType, type MarketWithConnectionDatesType, type NotificationType, type OptionItem, type PlacePrediction, type Region, type RegisterFormData, type RelationDate, type RelationLog, type RelationType, type RequestPasswordResetFormData, type ResetPasswordFormData, type ResourceConnectionsType, type ResourceImageType, type SatllholderWithConnectionDatesType, 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, dateTimeSchema, defaultMarketFormValues, defaultRegion, defaultStallholderApplyFormValues, defaultStallholderFormValues, emailSchema, endDateAfterStartDateTest, endDateNotInPastTest, endTimeMustBeAfterStartTimeTest, formatDate, formatTimestamp, getCurrentAndFutureDates, getFutureDatesAfterThreshold, globalDefaultValues, globalResourceSchema, locationSchema, loginFields, loginSchema, mapArrayToOptions, marketBasicInfoFields, marketEndDateFields, marketSchema, marketStartDateFields, packagingOptions, passwordSchema, paymentMethodOptions, producedIngOptions, profileFields, registerFields, registerSchema, rejectionPolicyOptions, removeTypename, requestPasswordResetFields, requestPasswordResetSchema, resetPasswordFields, resetPasswordSchema, sortDatesByProximity, stallApplicationInfo, stallHolderSchema, stallholderApplyFormSchema, stallholderBasicInfoFields, stallholderElectricity, stallholderEndDateFields, stallholderFullAddress, stallholderGazebo, stallholderLocationDescription, stallholderMultiLocation, stallholderPackaging, stallholderPaymentMethod, stallholderPriceRange, stallholderProducedIn, stallholderStallSize, stallholderStartDateFields, stallholderTable, startDateNotInPastTest, startTimeCannotBeInPastTest, statusOptions, tagOptions, timeFormat, truncateText, useAddParticipantToChat, useAddUserFavouriteResource, useCreateChat, useCreateMarket, useCreateRelation, useCreateStallholder, useCreateStallholderApplyForm, useCreateUser, useDeleteChat, useDeleteMarket, useDeleteRelation, useDeleteStallholder, useGetChat, useGetChatSubscription, useGetMarket, useGetMarketRelations, useGetMarkets, useGetMarketsByRegion, useGetMarketsNearMe, useGetNotification, useGetRelation, useGetRelationByMarketAndStallholder, useGetResourceConnections, useGetStallholder, useGetStallholderApplyForm, useGetStallholderRelations, useGetStallholders, useGetStallholdersByRegion, useGetUser, useGetUserChats, useGetUserFavourites, useGetUserMarkets, useGetUserNotifications, useGetUsers, useLocationSearch, useLogin, useLoginForm, useMarketForm, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSearchMarkets, useSearchStallholders, useSendChatMessage, useStallholderApplyForm, useStallholderForm, useUpdateMarket, useUpdateRelation, useUpdateStallholder, useUpdateStallholderApplyForm, useUpdateUser, useUserForm, useValidateToken, useValidateTokenForm, userSchema, validateTokenFields, validateTokenSchema };
|
|
1248
|
+
export { type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatInput, type ChatMessageInput, type ChatMessageType, type ChatType, type CreateLoginFormData, type CreateMarketFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateStallholderApplyFormFormData, type CreateStallholderFormData, type CreateUserFormData, type CreateValidateTokenFormData, type DateTimeType, type DateTimeWithPrice, EnumInviteStatus, EnumNotification, EnumRegions, EnumRejectionPolicy, EnumRelationResource, EnumResourceType, EnumResourceTypeIcon, EnumUserLicence, EnumUserRole, type FormDateField, type FormField, type GeocodeLocation, type ImageObjectType, ImageTypeEnum, type LocationType, type LoginFormData, type MapMultiLocation, type MarketFormData, type MarketType, type MarketWithConnectionDatesType, type NotificationType, type Nullable, type OptionItem, type PlacePrediction, type Region, type RegisterFormData, type RelationDate, type RelationLog, type RelationType, type RequestPasswordResetFormData, type ResetPasswordFormData, type ResourceConnectionsType, type ResourceImageType, type SatllholderWithConnectionDatesType, 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, dateTimeSchema, defaultMarketFormValues, defaultRegion, defaultStallholderApplyFormValues, defaultStallholderFormValues, emailSchema, endDateAfterStartDateTest, endDateNotInPastTest, endTimeMustBeAfterStartTimeTest, formatDate, formatTimestamp, getCurrentAndFutureDates, getFutureDatesAfterThreshold, globalDefaultValues, globalResourceSchema, locationSchema, loginFields, loginSchema, mapArrayToOptions, marketBasicInfoFields, marketEndDateFields, marketPriceByDateFields, marketSchema, marketStartDateFields, packagingOptions, passwordSchema, paymentMethodOptions, producedIngOptions, profileFields, registerFields, registerSchema, rejectionPolicyOptions, removeTypename, requestPasswordResetFields, requestPasswordResetSchema, resetPasswordFields, resetPasswordSchema, sortDatesByProximity, stallApplicationInfo, stallHolderSchema, stallholderApplyFormSchema, stallholderBasicInfoFields, stallholderElectricity, stallholderEndDateFields, stallholderFullAddress, stallholderGazebo, stallholderLocationDescription, stallholderMultiLocation, stallholderPackaging, stallholderPaymentMethod, stallholderPriceRange, stallholderProducedIn, stallholderStallSize, stallholderStartDateFields, stallholderTable, startDateNotInPastTest, startTimeCannotBeInPastTest, statusOptions, tagOptions, timeFormat, truncateText, useAddParticipantToChat, useAddUserFavouriteResource, useCreateChat, useCreateMarket, useCreateRelation, useCreateStallholder, useCreateStallholderApplyForm, useCreateUser, useDeleteChat, useDeleteMarket, useDeleteRelation, useDeleteStallholder, useGetChat, useGetChatSubscription, useGetMarket, useGetMarketRelations, useGetMarkets, useGetMarketsByRegion, useGetMarketsNearMe, useGetNotification, useGetRelation, useGetRelationByMarketAndStallholder, useGetResourceConnections, useGetStallholder, useGetStallholderApplyForm, useGetStallholderRelations, useGetStallholders, useGetStallholdersByRegion, useGetUser, useGetUserChats, useGetUserFavourites, useGetUserMarkets, useGetUserNotifications, useGetUsers, useLocationSearch, useLogin, useLoginForm, useMarketForm, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSearchMarkets, useSearchStallholders, useSendChatMessage, useStallholderApplyForm, useStallholderForm, useUpdateMarket, useUpdateRelation, useUpdateStallholder, useUpdateStallholderApplyForm, useUpdateUser, useUserForm, useValidateToken, useValidateTokenForm, userSchema, validateTokenFields, validateTokenSchema };
|
package/dist/index.d.ts
CHANGED
|
@@ -186,6 +186,7 @@ type RelationLog = {
|
|
|
186
186
|
};
|
|
187
187
|
type RelationDate = {
|
|
188
188
|
lastUpdateBy: string;
|
|
189
|
+
marketPrice: number;
|
|
189
190
|
startDate: string;
|
|
190
191
|
status: EnumInviteStatus;
|
|
191
192
|
};
|
|
@@ -201,8 +202,11 @@ interface RelationType {
|
|
|
201
202
|
updatedAt?: string;
|
|
202
203
|
}
|
|
203
204
|
|
|
205
|
+
type DateTimeWithPrice = DateTimeType & {
|
|
206
|
+
marketPrice: number;
|
|
207
|
+
};
|
|
204
208
|
interface MarketFormData extends BaseResourceTypeFormData {
|
|
205
|
-
dateTime:
|
|
209
|
+
dateTime: DateTimeWithPrice[];
|
|
206
210
|
location: LocationType;
|
|
207
211
|
provider: string;
|
|
208
212
|
stallApplicationInfo: {
|
|
@@ -235,23 +239,9 @@ interface MarketWithConnectionDatesType extends MarketType {
|
|
|
235
239
|
}
|
|
236
240
|
|
|
237
241
|
type StallholderLocation = {
|
|
238
|
-
dateTime:
|
|
239
|
-
startDate?: string | null;
|
|
240
|
-
startTime?: string | null;
|
|
241
|
-
endDate?: string | null;
|
|
242
|
-
endTime?: string | null;
|
|
243
|
-
} | null;
|
|
242
|
+
dateTime: Nullable<DateTimeType> | null;
|
|
244
243
|
description?: string | null;
|
|
245
|
-
location:
|
|
246
|
-
city?: string | null;
|
|
247
|
-
coordinates?: number[] | null;
|
|
248
|
-
country?: string | null;
|
|
249
|
-
fullAddress?: string | null;
|
|
250
|
-
latitude?: number | null;
|
|
251
|
-
longitude?: number | null;
|
|
252
|
-
region?: string | null;
|
|
253
|
-
type?: "Point" | null;
|
|
254
|
-
} | null;
|
|
244
|
+
location: Nullable<LocationType> | null;
|
|
255
245
|
resourceId?: MapMultiLocation["resourceId"];
|
|
256
246
|
resourceName?: MapMultiLocation["resourceName"];
|
|
257
247
|
resourceType?: MapMultiLocation["resourceType"];
|
|
@@ -395,6 +385,9 @@ interface UserType {
|
|
|
395
385
|
updatedAt: string;
|
|
396
386
|
}
|
|
397
387
|
|
|
388
|
+
type Nullable<T> = {
|
|
389
|
+
[K in keyof T]: T[K] | null | undefined;
|
|
390
|
+
};
|
|
398
391
|
type ResourceImageType = {
|
|
399
392
|
source: string;
|
|
400
393
|
title: string;
|
|
@@ -516,13 +509,10 @@ type DateFormat = "date" | "time" | "datetime";
|
|
|
516
509
|
* @returns formatted string based on display option
|
|
517
510
|
*/
|
|
518
511
|
declare const formatDate: (dateStr: string, display?: DateFormat, timeStr?: string) => string;
|
|
519
|
-
declare const getCurrentAndFutureDates:
|
|
520
|
-
startDate: string;
|
|
521
|
-
startTime: string;
|
|
522
|
-
}[]) => {
|
|
512
|
+
declare const getCurrentAndFutureDates: <T extends {
|
|
523
513
|
startDate: string;
|
|
524
514
|
startTime: string;
|
|
525
|
-
}[];
|
|
515
|
+
}>(dates: T[]) => T[];
|
|
526
516
|
declare const getFutureDatesAfterThreshold: (dates: {
|
|
527
517
|
startDate: string;
|
|
528
518
|
startTime: string;
|
|
@@ -561,13 +551,10 @@ declare const statusOptions: {
|
|
|
561
551
|
* @param dates - The array of date strings to sort.
|
|
562
552
|
* @returns - The sorted array of date strings.
|
|
563
553
|
*/
|
|
564
|
-
declare function sortDatesByProximity
|
|
554
|
+
declare function sortDatesByProximity<T extends {
|
|
565
555
|
startDate: string;
|
|
566
556
|
startTime: string;
|
|
567
|
-
}[]):
|
|
568
|
-
startDate: string;
|
|
569
|
-
startTime: string;
|
|
570
|
-
}[];
|
|
557
|
+
}>(dates: T[]): T[];
|
|
571
558
|
declare const availableRegionTypes: EnumRegions[];
|
|
572
559
|
declare const availableRegionOptions: OptionItem[];
|
|
573
560
|
|
|
@@ -651,11 +638,13 @@ declare const startTimeCannotBeInPastTest: yup.StringSchema<string | undefined,
|
|
|
651
638
|
declare const dateTimeSchema: yup.ObjectSchema<{
|
|
652
639
|
endDate: string;
|
|
653
640
|
endTime: string;
|
|
641
|
+
marketPrice: number;
|
|
654
642
|
startDate: string;
|
|
655
643
|
startTime: string;
|
|
656
644
|
}, yup.AnyObject, {
|
|
657
645
|
endDate: undefined;
|
|
658
646
|
endTime: undefined;
|
|
647
|
+
marketPrice: undefined;
|
|
659
648
|
startDate: undefined;
|
|
660
649
|
startTime: undefined;
|
|
661
650
|
}, "">;
|
|
@@ -714,6 +703,7 @@ declare const marketSchema: yup.ObjectSchema<{
|
|
|
714
703
|
endTime: string;
|
|
715
704
|
startDate: string;
|
|
716
705
|
startTime: string;
|
|
706
|
+
marketPrice: number;
|
|
717
707
|
}[];
|
|
718
708
|
location: {
|
|
719
709
|
region: string;
|
|
@@ -1238,6 +1228,7 @@ declare const paymentMethodOptions: OptionItem[];
|
|
|
1238
1228
|
declare const marketBasicInfoFields: FormField[];
|
|
1239
1229
|
declare const stallApplicationInfo: FormField[];
|
|
1240
1230
|
declare const marketStartDateFields: FormDateField[];
|
|
1231
|
+
declare const marketPriceByDateFields: FormField[];
|
|
1241
1232
|
declare const marketEndDateFields: FormDateField[];
|
|
1242
1233
|
declare const availableTagTypes: string[];
|
|
1243
1234
|
declare const tagOptions: OptionItem[];
|
|
@@ -1254,4 +1245,4 @@ declare const profileFields: FormField[];
|
|
|
1254
1245
|
declare const availableCategories: Category[];
|
|
1255
1246
|
declare const categoryColors: Record<string, string>;
|
|
1256
1247
|
|
|
1257
|
-
export { type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatInput, type ChatMessageInput, type ChatMessageType, type ChatType, type CreateLoginFormData, type CreateMarketFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateStallholderApplyFormFormData, type CreateStallholderFormData, type CreateUserFormData, type CreateValidateTokenFormData, type DateTimeType, EnumInviteStatus, EnumNotification, EnumRegions, EnumRejectionPolicy, EnumRelationResource, EnumResourceType, EnumResourceTypeIcon, EnumUserLicence, EnumUserRole, type FormDateField, type FormField, type GeocodeLocation, type ImageObjectType, ImageTypeEnum, type LocationType, type LoginFormData, type MapMultiLocation, type MarketFormData, type MarketType, type MarketWithConnectionDatesType, type NotificationType, type OptionItem, type PlacePrediction, type Region, type RegisterFormData, type RelationDate, type RelationLog, type RelationType, type RequestPasswordResetFormData, type ResetPasswordFormData, type ResourceConnectionsType, type ResourceImageType, type SatllholderWithConnectionDatesType, 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, dateTimeSchema, defaultMarketFormValues, defaultRegion, defaultStallholderApplyFormValues, defaultStallholderFormValues, emailSchema, endDateAfterStartDateTest, endDateNotInPastTest, endTimeMustBeAfterStartTimeTest, formatDate, formatTimestamp, getCurrentAndFutureDates, getFutureDatesAfterThreshold, globalDefaultValues, globalResourceSchema, locationSchema, loginFields, loginSchema, mapArrayToOptions, marketBasicInfoFields, marketEndDateFields, marketSchema, marketStartDateFields, packagingOptions, passwordSchema, paymentMethodOptions, producedIngOptions, profileFields, registerFields, registerSchema, rejectionPolicyOptions, removeTypename, requestPasswordResetFields, requestPasswordResetSchema, resetPasswordFields, resetPasswordSchema, sortDatesByProximity, stallApplicationInfo, stallHolderSchema, stallholderApplyFormSchema, stallholderBasicInfoFields, stallholderElectricity, stallholderEndDateFields, stallholderFullAddress, stallholderGazebo, stallholderLocationDescription, stallholderMultiLocation, stallholderPackaging, stallholderPaymentMethod, stallholderPriceRange, stallholderProducedIn, stallholderStallSize, stallholderStartDateFields, stallholderTable, startDateNotInPastTest, startTimeCannotBeInPastTest, statusOptions, tagOptions, timeFormat, truncateText, useAddParticipantToChat, useAddUserFavouriteResource, useCreateChat, useCreateMarket, useCreateRelation, useCreateStallholder, useCreateStallholderApplyForm, useCreateUser, useDeleteChat, useDeleteMarket, useDeleteRelation, useDeleteStallholder, useGetChat, useGetChatSubscription, useGetMarket, useGetMarketRelations, useGetMarkets, useGetMarketsByRegion, useGetMarketsNearMe, useGetNotification, useGetRelation, useGetRelationByMarketAndStallholder, useGetResourceConnections, useGetStallholder, useGetStallholderApplyForm, useGetStallholderRelations, useGetStallholders, useGetStallholdersByRegion, useGetUser, useGetUserChats, useGetUserFavourites, useGetUserMarkets, useGetUserNotifications, useGetUsers, useLocationSearch, useLogin, useLoginForm, useMarketForm, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSearchMarkets, useSearchStallholders, useSendChatMessage, useStallholderApplyForm, useStallholderForm, useUpdateMarket, useUpdateRelation, useUpdateStallholder, useUpdateStallholderApplyForm, useUpdateUser, useUserForm, useValidateToken, useValidateTokenForm, userSchema, validateTokenFields, validateTokenSchema };
|
|
1248
|
+
export { type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatInput, type ChatMessageInput, type ChatMessageType, type ChatType, type CreateLoginFormData, type CreateMarketFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateStallholderApplyFormFormData, type CreateStallholderFormData, type CreateUserFormData, type CreateValidateTokenFormData, type DateTimeType, type DateTimeWithPrice, EnumInviteStatus, EnumNotification, EnumRegions, EnumRejectionPolicy, EnumRelationResource, EnumResourceType, EnumResourceTypeIcon, EnumUserLicence, EnumUserRole, type FormDateField, type FormField, type GeocodeLocation, type ImageObjectType, ImageTypeEnum, type LocationType, type LoginFormData, type MapMultiLocation, type MarketFormData, type MarketType, type MarketWithConnectionDatesType, type NotificationType, type Nullable, type OptionItem, type PlacePrediction, type Region, type RegisterFormData, type RelationDate, type RelationLog, type RelationType, type RequestPasswordResetFormData, type ResetPasswordFormData, type ResourceConnectionsType, type ResourceImageType, type SatllholderWithConnectionDatesType, 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, dateTimeSchema, defaultMarketFormValues, defaultRegion, defaultStallholderApplyFormValues, defaultStallholderFormValues, emailSchema, endDateAfterStartDateTest, endDateNotInPastTest, endTimeMustBeAfterStartTimeTest, formatDate, formatTimestamp, getCurrentAndFutureDates, getFutureDatesAfterThreshold, globalDefaultValues, globalResourceSchema, locationSchema, loginFields, loginSchema, mapArrayToOptions, marketBasicInfoFields, marketEndDateFields, marketPriceByDateFields, marketSchema, marketStartDateFields, packagingOptions, passwordSchema, paymentMethodOptions, producedIngOptions, profileFields, registerFields, registerSchema, rejectionPolicyOptions, removeTypename, requestPasswordResetFields, requestPasswordResetSchema, resetPasswordFields, resetPasswordSchema, sortDatesByProximity, stallApplicationInfo, stallHolderSchema, stallholderApplyFormSchema, stallholderBasicInfoFields, stallholderElectricity, stallholderEndDateFields, stallholderFullAddress, stallholderGazebo, stallholderLocationDescription, stallholderMultiLocation, stallholderPackaging, stallholderPaymentMethod, stallholderPriceRange, stallholderProducedIn, stallholderStallSize, stallholderStartDateFields, stallholderTable, startDateNotInPastTest, startTimeCannotBeInPastTest, statusOptions, tagOptions, timeFormat, truncateText, useAddParticipantToChat, useAddUserFavouriteResource, useCreateChat, useCreateMarket, useCreateRelation, useCreateStallholder, useCreateStallholderApplyForm, useCreateUser, useDeleteChat, useDeleteMarket, useDeleteRelation, useDeleteStallholder, useGetChat, useGetChatSubscription, useGetMarket, useGetMarketRelations, useGetMarkets, useGetMarketsByRegion, useGetMarketsNearMe, useGetNotification, useGetRelation, useGetRelationByMarketAndStallholder, useGetResourceConnections, useGetStallholder, useGetStallholderApplyForm, useGetStallholderRelations, useGetStallholders, useGetStallholdersByRegion, useGetUser, useGetUserChats, useGetUserFavourites, useGetUserMarkets, useGetUserNotifications, useGetUsers, useLocationSearch, useLogin, useLoginForm, useMarketForm, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSearchMarkets, useSearchStallholders, useSendChatMessage, useStallholderApplyForm, useStallholderForm, useUpdateMarket, useUpdateRelation, useUpdateStallholder, useUpdateStallholderApplyForm, useUpdateUser, useUserForm, useValidateToken, useValidateTokenForm, userSchema, validateTokenFields, validateTokenSchema };
|