@timardex/cluemart-shared 1.0.16 → 1.0.17

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.
Files changed (35) hide show
  1. package/dist/{auth-CdcH8nqw.d.mts → auth-CAeHx-BM.d.mts} +1 -1
  2. package/dist/{auth-TM_XttY3.d.ts → auth-gmfsaSPo.d.ts} +1 -1
  3. package/dist/{chat-NGx5Emrr.d.mts → chat-BUVCf9Tu.d.mts} +1 -1
  4. package/dist/{chat-NGx5Emrr.d.ts → chat-BUVCf9Tu.d.ts} +1 -1
  5. package/dist/formFields/index.cjs +49 -47
  6. package/dist/formFields/index.cjs.map +1 -1
  7. package/dist/formFields/index.d.mts +5 -4
  8. package/dist/formFields/index.d.ts +5 -4
  9. package/dist/formFields/index.mjs +49 -47
  10. package/dist/formFields/index.mjs.map +1 -1
  11. package/dist/{global-B8kYikwQ.d.mts → global-B6OE9jjE.d.mts} +20 -9
  12. package/dist/{global-B7gB8cvC.d.ts → global-Diphaotm.d.ts} +20 -9
  13. package/dist/graphql/index.cjs +94 -16
  14. package/dist/graphql/index.cjs.map +1 -1
  15. package/dist/graphql/index.d.mts +19 -3
  16. package/dist/graphql/index.d.ts +19 -3
  17. package/dist/graphql/index.mjs +91 -16
  18. package/dist/graphql/index.mjs.map +1 -1
  19. package/dist/hooks/index.cjs +159 -82
  20. package/dist/hooks/index.cjs.map +1 -1
  21. package/dist/hooks/index.d.mts +12 -3
  22. package/dist/hooks/index.d.ts +12 -3
  23. package/dist/hooks/index.mjs +157 -82
  24. package/dist/hooks/index.mjs.map +1 -1
  25. package/dist/index.cjs +302 -145
  26. package/dist/index.cjs.map +1 -1
  27. package/dist/index.d.mts +48 -11
  28. package/dist/index.d.ts +48 -11
  29. package/dist/index.mjs +297 -145
  30. package/dist/index.mjs.map +1 -1
  31. package/dist/types/index.d.mts +3 -3
  32. package/dist/types/index.d.ts +3 -3
  33. package/dist/utils/index.d.mts +1 -1
  34. package/dist/utils/index.d.ts +1 -1
  35. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -50,6 +50,7 @@ __export(index_exports, {
50
50
  categoryColors: () => categoryColors,
51
51
  dateFormat: () => dateFormat,
52
52
  defaultMarketFormValues: () => defaultMarketFormValues,
53
+ defaultMarketInfoFormValues: () => defaultMarketInfoFormValues,
53
54
  defaultRegion: () => defaultRegion,
54
55
  defaultStallholderApplyFormValues: () => defaultStallholderApplyFormValues,
55
56
  defaultStallholderFormValues: () => defaultStallholderFormValues,
@@ -98,6 +99,7 @@ __export(index_exports, {
98
99
  useAddUserFavouriteResource: () => useAddUserFavouriteResource,
99
100
  useCreateChat: () => useCreateChat,
100
101
  useCreateMarket: () => useCreateMarket,
102
+ useCreateMarketInfo: () => useCreateMarketInfo,
101
103
  useCreatePoster: () => useCreatePoster,
102
104
  useCreateRelation: () => useCreateRelation,
103
105
  useCreateStallholder: () => useCreateStallholder,
@@ -110,6 +112,7 @@ __export(index_exports, {
110
112
  useGetChat: () => useGetChat,
111
113
  useGetChatSubscription: () => useGetChatSubscription,
112
114
  useGetMarket: () => useGetMarket,
115
+ useGetMarketInfo: () => useGetMarketInfo,
113
116
  useGetMarketRelations: () => useGetMarketRelations,
114
117
  useGetMarkets: () => useGetMarkets,
115
118
  useGetMarketsByRegion: () => useGetMarketsByRegion,
@@ -133,6 +136,7 @@ __export(index_exports, {
133
136
  useLogin: () => useLogin,
134
137
  useLoginForm: () => useLoginForm,
135
138
  useMarketForm: () => useMarketForm,
139
+ useMarketInfoForm: () => useMarketInfoForm,
136
140
  useRegister: () => useRegister,
137
141
  useRegisterForm: () => useRegisterForm,
138
142
  useRemoveParticipantFromChat: () => useRemoveParticipantFromChat,
@@ -147,6 +151,7 @@ __export(index_exports, {
147
151
  useStallholderApplyForm: () => useStallholderApplyForm,
148
152
  useStallholderForm: () => useStallholderForm,
149
153
  useUpdateMarket: () => useUpdateMarket,
154
+ useUpdateMarketInfo: () => useUpdateMarketInfo,
150
155
  useUpdateRelation: () => useUpdateRelation,
151
156
  useUpdateStallholder: () => useUpdateStallholder,
152
157
  useUpdateStallholderApplyForm: () => useUpdateStallholderApplyForm,
@@ -507,13 +512,15 @@ var startTimeCannotBeInPastTest = yup.string().test(
507
512
  var dateTimeSchema = yup.object().shape({
508
513
  endDate: yup.string().concat(endDateNotInPastTest).concat(endDateAfterStartDateTest).required("End date is required"),
509
514
  endTime: yup.string().concat(endTimeMustBeAfterStartTimeTest).required("End time is required"),
515
+ startDate: yup.string().concat(startDateNotInPastTest).required("Start date is required"),
516
+ startTime: yup.string().concat(startTimeCannotBeInPastTest).required("Start time is required")
517
+ });
518
+ var dateTimeWithPriceSchema = dateTimeSchema.shape({
510
519
  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(
511
520
  "no-leading-zeros",
512
521
  "",
513
522
  noLeadingZeros("Market price", { allowDecimal: true })
514
- ),
515
- startDate: yup.string().concat(startDateNotInPastTest).required("Start date is required"),
516
- startTime: yup.string().concat(startTimeCannotBeInPastTest).required("Start time is required")
523
+ )
517
524
  });
518
525
  var locationSchema = yup.object().shape({
519
526
  city: yup.string().required("City is required"),
@@ -550,46 +557,43 @@ var marketSchema = globalResourceSchema.shape({
550
557
  dateTime: yup2.array().of(dateTimeSchema).required("DateTime is required"),
551
558
  location: locationSchema,
552
559
  provider: yup2.string().trim().min(3).required("Provider is required"),
553
- stallApplicationInfo: yup2.object().shape({
554
- 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(
555
- "no-leading-zeros",
556
- "",
557
- noLeadingZeros("Application deadline hours")
558
- ),
559
- 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")),
560
- paymentMethod: yup2.mixed().oneOf(Object.values(EnumPaymentMethod)).required("Please select a Payment method"),
561
- paymentTarget: yup2.object().when("paymentMethod", (paymentMethod, schema) => {
562
- const isBankTransfer = paymentMethod.includes(
563
- "bank_transfer" /* BANK_TRANSFER */
564
- );
565
- if (!isBankTransfer) {
566
- return schema.shape({
567
- accountHolderName: yup2.string().notRequired(),
568
- accountNumber: yup2.string().notRequired(),
569
- link: yup2.string().trim().required("Link is required for PayPal/Stripe")
570
- });
571
- } else if (isBankTransfer) {
572
- return schema.shape({
573
- accountHolderName: yup2.string().trim().required("Account holder name is required for bank transfer"),
574
- accountNumber: yup2.string().trim().required("Account number is required for bank transfer").matches(
575
- nzBankAccountRegex,
576
- "Account number must be in format: XX-XXXX-XXXXXXX-XX"
577
- ),
578
- link: yup2.string().notRequired()
579
- });
580
- } else {
581
- return schema.shape({
582
- accountHolderName: yup2.string().notRequired(),
583
- accountNumber: yup2.string().notRequired(),
584
- link: yup2.string().notRequired()
585
- });
586
- }
587
- }),
588
- rejectionPolicy: yup2.mixed().oneOf(Object.values(EnumRejectionPolicy)).required("Rejection policy is required"),
589
- 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"))
590
- }),
591
560
  tags: yup2.array().of(yup2.string().defined()).nullable()
592
561
  });
562
+ var marketInfoSchema = yup2.object().shape({
563
+ 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")),
564
+ dateTime: yup2.array().of(dateTimeWithPriceSchema).required("DateTime is required"),
565
+ 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")),
566
+ paymentMethod: yup2.mixed().oneOf(Object.values(EnumPaymentMethod)).required("Please select a Payment method"),
567
+ paymentTarget: yup2.object().when("paymentMethod", (paymentMethod, schema) => {
568
+ const isBankTransfer = paymentMethod.includes(
569
+ "bank_transfer" /* BANK_TRANSFER */
570
+ );
571
+ if (!isBankTransfer) {
572
+ return schema.shape({
573
+ accountHolderName: yup2.string().notRequired(),
574
+ accountNumber: yup2.string().notRequired(),
575
+ link: yup2.string().trim().required("Link is required for PayPal/Stripe")
576
+ });
577
+ } else if (isBankTransfer) {
578
+ return schema.shape({
579
+ accountHolderName: yup2.string().trim().required("Account holder name is required for bank transfer"),
580
+ accountNumber: yup2.string().trim().required("Account number is required for bank transfer").matches(
581
+ nzBankAccountRegex,
582
+ "Account number must be in format: XX-XXXX-XXXXXXX-XX"
583
+ ),
584
+ link: yup2.string().notRequired()
585
+ });
586
+ } else {
587
+ return schema.shape({
588
+ accountHolderName: yup2.string().notRequired(),
589
+ accountNumber: yup2.string().notRequired(),
590
+ link: yup2.string().notRequired()
591
+ });
592
+ }
593
+ }),
594
+ rejectionPolicy: yup2.mixed().oneOf(Object.values(EnumRejectionPolicy)).required("Rejection policy is required"),
595
+ 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"))
596
+ });
593
597
 
594
598
  // src/yupSchema/stallholder.ts
595
599
  var yup3 = __toESM(require("yup"));
@@ -720,14 +724,12 @@ var defaultMarketFormValues = {
720
724
  {
721
725
  endDate: "04-05-2025",
722
726
  endTime: "15:00",
723
- marketPrice: 0,
724
727
  startDate: "04-05-2025",
725
728
  startTime: "09:00"
726
729
  },
727
730
  {
728
731
  endDate: "05-05-2025",
729
732
  endTime: "15:00",
730
- marketPrice: 0,
731
733
  startDate: "05-05-2025",
732
734
  startTime: "09:00"
733
735
  }
@@ -745,19 +747,35 @@ var defaultMarketFormValues = {
745
747
  // Default type for GeoJSON
746
748
  },
747
749
  provider: "Provider name",
748
- stallApplicationInfo: {
749
- applicationDeadlineHours: 0,
750
- paymentDueHours: 0,
751
- paymentMethod: "",
752
- paymentTarget: {
753
- accountHolderName: "",
754
- accountNumber: "",
755
- link: ""
750
+ tags: null
751
+ };
752
+ var defaultMarketInfoFormValues = {
753
+ applicationDeadlineHours: 0,
754
+ dateTime: [
755
+ {
756
+ endDate: "04-05-2025",
757
+ endTime: "15:00",
758
+ marketPrice: 0,
759
+ startDate: "04-05-2025",
760
+ startTime: "09:00"
756
761
  },
757
- rejectionPolicy: "multi_date_allowed" /* MULTI_DATE_ALLOWED */,
758
- stallCapacity: 0
762
+ {
763
+ endDate: "05-05-2025",
764
+ endTime: "15:00",
765
+ marketPrice: 0,
766
+ startDate: "05-05-2025",
767
+ startTime: "09:00"
768
+ }
769
+ ],
770
+ paymentDueHours: 0,
771
+ paymentMethod: "",
772
+ paymentTarget: {
773
+ accountHolderName: "",
774
+ accountNumber: "",
775
+ link: ""
759
776
  },
760
- tags: null
777
+ rejectionPolicy: "multi_date_allowed" /* MULTI_DATE_ALLOWED */,
778
+ stallCapacity: 0
761
779
  };
762
780
  var defaultStallholderFormValues = {
763
781
  ...globalDefaultValues,
@@ -943,7 +961,7 @@ function useStallholderApplyForm(data) {
943
961
  };
944
962
  }
945
963
 
946
- // src/hooks/useMarketForm.ts
964
+ // src/hooks/market/useMarketForm.ts
947
965
  var import_yup3 = require("@hookform/resolvers/yup");
948
966
  var React3 = __toESM(require("react"));
949
967
  var import_react_hook_form3 = require("react-hook-form");
@@ -978,7 +996,6 @@ function useMarketForm(data) {
978
996
  promoCode: data.promoCode,
979
997
  provider: data.provider,
980
998
  region: data.region,
981
- stallApplicationInfo: data.stallApplicationInfo,
982
999
  tags: data.tags
983
1000
  });
984
1001
  } else {
@@ -1000,7 +1017,6 @@ function useMarketForm(data) {
1000
1017
  name,
1001
1018
  provider,
1002
1019
  region,
1003
- stallApplicationInfo: stallApplicationInfo2,
1004
1020
  tags
1005
1021
  } = getValues();
1006
1022
  return {
@@ -1020,7 +1036,6 @@ function useMarketForm(data) {
1020
1036
  name,
1021
1037
  provider,
1022
1038
  region,
1023
- stallApplicationInfo: stallApplicationInfo2,
1024
1039
  tags
1025
1040
  },
1026
1041
  formState: { errors },
@@ -1031,10 +1046,73 @@ function useMarketForm(data) {
1031
1046
  };
1032
1047
  }
1033
1048
 
1034
- // src/hooks/useUserForm.ts
1049
+ // src/hooks/market/useMarketInfoForm.ts
1035
1050
  var import_yup4 = require("@hookform/resolvers/yup");
1036
1051
  var React4 = __toESM(require("react"));
1037
1052
  var import_react_hook_form4 = require("react-hook-form");
1053
+ function useMarketInfoForm(data) {
1054
+ const {
1055
+ control,
1056
+ formState: { errors },
1057
+ getValues,
1058
+ handleSubmit,
1059
+ reset,
1060
+ setValue,
1061
+ watch
1062
+ } = (0, import_react_hook_form4.useForm)({
1063
+ defaultValues: defaultMarketInfoFormValues,
1064
+ resolver: (0, import_yup4.yupResolver)(marketInfoSchema)
1065
+ });
1066
+ React4.useEffect(() => {
1067
+ if (data) {
1068
+ reset({
1069
+ _id: data._id,
1070
+ applicationDeadlineHours: data.applicationDeadlineHours,
1071
+ dateTime: data.dateTime,
1072
+ paymentDueHours: data.paymentDueHours,
1073
+ paymentMethod: data.paymentMethod,
1074
+ paymentTarget: data.paymentTarget,
1075
+ rejectionPolicy: data.rejectionPolicy,
1076
+ stallCapacity: data.stallCapacity
1077
+ });
1078
+ } else {
1079
+ reset(defaultMarketInfoFormValues);
1080
+ }
1081
+ }, [data]);
1082
+ const {
1083
+ _id,
1084
+ applicationDeadlineHours,
1085
+ dateTime,
1086
+ paymentDueHours,
1087
+ paymentMethod,
1088
+ paymentTarget,
1089
+ rejectionPolicy,
1090
+ stallCapacity
1091
+ } = getValues();
1092
+ return {
1093
+ control,
1094
+ fields: {
1095
+ _id,
1096
+ applicationDeadlineHours,
1097
+ dateTime,
1098
+ paymentDueHours,
1099
+ paymentMethod,
1100
+ paymentTarget,
1101
+ rejectionPolicy,
1102
+ stallCapacity
1103
+ },
1104
+ formState: { errors },
1105
+ handleSubmit,
1106
+ reset,
1107
+ setValue,
1108
+ watch
1109
+ };
1110
+ }
1111
+
1112
+ // src/hooks/useUserForm.ts
1113
+ var import_yup5 = require("@hookform/resolvers/yup");
1114
+ var React5 = __toESM(require("react"));
1115
+ var import_react_hook_form5 = require("react-hook-form");
1038
1116
  var defaultValues = {
1039
1117
  active: false,
1040
1118
  avatar: null,
@@ -1056,11 +1134,11 @@ function useUserForm(data) {
1056
1134
  reset,
1057
1135
  setValue,
1058
1136
  watch
1059
- } = (0, import_react_hook_form4.useForm)({
1137
+ } = (0, import_react_hook_form5.useForm)({
1060
1138
  defaultValues,
1061
- resolver: (0, import_yup4.yupResolver)(userSchema)
1139
+ resolver: (0, import_yup5.yupResolver)(userSchema)
1062
1140
  });
1063
- React4.useEffect(() => {
1141
+ React5.useEffect(() => {
1064
1142
  if (data) {
1065
1143
  reset({
1066
1144
  _id: data._id,
@@ -1116,8 +1194,8 @@ function useUserForm(data) {
1116
1194
  }
1117
1195
 
1118
1196
  // src/hooks/auth/useLoginForm.ts
1119
- var import_yup5 = require("@hookform/resolvers/yup");
1120
- var import_react_hook_form5 = require("react-hook-form");
1197
+ var import_yup6 = require("@hookform/resolvers/yup");
1198
+ var import_react_hook_form6 = require("react-hook-form");
1121
1199
  var defaultValues2 = {
1122
1200
  email: "",
1123
1201
  password: ""
@@ -1131,9 +1209,9 @@ function useLoginForm() {
1131
1209
  reset,
1132
1210
  setValue,
1133
1211
  watch
1134
- } = (0, import_react_hook_form5.useForm)({
1212
+ } = (0, import_react_hook_form6.useForm)({
1135
1213
  defaultValues: defaultValues2,
1136
- resolver: (0, import_yup5.yupResolver)(loginSchema)
1214
+ resolver: (0, import_yup6.yupResolver)(loginSchema)
1137
1215
  });
1138
1216
  const { email, password } = getValues();
1139
1217
  return {
@@ -1151,8 +1229,8 @@ function useLoginForm() {
1151
1229
  }
1152
1230
 
1153
1231
  // src/hooks/auth/useRegisterForm.ts
1154
- var import_yup6 = require("@hookform/resolvers/yup");
1155
- var import_react_hook_form6 = require("react-hook-form");
1232
+ var import_yup7 = require("@hookform/resolvers/yup");
1233
+ var import_react_hook_form7 = require("react-hook-form");
1156
1234
  var defaultValues3 = {
1157
1235
  email: "",
1158
1236
  firstName: "",
@@ -1170,9 +1248,9 @@ function useRegisterForm() {
1170
1248
  reset,
1171
1249
  setValue,
1172
1250
  watch
1173
- } = (0, import_react_hook_form6.useForm)({
1251
+ } = (0, import_react_hook_form7.useForm)({
1174
1252
  defaultValues: defaultValues3,
1175
- resolver: (0, import_yup6.yupResolver)(registerSchema)
1253
+ resolver: (0, import_yup7.yupResolver)(registerSchema)
1176
1254
  });
1177
1255
  const { email, firstName, lastName, password, preferredRegion, role } = getValues();
1178
1256
  return {
@@ -1194,8 +1272,8 @@ function useRegisterForm() {
1194
1272
  }
1195
1273
 
1196
1274
  // src/hooks/auth/useRequestPasswordResetForm.ts
1197
- var import_yup7 = require("@hookform/resolvers/yup");
1198
- var import_react_hook_form7 = require("react-hook-form");
1275
+ var import_yup8 = require("@hookform/resolvers/yup");
1276
+ var import_react_hook_form8 = require("react-hook-form");
1199
1277
  var defaultValues4 = {
1200
1278
  email: ""
1201
1279
  };
@@ -1208,9 +1286,9 @@ function useRequestPasswordResetForm() {
1208
1286
  reset,
1209
1287
  setValue,
1210
1288
  watch
1211
- } = (0, import_react_hook_form7.useForm)({
1289
+ } = (0, import_react_hook_form8.useForm)({
1212
1290
  defaultValues: defaultValues4,
1213
- resolver: (0, import_yup7.yupResolver)(requestPasswordResetSchema)
1291
+ resolver: (0, import_yup8.yupResolver)(requestPasswordResetSchema)
1214
1292
  });
1215
1293
  const { email } = getValues();
1216
1294
  return {
@@ -1227,8 +1305,8 @@ function useRequestPasswordResetForm() {
1227
1305
  }
1228
1306
 
1229
1307
  // src/hooks/auth/useValidateTokenForm.ts
1230
- var import_yup8 = require("@hookform/resolvers/yup");
1231
- var import_react_hook_form8 = require("react-hook-form");
1308
+ var import_yup9 = require("@hookform/resolvers/yup");
1309
+ var import_react_hook_form9 = require("react-hook-form");
1232
1310
  var defaultValues5 = {
1233
1311
  email: "",
1234
1312
  token: ""
@@ -1242,9 +1320,9 @@ function useValidateTokenForm() {
1242
1320
  reset,
1243
1321
  setValue,
1244
1322
  watch
1245
- } = (0, import_react_hook_form8.useForm)({
1323
+ } = (0, import_react_hook_form9.useForm)({
1246
1324
  defaultValues: defaultValues5,
1247
- resolver: (0, import_yup8.yupResolver)(validateTokenSchema)
1325
+ resolver: (0, import_yup9.yupResolver)(validateTokenSchema)
1248
1326
  });
1249
1327
  const { email, token } = getValues();
1250
1328
  return {
@@ -1262,8 +1340,8 @@ function useValidateTokenForm() {
1262
1340
  }
1263
1341
 
1264
1342
  // src/hooks/auth/useResetPasswordForm.ts
1265
- var import_yup9 = require("@hookform/resolvers/yup");
1266
- var import_react_hook_form9 = require("react-hook-form");
1343
+ var import_yup10 = require("@hookform/resolvers/yup");
1344
+ var import_react_hook_form10 = require("react-hook-form");
1267
1345
  var defaultValues6 = {
1268
1346
  confirmPassword: "",
1269
1347
  email: "",
@@ -1278,9 +1356,9 @@ function useResetPasswordForm() {
1278
1356
  reset,
1279
1357
  setValue,
1280
1358
  watch
1281
- } = (0, import_react_hook_form9.useForm)({
1359
+ } = (0, import_react_hook_form10.useForm)({
1282
1360
  defaultValues: defaultValues6,
1283
- resolver: (0, import_yup9.yupResolver)(resetPasswordSchema)
1361
+ resolver: (0, import_yup10.yupResolver)(resetPasswordSchema)
1284
1362
  });
1285
1363
  const { confirmPassword, email, password } = getValues();
1286
1364
  return {
@@ -1630,7 +1708,6 @@ var MARKET_DATETIME_FIELDS_FRAGMENT = import_client8.gql`
1630
1708
  fragment MarketDateTimeFields on MarketDateTimeType {
1631
1709
  endDate
1632
1710
  endTime
1633
- marketPrice
1634
1711
  startDate
1635
1712
  startTime
1636
1713
  }
@@ -1647,25 +1724,27 @@ var MARKET_LOCATION_FIELDS_FRAGMENT = import_client8.gql`
1647
1724
  type
1648
1725
  }
1649
1726
  `;
1650
- var PAYMENT_TARGET_FIELDS_FRAGMENT = import_client8.gql`
1651
- fragment PaymentTargetFields on PaymentTargetType {
1652
- accountHolderName
1653
- accountNumber
1654
- link
1655
- }
1656
- `;
1657
- var STALL_APPLICATION_INFO_FIELDS_FRAGMENT = import_client8.gql`
1658
- fragment StallApplicationInfoFields on StallApplicationInfoType {
1727
+ var MARKET_INFO = import_client8.gql`
1728
+ fragment MarketInfoFields on MarketInfoType {
1729
+ _id
1659
1730
  applicationDeadlineHours
1731
+ dateTime {
1732
+ endDate
1733
+ endTime
1734
+ marketPrice
1735
+ startDate
1736
+ startTime
1737
+ }
1660
1738
  paymentDueHours
1661
1739
  paymentMethod
1662
1740
  paymentTarget {
1663
- ...PaymentTargetFields
1741
+ accountHolderName
1742
+ accountNumber
1743
+ link
1664
1744
  }
1665
1745
  rejectionPolicy
1666
1746
  stallCapacity
1667
1747
  }
1668
- ${PAYMENT_TARGET_FIELDS_FRAGMENT}
1669
1748
  `;
1670
1749
  var MARKET = import_client8.gql`
1671
1750
  fragment MarketFields on MarketType {
@@ -1696,9 +1775,6 @@ var MARKET = import_client8.gql`
1696
1775
  provider
1697
1776
  region
1698
1777
  relationIds
1699
- stallApplicationInfo {
1700
- ...StallApplicationInfoFields
1701
- }
1702
1778
  tags
1703
1779
  updatedAt
1704
1780
  }
@@ -1706,7 +1782,6 @@ var MARKET = import_client8.gql`
1706
1782
  ${MARKET_LOCATION_FIELDS_FRAGMENT}
1707
1783
  ${OWNER_FIELDS_FRAGMENT}
1708
1784
  ${RESOURCE_IMAGE_FIELDS_FRAGMENT}
1709
- ${STALL_APPLICATION_INFO_FIELDS_FRAGMENT}
1710
1785
  `;
1711
1786
  var GET_MARKETS = import_client8.gql`
1712
1787
  query getMarkets {
@@ -1748,6 +1823,14 @@ var GET_MARKETS_NEAR_ME = import_client8.gql`
1748
1823
  }
1749
1824
  ${MARKET}
1750
1825
  `;
1826
+ var GET_MARKET_INFO = import_client8.gql`
1827
+ query getMarketInfo($_id: ID!) {
1828
+ marketInfo(_id: $_id) {
1829
+ ...MarketInfoFields
1830
+ }
1831
+ }
1832
+ ${MARKET_INFO}
1833
+ `;
1751
1834
 
1752
1835
  // src/graphql/mutations/market.ts
1753
1836
  var CREATE_MARKET_MUTATION = import_client9.gql`
@@ -1771,6 +1854,22 @@ var DELETE_MARKET_MUTATION = import_client9.gql`
1771
1854
  deleteMarket(_id: $_id)
1772
1855
  }
1773
1856
  `;
1857
+ var CREATE_MARKET_INFO_MUTATION = import_client9.gql`
1858
+ mutation createMarketInfo($input: MarketInfoInputType!) {
1859
+ createMarketInfo(input: $input) {
1860
+ ...MarketInfoFields
1861
+ }
1862
+ }
1863
+ ${MARKET_INFO}
1864
+ `;
1865
+ var UPDATE_MARKET_INFO_MUTATION = import_client9.gql`
1866
+ mutation updateMarketInfo($_id: ID!, $input: MarketInfoInputType!) {
1867
+ updateMarketInfo(_id: $_id, input: $input) {
1868
+ ...MarketInfoFields
1869
+ }
1870
+ }
1871
+ ${MARKET_INFO}
1872
+ `;
1774
1873
 
1775
1874
  // src/graphql/queries/user.ts
1776
1875
  var import_client11 = require("@apollo/client");
@@ -1991,6 +2090,46 @@ var useDeleteMarket = () => {
1991
2090
  );
1992
2091
  return { deleteMarket, error, loading };
1993
2092
  };
2093
+ var useCreateMarketInfo = () => {
2094
+ const [createMarketInfo, { loading, error }] = (0, import_client12.useMutation)(
2095
+ CREATE_MARKET_INFO_MUTATION,
2096
+ {
2097
+ awaitRefetchQueries: true,
2098
+ refetchQueries: (mutationResult) => {
2099
+ const marketId = mutationResult?.data?.createMarketInfo?.stallholderId;
2100
+ if (!marketId) return [];
2101
+ return [
2102
+ {
2103
+ query: GET_MARKET_INFO,
2104
+ variables: { marketId }
2105
+ // Pass the marketId for refetching
2106
+ }
2107
+ ];
2108
+ }
2109
+ }
2110
+ );
2111
+ return { createMarketInfo, error, loading };
2112
+ };
2113
+ var useUpdateMarketInfo = () => {
2114
+ const [updateMarketInfo, { loading, error }] = (0, import_client12.useMutation)(
2115
+ UPDATE_MARKET_INFO_MUTATION,
2116
+ {
2117
+ awaitRefetchQueries: true,
2118
+ refetchQueries: (mutationResult) => {
2119
+ const marketId = mutationResult?.data?.updateMarketInfo?.marketId;
2120
+ if (!marketId) return [];
2121
+ return [
2122
+ {
2123
+ query: GET_MARKET_INFO,
2124
+ variables: { marketId }
2125
+ // Pass the marketId for refetching
2126
+ }
2127
+ ];
2128
+ }
2129
+ }
2130
+ );
2131
+ return { error, loading, updateMarketInfo };
2132
+ };
1994
2133
 
1995
2134
  // src/graphql/hooks/market/hooksQuery.ts
1996
2135
  var import_client13 = require("@apollo/client");
@@ -2042,6 +2181,15 @@ var useGetMarketsNearMe = (location) => {
2042
2181
  const markets = data?.marketsNearMe;
2043
2182
  return { error, loading, markets, refetch };
2044
2183
  };
2184
+ var useGetMarketInfo = (marketId) => {
2185
+ const { loading, error, data, refetch } = (0, import_client13.useQuery)(GET_MARKET_INFO, {
2186
+ fetchPolicy: "network-only",
2187
+ skip: !marketId,
2188
+ variables: { marketId }
2189
+ });
2190
+ const marketInfo = data?.marketInfo;
2191
+ return { error, loading, marketInfo, refetch };
2192
+ };
2045
2193
 
2046
2194
  // src/graphql/hooks/poster.ts
2047
2195
  var import_client15 = require("@apollo/client");
@@ -2595,6 +2743,8 @@ var useGetStallholderApplyForm = (stallholderId) => {
2595
2743
  const { loading, error, data, refetch } = (0, import_client22.useQuery)(
2596
2744
  GET_STALLHOLDER_APPLY_FORM,
2597
2745
  {
2746
+ fetchPolicy: "network-only",
2747
+ skip: !stallholderId,
2598
2748
  variables: { stallholderId }
2599
2749
  }
2600
2750
  );
@@ -2804,7 +2954,7 @@ var useGetUserNotifications = () => {
2804
2954
  return { error, loading, refetch, userNotifications };
2805
2955
  };
2806
2956
 
2807
- // src/formFields/stallholder/createEditStallholder.ts
2957
+ // src/formFields/stallholder/stallholder.ts
2808
2958
  var stallholderBasicInfoFields = [
2809
2959
  {
2810
2960
  helperText: "Business Name of the Stallholder *",
@@ -2973,7 +3123,7 @@ var producedIngTypes = [
2973
3123
  var packagingOptions = mapArrayToOptions(packagingTypes);
2974
3124
  var producedIngOptions = mapArrayToOptions(producedIngTypes);
2975
3125
 
2976
- // src/formFields/market.ts
3126
+ // src/formFields/market/market.ts
2977
3127
  var marketBasicInfoFields = [
2978
3128
  {
2979
3129
  helperText: "Name of the Market *",
@@ -2997,43 +3147,6 @@ var marketBasicInfoFields = [
2997
3147
  placeholder: "Promo code"
2998
3148
  }
2999
3149
  ];
3000
- var stallApplicationInfo = [
3001
- {
3002
- helperText: "Application Deadline of the Market *",
3003
- keyboardType: "number-pad",
3004
- name: "stallApplicationInfo.applicationDeadlineHours",
3005
- placeholder: "Application Deadline Hours"
3006
- },
3007
- {
3008
- helperText: "Stall Capacity of the Market *",
3009
- keyboardType: "number-pad",
3010
- name: "stallApplicationInfo.stallCapacity",
3011
- placeholder: "Stall Capacity"
3012
- },
3013
- {
3014
- helperText: "Payment Due Hours of the Market *",
3015
- keyboardType: "number-pad",
3016
- name: "stallApplicationInfo.paymentDueHours",
3017
- placeholder: "Payment Due Hours"
3018
- }
3019
- ];
3020
- var stallApplicationInfoPaymentTarget = [
3021
- {
3022
- helperText: "Account holder name *",
3023
- name: "stallApplicationInfo.paymentTarget.accountHolderName",
3024
- placeholder: "Account holder name"
3025
- },
3026
- {
3027
- helperText: "Account number *",
3028
- name: "stallApplicationInfo.paymentTarget.accountNumber",
3029
- placeholder: "Account number"
3030
- },
3031
- {
3032
- helperText: "Link to payment target *",
3033
- name: "stallApplicationInfo.paymentTarget.link",
3034
- placeholder: "Link to payment target"
3035
- }
3036
- ];
3037
3150
  var marketStartDateFields = [
3038
3151
  {
3039
3152
  dateMode: "date",
@@ -3048,14 +3161,6 @@ var marketStartDateFields = [
3048
3161
  placeholder: "Start Time"
3049
3162
  }
3050
3163
  ];
3051
- var marketPriceByDateFields = [
3052
- {
3053
- helperText: "Market Price for this date *",
3054
- keyboardType: "number-pad",
3055
- name: "marketPrice",
3056
- placeholder: "Market Price"
3057
- }
3058
- ];
3059
3164
  var marketEndDateFields = [
3060
3165
  {
3061
3166
  dateMode: "date",
@@ -3089,6 +3194,53 @@ var availableTagTypes = [
3089
3194
  "Port Nearby"
3090
3195
  ];
3091
3196
  var tagOptions = mapArrayToOptions(availableTagTypes);
3197
+
3198
+ // src/formFields/market/marketInfo.ts
3199
+ var stallApplicationInfo = [
3200
+ {
3201
+ helperText: "Application Deadline of the Market *",
3202
+ keyboardType: "number-pad",
3203
+ name: "stallApplicationInfo.applicationDeadlineHours",
3204
+ placeholder: "Application Deadline Hours"
3205
+ },
3206
+ {
3207
+ helperText: "Stall Capacity of the Market *",
3208
+ keyboardType: "number-pad",
3209
+ name: "stallApplicationInfo.stallCapacity",
3210
+ placeholder: "Stall Capacity"
3211
+ },
3212
+ {
3213
+ helperText: "Payment Due Hours of the Market *",
3214
+ keyboardType: "number-pad",
3215
+ name: "stallApplicationInfo.paymentDueHours",
3216
+ placeholder: "Payment Due Hours"
3217
+ }
3218
+ ];
3219
+ var stallApplicationInfoPaymentTarget = [
3220
+ {
3221
+ helperText: "Account holder name *",
3222
+ name: "stallApplicationInfo.paymentTarget.accountHolderName",
3223
+ placeholder: "Account holder name"
3224
+ },
3225
+ {
3226
+ helperText: "Account number *",
3227
+ name: "stallApplicationInfo.paymentTarget.accountNumber",
3228
+ placeholder: "Account number"
3229
+ },
3230
+ {
3231
+ helperText: "Link to payment target *",
3232
+ name: "stallApplicationInfo.paymentTarget.link",
3233
+ placeholder: "Link to payment target"
3234
+ }
3235
+ ];
3236
+ var marketPriceByDateFields = [
3237
+ {
3238
+ helperText: "Market Price for this date *",
3239
+ keyboardType: "number-pad",
3240
+ name: "marketPrice",
3241
+ placeholder: "Market Price"
3242
+ }
3243
+ ];
3092
3244
  var rejectionPolicyOptions = mapArrayToOptions(
3093
3245
  Object.values(EnumRejectionPolicy)
3094
3246
  );
@@ -3536,6 +3688,7 @@ var categoryColors = {
3536
3688
  categoryColors,
3537
3689
  dateFormat,
3538
3690
  defaultMarketFormValues,
3691
+ defaultMarketInfoFormValues,
3539
3692
  defaultRegion,
3540
3693
  defaultStallholderApplyFormValues,
3541
3694
  defaultStallholderFormValues,
@@ -3584,6 +3737,7 @@ var categoryColors = {
3584
3737
  useAddUserFavouriteResource,
3585
3738
  useCreateChat,
3586
3739
  useCreateMarket,
3740
+ useCreateMarketInfo,
3587
3741
  useCreatePoster,
3588
3742
  useCreateRelation,
3589
3743
  useCreateStallholder,
@@ -3596,6 +3750,7 @@ var categoryColors = {
3596
3750
  useGetChat,
3597
3751
  useGetChatSubscription,
3598
3752
  useGetMarket,
3753
+ useGetMarketInfo,
3599
3754
  useGetMarketRelations,
3600
3755
  useGetMarkets,
3601
3756
  useGetMarketsByRegion,
@@ -3619,6 +3774,7 @@ var categoryColors = {
3619
3774
  useLogin,
3620
3775
  useLoginForm,
3621
3776
  useMarketForm,
3777
+ useMarketInfoForm,
3622
3778
  useRegister,
3623
3779
  useRegisterForm,
3624
3780
  useRemoveParticipantFromChat,
@@ -3633,6 +3789,7 @@ var categoryColors = {
3633
3789
  useStallholderApplyForm,
3634
3790
  useStallholderForm,
3635
3791
  useUpdateMarket,
3792
+ useUpdateMarketInfo,
3636
3793
  useUpdateRelation,
3637
3794
  useUpdateStallholder,
3638
3795
  useUpdateStallholderApplyForm,