@timardex/cluemart-shared 1.0.57 → 1.0.59

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
@@ -59,8 +59,8 @@ __export(index_exports, {
59
59
  defaultMarketFormValues: () => defaultMarketFormValues,
60
60
  defaultMarketInfoFormValues: () => defaultMarketInfoFormValues,
61
61
  defaultRegion: () => defaultRegion,
62
- defaultStallholderApplyFormValues: () => defaultStallholderApplyFormValues,
63
62
  defaultStallholderFormValues: () => defaultStallholderFormValues,
63
+ defaultStallholderInfoFormValues: () => defaultStallholderInfoFormValues,
64
64
  formatDate: () => formatDate,
65
65
  formatTimestamp: () => formatTimestamp,
66
66
  getCurrentAndFutureDates: () => getCurrentAndFutureDates,
@@ -116,7 +116,7 @@ __export(index_exports, {
116
116
  useCreatePoster: () => useCreatePoster,
117
117
  useCreateRelation: () => useCreateRelation,
118
118
  useCreateStallholder: () => useCreateStallholder,
119
- useCreateStallholderApplyForm: () => useCreateStallholderApplyForm,
119
+ useCreateStallholderInfo: () => useCreateStallholderInfo,
120
120
  useCreateTester: () => useCreateTester,
121
121
  useCreateUser: () => useCreateUser,
122
122
  useDeleteChat: () => useDeleteChat,
@@ -137,7 +137,7 @@ __export(index_exports, {
137
137
  useGetRelationByMarketAndStallholder: () => useGetRelationByMarketAndStallholder,
138
138
  useGetResourceConnections: () => useGetResourceConnections,
139
139
  useGetStallholder: () => useGetStallholder,
140
- useGetStallholderApplyForm: () => useGetStallholderApplyForm,
140
+ useGetStallholderInfo: () => useGetStallholderInfo,
141
141
  useGetStallholderRelations: () => useGetStallholderRelations,
142
142
  useGetStallholders: () => useGetStallholders,
143
143
  useGetStallholdersByRegion: () => useGetStallholdersByRegion,
@@ -168,14 +168,14 @@ __export(index_exports, {
168
168
  useSearchMarkets: () => useSearchMarkets,
169
169
  useSearchStallholders: () => useSearchStallholders,
170
170
  useSendChatMessage: () => useSendChatMessage,
171
- useStallholderApplyForm: () => useStallholderApplyForm,
172
171
  useStallholderForm: () => useStallholderForm,
172
+ useStallholderInfoForm: () => useStallholderInfoForm,
173
173
  useTestersForm: () => useTestersForm,
174
174
  useUpdateMarket: () => useUpdateMarket,
175
175
  useUpdateMarketInfo: () => useUpdateMarketInfo,
176
176
  useUpdateRelation: () => useUpdateRelation,
177
177
  useUpdateStallholder: () => useUpdateStallholder,
178
- useUpdateStallholderApplyForm: () => useUpdateStallholderApplyForm,
178
+ useUpdateStallholderInfo: () => useUpdateStallholderInfo,
179
179
  useUpdateTester: () => useUpdateTester,
180
180
  useUpdateUser: () => useUpdateUser,
181
181
  useUserForm: () => useUserForm,
@@ -666,7 +666,7 @@ var stallHolderSchema = globalResourceSchema.shape({
666
666
  multiLocation: yup3.boolean().required("Multi location is required"),
667
667
  products: yup3.array().of(yup3.string().defined()).min(1, "Product list must contain at least one item").required("Products are required")
668
668
  });
669
- var stallholderApplyFormSchema = yup3.object().shape({
669
+ var stallholderInfoSchema = yup3.object().shape({
670
670
  electricity: yup3.object().shape({
671
671
  details: yup3.string().trim().test("details-required", "Please add details", function(value) {
672
672
  return !this.parent?.isRequired || (value?.trim().length ?? 0) > 0;
@@ -849,7 +849,7 @@ var defaultStallholderFormValues = {
849
849
  products: [],
850
850
  specialities: null
851
851
  };
852
- var defaultStallholderApplyFormValues = {
852
+ var defaultStallholderInfoFormValues = {
853
853
  electricity: { details: null, isRequired: false },
854
854
  foodSafetyGradeFiles: null,
855
855
  foodSafetyGradeFilesUpload: null,
@@ -958,11 +958,11 @@ function useStallholderForm(data) {
958
958
  };
959
959
  }
960
960
 
961
- // src/hooks/stallholder/useStallholderApplyForm.ts
961
+ // src/hooks/stallholder/useStallholderInfoForm.ts
962
962
  var import_yup2 = require("@hookform/resolvers/yup");
963
963
  var React2 = __toESM(require("react"));
964
964
  var import_react_hook_form2 = require("react-hook-form");
965
- function useStallholderApplyForm(data) {
965
+ function useStallholderInfoForm(data) {
966
966
  const {
967
967
  control,
968
968
  formState: { errors },
@@ -972,8 +972,8 @@ function useStallholderApplyForm(data) {
972
972
  setValue,
973
973
  watch
974
974
  } = (0, import_react_hook_form2.useForm)({
975
- defaultValues: defaultStallholderApplyFormValues,
976
- resolver: (0, import_yup2.yupResolver)(stallholderApplyFormSchema)
975
+ defaultValues: defaultStallholderInfoFormValues,
976
+ resolver: (0, import_yup2.yupResolver)(stallholderInfoSchema)
977
977
  });
978
978
  React2.useEffect(() => {
979
979
  if (data) {
@@ -992,7 +992,7 @@ function useStallholderApplyForm(data) {
992
992
  table: data.table
993
993
  });
994
994
  } else {
995
- reset(defaultStallholderApplyFormValues);
995
+ reset(defaultStallholderInfoFormValues);
996
996
  }
997
997
  }, [data]);
998
998
  const {
@@ -2135,7 +2135,7 @@ var STALLHOLDER = import_client10.gql`
2135
2135
  fragment StallholderFields on StallholderType {
2136
2136
  _id
2137
2137
  active
2138
- applyFormId
2138
+ stallholderInfoId
2139
2139
  categories {
2140
2140
  ...CategoryFields
2141
2141
  }
@@ -2181,8 +2181,8 @@ var STALLHOLDER = import_client10.gql`
2181
2181
  ${RESOURCE_IMAGE_FIELDS_FRAGMENT}
2182
2182
  ${SOCIAL_MEDIA_FIELDS_FRAGMENT}
2183
2183
  `;
2184
- var STALLHOLDER_APPLY_FORM = import_client10.gql`
2185
- fragment StallholderApplyFormFields on StallholderApplyFormType {
2184
+ var STALLHOLDER_INFO = import_client10.gql`
2185
+ fragment StallholderInfoFields on StallholderInfoType {
2186
2186
  _id
2187
2187
  electricity {
2188
2188
  details
@@ -2243,13 +2243,13 @@ var SEARCH_STALLHOLDERS = import_client10.gql`
2243
2243
  }
2244
2244
  ${STALLHOLDER}
2245
2245
  `;
2246
- var GET_STALLHOLDER_APPLY_FORM = import_client10.gql`
2247
- query getStallholderApplyForm($stallholderId: ID!) {
2248
- stallholderApplyForm(stallholderId: $stallholderId) {
2249
- ...StallholderApplyFormFields
2246
+ var GET_STALLHOLDER_INFO = import_client10.gql`
2247
+ query getStallholderInfo($stallholderId: ID!) {
2248
+ stallholderInfo(stallholderId: $stallholderId) {
2249
+ ...StallholderInfoFields
2250
2250
  }
2251
2251
  }
2252
- ${STALLHOLDER_APPLY_FORM}
2252
+ ${STALLHOLDER_INFO}
2253
2253
  `;
2254
2254
 
2255
2255
  // src/graphql/queries/user.ts
@@ -2411,8 +2411,8 @@ var useGetMarketsByRegion = (region) => {
2411
2411
  skip: !region,
2412
2412
  variables: { region }
2413
2413
  });
2414
- const markets = data?.marketsByRegion;
2415
- return { error, loading, markets, refetch };
2414
+ const marketsByRegion = data?.marketsByRegion;
2415
+ return { error, loading, marketsByRegion, refetch };
2416
2416
  };
2417
2417
  var useSearchMarkets = (search, region) => {
2418
2418
  const { loading, error, data, refetch } = (0, import_client13.useQuery)(SEARCH_MARKETS, {
@@ -2420,8 +2420,8 @@ var useSearchMarkets = (search, region) => {
2420
2420
  skip: search.length < 3,
2421
2421
  variables: { region, search }
2422
2422
  });
2423
- const markets = data?.marketSearch;
2424
- return { error, loading, markets, refetch };
2423
+ const marketsSearch = data?.marketSearch;
2424
+ return { error, loading, marketsSearch, refetch };
2425
2425
  };
2426
2426
  var useGetMarketsNearMe = (location) => {
2427
2427
  const { loading, error, data, refetch } = (0, import_client13.useQuery)(GET_MARKETS_NEAR_ME, {
@@ -2434,8 +2434,8 @@ var useGetMarketsNearMe = (location) => {
2434
2434
  // Default to 10km if no radius is provided
2435
2435
  }
2436
2436
  });
2437
- const markets = data?.marketsNearMe;
2438
- return { error, loading, markets, refetch };
2437
+ const marketsNearMe = data?.marketsNearMe;
2438
+ return { error, loading, marketsNearMe, refetch };
2439
2439
  };
2440
2440
  var useGetMarketInfo = (marketId) => {
2441
2441
  const { loading, error, data, refetch } = (0, import_client13.useQuery)(GET_MARKET_INFO, {
@@ -2614,7 +2614,7 @@ var GET_RESOURCE_CONNECTIONS = import_client16.gql`
2614
2614
  stallholders {
2615
2615
  _id
2616
2616
  active
2617
- applyFormId
2617
+ stallholderInfoId
2618
2618
  categories {
2619
2619
  ...CategoryFields
2620
2620
  }
@@ -2879,24 +2879,21 @@ var DELETE_STALLHOLDER_MUTATION = import_client20.gql`
2879
2879
  deleteStallholder(_id: $_id)
2880
2880
  }
2881
2881
  `;
2882
- var CREATE_STALLHOLDER_APPLY_FORM_MUTATION = import_client20.gql`
2883
- mutation createStallholderApplyForm($input: StallholderApplyFormInputType!) {
2884
- createStallholderApplyForm(input: $input) {
2885
- ...StallholderApplyFormFields
2882
+ var CREATE_STALLHOLDER_INFO_MUTATION = import_client20.gql`
2883
+ mutation createStallholderInfo($input: StallholderInfoInputType!) {
2884
+ createStallholderInfo(input: $input) {
2885
+ ...StallholderInfoFields
2886
2886
  }
2887
2887
  }
2888
- ${STALLHOLDER_APPLY_FORM}
2888
+ ${STALLHOLDER_INFO}
2889
2889
  `;
2890
- var UPDATE_STALLHOLDER_APPLY_FORM_MUTATION = import_client20.gql`
2891
- mutation updateStallholderApplyForm(
2892
- $_id: ID!
2893
- $input: StallholderApplyFormInputType!
2894
- ) {
2895
- updateStallholderApplyForm(_id: $_id, input: $input) {
2896
- ...StallholderApplyFormFields
2890
+ var UPDATE_STALLHOLDER_INFO_MUTATION = import_client20.gql`
2891
+ mutation updateStallholderInfo($_id: ID!, $input: StallholderInfoInputType!) {
2892
+ updateStallholderInfo(_id: $_id, input: $input) {
2893
+ ...StallholderInfoFields
2897
2894
  }
2898
2895
  }
2899
- ${STALLHOLDER_APPLY_FORM}
2896
+ ${STALLHOLDER_INFO}
2900
2897
  `;
2901
2898
 
2902
2899
  // src/graphql/hooks/stallholder/hooksMutation.ts
@@ -2939,17 +2936,17 @@ var useDeleteStallholder = () => {
2939
2936
  );
2940
2937
  return { deleteStallholder, error, loading };
2941
2938
  };
2942
- var useCreateStallholderApplyForm = () => {
2943
- const [createStallholderApplyForm, { loading, error }] = (0, import_client21.useMutation)(
2944
- CREATE_STALLHOLDER_APPLY_FORM_MUTATION,
2939
+ var useCreateStallholderInfo = () => {
2940
+ const [createStallholderInfo, { loading, error }] = (0, import_client21.useMutation)(
2941
+ CREATE_STALLHOLDER_INFO_MUTATION,
2945
2942
  {
2946
2943
  awaitRefetchQueries: true,
2947
2944
  refetchQueries: (mutationResult) => {
2948
- const stallholderId = mutationResult?.data?.createStallholderApplyForm?.stallholderId;
2945
+ const stallholderId = mutationResult?.data?.createStallholderInfo?.stallholderId;
2949
2946
  if (!stallholderId) return [];
2950
2947
  return [
2951
2948
  {
2952
- query: GET_STALLHOLDER_APPLY_FORM,
2949
+ query: GET_STALLHOLDER_INFO,
2953
2950
  variables: { stallholderId }
2954
2951
  // Pass the stallholderId for refetching
2955
2952
  }
@@ -2957,19 +2954,19 @@ var useCreateStallholderApplyForm = () => {
2957
2954
  }
2958
2955
  }
2959
2956
  );
2960
- return { createStallholderApplyForm, error, loading };
2957
+ return { createStallholderInfo, error, loading };
2961
2958
  };
2962
- var useUpdateStallholderApplyForm = () => {
2963
- const [updateStallholderApplyForm, { loading, error }] = (0, import_client21.useMutation)(
2964
- UPDATE_STALLHOLDER_APPLY_FORM_MUTATION,
2959
+ var useUpdateStallholderInfo = () => {
2960
+ const [updateStallholderInfo, { loading, error }] = (0, import_client21.useMutation)(
2961
+ UPDATE_STALLHOLDER_INFO_MUTATION,
2965
2962
  {
2966
2963
  awaitRefetchQueries: true,
2967
2964
  refetchQueries: (mutationResult) => {
2968
- const stallholderId = mutationResult?.data?.createStallholderApplyForm?.stallholderId;
2965
+ const stallholderId = mutationResult?.data?.updateStallholderInfo?.stallholderId;
2969
2966
  if (!stallholderId) return [];
2970
2967
  return [
2971
2968
  {
2972
- query: GET_STALLHOLDER_APPLY_FORM,
2969
+ query: GET_STALLHOLDER_INFO,
2973
2970
  variables: { stallholderId }
2974
2971
  // Pass the stallholderId for refetching
2975
2972
  }
@@ -2977,7 +2974,7 @@ var useUpdateStallholderApplyForm = () => {
2977
2974
  }
2978
2975
  }
2979
2976
  );
2980
- return { error, loading, updateStallholderApplyForm };
2977
+ return { error, loading, updateStallholderInfo };
2981
2978
  };
2982
2979
 
2983
2980
  // src/graphql/hooks/stallholder/hooksQuery.ts
@@ -3012,8 +3009,8 @@ var useGetStallholdersByRegion = (region) => {
3012
3009
  variables: { region }
3013
3010
  }
3014
3011
  );
3015
- const stallholders = data?.stallholdersByRegion;
3016
- return { error, loading, refetch, stallholders };
3012
+ const stallholdersByRegion = data?.stallholdersByRegion;
3013
+ return { error, loading, refetch, stallholdersByRegion };
3017
3014
  };
3018
3015
  var useSearchStallholders = (search, region) => {
3019
3016
  const { loading, error, data, refetch } = (0, import_client22.useQuery)(SEARCH_STALLHOLDERS, {
@@ -3021,24 +3018,21 @@ var useSearchStallholders = (search, region) => {
3021
3018
  skip: search.length < 3,
3022
3019
  variables: { region, search }
3023
3020
  });
3024
- const stallholders = data?.stallholderSearch;
3025
- return { error, loading, refetch, stallholders };
3021
+ const stallholderSearch = data?.stallholderSearch;
3022
+ return { error, loading, refetch, stallholderSearch };
3026
3023
  };
3027
- var useGetStallholderApplyForm = (stallholderId) => {
3028
- const { loading, error, data, refetch } = (0, import_client22.useQuery)(
3029
- GET_STALLHOLDER_APPLY_FORM,
3030
- {
3031
- fetchPolicy: "network-only",
3032
- skip: !stallholderId,
3033
- variables: { stallholderId }
3034
- }
3035
- );
3036
- const applyForm = data?.stallholderApplyForm;
3024
+ var useGetStallholderInfo = (stallholderId) => {
3025
+ const { loading, error, data, refetch } = (0, import_client22.useQuery)(GET_STALLHOLDER_INFO, {
3026
+ fetchPolicy: "network-only",
3027
+ skip: !stallholderId,
3028
+ variables: { stallholderId }
3029
+ });
3030
+ const stallholderInfo = data?.stallholderInfo;
3037
3031
  return {
3038
- applyForm,
3039
3032
  error,
3040
3033
  loading,
3041
- refetch
3034
+ refetch,
3035
+ stallholderInfo
3042
3036
  };
3043
3037
  };
3044
3038
 
@@ -3448,7 +3442,7 @@ var availableCityTypes = [
3448
3442
  ];
3449
3443
  var availableCityOptions = mapArrayToOptions(availableCityTypes);
3450
3444
 
3451
- // src/formFields/stallholder/stallholderApplyForm.ts
3445
+ // src/formFields/stallholder/stallholderInfo.ts
3452
3446
  var stallholderElectricity = {
3453
3447
  details: {
3454
3448
  helperText: "Please describe details e.g. amps, voltage, etc.",
@@ -4432,8 +4426,8 @@ var USER_STORAGE_KEY = "authUser";
4432
4426
  defaultMarketFormValues,
4433
4427
  defaultMarketInfoFormValues,
4434
4428
  defaultRegion,
4435
- defaultStallholderApplyFormValues,
4436
4429
  defaultStallholderFormValues,
4430
+ defaultStallholderInfoFormValues,
4437
4431
  formatDate,
4438
4432
  formatTimestamp,
4439
4433
  getCurrentAndFutureDates,
@@ -4489,7 +4483,7 @@ var USER_STORAGE_KEY = "authUser";
4489
4483
  useCreatePoster,
4490
4484
  useCreateRelation,
4491
4485
  useCreateStallholder,
4492
- useCreateStallholderApplyForm,
4486
+ useCreateStallholderInfo,
4493
4487
  useCreateTester,
4494
4488
  useCreateUser,
4495
4489
  useDeleteChat,
@@ -4510,7 +4504,7 @@ var USER_STORAGE_KEY = "authUser";
4510
4504
  useGetRelationByMarketAndStallholder,
4511
4505
  useGetResourceConnections,
4512
4506
  useGetStallholder,
4513
- useGetStallholderApplyForm,
4507
+ useGetStallholderInfo,
4514
4508
  useGetStallholderRelations,
4515
4509
  useGetStallholders,
4516
4510
  useGetStallholdersByRegion,
@@ -4541,14 +4535,14 @@ var USER_STORAGE_KEY = "authUser";
4541
4535
  useSearchMarkets,
4542
4536
  useSearchStallholders,
4543
4537
  useSendChatMessage,
4544
- useStallholderApplyForm,
4545
4538
  useStallholderForm,
4539
+ useStallholderInfoForm,
4546
4540
  useTestersForm,
4547
4541
  useUpdateMarket,
4548
4542
  useUpdateMarketInfo,
4549
4543
  useUpdateRelation,
4550
4544
  useUpdateStallholder,
4551
- useUpdateStallholderApplyForm,
4545
+ useUpdateStallholderInfo,
4552
4546
  useUpdateTester,
4553
4547
  useUpdateUser,
4554
4548
  useUserForm,