@timardex/cluemart-shared 1.0.13 → 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,20 +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["EXPIRED"] = "EXPIRED";
188
- EnumInviteStatus2["NO_STATUS"] = "NO_STATUS";
189
- EnumInviteStatus2["PENDING"] = "PENDING";
190
- EnumInviteStatus2["REJECTED"] = "REJECTED";
191
- EnumInviteStatus2["WAITING"] = "WAITING";
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";
192
197
  return EnumInviteStatus2;
193
198
  })(EnumInviteStatus || {});
194
199
  var EnumRejectionPolicy = /* @__PURE__ */ ((EnumRejectionPolicy2) => {
195
- EnumRejectionPolicy2["SINGLE_DATE_ALLOWED"] = "single_date_allowed";
196
- EnumRejectionPolicy2["MULTI_DATE_ALLOWED"] = "multi_date_allowed";
200
+ EnumRejectionPolicy2["SINGLE_DATE_ALLOWED"] = "Single date allowed";
201
+ EnumRejectionPolicy2["MULTI_DATE_ALLOWED"] = "Multi date allowed";
197
202
  return EnumRejectionPolicy2;
198
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 || {});
199
212
  var EnumResourceType = /* @__PURE__ */ ((EnumResourceType2) => {
200
213
  EnumResourceType2["MARKET"] = "market";
201
214
  EnumResourceType2["STALLHOLDER"] = "stallholder";
@@ -328,8 +341,8 @@ var truncateText = (text, maxLength = 30) => {
328
341
  return text.length > maxLength ? text.substring(0, maxLength) + "..." : text;
329
342
  };
330
343
  var mapArrayToOptions = (items) => items.map((item) => ({
331
- label: item.replace(/_/g, " "),
332
- value: item.replace(/\s+/g, "_").toLowerCase()
344
+ label: item,
345
+ value: item
333
346
  }));
334
347
  var capitalizeFirstLetter = (str) => {
335
348
  return str.split(" ").map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(" ");
@@ -356,6 +369,9 @@ function sortDatesByProximity(dates) {
356
369
  }
357
370
  var availableRegionTypes = Object.values(EnumRegions);
358
371
  var availableRegionOptions = mapArrayToOptions(availableRegionTypes);
372
+ var paymentMethodOptions = mapArrayToOptions(
373
+ Object.values(EnumPaymentMethod)
374
+ );
359
375
 
360
376
  // src/hooks/useLocationSearch.ts
361
377
  var handleApiError = (error, message) => {
@@ -441,6 +457,18 @@ var import_dayjs2 = __toESM(require("dayjs"));
441
457
  var import_customParseFormat2 = __toESM(require("dayjs/plugin/customParseFormat"));
442
458
  var import_isSameOrAfter = __toESM(require("dayjs/plugin/isSameOrAfter"));
443
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
+ };
444
472
  (0, import_dayjs2.extend)(import_isSameOrAfter.default);
445
473
  (0, import_dayjs2.extend)(import_customParseFormat2.default);
446
474
  var now = (0, import_dayjs2.default)();
@@ -500,11 +528,8 @@ var dateTimeSchema = yup.object().shape({
500
528
  endTime: yup.string().concat(endTimeMustBeAfterStartTimeTest).required("End time is required"),
501
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(
502
530
  "no-leading-zeros",
503
- "Market price must not have leading zeros",
504
- (value, context) => {
505
- const original = context.originalValue?.toString() ?? "";
506
- return !/^0\d+(\.\d+)?$/.test(original);
507
- }
531
+ "",
532
+ noLeadingZeros("Market price", { allowDecimal: true })
508
533
  ),
509
534
  startDate: yup.string().concat(startDateNotInPastTest).required("Start date is required"),
510
535
  startTime: yup.string().concat(startTimeCannotBeInPastTest).required("Start time is required")
@@ -546,21 +571,14 @@ var marketSchema = globalResourceSchema.shape({
546
571
  stallApplicationInfo: yup2.object().shape({
547
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(
548
573
  "no-leading-zeros",
549
- "Application deadline hours must not start with leading zeros",
550
- (value, context) => {
551
- const original = context.originalValue?.toString() ?? "";
552
- return !/^0\d+$/.test(original);
553
- }
574
+ "",
575
+ noLeadingZeros("Application deadline hours")
554
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"),
555
580
  rejectionPolicy: yup2.mixed().oneOf(Object.values(EnumRejectionPolicy)).required("Rejection policy is required"),
556
- 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(
557
- "no-leading-zeros",
558
- "Stall capacity must not have leading zeros",
559
- (value, context) => {
560
- const original = context.originalValue?.toString() ?? "";
561
- return !/^0\d+$/.test(original);
562
- }
563
- )
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"))
564
582
  }),
565
583
  tags: yup2.array().of(yup2.string().defined()).nullable()
566
584
  });
@@ -601,7 +619,7 @@ var stallholderApplyFormSchema = yup3.object().shape({
601
619
  isRequired: yup3.boolean().required("Gazebo requirement is required")
602
620
  }),
603
621
  packaging: yup3.array().of(yup3.string().defined()).min(1, "Packaging list must contain at least one item").required("Packaging is required"),
604
- paymentMethod: yup3.string().required("Please select a Payment method"),
622
+ paymentMethod: yup3.mixed().oneOf(Object.values(EnumPaymentMethod)).required("Please select a Payment method"),
605
623
  priceRange: yup3.object().shape({
606
624
  max: yup3.number().min(1).required("Max price is required").test(
607
625
  "is-greater",
@@ -721,7 +739,10 @@ var defaultMarketFormValues = {
721
739
  provider: "Provider name",
722
740
  stallApplicationInfo: {
723
741
  applicationDeadlineHours: 0,
724
- rejectionPolicy: "multi_date_allowed" /* MULTI_DATE_ALLOWED */,
742
+ paymentDueHours: 0,
743
+ paymentMethod: "",
744
+ paymentTarget: "",
745
+ rejectionPolicy: "Multi date allowed" /* MULTI_DATE_ALLOWED */,
725
746
  stallCapacity: 0
726
747
  },
727
748
  tags: null
@@ -1645,6 +1666,9 @@ var MARKET = import_client8.gql`
1645
1666
  relationIds
1646
1667
  stallApplicationInfo {
1647
1668
  applicationDeadlineHours
1669
+ paymentDueHours
1670
+ paymentMethod
1671
+ paymentTarget
1648
1672
  rejectionPolicy
1649
1673
  stallCapacity
1650
1674
  }
@@ -1991,15 +2015,36 @@ var useGetMarketsNearMe = (location) => {
1991
2015
  return { error, loading, markets, refetch };
1992
2016
  };
1993
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
+
1994
2039
  // src/graphql/hooks/relation/hooksMutation.ts
1995
- var import_client16 = require("@apollo/client");
2040
+ var import_client18 = require("@apollo/client");
1996
2041
 
1997
2042
  // src/graphql/mutations/relation.ts
1998
- var import_client15 = require("@apollo/client");
2043
+ var import_client17 = require("@apollo/client");
1999
2044
 
2000
2045
  // src/graphql/queries/relation.ts
2001
- var import_client14 = require("@apollo/client");
2002
- var RELATION_UPDATE_BY_FRAGMENT = import_client14.gql`
2046
+ var import_client16 = require("@apollo/client");
2047
+ var RELATION_UPDATE_BY_FRAGMENT = import_client16.gql`
2003
2048
  fragment RelationUpdateBy on RelationUpdateByType {
2004
2049
  resourceId
2005
2050
  resourceName
@@ -2008,7 +2053,7 @@ var RELATION_UPDATE_BY_FRAGMENT = import_client14.gql`
2008
2053
  toStatus
2009
2054
  }
2010
2055
  `;
2011
- var RELATION_LOGS_FRAGMENT = import_client14.gql`
2056
+ var RELATION_LOGS_FRAGMENT = import_client16.gql`
2012
2057
  fragment RelationLogs on RelationLogType {
2013
2058
  createdAt
2014
2059
  updatedAt
@@ -2018,7 +2063,7 @@ var RELATION_LOGS_FRAGMENT = import_client14.gql`
2018
2063
  }
2019
2064
  ${RELATION_UPDATE_BY_FRAGMENT}
2020
2065
  `;
2021
- var RELATION_DATES_FRAGMENT = import_client14.gql`
2066
+ var RELATION_DATES_FRAGMENT = import_client16.gql`
2022
2067
  fragment RelationDates on RelationDateType {
2023
2068
  lastUpdateBy
2024
2069
  marketPrice
@@ -2026,7 +2071,7 @@ var RELATION_DATES_FRAGMENT = import_client14.gql`
2026
2071
  status
2027
2072
  }
2028
2073
  `;
2029
- var RELATION_FIELDS_FRAGMENT = import_client14.gql`
2074
+ var RELATION_FIELDS_FRAGMENT = import_client16.gql`
2030
2075
  fragment RelationFields on RelationType {
2031
2076
  _id
2032
2077
  apiMessage
@@ -2046,7 +2091,7 @@ var RELATION_FIELDS_FRAGMENT = import_client14.gql`
2046
2091
  ${RELATION_DATES_FRAGMENT}
2047
2092
  ${RELATION_LOGS_FRAGMENT}
2048
2093
  `;
2049
- var GET_RELATION = import_client14.gql`
2094
+ var GET_RELATION = import_client16.gql`
2050
2095
  query getRelation($id: ID!) {
2051
2096
  relation(_id: $id) {
2052
2097
  ...RelationFields
@@ -2054,7 +2099,7 @@ var GET_RELATION = import_client14.gql`
2054
2099
  }
2055
2100
  ${RELATION_FIELDS_FRAGMENT}
2056
2101
  `;
2057
- var GET_RELATION_BY_MARKET_AND_STALLHOLDER = import_client14.gql`
2102
+ var GET_RELATION_BY_MARKET_AND_STALLHOLDER = import_client16.gql`
2058
2103
  query getRelationByMarketAndStallholder($marketId: ID!, $stallholderId: ID!) {
2059
2104
  relationByMarketAndStallholder(
2060
2105
  marketId: $marketId
@@ -2065,7 +2110,7 @@ var GET_RELATION_BY_MARKET_AND_STALLHOLDER = import_client14.gql`
2065
2110
  }
2066
2111
  ${RELATION_FIELDS_FRAGMENT}
2067
2112
  `;
2068
- var GET_MARKET_RELATIONS = import_client14.gql`
2113
+ var GET_MARKET_RELATIONS = import_client16.gql`
2069
2114
  query getMarketRelations($marketId: ID!) {
2070
2115
  marketRelations(marketId: $marketId) {
2071
2116
  ...RelationFields
@@ -2073,7 +2118,7 @@ var GET_MARKET_RELATIONS = import_client14.gql`
2073
2118
  }
2074
2119
  ${RELATION_FIELDS_FRAGMENT}
2075
2120
  `;
2076
- var GET_STALLHOLDER_RELATIONS = import_client14.gql`
2121
+ var GET_STALLHOLDER_RELATIONS = import_client16.gql`
2077
2122
  query getStallholderRelations($stallholderId: ID!) {
2078
2123
  stallholderRelations(stallholderId: $stallholderId) {
2079
2124
  ...RelationFields
@@ -2081,7 +2126,7 @@ var GET_STALLHOLDER_RELATIONS = import_client14.gql`
2081
2126
  }
2082
2127
  ${RELATION_FIELDS_FRAGMENT}
2083
2128
  `;
2084
- var GET_RESOURCE_CONNECTIONS = import_client14.gql`
2129
+ var GET_RESOURCE_CONNECTIONS = import_client16.gql`
2085
2130
  query getResourceConnections(
2086
2131
  $resourceId: ID!
2087
2132
  $resourceType: ResourceTypeEnum!
@@ -2179,7 +2224,7 @@ var GET_RESOURCE_CONNECTIONS = import_client14.gql`
2179
2224
  `;
2180
2225
 
2181
2226
  // src/graphql/mutations/relation.ts
2182
- var CREATE_RELATION_MUTATION = import_client15.gql`
2227
+ var CREATE_RELATION_MUTATION = import_client17.gql`
2183
2228
  mutation createRelation($input: RelationInputType!) {
2184
2229
  createRelation(input: $input) {
2185
2230
  ...RelationFields
@@ -2187,7 +2232,7 @@ var CREATE_RELATION_MUTATION = import_client15.gql`
2187
2232
  }
2188
2233
  ${RELATION_FIELDS_FRAGMENT}
2189
2234
  `;
2190
- var UPDATE_RELATION_MUTATION = import_client15.gql`
2235
+ var UPDATE_RELATION_MUTATION = import_client17.gql`
2191
2236
  mutation updateRelation($_id: ID!, $input: RelationInputType!) {
2192
2237
  updateRelation(_id: $_id, input: $input) {
2193
2238
  ...RelationFields
@@ -2195,7 +2240,7 @@ var UPDATE_RELATION_MUTATION = import_client15.gql`
2195
2240
  }
2196
2241
  ${RELATION_FIELDS_FRAGMENT}
2197
2242
  `;
2198
- var DELETE_RELATION_MUTATION = import_client15.gql`
2243
+ var DELETE_RELATION_MUTATION = import_client17.gql`
2199
2244
  mutation deleteRelation($_id: ID!) {
2200
2245
  deleteRelation(_id: $_id) {
2201
2246
  ...RelationFields
@@ -2206,7 +2251,7 @@ var DELETE_RELATION_MUTATION = import_client15.gql`
2206
2251
 
2207
2252
  // src/graphql/hooks/relation/hooksMutation.ts
2208
2253
  var useCreateRelation = () => {
2209
- const [createRelation, { loading, error }] = (0, import_client16.useMutation)(
2254
+ const [createRelation, { loading, error }] = (0, import_client18.useMutation)(
2210
2255
  CREATE_RELATION_MUTATION,
2211
2256
  {
2212
2257
  awaitRefetchQueries: true,
@@ -2241,7 +2286,7 @@ var useCreateRelation = () => {
2241
2286
  return { createRelation, error, loading };
2242
2287
  };
2243
2288
  var useUpdateRelation = () => {
2244
- const [updateRelation, { loading, error }] = (0, import_client16.useMutation)(
2289
+ const [updateRelation, { loading, error }] = (0, import_client18.useMutation)(
2245
2290
  UPDATE_RELATION_MUTATION,
2246
2291
  {
2247
2292
  awaitRefetchQueries: true,
@@ -2276,7 +2321,7 @@ var useUpdateRelation = () => {
2276
2321
  return { error, loading, updateRelation };
2277
2322
  };
2278
2323
  var useDeleteRelation = () => {
2279
- const [deleteRelation, { loading, error }] = (0, import_client16.useMutation)(
2324
+ const [deleteRelation, { loading, error }] = (0, import_client18.useMutation)(
2280
2325
  DELETE_RELATION_MUTATION,
2281
2326
  {
2282
2327
  awaitRefetchQueries: true,
@@ -2304,9 +2349,9 @@ var useDeleteRelation = () => {
2304
2349
  };
2305
2350
 
2306
2351
  // src/graphql/hooks/relation/hooksQuery.ts
2307
- var import_client17 = require("@apollo/client");
2352
+ var import_client19 = require("@apollo/client");
2308
2353
  var useGetRelation = (id) => {
2309
- const { loading, error, data, refetch } = (0, import_client17.useQuery)(GET_RELATION, {
2354
+ const { loading, error, data, refetch } = (0, import_client19.useQuery)(GET_RELATION, {
2310
2355
  fetchPolicy: "network-only",
2311
2356
  skip: id === "",
2312
2357
  variables: { id }
@@ -2315,7 +2360,7 @@ var useGetRelation = (id) => {
2315
2360
  return { error, loading, refetch, relation };
2316
2361
  };
2317
2362
  var useGetRelationByMarketAndStallholder = (marketId, stallholderId) => {
2318
- const { loading, error, data, refetch } = (0, import_client17.useQuery)(
2363
+ const { loading, error, data, refetch } = (0, import_client19.useQuery)(
2319
2364
  GET_RELATION_BY_MARKET_AND_STALLHOLDER,
2320
2365
  {
2321
2366
  fetchPolicy: "no-cache",
@@ -2327,7 +2372,7 @@ var useGetRelationByMarketAndStallholder = (marketId, stallholderId) => {
2327
2372
  return { error, loading, refetch, relationByMarketAndStallholder };
2328
2373
  };
2329
2374
  var useGetMarketRelations = (marketId) => {
2330
- 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, {
2331
2376
  fetchPolicy: "network-only",
2332
2377
  skip: marketId === "",
2333
2378
  variables: { marketId }
@@ -2336,7 +2381,7 @@ var useGetMarketRelations = (marketId) => {
2336
2381
  return { error, loading, marketRelations, refetch };
2337
2382
  };
2338
2383
  var useGetStallholderRelations = (stallholderId) => {
2339
- const { loading, error, data, refetch } = (0, import_client17.useQuery)(
2384
+ const { loading, error, data, refetch } = (0, import_client19.useQuery)(
2340
2385
  GET_STALLHOLDER_RELATIONS,
2341
2386
  {
2342
2387
  fetchPolicy: "network-only",
@@ -2348,7 +2393,7 @@ var useGetStallholderRelations = (stallholderId) => {
2348
2393
  return { error, loading, refetch, stallholderRelations };
2349
2394
  };
2350
2395
  var useGetResourceConnections = (resourceId, resourceType) => {
2351
- 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, {
2352
2397
  fetchPolicy: "network-only",
2353
2398
  variables: { resourceId, resourceType }
2354
2399
  });
@@ -2357,11 +2402,11 @@ var useGetResourceConnections = (resourceId, resourceType) => {
2357
2402
  };
2358
2403
 
2359
2404
  // src/graphql/hooks/stallholder/hooksMutation.ts
2360
- var import_client19 = require("@apollo/client");
2405
+ var import_client21 = require("@apollo/client");
2361
2406
 
2362
2407
  // src/graphql/mutations/stallholder.ts
2363
- var import_client18 = require("@apollo/client");
2364
- var CREATE_STALLHOLDER_MUTATION = import_client18.gql`
2408
+ var import_client20 = require("@apollo/client");
2409
+ var CREATE_STALLHOLDER_MUTATION = import_client20.gql`
2365
2410
  mutation createStallholder($input: StallholderInputType!) {
2366
2411
  createStallholder(input: $input) {
2367
2412
  ...StallholderFields
@@ -2369,7 +2414,7 @@ var CREATE_STALLHOLDER_MUTATION = import_client18.gql`
2369
2414
  }
2370
2415
  ${STALLHOLDER}
2371
2416
  `;
2372
- var UPDATE_STALLHOLDER_MUTATION = import_client18.gql`
2417
+ var UPDATE_STALLHOLDER_MUTATION = import_client20.gql`
2373
2418
  mutation updateStallholder($_id: ID!, $input: StallholderInputType!) {
2374
2419
  updateStallholder(_id: $_id, input: $input) {
2375
2420
  ...StallholderFields
@@ -2377,12 +2422,12 @@ var UPDATE_STALLHOLDER_MUTATION = import_client18.gql`
2377
2422
  }
2378
2423
  ${STALLHOLDER}
2379
2424
  `;
2380
- var DELETE_STALLHOLDER_MUTATION = import_client18.gql`
2425
+ var DELETE_STALLHOLDER_MUTATION = import_client20.gql`
2381
2426
  mutation deleteStallholder($_id: ID!) {
2382
2427
  deleteStallholder(_id: $_id)
2383
2428
  }
2384
2429
  `;
2385
- var CREATE_STALLHOLDER_APPLY_FORM_MUTATION = import_client18.gql`
2430
+ var CREATE_STALLHOLDER_APPLY_FORM_MUTATION = import_client20.gql`
2386
2431
  mutation createStallholderApplyForm($input: StallholderApplyFormInputType!) {
2387
2432
  createStallholderApplyForm(input: $input) {
2388
2433
  ...StallholderApplyFormFields
@@ -2390,7 +2435,7 @@ var CREATE_STALLHOLDER_APPLY_FORM_MUTATION = import_client18.gql`
2390
2435
  }
2391
2436
  ${STALLHOLDER_APPLY_FORM}
2392
2437
  `;
2393
- var UPDATE_STALLHOLDER_APPLY_FORM_MUTATION = import_client18.gql`
2438
+ var UPDATE_STALLHOLDER_APPLY_FORM_MUTATION = import_client20.gql`
2394
2439
  mutation updateStallholderApplyForm(
2395
2440
  $_id: ID!
2396
2441
  $input: StallholderApplyFormInputType!
@@ -2404,7 +2449,7 @@ var UPDATE_STALLHOLDER_APPLY_FORM_MUTATION = import_client18.gql`
2404
2449
 
2405
2450
  // src/graphql/hooks/stallholder/hooksMutation.ts
2406
2451
  var useCreateStallholder = () => {
2407
- const [createStallholder, { loading, error }] = (0, import_client19.useMutation)(
2452
+ const [createStallholder, { loading, error }] = (0, import_client21.useMutation)(
2408
2453
  CREATE_STALLHOLDER_MUTATION,
2409
2454
  {
2410
2455
  awaitRefetchQueries: true,
@@ -2414,7 +2459,7 @@ var useCreateStallholder = () => {
2414
2459
  return { createStallholder, error, loading };
2415
2460
  };
2416
2461
  var useUpdateStallholder = () => {
2417
- const [updateStallholder, { loading, error }] = (0, import_client19.useMutation)(
2462
+ const [updateStallholder, { loading, error }] = (0, import_client21.useMutation)(
2418
2463
  UPDATE_STALLHOLDER_MUTATION,
2419
2464
  {
2420
2465
  awaitRefetchQueries: true,
@@ -2424,7 +2469,7 @@ var useUpdateStallholder = () => {
2424
2469
  return { error, loading, updateStallholder };
2425
2470
  };
2426
2471
  var useDeleteStallholder = () => {
2427
- const [deleteStallholder, { loading, error }] = (0, import_client19.useMutation)(
2472
+ const [deleteStallholder, { loading, error }] = (0, import_client21.useMutation)(
2428
2473
  DELETE_STALLHOLDER_MUTATION,
2429
2474
  {
2430
2475
  awaitRefetchQueries: true,
@@ -2434,7 +2479,7 @@ var useDeleteStallholder = () => {
2434
2479
  return { deleteStallholder, error, loading };
2435
2480
  };
2436
2481
  var useCreateStallholderApplyForm = () => {
2437
- const [createStallholderApplyForm, { loading, error }] = (0, import_client19.useMutation)(
2482
+ const [createStallholderApplyForm, { loading, error }] = (0, import_client21.useMutation)(
2438
2483
  CREATE_STALLHOLDER_APPLY_FORM_MUTATION,
2439
2484
  {
2440
2485
  awaitRefetchQueries: true,
@@ -2454,7 +2499,7 @@ var useCreateStallholderApplyForm = () => {
2454
2499
  return { createStallholderApplyForm, error, loading };
2455
2500
  };
2456
2501
  var useUpdateStallholderApplyForm = () => {
2457
- const [updateStallholderApplyForm, { loading, error }] = (0, import_client19.useMutation)(
2502
+ const [updateStallholderApplyForm, { loading, error }] = (0, import_client21.useMutation)(
2458
2503
  UPDATE_STALLHOLDER_APPLY_FORM_MUTATION,
2459
2504
  {
2460
2505
  awaitRefetchQueries: true,
@@ -2475,9 +2520,9 @@ var useUpdateStallholderApplyForm = () => {
2475
2520
  };
2476
2521
 
2477
2522
  // src/graphql/hooks/stallholder/hooksQuery.ts
2478
- var import_client20 = require("@apollo/client");
2523
+ var import_client22 = require("@apollo/client");
2479
2524
  var useGetStallholders = () => {
2480
- const { loading, error, data, refetch } = (0, import_client20.useQuery)(GET_STALLHOLDERS, {
2525
+ const { loading, error, data, refetch } = (0, import_client22.useQuery)(GET_STALLHOLDERS, {
2481
2526
  fetchPolicy: "network-only"
2482
2527
  });
2483
2528
  const stallholders = data?.stallholders;
@@ -2489,7 +2534,7 @@ var useGetStallholders = () => {
2489
2534
  };
2490
2535
  };
2491
2536
  var useGetStallholder = (_id) => {
2492
- const { loading, error, data, refetch } = (0, import_client20.useQuery)(GET_STALLHOLDER, {
2537
+ const { loading, error, data, refetch } = (0, import_client22.useQuery)(GET_STALLHOLDER, {
2493
2538
  fetchPolicy: "network-only",
2494
2539
  skip: !_id,
2495
2540
  variables: { _id }
@@ -2498,7 +2543,7 @@ var useGetStallholder = (_id) => {
2498
2543
  return { error, loading, refetch, stallholder };
2499
2544
  };
2500
2545
  var useGetStallholdersByRegion = (region) => {
2501
- const { loading, error, data, refetch } = (0, import_client20.useQuery)(
2546
+ const { loading, error, data, refetch } = (0, import_client22.useQuery)(
2502
2547
  GET_STALLHOLDERS_BY_REGION,
2503
2548
  {
2504
2549
  fetchPolicy: "network-only",
@@ -2510,7 +2555,7 @@ var useGetStallholdersByRegion = (region) => {
2510
2555
  return { error, loading, refetch, stallholders };
2511
2556
  };
2512
2557
  var useSearchStallholders = (search, region) => {
2513
- const { loading, error, data, refetch } = (0, import_client20.useQuery)(SEARCH_STALLHOLDERS, {
2558
+ const { loading, error, data, refetch } = (0, import_client22.useQuery)(SEARCH_STALLHOLDERS, {
2514
2559
  fetchPolicy: "network-only",
2515
2560
  skip: search.length < 3,
2516
2561
  variables: { region, search }
@@ -2519,7 +2564,7 @@ var useSearchStallholders = (search, region) => {
2519
2564
  return { error, loading, refetch, stallholders };
2520
2565
  };
2521
2566
  var useGetStallholderApplyForm = (stallholderId) => {
2522
- const { loading, error, data, refetch } = (0, import_client20.useQuery)(
2567
+ const { loading, error, data, refetch } = (0, import_client22.useQuery)(
2523
2568
  GET_STALLHOLDER_APPLY_FORM,
2524
2569
  {
2525
2570
  variables: { stallholderId }
@@ -2535,11 +2580,11 @@ var useGetStallholderApplyForm = (stallholderId) => {
2535
2580
  };
2536
2581
 
2537
2582
  // src/graphql/hooks/subscriptions.ts
2538
- var import_client23 = require("@apollo/client");
2583
+ var import_client25 = require("@apollo/client");
2539
2584
 
2540
2585
  // src/graphql/subscriptions/chat.ts
2541
- var import_client21 = require("@apollo/client");
2542
- var GET_CHAT_MESSAGE = import_client21.gql`
2586
+ var import_client23 = require("@apollo/client");
2587
+ var GET_CHAT_MESSAGE = import_client23.gql`
2543
2588
  subscription {
2544
2589
  getChatMessage {
2545
2590
  ...ChatFields
@@ -2549,8 +2594,8 @@ var GET_CHAT_MESSAGE = import_client21.gql`
2549
2594
  `;
2550
2595
 
2551
2596
  // src/graphql/subscriptions/notification.ts
2552
- var import_client22 = require("@apollo/client");
2553
- var NOTIFICATION_FIELDS_FRAGMENT = import_client22.gql`
2597
+ var import_client24 = require("@apollo/client");
2598
+ var NOTIFICATION_FIELDS_FRAGMENT = import_client24.gql`
2554
2599
  fragment NotificationFields on NotificationType {
2555
2600
  createdBy
2556
2601
  important
@@ -2560,7 +2605,7 @@ var NOTIFICATION_FIELDS_FRAGMENT = import_client22.gql`
2560
2605
  resourceType
2561
2606
  }
2562
2607
  `;
2563
- var GET_GLOBAL_NOTIFICATION = import_client22.gql`
2608
+ var GET_GLOBAL_NOTIFICATION = import_client24.gql`
2564
2609
  subscription {
2565
2610
  getGlobalNotification {
2566
2611
  ...NotificationFields
@@ -2568,7 +2613,7 @@ var GET_GLOBAL_NOTIFICATION = import_client22.gql`
2568
2613
  }
2569
2614
  ${NOTIFICATION_FIELDS_FRAGMENT}
2570
2615
  `;
2571
- var GET_RELATION_NOTIFICATION = import_client22.gql`
2616
+ var GET_RELATION_NOTIFICATION = import_client24.gql`
2572
2617
  subscription {
2573
2618
  getRelationNotification {
2574
2619
  ...NotificationFields
@@ -2583,29 +2628,29 @@ var useGetNotification = () => {
2583
2628
  data: global,
2584
2629
  loading: loadingGlobal,
2585
2630
  error: errorGlobal
2586
- } = (0, import_client23.useSubscription)(GET_GLOBAL_NOTIFICATION);
2631
+ } = (0, import_client25.useSubscription)(GET_GLOBAL_NOTIFICATION);
2587
2632
  const {
2588
2633
  data: relation,
2589
2634
  loading: loadingImportant,
2590
2635
  error: errorImportant
2591
- } = (0, import_client23.useSubscription)(GET_RELATION_NOTIFICATION);
2636
+ } = (0, import_client25.useSubscription)(GET_RELATION_NOTIFICATION);
2592
2637
  const error = errorGlobal || errorImportant;
2593
2638
  const loading = loadingGlobal || loadingImportant;
2594
2639
  const notification = relation?.getRelationNotification || global?.getGlobalNotification;
2595
2640
  return { error, loading, notification };
2596
2641
  };
2597
2642
  var useGetChatSubscription = () => {
2598
- const { data, loading, error } = (0, import_client23.useSubscription)(GET_CHAT_MESSAGE);
2643
+ const { data, loading, error } = (0, import_client25.useSubscription)(GET_CHAT_MESSAGE);
2599
2644
  const chat = data?.getChat;
2600
2645
  return { chat, error, loading };
2601
2646
  };
2602
2647
 
2603
2648
  // src/graphql/hooks/user/hooksMutation.ts
2604
- var import_client25 = require("@apollo/client");
2649
+ var import_client27 = require("@apollo/client");
2605
2650
 
2606
2651
  // src/graphql/mutations/user.ts
2607
- var import_client24 = require("@apollo/client");
2608
- var CREATE_USER_MUTATION = import_client24.gql`
2652
+ var import_client26 = require("@apollo/client");
2653
+ var CREATE_USER_MUTATION = import_client26.gql`
2609
2654
  mutation createUser($input: UserInputType!) {
2610
2655
  createUser(input: $input) {
2611
2656
  ...UserFields
@@ -2613,7 +2658,7 @@ var CREATE_USER_MUTATION = import_client24.gql`
2613
2658
  }
2614
2659
  ${USER_FIELDS_FRAGMENT}
2615
2660
  `;
2616
- var UPDATE_USER_MUTATION = import_client24.gql`
2661
+ var UPDATE_USER_MUTATION = import_client26.gql`
2617
2662
  mutation updateUser($_id: ID!, $input: UserInputType!) {
2618
2663
  updateUser(_id: $_id, input: $input) {
2619
2664
  ...UserFields
@@ -2621,7 +2666,7 @@ var UPDATE_USER_MUTATION = import_client24.gql`
2621
2666
  }
2622
2667
  ${USER_FIELDS_FRAGMENT}
2623
2668
  `;
2624
- var ADD_USER_FAVOURITE_RESOURCE_MUTATION = import_client24.gql`
2669
+ var ADD_USER_FAVOURITE_RESOURCE_MUTATION = import_client26.gql`
2625
2670
  mutation addUserFavouriteResource(
2626
2671
  $resourceId: ID!
2627
2672
  $resourceType: ResourceTypeEnum!
@@ -2637,7 +2682,7 @@ var ADD_USER_FAVOURITE_RESOURCE_MUTATION = import_client24.gql`
2637
2682
  }
2638
2683
  ${USER_FIELDS_FRAGMENT}
2639
2684
  `;
2640
- var REMOVE_USER_FAVOURITE_RESOURCE_MUTATION = import_client24.gql`
2685
+ var REMOVE_USER_FAVOURITE_RESOURCE_MUTATION = import_client26.gql`
2641
2686
  mutation removeUserFavouriteResource(
2642
2687
  $resourceId: ID!
2643
2688
  $resourceType: ResourceTypeEnum!
@@ -2656,19 +2701,19 @@ var REMOVE_USER_FAVOURITE_RESOURCE_MUTATION = import_client24.gql`
2656
2701
 
2657
2702
  // src/graphql/hooks/user/hooksMutation.ts
2658
2703
  var useCreateUser = () => {
2659
- const [createUser, { loading, error }] = (0, import_client25.useMutation)(CREATE_USER_MUTATION, {
2704
+ const [createUser, { loading, error }] = (0, import_client27.useMutation)(CREATE_USER_MUTATION, {
2660
2705
  awaitRefetchQueries: true
2661
2706
  });
2662
2707
  return { createUser, error, loading };
2663
2708
  };
2664
2709
  var useUpdateUser = () => {
2665
- const [updateUser, { loading, error }] = (0, import_client25.useMutation)(UPDATE_USER_MUTATION, {
2710
+ const [updateUser, { loading, error }] = (0, import_client27.useMutation)(UPDATE_USER_MUTATION, {
2666
2711
  awaitRefetchQueries: true
2667
2712
  });
2668
2713
  return { error, loading, updateUser };
2669
2714
  };
2670
2715
  var useAddUserFavouriteResource = () => {
2671
- const [addUserFavouriteResource, { loading, error }] = (0, import_client25.useMutation)(
2716
+ const [addUserFavouriteResource, { loading, error }] = (0, import_client27.useMutation)(
2672
2717
  ADD_USER_FAVOURITE_RESOURCE_MUTATION,
2673
2718
  {
2674
2719
  awaitRefetchQueries: true,
@@ -2678,7 +2723,7 @@ var useAddUserFavouriteResource = () => {
2678
2723
  return { addUserFavouriteResource, error, loading };
2679
2724
  };
2680
2725
  var useRemoveUserFavouriteResource = () => {
2681
- const [removeUserFavouriteResource, { loading, error }] = (0, import_client25.useMutation)(
2726
+ const [removeUserFavouriteResource, { loading, error }] = (0, import_client27.useMutation)(
2682
2727
  REMOVE_USER_FAVOURITE_RESOURCE_MUTATION,
2683
2728
  {
2684
2729
  awaitRefetchQueries: true,
@@ -2689,30 +2734,30 @@ var useRemoveUserFavouriteResource = () => {
2689
2734
  };
2690
2735
 
2691
2736
  // src/graphql/hooks/user/hooksQuery.ts
2692
- var import_client26 = require("@apollo/client");
2737
+ var import_client28 = require("@apollo/client");
2693
2738
  var useGetUsers = () => {
2694
- const { loading, error, data, refetch } = (0, import_client26.useQuery)(GET_USERS, {
2739
+ const { loading, error, data, refetch } = (0, import_client28.useQuery)(GET_USERS, {
2695
2740
  fetchPolicy: "network-only"
2696
2741
  });
2697
2742
  const users = data?.users;
2698
2743
  return { error, loading, refetch, users };
2699
2744
  };
2700
2745
  var useGetUser = (id) => {
2701
- const { loading, error, data, refetch } = (0, import_client26.useQuery)(GET_USER, {
2746
+ const { loading, error, data, refetch } = (0, import_client28.useQuery)(GET_USER, {
2702
2747
  variables: { id }
2703
2748
  });
2704
2749
  const user = data?.user;
2705
2750
  return { error, loading, refetch, user };
2706
2751
  };
2707
2752
  var useGetUserMarkets = () => {
2708
- 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, {
2709
2754
  fetchPolicy: "network-only"
2710
2755
  });
2711
2756
  const userMarkets = data?.userMarkets;
2712
2757
  return { error, loading, refetch, userMarkets };
2713
2758
  };
2714
2759
  var useGetUserFavourites = () => {
2715
- 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, {
2716
2761
  fetchPolicy: "network-only"
2717
2762
  });
2718
2763
  const markets = data?.userFavourites.markets;
@@ -2724,7 +2769,7 @@ var useGetUserFavourites = () => {
2724
2769
  return { error, loading, refetch, userFavourites };
2725
2770
  };
2726
2771
  var useGetUserNotifications = () => {
2727
- 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, {
2728
2773
  fetchPolicy: "network-only"
2729
2774
  });
2730
2775
  const userNotifications = data?.userNotifications;
@@ -2897,10 +2942,8 @@ var producedIngTypes = [
2897
2942
  "Farm",
2898
2943
  "Other"
2899
2944
  ];
2900
- var paymentMethodTyes = ["Cash", "Eftpos", "Transfer"];
2901
2945
  var packagingOptions = mapArrayToOptions(packagingTypes);
2902
2946
  var producedIngOptions = mapArrayToOptions(producedIngTypes);
2903
- var paymentMethodOptions = mapArrayToOptions(paymentMethodTyes);
2904
2947
 
2905
2948
  // src/formFields/market.ts
2906
2949
  var marketBasicInfoFields = [
@@ -2938,6 +2981,30 @@ var stallApplicationInfo = [
2938
2981
  keyboardType: "number-pad",
2939
2982
  name: "stallApplicationInfo.stallCapacity",
2940
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"
2941
3008
  }
2942
3009
  ];
2943
3010
  var marketStartDateFields = [
@@ -2991,7 +3058,8 @@ var availableTagTypes = [
2991
3058
  "Parking Available",
2992
3059
  "Toilet Available",
2993
3060
  "Wheelchair Accessible",
2994
- "Near Playground"
3061
+ "Near Playground",
3062
+ "Port Nearby"
2995
3063
  ];
2996
3064
  var tagOptions = mapArrayToOptions(availableTagTypes);
2997
3065
  var rejectionPolicyOptions = mapArrayToOptions(
@@ -3423,6 +3491,7 @@ var categoryColors = {
3423
3491
  0 && (module.exports = {
3424
3492
  EnumInviteStatus,
3425
3493
  EnumNotification,
3494
+ EnumPaymentMethod,
3426
3495
  EnumRegions,
3427
3496
  EnumRejectionPolicy,
3428
3497
  EnumRelationResource,
@@ -3463,6 +3532,7 @@ var categoryColors = {
3463
3532
  marketPriceByDateFields,
3464
3533
  marketSchema,
3465
3534
  marketStartDateFields,
3535
+ noLeadingZeros,
3466
3536
  packagingOptions,
3467
3537
  passwordSchema,
3468
3538
  paymentMethodOptions,
@@ -3478,6 +3548,8 @@ var categoryColors = {
3478
3548
  resetPasswordSchema,
3479
3549
  sortDatesByProximity,
3480
3550
  stallApplicationInfo,
3551
+ stallApplicationInfoDropdowns,
3552
+ stallApplicationInfoPaymentTarget,
3481
3553
  stallHolderSchema,
3482
3554
  stallholderApplyFormSchema,
3483
3555
  stallholderBasicInfoFields,
@@ -3504,6 +3576,7 @@ var categoryColors = {
3504
3576
  useAddUserFavouriteResource,
3505
3577
  useCreateChat,
3506
3578
  useCreateMarket,
3579
+ useCreatePoster,
3507
3580
  useCreateRelation,
3508
3581
  useCreateStallholder,
3509
3582
  useCreateStallholderApplyForm,