@timardex/cluemart-shared 1.0.12 → 1.0.14

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 CHANGED
@@ -32,6 +32,7 @@ var index_exports = {};
32
32
  __export(index_exports, {
33
33
  EnumInviteStatus: () => EnumInviteStatus,
34
34
  EnumNotification: () => EnumNotification,
35
+ EnumPaymentMethod: () => EnumPaymentMethod,
35
36
  EnumRegions: () => EnumRegions,
36
37
  EnumRejectionPolicy: () => EnumRejectionPolicy,
37
38
  EnumRelationResource: () => EnumRelationResource,
@@ -72,6 +73,7 @@ __export(index_exports, {
72
73
  marketPriceByDateFields: () => marketPriceByDateFields,
73
74
  marketSchema: () => marketSchema,
74
75
  marketStartDateFields: () => marketStartDateFields,
76
+ noLeadingZeros: () => noLeadingZeros,
75
77
  packagingOptions: () => packagingOptions,
76
78
  passwordSchema: () => passwordSchema,
77
79
  paymentMethodOptions: () => paymentMethodOptions,
@@ -87,6 +89,8 @@ __export(index_exports, {
87
89
  resetPasswordSchema: () => resetPasswordSchema,
88
90
  sortDatesByProximity: () => sortDatesByProximity,
89
91
  stallApplicationInfo: () => stallApplicationInfo,
92
+ stallApplicationInfoDropdowns: () => stallApplicationInfoDropdowns,
93
+ stallApplicationInfoPaymentTarget: () => stallApplicationInfoPaymentTarget,
90
94
  stallHolderSchema: () => stallHolderSchema,
91
95
  stallholderApplyFormSchema: () => stallholderApplyFormSchema,
92
96
  stallholderBasicInfoFields: () => stallholderBasicInfoFields,
@@ -113,6 +117,7 @@ __export(index_exports, {
113
117
  useAddUserFavouriteResource: () => useAddUserFavouriteResource,
114
118
  useCreateChat: () => useCreateChat,
115
119
  useCreateMarket: () => useCreateMarket,
120
+ useCreatePoster: () => useCreatePoster,
116
121
  useCreateRelation: () => useCreateRelation,
117
122
  useCreateStallholder: () => useCreateStallholder,
118
123
  useCreateStallholderApplyForm: () => useCreateStallholderApplyForm,
@@ -182,18 +187,28 @@ var import_utc = __toESM(require("dayjs/plugin/utc"));
182
187
 
183
188
  // src/enums.ts
184
189
  var EnumInviteStatus = /* @__PURE__ */ ((EnumInviteStatus2) => {
185
- EnumInviteStatus2["ACCEPTED"] = "ACCEPTED";
186
- EnumInviteStatus2["COMPLETED"] = "COMPLETED";
187
- EnumInviteStatus2["PENDING"] = "PENDING";
188
- EnumInviteStatus2["REJECTED"] = "REJECTED";
189
- EnumInviteStatus2["NO_STATUS"] = "NO_STATUS";
190
+ EnumInviteStatus2["ACCEPTED"] = "Accepted";
191
+ EnumInviteStatus2["COMPLETED"] = "Completed";
192
+ EnumInviteStatus2["EXPIRED"] = "Expired";
193
+ EnumInviteStatus2["NO_STATUS"] = "No Status";
194
+ EnumInviteStatus2["PENDING"] = "Pending";
195
+ EnumInviteStatus2["REJECTED"] = "Rejected";
196
+ EnumInviteStatus2["WAITING"] = "waiting";
190
197
  return EnumInviteStatus2;
191
198
  })(EnumInviteStatus || {});
192
199
  var EnumRejectionPolicy = /* @__PURE__ */ ((EnumRejectionPolicy2) => {
193
- EnumRejectionPolicy2["SINGLE_DATE_ALLOWED"] = "single_date_allowed";
194
- EnumRejectionPolicy2["MULTI_DATE_ALLOWED"] = "multi_date_allowed";
200
+ EnumRejectionPolicy2["SINGLE_DATE_ALLOWED"] = "Single date allowed";
201
+ EnumRejectionPolicy2["MULTI_DATE_ALLOWED"] = "Multi date allowed";
195
202
  return EnumRejectionPolicy2;
196
203
  })(EnumRejectionPolicy || {});
204
+ var EnumPaymentMethod = /* @__PURE__ */ ((EnumPaymentMethod3) => {
205
+ EnumPaymentMethod3["CASH"] = "Cash";
206
+ EnumPaymentMethod3["EFTPOS"] = "Eftpos";
207
+ EnumPaymentMethod3["BANK_TRANSFER"] = "Bank Transfer";
208
+ EnumPaymentMethod3["PAYPAL"] = "PayPal";
209
+ EnumPaymentMethod3["STRIPE"] = "Stripe";
210
+ return EnumPaymentMethod3;
211
+ })(EnumPaymentMethod || {});
197
212
  var EnumResourceType = /* @__PURE__ */ ((EnumResourceType2) => {
198
213
  EnumResourceType2["MARKET"] = "market";
199
214
  EnumResourceType2["STALLHOLDER"] = "stallholder";
@@ -326,8 +341,8 @@ var truncateText = (text, maxLength = 30) => {
326
341
  return text.length > maxLength ? text.substring(0, maxLength) + "..." : text;
327
342
  };
328
343
  var mapArrayToOptions = (items) => items.map((item) => ({
329
- label: item.replace(/_/g, " "),
330
- value: item.replace(/\s+/g, "_").toLowerCase()
344
+ label: item,
345
+ value: item
331
346
  }));
332
347
  var capitalizeFirstLetter = (str) => {
333
348
  return str.split(" ").map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
@@ -354,6 +369,9 @@ function sortDatesByProximity(dates) {
354
369
  }
355
370
  var availableRegionTypes = Object.values(EnumRegions);
356
371
  var availableRegionOptions = mapArrayToOptions(availableRegionTypes);
372
+ var paymentMethodOptions = mapArrayToOptions(
373
+ Object.values(EnumPaymentMethod)
374
+ );
357
375
 
358
376
  // src/hooks/useLocationSearch.ts
359
377
  var handleApiError = (error, message) => {
@@ -439,6 +457,18 @@ var import_dayjs2 = __toESM(require("dayjs"));
439
457
  var import_customParseFormat2 = __toESM(require("dayjs/plugin/customParseFormat"));
440
458
  var import_isSameOrAfter = __toESM(require("dayjs/plugin/isSameOrAfter"));
441
459
  var yup = __toESM(require("yup"));
460
+ var noLeadingZeros = (fieldName, options = {}) => {
461
+ return function(value, context) {
462
+ const original = context.originalValue?.toString() ?? "";
463
+ const regex = options.allowDecimal ? /^0\d+(\.\d+)?$/ : /^0\d+$/;
464
+ if (regex.test(original)) {
465
+ return context.createError({
466
+ message: `${fieldName} must not have leading zeros`
467
+ });
468
+ }
469
+ return true;
470
+ };
471
+ };
442
472
  (0, import_dayjs2.extend)(import_isSameOrAfter.default);
443
473
  (0, import_dayjs2.extend)(import_customParseFormat2.default);
444
474
  var now = (0, import_dayjs2.default)();
@@ -498,11 +528,8 @@ var dateTimeSchema = yup.object().shape({
498
528
  endTime: yup.string().concat(endTimeMustBeAfterStartTimeTest).required("End time is required"),
499
529
  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
530
  "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
- }
531
+ "",
532
+ noLeadingZeros("Market price", { allowDecimal: true })
506
533
  ),
507
534
  startDate: yup.string().concat(startDateNotInPastTest).required("Start date is required"),
508
535
  startTime: yup.string().concat(startTimeCannotBeInPastTest).required("Start time is required")
@@ -544,21 +571,14 @@ var marketSchema = globalResourceSchema.shape({
544
571
  stallApplicationInfo: yup2.object().shape({
545
572
  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
573
  "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
- }
574
+ "",
575
+ noLeadingZeros("Application deadline hours")
552
576
  ),
577
+ 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")),
578
+ paymentMethod: yup2.mixed().oneOf(Object.values(EnumPaymentMethod)).required("Please select a Payment method"),
579
+ paymentTarget: yup2.string().trim().required("Payment target is required"),
553
580
  rejectionPolicy: yup2.mixed().oneOf(Object.values(EnumRejectionPolicy)).required("Rejection policy 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
- )
581
+ 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"))
562
582
  }),
563
583
  tags: yup2.array().of(yup2.string().defined()).nullable()
564
584
  });
@@ -599,7 +619,7 @@ var stallholderApplyFormSchema = yup3.object().shape({
599
619
  isRequired: yup3.boolean().required("Gazebo requirement is required")
600
620
  }),
601
621
  packaging: yup3.array().of(yup3.string().defined()).min(1, "Packaging list must contain at least one item").required("Packaging is required"),
602
- paymentMethod: yup3.string().required("Please select a Payment method"),
622
+ paymentMethod: yup3.mixed().oneOf(Object.values(EnumPaymentMethod)).required("Please select a Payment method"),
603
623
  priceRange: yup3.object().shape({
604
624
  max: yup3.number().min(1).required("Max price is required").test(
605
625
  "is-greater",
@@ -719,7 +739,10 @@ var defaultMarketFormValues = {
719
739
  provider: "Provider name",
720
740
  stallApplicationInfo: {
721
741
  applicationDeadlineHours: 0,
722
- rejectionPolicy: "multi_date_allowed" /* MULTI_DATE_ALLOWED */,
742
+ paymentDueHours: 0,
743
+ paymentMethod: "",
744
+ paymentTarget: "",
745
+ rejectionPolicy: "Multi date allowed" /* MULTI_DATE_ALLOWED */,
723
746
  stallCapacity: 0
724
747
  },
725
748
  tags: null
@@ -1643,6 +1666,9 @@ var MARKET = import_client8.gql`
1643
1666
  relationIds
1644
1667
  stallApplicationInfo {
1645
1668
  applicationDeadlineHours
1669
+ paymentDueHours
1670
+ paymentMethod
1671
+ paymentTarget
1646
1672
  rejectionPolicy
1647
1673
  stallCapacity
1648
1674
  }
@@ -1989,15 +2015,36 @@ var useGetMarketsNearMe = (location) => {
1989
2015
  return { error, loading, markets, refetch };
1990
2016
  };
1991
2017
 
2018
+ // src/graphql/hooks/poster.ts
2019
+ var import_client15 = require("@apollo/client");
2020
+
2021
+ // src/graphql/mutations/poster.ts
2022
+ var import_client14 = require("@apollo/client");
2023
+ var CREATE_POSTER_MUTATION = import_client14.gql`
2024
+ mutation createPoster($input: PosterInputType!) {
2025
+ createPoster(input: $input) {
2026
+ message
2027
+ }
2028
+ }
2029
+ `;
2030
+
2031
+ // src/graphql/hooks/poster.ts
2032
+ var useCreatePoster = () => {
2033
+ const [createPoster, { loading, error }] = (0, import_client15.useMutation)(
2034
+ CREATE_POSTER_MUTATION
2035
+ );
2036
+ return { createPoster, error, loading };
2037
+ };
2038
+
1992
2039
  // src/graphql/hooks/relation/hooksMutation.ts
1993
- var import_client16 = require("@apollo/client");
2040
+ var import_client18 = require("@apollo/client");
1994
2041
 
1995
2042
  // src/graphql/mutations/relation.ts
1996
- var import_client15 = require("@apollo/client");
2043
+ var import_client17 = require("@apollo/client");
1997
2044
 
1998
2045
  // src/graphql/queries/relation.ts
1999
- var import_client14 = require("@apollo/client");
2000
- var RELATION_UPDATE_BY_FRAGMENT = import_client14.gql`
2046
+ var import_client16 = require("@apollo/client");
2047
+ var RELATION_UPDATE_BY_FRAGMENT = import_client16.gql`
2001
2048
  fragment RelationUpdateBy on RelationUpdateByType {
2002
2049
  resourceId
2003
2050
  resourceName
@@ -2006,7 +2053,7 @@ var RELATION_UPDATE_BY_FRAGMENT = import_client14.gql`
2006
2053
  toStatus
2007
2054
  }
2008
2055
  `;
2009
- var RELATION_LOGS_FRAGMENT = import_client14.gql`
2056
+ var RELATION_LOGS_FRAGMENT = import_client16.gql`
2010
2057
  fragment RelationLogs on RelationLogType {
2011
2058
  createdAt
2012
2059
  updatedAt
@@ -2016,7 +2063,7 @@ var RELATION_LOGS_FRAGMENT = import_client14.gql`
2016
2063
  }
2017
2064
  ${RELATION_UPDATE_BY_FRAGMENT}
2018
2065
  `;
2019
- var RELATION_DATES_FRAGMENT = import_client14.gql`
2066
+ var RELATION_DATES_FRAGMENT = import_client16.gql`
2020
2067
  fragment RelationDates on RelationDateType {
2021
2068
  lastUpdateBy
2022
2069
  marketPrice
@@ -2024,9 +2071,10 @@ var RELATION_DATES_FRAGMENT = import_client14.gql`
2024
2071
  status
2025
2072
  }
2026
2073
  `;
2027
- var RELATION_FIELDS_FRAGMENT = import_client14.gql`
2074
+ var RELATION_FIELDS_FRAGMENT = import_client16.gql`
2028
2075
  fragment RelationFields on RelationType {
2029
2076
  _id
2077
+ apiMessage
2030
2078
  createdAt
2031
2079
  lastUpdateBy
2032
2080
  marketId
@@ -2043,7 +2091,7 @@ var RELATION_FIELDS_FRAGMENT = import_client14.gql`
2043
2091
  ${RELATION_DATES_FRAGMENT}
2044
2092
  ${RELATION_LOGS_FRAGMENT}
2045
2093
  `;
2046
- var GET_RELATION = import_client14.gql`
2094
+ var GET_RELATION = import_client16.gql`
2047
2095
  query getRelation($id: ID!) {
2048
2096
  relation(_id: $id) {
2049
2097
  ...RelationFields
@@ -2051,7 +2099,7 @@ var GET_RELATION = import_client14.gql`
2051
2099
  }
2052
2100
  ${RELATION_FIELDS_FRAGMENT}
2053
2101
  `;
2054
- var GET_RELATION_BY_MARKET_AND_STALLHOLDER = import_client14.gql`
2102
+ var GET_RELATION_BY_MARKET_AND_STALLHOLDER = import_client16.gql`
2055
2103
  query getRelationByMarketAndStallholder($marketId: ID!, $stallholderId: ID!) {
2056
2104
  relationByMarketAndStallholder(
2057
2105
  marketId: $marketId
@@ -2062,7 +2110,7 @@ var GET_RELATION_BY_MARKET_AND_STALLHOLDER = import_client14.gql`
2062
2110
  }
2063
2111
  ${RELATION_FIELDS_FRAGMENT}
2064
2112
  `;
2065
- var GET_MARKET_RELATIONS = import_client14.gql`
2113
+ var GET_MARKET_RELATIONS = import_client16.gql`
2066
2114
  query getMarketRelations($marketId: ID!) {
2067
2115
  marketRelations(marketId: $marketId) {
2068
2116
  ...RelationFields
@@ -2070,7 +2118,7 @@ var GET_MARKET_RELATIONS = import_client14.gql`
2070
2118
  }
2071
2119
  ${RELATION_FIELDS_FRAGMENT}
2072
2120
  `;
2073
- var GET_STALLHOLDER_RELATIONS = import_client14.gql`
2121
+ var GET_STALLHOLDER_RELATIONS = import_client16.gql`
2074
2122
  query getStallholderRelations($stallholderId: ID!) {
2075
2123
  stallholderRelations(stallholderId: $stallholderId) {
2076
2124
  ...RelationFields
@@ -2078,7 +2126,7 @@ var GET_STALLHOLDER_RELATIONS = import_client14.gql`
2078
2126
  }
2079
2127
  ${RELATION_FIELDS_FRAGMENT}
2080
2128
  `;
2081
- var GET_RESOURCE_CONNECTIONS = import_client14.gql`
2129
+ var GET_RESOURCE_CONNECTIONS = import_client16.gql`
2082
2130
  query getResourceConnections(
2083
2131
  $resourceId: ID!
2084
2132
  $resourceType: ResourceTypeEnum!
@@ -2176,7 +2224,7 @@ var GET_RESOURCE_CONNECTIONS = import_client14.gql`
2176
2224
  `;
2177
2225
 
2178
2226
  // src/graphql/mutations/relation.ts
2179
- var CREATE_RELATION_MUTATION = import_client15.gql`
2227
+ var CREATE_RELATION_MUTATION = import_client17.gql`
2180
2228
  mutation createRelation($input: RelationInputType!) {
2181
2229
  createRelation(input: $input) {
2182
2230
  ...RelationFields
@@ -2184,7 +2232,7 @@ var CREATE_RELATION_MUTATION = import_client15.gql`
2184
2232
  }
2185
2233
  ${RELATION_FIELDS_FRAGMENT}
2186
2234
  `;
2187
- var UPDATE_RELATION_MUTATION = import_client15.gql`
2235
+ var UPDATE_RELATION_MUTATION = import_client17.gql`
2188
2236
  mutation updateRelation($_id: ID!, $input: RelationInputType!) {
2189
2237
  updateRelation(_id: $_id, input: $input) {
2190
2238
  ...RelationFields
@@ -2192,7 +2240,7 @@ var UPDATE_RELATION_MUTATION = import_client15.gql`
2192
2240
  }
2193
2241
  ${RELATION_FIELDS_FRAGMENT}
2194
2242
  `;
2195
- var DELETE_RELATION_MUTATION = import_client15.gql`
2243
+ var DELETE_RELATION_MUTATION = import_client17.gql`
2196
2244
  mutation deleteRelation($_id: ID!) {
2197
2245
  deleteRelation(_id: $_id) {
2198
2246
  ...RelationFields
@@ -2203,7 +2251,7 @@ var DELETE_RELATION_MUTATION = import_client15.gql`
2203
2251
 
2204
2252
  // src/graphql/hooks/relation/hooksMutation.ts
2205
2253
  var useCreateRelation = () => {
2206
- const [createRelation, { loading, error }] = (0, import_client16.useMutation)(
2254
+ const [createRelation, { loading, error }] = (0, import_client18.useMutation)(
2207
2255
  CREATE_RELATION_MUTATION,
2208
2256
  {
2209
2257
  awaitRefetchQueries: true,
@@ -2238,7 +2286,7 @@ var useCreateRelation = () => {
2238
2286
  return { createRelation, error, loading };
2239
2287
  };
2240
2288
  var useUpdateRelation = () => {
2241
- const [updateRelation, { loading, error }] = (0, import_client16.useMutation)(
2289
+ const [updateRelation, { loading, error }] = (0, import_client18.useMutation)(
2242
2290
  UPDATE_RELATION_MUTATION,
2243
2291
  {
2244
2292
  awaitRefetchQueries: true,
@@ -2273,7 +2321,7 @@ var useUpdateRelation = () => {
2273
2321
  return { error, loading, updateRelation };
2274
2322
  };
2275
2323
  var useDeleteRelation = () => {
2276
- const [deleteRelation, { loading, error }] = (0, import_client16.useMutation)(
2324
+ const [deleteRelation, { loading, error }] = (0, import_client18.useMutation)(
2277
2325
  DELETE_RELATION_MUTATION,
2278
2326
  {
2279
2327
  awaitRefetchQueries: true,
@@ -2301,9 +2349,9 @@ var useDeleteRelation = () => {
2301
2349
  };
2302
2350
 
2303
2351
  // src/graphql/hooks/relation/hooksQuery.ts
2304
- var import_client17 = require("@apollo/client");
2352
+ var import_client19 = require("@apollo/client");
2305
2353
  var useGetRelation = (id) => {
2306
- const { loading, error, data, refetch } = (0, import_client17.useQuery)(GET_RELATION, {
2354
+ const { loading, error, data, refetch } = (0, import_client19.useQuery)(GET_RELATION, {
2307
2355
  fetchPolicy: "network-only",
2308
2356
  skip: id === "",
2309
2357
  variables: { id }
@@ -2312,7 +2360,7 @@ var useGetRelation = (id) => {
2312
2360
  return { error, loading, refetch, relation };
2313
2361
  };
2314
2362
  var useGetRelationByMarketAndStallholder = (marketId, stallholderId) => {
2315
- const { loading, error, data, refetch } = (0, import_client17.useQuery)(
2363
+ const { loading, error, data, refetch } = (0, import_client19.useQuery)(
2316
2364
  GET_RELATION_BY_MARKET_AND_STALLHOLDER,
2317
2365
  {
2318
2366
  fetchPolicy: "no-cache",
@@ -2324,7 +2372,7 @@ var useGetRelationByMarketAndStallholder = (marketId, stallholderId) => {
2324
2372
  return { error, loading, refetch, relationByMarketAndStallholder };
2325
2373
  };
2326
2374
  var useGetMarketRelations = (marketId) => {
2327
- const { loading, error, data, refetch } = (0, import_client17.useQuery)(GET_MARKET_RELATIONS, {
2375
+ const { loading, error, data, refetch } = (0, import_client19.useQuery)(GET_MARKET_RELATIONS, {
2328
2376
  fetchPolicy: "network-only",
2329
2377
  skip: marketId === "",
2330
2378
  variables: { marketId }
@@ -2333,7 +2381,7 @@ var useGetMarketRelations = (marketId) => {
2333
2381
  return { error, loading, marketRelations, refetch };
2334
2382
  };
2335
2383
  var useGetStallholderRelations = (stallholderId) => {
2336
- const { loading, error, data, refetch } = (0, import_client17.useQuery)(
2384
+ const { loading, error, data, refetch } = (0, import_client19.useQuery)(
2337
2385
  GET_STALLHOLDER_RELATIONS,
2338
2386
  {
2339
2387
  fetchPolicy: "network-only",
@@ -2345,7 +2393,7 @@ var useGetStallholderRelations = (stallholderId) => {
2345
2393
  return { error, loading, refetch, stallholderRelations };
2346
2394
  };
2347
2395
  var useGetResourceConnections = (resourceId, resourceType) => {
2348
- const { loading, error, data, refetch } = (0, import_client17.useQuery)(GET_RESOURCE_CONNECTIONS, {
2396
+ const { loading, error, data, refetch } = (0, import_client19.useQuery)(GET_RESOURCE_CONNECTIONS, {
2349
2397
  fetchPolicy: "network-only",
2350
2398
  variables: { resourceId, resourceType }
2351
2399
  });
@@ -2354,11 +2402,11 @@ var useGetResourceConnections = (resourceId, resourceType) => {
2354
2402
  };
2355
2403
 
2356
2404
  // src/graphql/hooks/stallholder/hooksMutation.ts
2357
- var import_client19 = require("@apollo/client");
2405
+ var import_client21 = require("@apollo/client");
2358
2406
 
2359
2407
  // src/graphql/mutations/stallholder.ts
2360
- var import_client18 = require("@apollo/client");
2361
- var CREATE_STALLHOLDER_MUTATION = import_client18.gql`
2408
+ var import_client20 = require("@apollo/client");
2409
+ var CREATE_STALLHOLDER_MUTATION = import_client20.gql`
2362
2410
  mutation createStallholder($input: StallholderInputType!) {
2363
2411
  createStallholder(input: $input) {
2364
2412
  ...StallholderFields
@@ -2366,7 +2414,7 @@ var CREATE_STALLHOLDER_MUTATION = import_client18.gql`
2366
2414
  }
2367
2415
  ${STALLHOLDER}
2368
2416
  `;
2369
- var UPDATE_STALLHOLDER_MUTATION = import_client18.gql`
2417
+ var UPDATE_STALLHOLDER_MUTATION = import_client20.gql`
2370
2418
  mutation updateStallholder($_id: ID!, $input: StallholderInputType!) {
2371
2419
  updateStallholder(_id: $_id, input: $input) {
2372
2420
  ...StallholderFields
@@ -2374,12 +2422,12 @@ var UPDATE_STALLHOLDER_MUTATION = import_client18.gql`
2374
2422
  }
2375
2423
  ${STALLHOLDER}
2376
2424
  `;
2377
- var DELETE_STALLHOLDER_MUTATION = import_client18.gql`
2425
+ var DELETE_STALLHOLDER_MUTATION = import_client20.gql`
2378
2426
  mutation deleteStallholder($_id: ID!) {
2379
2427
  deleteStallholder(_id: $_id)
2380
2428
  }
2381
2429
  `;
2382
- var CREATE_STALLHOLDER_APPLY_FORM_MUTATION = import_client18.gql`
2430
+ var CREATE_STALLHOLDER_APPLY_FORM_MUTATION = import_client20.gql`
2383
2431
  mutation createStallholderApplyForm($input: StallholderApplyFormInputType!) {
2384
2432
  createStallholderApplyForm(input: $input) {
2385
2433
  ...StallholderApplyFormFields
@@ -2387,7 +2435,7 @@ var CREATE_STALLHOLDER_APPLY_FORM_MUTATION = import_client18.gql`
2387
2435
  }
2388
2436
  ${STALLHOLDER_APPLY_FORM}
2389
2437
  `;
2390
- var UPDATE_STALLHOLDER_APPLY_FORM_MUTATION = import_client18.gql`
2438
+ var UPDATE_STALLHOLDER_APPLY_FORM_MUTATION = import_client20.gql`
2391
2439
  mutation updateStallholderApplyForm(
2392
2440
  $_id: ID!
2393
2441
  $input: StallholderApplyFormInputType!
@@ -2401,7 +2449,7 @@ var UPDATE_STALLHOLDER_APPLY_FORM_MUTATION = import_client18.gql`
2401
2449
 
2402
2450
  // src/graphql/hooks/stallholder/hooksMutation.ts
2403
2451
  var useCreateStallholder = () => {
2404
- const [createStallholder, { loading, error }] = (0, import_client19.useMutation)(
2452
+ const [createStallholder, { loading, error }] = (0, import_client21.useMutation)(
2405
2453
  CREATE_STALLHOLDER_MUTATION,
2406
2454
  {
2407
2455
  awaitRefetchQueries: true,
@@ -2411,7 +2459,7 @@ var useCreateStallholder = () => {
2411
2459
  return { createStallholder, error, loading };
2412
2460
  };
2413
2461
  var useUpdateStallholder = () => {
2414
- const [updateStallholder, { loading, error }] = (0, import_client19.useMutation)(
2462
+ const [updateStallholder, { loading, error }] = (0, import_client21.useMutation)(
2415
2463
  UPDATE_STALLHOLDER_MUTATION,
2416
2464
  {
2417
2465
  awaitRefetchQueries: true,
@@ -2421,7 +2469,7 @@ var useUpdateStallholder = () => {
2421
2469
  return { error, loading, updateStallholder };
2422
2470
  };
2423
2471
  var useDeleteStallholder = () => {
2424
- const [deleteStallholder, { loading, error }] = (0, import_client19.useMutation)(
2472
+ const [deleteStallholder, { loading, error }] = (0, import_client21.useMutation)(
2425
2473
  DELETE_STALLHOLDER_MUTATION,
2426
2474
  {
2427
2475
  awaitRefetchQueries: true,
@@ -2431,7 +2479,7 @@ var useDeleteStallholder = () => {
2431
2479
  return { deleteStallholder, error, loading };
2432
2480
  };
2433
2481
  var useCreateStallholderApplyForm = () => {
2434
- const [createStallholderApplyForm, { loading, error }] = (0, import_client19.useMutation)(
2482
+ const [createStallholderApplyForm, { loading, error }] = (0, import_client21.useMutation)(
2435
2483
  CREATE_STALLHOLDER_APPLY_FORM_MUTATION,
2436
2484
  {
2437
2485
  awaitRefetchQueries: true,
@@ -2451,7 +2499,7 @@ var useCreateStallholderApplyForm = () => {
2451
2499
  return { createStallholderApplyForm, error, loading };
2452
2500
  };
2453
2501
  var useUpdateStallholderApplyForm = () => {
2454
- const [updateStallholderApplyForm, { loading, error }] = (0, import_client19.useMutation)(
2502
+ const [updateStallholderApplyForm, { loading, error }] = (0, import_client21.useMutation)(
2455
2503
  UPDATE_STALLHOLDER_APPLY_FORM_MUTATION,
2456
2504
  {
2457
2505
  awaitRefetchQueries: true,
@@ -2472,9 +2520,9 @@ var useUpdateStallholderApplyForm = () => {
2472
2520
  };
2473
2521
 
2474
2522
  // src/graphql/hooks/stallholder/hooksQuery.ts
2475
- var import_client20 = require("@apollo/client");
2523
+ var import_client22 = require("@apollo/client");
2476
2524
  var useGetStallholders = () => {
2477
- const { loading, error, data, refetch } = (0, import_client20.useQuery)(GET_STALLHOLDERS, {
2525
+ const { loading, error, data, refetch } = (0, import_client22.useQuery)(GET_STALLHOLDERS, {
2478
2526
  fetchPolicy: "network-only"
2479
2527
  });
2480
2528
  const stallholders = data?.stallholders;
@@ -2486,7 +2534,7 @@ var useGetStallholders = () => {
2486
2534
  };
2487
2535
  };
2488
2536
  var useGetStallholder = (_id) => {
2489
- const { loading, error, data, refetch } = (0, import_client20.useQuery)(GET_STALLHOLDER, {
2537
+ const { loading, error, data, refetch } = (0, import_client22.useQuery)(GET_STALLHOLDER, {
2490
2538
  fetchPolicy: "network-only",
2491
2539
  skip: !_id,
2492
2540
  variables: { _id }
@@ -2495,7 +2543,7 @@ var useGetStallholder = (_id) => {
2495
2543
  return { error, loading, refetch, stallholder };
2496
2544
  };
2497
2545
  var useGetStallholdersByRegion = (region) => {
2498
- const { loading, error, data, refetch } = (0, import_client20.useQuery)(
2546
+ const { loading, error, data, refetch } = (0, import_client22.useQuery)(
2499
2547
  GET_STALLHOLDERS_BY_REGION,
2500
2548
  {
2501
2549
  fetchPolicy: "network-only",
@@ -2507,7 +2555,7 @@ var useGetStallholdersByRegion = (region) => {
2507
2555
  return { error, loading, refetch, stallholders };
2508
2556
  };
2509
2557
  var useSearchStallholders = (search, region) => {
2510
- const { loading, error, data, refetch } = (0, import_client20.useQuery)(SEARCH_STALLHOLDERS, {
2558
+ const { loading, error, data, refetch } = (0, import_client22.useQuery)(SEARCH_STALLHOLDERS, {
2511
2559
  fetchPolicy: "network-only",
2512
2560
  skip: search.length < 3,
2513
2561
  variables: { region, search }
@@ -2516,7 +2564,7 @@ var useSearchStallholders = (search, region) => {
2516
2564
  return { error, loading, refetch, stallholders };
2517
2565
  };
2518
2566
  var useGetStallholderApplyForm = (stallholderId) => {
2519
- const { loading, error, data, refetch } = (0, import_client20.useQuery)(
2567
+ const { loading, error, data, refetch } = (0, import_client22.useQuery)(
2520
2568
  GET_STALLHOLDER_APPLY_FORM,
2521
2569
  {
2522
2570
  variables: { stallholderId }
@@ -2532,11 +2580,11 @@ var useGetStallholderApplyForm = (stallholderId) => {
2532
2580
  };
2533
2581
 
2534
2582
  // src/graphql/hooks/subscriptions.ts
2535
- var import_client23 = require("@apollo/client");
2583
+ var import_client25 = require("@apollo/client");
2536
2584
 
2537
2585
  // src/graphql/subscriptions/chat.ts
2538
- var import_client21 = require("@apollo/client");
2539
- var GET_CHAT_MESSAGE = import_client21.gql`
2586
+ var import_client23 = require("@apollo/client");
2587
+ var GET_CHAT_MESSAGE = import_client23.gql`
2540
2588
  subscription {
2541
2589
  getChatMessage {
2542
2590
  ...ChatFields
@@ -2546,8 +2594,8 @@ var GET_CHAT_MESSAGE = import_client21.gql`
2546
2594
  `;
2547
2595
 
2548
2596
  // src/graphql/subscriptions/notification.ts
2549
- var import_client22 = require("@apollo/client");
2550
- var NOTIFICATION_FIELDS_FRAGMENT = import_client22.gql`
2597
+ var import_client24 = require("@apollo/client");
2598
+ var NOTIFICATION_FIELDS_FRAGMENT = import_client24.gql`
2551
2599
  fragment NotificationFields on NotificationType {
2552
2600
  createdBy
2553
2601
  important
@@ -2557,7 +2605,7 @@ var NOTIFICATION_FIELDS_FRAGMENT = import_client22.gql`
2557
2605
  resourceType
2558
2606
  }
2559
2607
  `;
2560
- var GET_GLOBAL_NOTIFICATION = import_client22.gql`
2608
+ var GET_GLOBAL_NOTIFICATION = import_client24.gql`
2561
2609
  subscription {
2562
2610
  getGlobalNotification {
2563
2611
  ...NotificationFields
@@ -2565,7 +2613,7 @@ var GET_GLOBAL_NOTIFICATION = import_client22.gql`
2565
2613
  }
2566
2614
  ${NOTIFICATION_FIELDS_FRAGMENT}
2567
2615
  `;
2568
- var GET_RELATION_NOTIFICATION = import_client22.gql`
2616
+ var GET_RELATION_NOTIFICATION = import_client24.gql`
2569
2617
  subscription {
2570
2618
  getRelationNotification {
2571
2619
  ...NotificationFields
@@ -2580,29 +2628,29 @@ var useGetNotification = () => {
2580
2628
  data: global,
2581
2629
  loading: loadingGlobal,
2582
2630
  error: errorGlobal
2583
- } = (0, import_client23.useSubscription)(GET_GLOBAL_NOTIFICATION);
2631
+ } = (0, import_client25.useSubscription)(GET_GLOBAL_NOTIFICATION);
2584
2632
  const {
2585
2633
  data: relation,
2586
2634
  loading: loadingImportant,
2587
2635
  error: errorImportant
2588
- } = (0, import_client23.useSubscription)(GET_RELATION_NOTIFICATION);
2636
+ } = (0, import_client25.useSubscription)(GET_RELATION_NOTIFICATION);
2589
2637
  const error = errorGlobal || errorImportant;
2590
2638
  const loading = loadingGlobal || loadingImportant;
2591
2639
  const notification = relation?.getRelationNotification || global?.getGlobalNotification;
2592
2640
  return { error, loading, notification };
2593
2641
  };
2594
2642
  var useGetChatSubscription = () => {
2595
- const { data, loading, error } = (0, import_client23.useSubscription)(GET_CHAT_MESSAGE);
2643
+ const { data, loading, error } = (0, import_client25.useSubscription)(GET_CHAT_MESSAGE);
2596
2644
  const chat = data?.getChat;
2597
2645
  return { chat, error, loading };
2598
2646
  };
2599
2647
 
2600
2648
  // src/graphql/hooks/user/hooksMutation.ts
2601
- var import_client25 = require("@apollo/client");
2649
+ var import_client27 = require("@apollo/client");
2602
2650
 
2603
2651
  // src/graphql/mutations/user.ts
2604
- var import_client24 = require("@apollo/client");
2605
- var CREATE_USER_MUTATION = import_client24.gql`
2652
+ var import_client26 = require("@apollo/client");
2653
+ var CREATE_USER_MUTATION = import_client26.gql`
2606
2654
  mutation createUser($input: UserInputType!) {
2607
2655
  createUser(input: $input) {
2608
2656
  ...UserFields
@@ -2610,7 +2658,7 @@ var CREATE_USER_MUTATION = import_client24.gql`
2610
2658
  }
2611
2659
  ${USER_FIELDS_FRAGMENT}
2612
2660
  `;
2613
- var UPDATE_USER_MUTATION = import_client24.gql`
2661
+ var UPDATE_USER_MUTATION = import_client26.gql`
2614
2662
  mutation updateUser($_id: ID!, $input: UserInputType!) {
2615
2663
  updateUser(_id: $_id, input: $input) {
2616
2664
  ...UserFields
@@ -2618,7 +2666,7 @@ var UPDATE_USER_MUTATION = import_client24.gql`
2618
2666
  }
2619
2667
  ${USER_FIELDS_FRAGMENT}
2620
2668
  `;
2621
- var ADD_USER_FAVOURITE_RESOURCE_MUTATION = import_client24.gql`
2669
+ var ADD_USER_FAVOURITE_RESOURCE_MUTATION = import_client26.gql`
2622
2670
  mutation addUserFavouriteResource(
2623
2671
  $resourceId: ID!
2624
2672
  $resourceType: ResourceTypeEnum!
@@ -2634,7 +2682,7 @@ var ADD_USER_FAVOURITE_RESOURCE_MUTATION = import_client24.gql`
2634
2682
  }
2635
2683
  ${USER_FIELDS_FRAGMENT}
2636
2684
  `;
2637
- var REMOVE_USER_FAVOURITE_RESOURCE_MUTATION = import_client24.gql`
2685
+ var REMOVE_USER_FAVOURITE_RESOURCE_MUTATION = import_client26.gql`
2638
2686
  mutation removeUserFavouriteResource(
2639
2687
  $resourceId: ID!
2640
2688
  $resourceType: ResourceTypeEnum!
@@ -2653,19 +2701,19 @@ var REMOVE_USER_FAVOURITE_RESOURCE_MUTATION = import_client24.gql`
2653
2701
 
2654
2702
  // src/graphql/hooks/user/hooksMutation.ts
2655
2703
  var useCreateUser = () => {
2656
- const [createUser, { loading, error }] = (0, import_client25.useMutation)(CREATE_USER_MUTATION, {
2704
+ const [createUser, { loading, error }] = (0, import_client27.useMutation)(CREATE_USER_MUTATION, {
2657
2705
  awaitRefetchQueries: true
2658
2706
  });
2659
2707
  return { createUser, error, loading };
2660
2708
  };
2661
2709
  var useUpdateUser = () => {
2662
- const [updateUser, { loading, error }] = (0, import_client25.useMutation)(UPDATE_USER_MUTATION, {
2710
+ const [updateUser, { loading, error }] = (0, import_client27.useMutation)(UPDATE_USER_MUTATION, {
2663
2711
  awaitRefetchQueries: true
2664
2712
  });
2665
2713
  return { error, loading, updateUser };
2666
2714
  };
2667
2715
  var useAddUserFavouriteResource = () => {
2668
- const [addUserFavouriteResource, { loading, error }] = (0, import_client25.useMutation)(
2716
+ const [addUserFavouriteResource, { loading, error }] = (0, import_client27.useMutation)(
2669
2717
  ADD_USER_FAVOURITE_RESOURCE_MUTATION,
2670
2718
  {
2671
2719
  awaitRefetchQueries: true,
@@ -2675,7 +2723,7 @@ var useAddUserFavouriteResource = () => {
2675
2723
  return { addUserFavouriteResource, error, loading };
2676
2724
  };
2677
2725
  var useRemoveUserFavouriteResource = () => {
2678
- const [removeUserFavouriteResource, { loading, error }] = (0, import_client25.useMutation)(
2726
+ const [removeUserFavouriteResource, { loading, error }] = (0, import_client27.useMutation)(
2679
2727
  REMOVE_USER_FAVOURITE_RESOURCE_MUTATION,
2680
2728
  {
2681
2729
  awaitRefetchQueries: true,
@@ -2686,30 +2734,30 @@ var useRemoveUserFavouriteResource = () => {
2686
2734
  };
2687
2735
 
2688
2736
  // src/graphql/hooks/user/hooksQuery.ts
2689
- var import_client26 = require("@apollo/client");
2737
+ var import_client28 = require("@apollo/client");
2690
2738
  var useGetUsers = () => {
2691
- const { loading, error, data, refetch } = (0, import_client26.useQuery)(GET_USERS, {
2739
+ const { loading, error, data, refetch } = (0, import_client28.useQuery)(GET_USERS, {
2692
2740
  fetchPolicy: "network-only"
2693
2741
  });
2694
2742
  const users = data?.users;
2695
2743
  return { error, loading, refetch, users };
2696
2744
  };
2697
2745
  var useGetUser = (id) => {
2698
- const { loading, error, data, refetch } = (0, import_client26.useQuery)(GET_USER, {
2746
+ const { loading, error, data, refetch } = (0, import_client28.useQuery)(GET_USER, {
2699
2747
  variables: { id }
2700
2748
  });
2701
2749
  const user = data?.user;
2702
2750
  return { error, loading, refetch, user };
2703
2751
  };
2704
2752
  var useGetUserMarkets = () => {
2705
- const { loading, error, data, refetch } = (0, import_client26.useQuery)(GET_USER_MARKETS, {
2753
+ const { loading, error, data, refetch } = (0, import_client28.useQuery)(GET_USER_MARKETS, {
2706
2754
  fetchPolicy: "network-only"
2707
2755
  });
2708
2756
  const userMarkets = data?.userMarkets;
2709
2757
  return { error, loading, refetch, userMarkets };
2710
2758
  };
2711
2759
  var useGetUserFavourites = () => {
2712
- const { loading, error, data, refetch } = (0, import_client26.useQuery)(GET_USER_FAVOURITES, {
2760
+ const { loading, error, data, refetch } = (0, import_client28.useQuery)(GET_USER_FAVOURITES, {
2713
2761
  fetchPolicy: "network-only"
2714
2762
  });
2715
2763
  const markets = data?.userFavourites.markets;
@@ -2721,7 +2769,7 @@ var useGetUserFavourites = () => {
2721
2769
  return { error, loading, refetch, userFavourites };
2722
2770
  };
2723
2771
  var useGetUserNotifications = () => {
2724
- const { loading, error, data, refetch } = (0, import_client26.useQuery)(GET_USER_NOTIFICATIONS, {
2772
+ const { loading, error, data, refetch } = (0, import_client28.useQuery)(GET_USER_NOTIFICATIONS, {
2725
2773
  fetchPolicy: "network-only"
2726
2774
  });
2727
2775
  const userNotifications = data?.userNotifications;
@@ -2894,10 +2942,8 @@ var producedIngTypes = [
2894
2942
  "Farm",
2895
2943
  "Other"
2896
2944
  ];
2897
- var paymentMethodTyes = ["Cash", "Eftpos", "Transfer"];
2898
2945
  var packagingOptions = mapArrayToOptions(packagingTypes);
2899
2946
  var producedIngOptions = mapArrayToOptions(producedIngTypes);
2900
- var paymentMethodOptions = mapArrayToOptions(paymentMethodTyes);
2901
2947
 
2902
2948
  // src/formFields/market.ts
2903
2949
  var marketBasicInfoFields = [
@@ -2935,6 +2981,30 @@ var stallApplicationInfo = [
2935
2981
  keyboardType: "number-pad",
2936
2982
  name: "stallApplicationInfo.stallCapacity",
2937
2983
  placeholder: "Stall Capacity"
2984
+ },
2985
+ {
2986
+ helperText: "Payment Due Hours of the Market *",
2987
+ keyboardType: "number-pad",
2988
+ name: "stallApplicationInfo.paymentDueHours",
2989
+ placeholder: "Payment Due Hours"
2990
+ }
2991
+ ];
2992
+ var stallApplicationInfoPaymentTarget = {
2993
+ helperText: "Payment Target of the Market *",
2994
+ isTextArea: true,
2995
+ name: "stallApplicationInfo.paymentTarget",
2996
+ placeholder: "Payment Target"
2997
+ };
2998
+ var stallApplicationInfoDropdowns = [
2999
+ {
3000
+ helperText: "Select payment method *",
3001
+ name: "stallApplicationInfo.paymentMethod",
3002
+ placeholder: "Choose Payment Method"
3003
+ },
3004
+ {
3005
+ helperText: "Rejection Policy *",
3006
+ name: "stallApplicationInfo.rejectionPolicy",
3007
+ placeholder: "Choose Rejection Policy"
2938
3008
  }
2939
3009
  ];
2940
3010
  var marketStartDateFields = [
@@ -2988,7 +3058,8 @@ var availableTagTypes = [
2988
3058
  "Parking Available",
2989
3059
  "Toilet Available",
2990
3060
  "Wheelchair Accessible",
2991
- "Near Playground"
3061
+ "Near Playground",
3062
+ "Port Nearby"
2992
3063
  ];
2993
3064
  var tagOptions = mapArrayToOptions(availableTagTypes);
2994
3065
  var rejectionPolicyOptions = mapArrayToOptions(
@@ -3420,6 +3491,7 @@ var categoryColors = {
3420
3491
  0 && (module.exports = {
3421
3492
  EnumInviteStatus,
3422
3493
  EnumNotification,
3494
+ EnumPaymentMethod,
3423
3495
  EnumRegions,
3424
3496
  EnumRejectionPolicy,
3425
3497
  EnumRelationResource,
@@ -3460,6 +3532,7 @@ var categoryColors = {
3460
3532
  marketPriceByDateFields,
3461
3533
  marketSchema,
3462
3534
  marketStartDateFields,
3535
+ noLeadingZeros,
3463
3536
  packagingOptions,
3464
3537
  passwordSchema,
3465
3538
  paymentMethodOptions,
@@ -3475,6 +3548,8 @@ var categoryColors = {
3475
3548
  resetPasswordSchema,
3476
3549
  sortDatesByProximity,
3477
3550
  stallApplicationInfo,
3551
+ stallApplicationInfoDropdowns,
3552
+ stallApplicationInfoPaymentTarget,
3478
3553
  stallHolderSchema,
3479
3554
  stallholderApplyFormSchema,
3480
3555
  stallholderBasicInfoFields,
@@ -3501,6 +3576,7 @@ var categoryColors = {
3501
3576
  useAddUserFavouriteResource,
3502
3577
  useCreateChat,
3503
3578
  useCreateMarket,
3579
+ useCreatePoster,
3504
3580
  useCreateRelation,
3505
3581
  useCreateStallholder,
3506
3582
  useCreateStallholderApplyForm,