@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.
@@ -134,7 +134,7 @@ type StallholderAttributes = {
134
134
  details?: string | null;
135
135
  isRequired: boolean;
136
136
  };
137
- type StallholderApplyFormFormData = {
137
+ type StallholderInfoFormData = {
138
138
  _id?: string;
139
139
  electricity: StallholderAttributes;
140
140
  foodSafetyGradeFiles?: string[] | null;
@@ -154,26 +154,26 @@ type StallholderApplyFormFormData = {
154
154
  };
155
155
  table: StallholderAttributes;
156
156
  };
157
- interface CreateStallholderApplyFormFormData {
158
- control: Control<StallholderApplyFormFormData, any>;
159
- fields: StallholderApplyFormFormData;
157
+ interface CreateStallholderInfoFormData {
158
+ control: Control<StallholderInfoFormData, any>;
159
+ fields: StallholderInfoFormData;
160
160
  formState: {
161
- errors: FieldErrors<StallholderApplyFormFormData>;
161
+ errors: FieldErrors<StallholderInfoFormData>;
162
162
  };
163
- handleSubmit: UseFormHandleSubmit<StallholderApplyFormFormData, any>;
164
- reset: UseFormReset<StallholderApplyFormFormData>;
165
- setValue: UseFormSetValue<StallholderApplyFormFormData>;
166
- watch: UseFormWatch<StallholderApplyFormFormData>;
163
+ handleSubmit: UseFormHandleSubmit<StallholderInfoFormData, any>;
164
+ reset: UseFormReset<StallholderInfoFormData>;
165
+ setValue: UseFormSetValue<StallholderInfoFormData>;
166
+ watch: UseFormWatch<StallholderInfoFormData>;
167
167
  }
168
168
  interface StallholderType extends BaseResourceType {
169
- applyFormId: string;
169
+ stallholderInfoId: string;
170
170
  categories: StallholderFormData["categories"];
171
171
  locations: StallholderLocation[] | null;
172
172
  multiLocation: boolean;
173
173
  products: StallholderFormData["products"];
174
174
  specialities: string[] | null;
175
175
  }
176
- type StallholderApplyFormType = Omit<StallholderApplyFormFormData, "_id" | "foodSafetyGradeFilesUpload"> & {
176
+ type StallholderInfoType = Omit<StallholderInfoFormData, "_id" | "foodSafetyGradeFilesUpload"> & {
177
177
  _id: string;
178
178
  };
179
179
  interface SatllholderWithConnectionDatesType extends StallholderType {
@@ -336,4 +336,4 @@ interface ResourceConnectionsType {
336
336
  stallholders: SatllholderWithConnectionDatesType[] | null;
337
337
  }
338
338
 
339
- export type { RelationDate as A, BaseResourceTypeFormData as B, Category as C, DateTimeType as D, StallholderLocation as E, FormField as F, GeocodeLocation as G, StallholderAttributes as H, ImageObjectType as I, SatllholderWithConnectionDatesType as J, LocationType as L, MarketType as M, NotificationType as N, OptionItem as O, PaymentInfoType as P, Requirement as R, StallType as S, UserType as U, FormDateField as a, MarketInfoType as b, RelationType as c, ResourceConnectionsType as d, StallholderType as e, StallholderApplyFormType as f, StallholderFormData as g, CreateStallholderFormData as h, StallholderApplyFormFormData as i, CreateStallholderApplyFormFormData as j, MarketFormData as k, CreateMarketFormData as l, MarketInfoFormData as m, CreateMarketInfoFormData as n, UserFormData as o, CreateUserFormData as p, Nullable as q, ResourceImageType as r, SocialMediaType as s, BaseResourceType as t, Region as u, MapMultiLocation as v, Subcategory as w, DateTimeWithPriceType as x, MarketWithConnectionDatesType as y, RelationLog as z };
339
+ export type { RelationDate as A, BaseResourceTypeFormData as B, Category as C, DateTimeType as D, StallholderLocation as E, FormField as F, GeocodeLocation as G, StallholderAttributes as H, ImageObjectType as I, SatllholderWithConnectionDatesType as J, LocationType as L, MarketType as M, NotificationType as N, OptionItem as O, PaymentInfoType as P, Requirement as R, StallType as S, UserType as U, FormDateField as a, MarketInfoType as b, RelationType as c, ResourceConnectionsType as d, StallholderType as e, StallholderInfoType as f, StallholderFormData as g, CreateStallholderFormData as h, StallholderInfoFormData as i, CreateStallholderInfoFormData as j, MarketFormData as k, CreateMarketFormData as l, MarketInfoFormData as m, CreateMarketInfoFormData as n, UserFormData as o, CreateUserFormData as p, Nullable as q, ResourceImageType as r, SocialMediaType as s, BaseResourceType as t, Region as u, MapMultiLocation as v, Subcategory as w, DateTimeWithPriceType as x, MarketWithConnectionDatesType as y, RelationLog as z };
@@ -134,7 +134,7 @@ type StallholderAttributes = {
134
134
  details?: string | null;
135
135
  isRequired: boolean;
136
136
  };
137
- type StallholderApplyFormFormData = {
137
+ type StallholderInfoFormData = {
138
138
  _id?: string;
139
139
  electricity: StallholderAttributes;
140
140
  foodSafetyGradeFiles?: string[] | null;
@@ -154,26 +154,26 @@ type StallholderApplyFormFormData = {
154
154
  };
155
155
  table: StallholderAttributes;
156
156
  };
157
- interface CreateStallholderApplyFormFormData {
158
- control: Control<StallholderApplyFormFormData, any>;
159
- fields: StallholderApplyFormFormData;
157
+ interface CreateStallholderInfoFormData {
158
+ control: Control<StallholderInfoFormData, any>;
159
+ fields: StallholderInfoFormData;
160
160
  formState: {
161
- errors: FieldErrors<StallholderApplyFormFormData>;
161
+ errors: FieldErrors<StallholderInfoFormData>;
162
162
  };
163
- handleSubmit: UseFormHandleSubmit<StallholderApplyFormFormData, any>;
164
- reset: UseFormReset<StallholderApplyFormFormData>;
165
- setValue: UseFormSetValue<StallholderApplyFormFormData>;
166
- watch: UseFormWatch<StallholderApplyFormFormData>;
163
+ handleSubmit: UseFormHandleSubmit<StallholderInfoFormData, any>;
164
+ reset: UseFormReset<StallholderInfoFormData>;
165
+ setValue: UseFormSetValue<StallholderInfoFormData>;
166
+ watch: UseFormWatch<StallholderInfoFormData>;
167
167
  }
168
168
  interface StallholderType extends BaseResourceType {
169
- applyFormId: string;
169
+ stallholderInfoId: string;
170
170
  categories: StallholderFormData["categories"];
171
171
  locations: StallholderLocation[] | null;
172
172
  multiLocation: boolean;
173
173
  products: StallholderFormData["products"];
174
174
  specialities: string[] | null;
175
175
  }
176
- type StallholderApplyFormType = Omit<StallholderApplyFormFormData, "_id" | "foodSafetyGradeFilesUpload"> & {
176
+ type StallholderInfoType = Omit<StallholderInfoFormData, "_id" | "foodSafetyGradeFilesUpload"> & {
177
177
  _id: string;
178
178
  };
179
179
  interface SatllholderWithConnectionDatesType extends StallholderType {
@@ -336,4 +336,4 @@ interface ResourceConnectionsType {
336
336
  stallholders: SatllholderWithConnectionDatesType[] | null;
337
337
  }
338
338
 
339
- export type { RelationDate as A, BaseResourceTypeFormData as B, Category as C, DateTimeType as D, StallholderLocation as E, FormField as F, GeocodeLocation as G, StallholderAttributes as H, ImageObjectType as I, SatllholderWithConnectionDatesType as J, LocationType as L, MarketType as M, NotificationType as N, OptionItem as O, PaymentInfoType as P, Requirement as R, StallType as S, UserType as U, FormDateField as a, MarketInfoType as b, RelationType as c, ResourceConnectionsType as d, StallholderType as e, StallholderApplyFormType as f, StallholderFormData as g, CreateStallholderFormData as h, StallholderApplyFormFormData as i, CreateStallholderApplyFormFormData as j, MarketFormData as k, CreateMarketFormData as l, MarketInfoFormData as m, CreateMarketInfoFormData as n, UserFormData as o, CreateUserFormData as p, Nullable as q, ResourceImageType as r, SocialMediaType as s, BaseResourceType as t, Region as u, MapMultiLocation as v, Subcategory as w, DateTimeWithPriceType as x, MarketWithConnectionDatesType as y, RelationLog as z };
339
+ export type { RelationDate as A, BaseResourceTypeFormData as B, Category as C, DateTimeType as D, StallholderLocation as E, FormField as F, GeocodeLocation as G, StallholderAttributes as H, ImageObjectType as I, SatllholderWithConnectionDatesType as J, LocationType as L, MarketType as M, NotificationType as N, OptionItem as O, PaymentInfoType as P, Requirement as R, StallType as S, UserType as U, FormDateField as a, MarketInfoType as b, RelationType as c, ResourceConnectionsType as d, StallholderType as e, StallholderInfoType as f, StallholderFormData as g, CreateStallholderFormData as h, StallholderInfoFormData as i, CreateStallholderInfoFormData as j, MarketFormData as k, CreateMarketFormData as l, MarketInfoFormData as m, CreateMarketInfoFormData as n, UserFormData as o, CreateUserFormData as p, Nullable as q, ResourceImageType as r, SocialMediaType as s, BaseResourceType as t, Region as u, MapMultiLocation as v, Subcategory as w, DateTimeWithPriceType as x, MarketWithConnectionDatesType as y, RelationLog as z };
@@ -29,7 +29,7 @@ __export(graphql_exports, {
29
29
  useCreatePoster: () => useCreatePoster,
30
30
  useCreateRelation: () => useCreateRelation,
31
31
  useCreateStallholder: () => useCreateStallholder,
32
- useCreateStallholderApplyForm: () => useCreateStallholderApplyForm,
32
+ useCreateStallholderInfo: () => useCreateStallholderInfo,
33
33
  useCreateTester: () => useCreateTester,
34
34
  useCreateUser: () => useCreateUser,
35
35
  useDeleteChat: () => useDeleteChat,
@@ -50,7 +50,7 @@ __export(graphql_exports, {
50
50
  useGetRelationByMarketAndStallholder: () => useGetRelationByMarketAndStallholder,
51
51
  useGetResourceConnections: () => useGetResourceConnections,
52
52
  useGetStallholder: () => useGetStallholder,
53
- useGetStallholderApplyForm: () => useGetStallholderApplyForm,
53
+ useGetStallholderInfo: () => useGetStallholderInfo,
54
54
  useGetStallholderRelations: () => useGetStallholderRelations,
55
55
  useGetStallholders: () => useGetStallholders,
56
56
  useGetStallholdersByRegion: () => useGetStallholdersByRegion,
@@ -78,7 +78,7 @@ __export(graphql_exports, {
78
78
  useUpdateMarketInfo: () => useUpdateMarketInfo,
79
79
  useUpdateRelation: () => useUpdateRelation,
80
80
  useUpdateStallholder: () => useUpdateStallholder,
81
- useUpdateStallholderApplyForm: () => useUpdateStallholderApplyForm,
81
+ useUpdateStallholderInfo: () => useUpdateStallholderInfo,
82
82
  useUpdateTester: () => useUpdateTester,
83
83
  useUpdateUser: () => useUpdateUser,
84
84
  useValidateVerificationToken: () => useValidateVerificationToken
@@ -660,7 +660,7 @@ var STALLHOLDER = import_client10.gql`
660
660
  fragment StallholderFields on StallholderType {
661
661
  _id
662
662
  active
663
- applyFormId
663
+ stallholderInfoId
664
664
  categories {
665
665
  ...CategoryFields
666
666
  }
@@ -706,8 +706,8 @@ var STALLHOLDER = import_client10.gql`
706
706
  ${RESOURCE_IMAGE_FIELDS_FRAGMENT}
707
707
  ${SOCIAL_MEDIA_FIELDS_FRAGMENT}
708
708
  `;
709
- var STALLHOLDER_APPLY_FORM = import_client10.gql`
710
- fragment StallholderApplyFormFields on StallholderApplyFormType {
709
+ var STALLHOLDER_INFO = import_client10.gql`
710
+ fragment StallholderInfoFields on StallholderInfoType {
711
711
  _id
712
712
  electricity {
713
713
  details
@@ -768,13 +768,13 @@ var SEARCH_STALLHOLDERS = import_client10.gql`
768
768
  }
769
769
  ${STALLHOLDER}
770
770
  `;
771
- var GET_STALLHOLDER_APPLY_FORM = import_client10.gql`
772
- query getStallholderApplyForm($stallholderId: ID!) {
773
- stallholderApplyForm(stallholderId: $stallholderId) {
774
- ...StallholderApplyFormFields
771
+ var GET_STALLHOLDER_INFO = import_client10.gql`
772
+ query getStallholderInfo($stallholderId: ID!) {
773
+ stallholderInfo(stallholderId: $stallholderId) {
774
+ ...StallholderInfoFields
775
775
  }
776
776
  }
777
- ${STALLHOLDER_APPLY_FORM}
777
+ ${STALLHOLDER_INFO}
778
778
  `;
779
779
 
780
780
  // src/graphql/queries/user.ts
@@ -936,8 +936,8 @@ var useGetMarketsByRegion = (region) => {
936
936
  skip: !region,
937
937
  variables: { region }
938
938
  });
939
- const markets = data?.marketsByRegion;
940
- return { error, loading, markets, refetch };
939
+ const marketsByRegion = data?.marketsByRegion;
940
+ return { error, loading, marketsByRegion, refetch };
941
941
  };
942
942
  var useSearchMarkets = (search, region) => {
943
943
  const { loading, error, data, refetch } = (0, import_client13.useQuery)(SEARCH_MARKETS, {
@@ -945,8 +945,8 @@ var useSearchMarkets = (search, region) => {
945
945
  skip: search.length < 3,
946
946
  variables: { region, search }
947
947
  });
948
- const markets = data?.marketSearch;
949
- return { error, loading, markets, refetch };
948
+ const marketsSearch = data?.marketSearch;
949
+ return { error, loading, marketsSearch, refetch };
950
950
  };
951
951
  var useGetMarketsNearMe = (location) => {
952
952
  const { loading, error, data, refetch } = (0, import_client13.useQuery)(GET_MARKETS_NEAR_ME, {
@@ -959,8 +959,8 @@ var useGetMarketsNearMe = (location) => {
959
959
  // Default to 10km if no radius is provided
960
960
  }
961
961
  });
962
- const markets = data?.marketsNearMe;
963
- return { error, loading, markets, refetch };
962
+ const marketsNearMe = data?.marketsNearMe;
963
+ return { error, loading, marketsNearMe, refetch };
964
964
  };
965
965
  var useGetMarketInfo = (marketId) => {
966
966
  const { loading, error, data, refetch } = (0, import_client13.useQuery)(GET_MARKET_INFO, {
@@ -1139,7 +1139,7 @@ var GET_RESOURCE_CONNECTIONS = import_client16.gql`
1139
1139
  stallholders {
1140
1140
  _id
1141
1141
  active
1142
- applyFormId
1142
+ stallholderInfoId
1143
1143
  categories {
1144
1144
  ...CategoryFields
1145
1145
  }
@@ -1404,24 +1404,21 @@ var DELETE_STALLHOLDER_MUTATION = import_client20.gql`
1404
1404
  deleteStallholder(_id: $_id)
1405
1405
  }
1406
1406
  `;
1407
- var CREATE_STALLHOLDER_APPLY_FORM_MUTATION = import_client20.gql`
1408
- mutation createStallholderApplyForm($input: StallholderApplyFormInputType!) {
1409
- createStallholderApplyForm(input: $input) {
1410
- ...StallholderApplyFormFields
1407
+ var CREATE_STALLHOLDER_INFO_MUTATION = import_client20.gql`
1408
+ mutation createStallholderInfo($input: StallholderInfoInputType!) {
1409
+ createStallholderInfo(input: $input) {
1410
+ ...StallholderInfoFields
1411
1411
  }
1412
1412
  }
1413
- ${STALLHOLDER_APPLY_FORM}
1413
+ ${STALLHOLDER_INFO}
1414
1414
  `;
1415
- var UPDATE_STALLHOLDER_APPLY_FORM_MUTATION = import_client20.gql`
1416
- mutation updateStallholderApplyForm(
1417
- $_id: ID!
1418
- $input: StallholderApplyFormInputType!
1419
- ) {
1420
- updateStallholderApplyForm(_id: $_id, input: $input) {
1421
- ...StallholderApplyFormFields
1415
+ var UPDATE_STALLHOLDER_INFO_MUTATION = import_client20.gql`
1416
+ mutation updateStallholderInfo($_id: ID!, $input: StallholderInfoInputType!) {
1417
+ updateStallholderInfo(_id: $_id, input: $input) {
1418
+ ...StallholderInfoFields
1422
1419
  }
1423
1420
  }
1424
- ${STALLHOLDER_APPLY_FORM}
1421
+ ${STALLHOLDER_INFO}
1425
1422
  `;
1426
1423
 
1427
1424
  // src/graphql/hooks/stallholder/hooksMutation.ts
@@ -1464,17 +1461,17 @@ var useDeleteStallholder = () => {
1464
1461
  );
1465
1462
  return { deleteStallholder, error, loading };
1466
1463
  };
1467
- var useCreateStallholderApplyForm = () => {
1468
- const [createStallholderApplyForm, { loading, error }] = (0, import_client21.useMutation)(
1469
- CREATE_STALLHOLDER_APPLY_FORM_MUTATION,
1464
+ var useCreateStallholderInfo = () => {
1465
+ const [createStallholderInfo, { loading, error }] = (0, import_client21.useMutation)(
1466
+ CREATE_STALLHOLDER_INFO_MUTATION,
1470
1467
  {
1471
1468
  awaitRefetchQueries: true,
1472
1469
  refetchQueries: (mutationResult) => {
1473
- const stallholderId = mutationResult?.data?.createStallholderApplyForm?.stallholderId;
1470
+ const stallholderId = mutationResult?.data?.createStallholderInfo?.stallholderId;
1474
1471
  if (!stallholderId) return [];
1475
1472
  return [
1476
1473
  {
1477
- query: GET_STALLHOLDER_APPLY_FORM,
1474
+ query: GET_STALLHOLDER_INFO,
1478
1475
  variables: { stallholderId }
1479
1476
  // Pass the stallholderId for refetching
1480
1477
  }
@@ -1482,19 +1479,19 @@ var useCreateStallholderApplyForm = () => {
1482
1479
  }
1483
1480
  }
1484
1481
  );
1485
- return { createStallholderApplyForm, error, loading };
1482
+ return { createStallholderInfo, error, loading };
1486
1483
  };
1487
- var useUpdateStallholderApplyForm = () => {
1488
- const [updateStallholderApplyForm, { loading, error }] = (0, import_client21.useMutation)(
1489
- UPDATE_STALLHOLDER_APPLY_FORM_MUTATION,
1484
+ var useUpdateStallholderInfo = () => {
1485
+ const [updateStallholderInfo, { loading, error }] = (0, import_client21.useMutation)(
1486
+ UPDATE_STALLHOLDER_INFO_MUTATION,
1490
1487
  {
1491
1488
  awaitRefetchQueries: true,
1492
1489
  refetchQueries: (mutationResult) => {
1493
- const stallholderId = mutationResult?.data?.createStallholderApplyForm?.stallholderId;
1490
+ const stallholderId = mutationResult?.data?.updateStallholderInfo?.stallholderId;
1494
1491
  if (!stallholderId) return [];
1495
1492
  return [
1496
1493
  {
1497
- query: GET_STALLHOLDER_APPLY_FORM,
1494
+ query: GET_STALLHOLDER_INFO,
1498
1495
  variables: { stallholderId }
1499
1496
  // Pass the stallholderId for refetching
1500
1497
  }
@@ -1502,7 +1499,7 @@ var useUpdateStallholderApplyForm = () => {
1502
1499
  }
1503
1500
  }
1504
1501
  );
1505
- return { error, loading, updateStallholderApplyForm };
1502
+ return { error, loading, updateStallholderInfo };
1506
1503
  };
1507
1504
 
1508
1505
  // src/graphql/hooks/stallholder/hooksQuery.ts
@@ -1537,8 +1534,8 @@ var useGetStallholdersByRegion = (region) => {
1537
1534
  variables: { region }
1538
1535
  }
1539
1536
  );
1540
- const stallholders = data?.stallholdersByRegion;
1541
- return { error, loading, refetch, stallholders };
1537
+ const stallholdersByRegion = data?.stallholdersByRegion;
1538
+ return { error, loading, refetch, stallholdersByRegion };
1542
1539
  };
1543
1540
  var useSearchStallholders = (search, region) => {
1544
1541
  const { loading, error, data, refetch } = (0, import_client22.useQuery)(SEARCH_STALLHOLDERS, {
@@ -1546,24 +1543,21 @@ var useSearchStallholders = (search, region) => {
1546
1543
  skip: search.length < 3,
1547
1544
  variables: { region, search }
1548
1545
  });
1549
- const stallholders = data?.stallholderSearch;
1550
- return { error, loading, refetch, stallholders };
1546
+ const stallholderSearch = data?.stallholderSearch;
1547
+ return { error, loading, refetch, stallholderSearch };
1551
1548
  };
1552
- var useGetStallholderApplyForm = (stallholderId) => {
1553
- const { loading, error, data, refetch } = (0, import_client22.useQuery)(
1554
- GET_STALLHOLDER_APPLY_FORM,
1555
- {
1556
- fetchPolicy: "network-only",
1557
- skip: !stallholderId,
1558
- variables: { stallholderId }
1559
- }
1560
- );
1561
- const applyForm = data?.stallholderApplyForm;
1549
+ var useGetStallholderInfo = (stallholderId) => {
1550
+ const { loading, error, data, refetch } = (0, import_client22.useQuery)(GET_STALLHOLDER_INFO, {
1551
+ fetchPolicy: "network-only",
1552
+ skip: !stallholderId,
1553
+ variables: { stallholderId }
1554
+ });
1555
+ const stallholderInfo = data?.stallholderInfo;
1562
1556
  return {
1563
- applyForm,
1564
1557
  error,
1565
1558
  loading,
1566
- refetch
1559
+ refetch,
1560
+ stallholderInfo
1567
1561
  };
1568
1562
  };
1569
1563
 
@@ -1912,7 +1906,7 @@ var useContactUs = () => {
1912
1906
  useCreatePoster,
1913
1907
  useCreateRelation,
1914
1908
  useCreateStallholder,
1915
- useCreateStallholderApplyForm,
1909
+ useCreateStallholderInfo,
1916
1910
  useCreateTester,
1917
1911
  useCreateUser,
1918
1912
  useDeleteChat,
@@ -1933,7 +1927,7 @@ var useContactUs = () => {
1933
1927
  useGetRelationByMarketAndStallholder,
1934
1928
  useGetResourceConnections,
1935
1929
  useGetStallholder,
1936
- useGetStallholderApplyForm,
1930
+ useGetStallholderInfo,
1937
1931
  useGetStallholderRelations,
1938
1932
  useGetStallholders,
1939
1933
  useGetStallholdersByRegion,
@@ -1961,7 +1955,7 @@ var useContactUs = () => {
1961
1955
  useUpdateMarketInfo,
1962
1956
  useUpdateRelation,
1963
1957
  useUpdateStallholder,
1964
- useUpdateStallholderApplyForm,
1958
+ useUpdateStallholderInfo,
1965
1959
  useUpdateTester,
1966
1960
  useUpdateUser,
1967
1961
  useValidateVerificationToken