@timardex/cluemart-shared 1.0.82 → 1.0.83

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.
@@ -25,9 +25,11 @@ __export(graphql_exports, {
25
25
  useAddUserFavouriteResource: () => useAddUserFavouriteResource,
26
26
  useAdminUpdateResourceType: () => useAdminUpdateResourceType,
27
27
  useContactUs: () => useContactUs,
28
+ useCreateBulkNotifications: () => useCreateBulkNotifications,
28
29
  useCreateChat: () => useCreateChat,
29
30
  useCreateMarket: () => useCreateMarket,
30
31
  useCreateMarketInfo: () => useCreateMarketInfo,
32
+ useCreateNotification: () => useCreateNotification,
31
33
  useCreatePoster: () => useCreatePoster,
32
34
  useCreatePushToken: () => useCreatePushToken,
33
35
  useCreateRelation: () => useCreateRelation,
@@ -49,6 +51,7 @@ __export(graphql_exports, {
49
51
  useGetMarkets: () => useGetMarkets,
50
52
  useGetMarketsByRegion: () => useGetMarketsByRegion,
51
53
  useGetMarketsNearMe: () => useGetMarketsNearMe,
54
+ useGetNotificationCount: () => useGetNotificationCount,
52
55
  useGetRelation: () => useGetRelation,
53
56
  useGetRelationByMarketAndStallholder: () => useGetRelationByMarketAndStallholder,
54
57
  useGetResourceConnections: () => useGetResourceConnections,
@@ -59,6 +62,7 @@ __export(graphql_exports, {
59
62
  useGetStallholdersByRegion: () => useGetStallholdersByRegion,
60
63
  useGetTester: () => useGetTester,
61
64
  useGetTesters: () => useGetTesters,
65
+ useGetUnreadNotifications: () => useGetUnreadNotifications,
62
66
  useGetUser: () => useGetUser,
63
67
  useGetUserChats: () => useGetUserChats,
64
68
  useGetUserFavourites: () => useGetUserFavourites,
@@ -68,7 +72,8 @@ __export(graphql_exports, {
68
72
  useGetUsers: () => useGetUsers,
69
73
  useLogin: () => useLogin,
70
74
  useLogout: () => useLogout,
71
- useNotifications: () => useNotifications,
75
+ useMarkAllNotificationsRead: () => useMarkAllNotificationsRead,
76
+ useMarkNotificationRead: () => useMarkNotificationRead,
72
77
  useRefreshToken: () => useRefreshToken,
73
78
  useRegister: () => useRegister,
74
79
  useRemoveParticipantFromChat: () => useRemoveParticipantFromChat,
@@ -906,11 +911,6 @@ var GET_USER_FAVOURITES = import_client16.gql`
906
911
  ${MARKET}
907
912
  ${STALLHOLDER}
908
913
  `;
909
- var GET_USER_NOTIFICATIONS = import_client16.gql`
910
- query getMissedNotifications {
911
- userNotifications
912
- }
913
- `;
914
914
 
915
915
  // src/graphql/hooks/market/hooksMutation.ts
916
916
  var useCreateMarket = () => {
@@ -1055,12 +1055,179 @@ var useGetMarketInfo = (marketId) => {
1055
1055
  return { error, loading, marketInfo, refetch };
1056
1056
  };
1057
1057
 
1058
- // src/graphql/hooks/poster.ts
1058
+ // src/graphql/hooks/notifications/hooksMutation.ts
1059
+ var import_client21 = require("@apollo/client");
1060
+
1061
+ // src/graphql/mutations/notification.ts
1059
1062
  var import_client20 = require("@apollo/client");
1060
1063
 
1061
- // src/graphql/mutations/poster.ts
1064
+ // src/graphql/queries/notification.ts
1062
1065
  var import_client19 = require("@apollo/client");
1063
- var CREATE_POSTER_MUTATION = import_client19.gql`
1066
+ var USER_NOTIFICATION_FRAGMENT = import_client19.gql`
1067
+ fragment UserNotificationFields on Notification {
1068
+ id
1069
+ userId
1070
+ title
1071
+ message
1072
+ type
1073
+ isRead
1074
+ data
1075
+ createdAt
1076
+ updatedAt
1077
+ }
1078
+ `;
1079
+ var GET_USER_NOTIFICATIONS = import_client19.gql`
1080
+ query getUserNotifications(
1081
+ $userId: String!
1082
+ $limit: Int
1083
+ $offset: Int
1084
+ $isRead: String
1085
+ ) {
1086
+ userNotifications(
1087
+ userId: $userId
1088
+ limit: $limit
1089
+ offset: $offset
1090
+ isRead: $isRead
1091
+ ) {
1092
+ ...UserNotificationFields
1093
+ }
1094
+ }
1095
+ ${USER_NOTIFICATION_FRAGMENT}
1096
+ `;
1097
+ var GET_UNREAD_NOTIFICATIONS = import_client19.gql`
1098
+ query getUnreadNotifications($userId: String!, $limit: Int) {
1099
+ unreadNotifications(userId: $userId, limit: $limit) {
1100
+ ...UserNotificationFields
1101
+ }
1102
+ }
1103
+ ${USER_NOTIFICATION_FRAGMENT}
1104
+ `;
1105
+ var GET_NOTIFICATION_COUNT = import_client19.gql`
1106
+ query getNotificationCount($userId: String!) {
1107
+ notificationCount(userId: $userId) {
1108
+ total
1109
+ unread
1110
+ }
1111
+ }
1112
+ `;
1113
+
1114
+ // src/graphql/mutations/notification.ts
1115
+ var CREATE_NOTIFICATION = import_client20.gql`
1116
+ mutation createNotification($input: CreateNotificationInput!) {
1117
+ createNotification(input: $input) {
1118
+ ...UserNotificationFields
1119
+ }
1120
+ }
1121
+ ${USER_NOTIFICATION_FRAGMENT}
1122
+ `;
1123
+ var CREATE_BULK_NOTIFICATIONS = import_client20.gql`
1124
+ mutation createBulkNotifications($input: CreateBulkNotificationInput!) {
1125
+ createBulkNotifications(input: $input) {
1126
+ ...UserNotificationFields
1127
+ }
1128
+ }
1129
+ ${USER_NOTIFICATION_FRAGMENT}
1130
+ `;
1131
+ var MARK_NOTIFICATION_READ = import_client20.gql`
1132
+ mutation markNotificationRead($input: MarkNotificationReadInput!) {
1133
+ markNotificationRead(input: $input) {
1134
+ ...UserNotificationFields
1135
+ }
1136
+ }
1137
+ ${USER_NOTIFICATION_FRAGMENT}
1138
+ `;
1139
+ var MARK_ALL_NOTIFICATIONS_READ = import_client20.gql`
1140
+ mutation markAllNotificationsRead($input: MarkAllNotificationsReadInput!) {
1141
+ markAllNotificationsRead(input: $input)
1142
+ }
1143
+ `;
1144
+
1145
+ // src/graphql/hooks/notifications/hooksMutation.ts
1146
+ var useCreateNotification = () => {
1147
+ const [createNotification, { loading, error }] = (0, import_client21.useMutation)(CREATE_NOTIFICATION);
1148
+ return { createNotification, error, loading };
1149
+ };
1150
+ var useCreateBulkNotifications = () => {
1151
+ const [createBulkNotifications, { loading, error }] = (0, import_client21.useMutation)(
1152
+ CREATE_BULK_NOTIFICATIONS
1153
+ );
1154
+ return { createBulkNotifications, error, loading };
1155
+ };
1156
+ var useMarkNotificationRead = () => {
1157
+ const [markNotificationRead, { loading, error }] = (0, import_client21.useMutation)(
1158
+ MARK_NOTIFICATION_READ
1159
+ );
1160
+ return { error, loading, markNotificationRead };
1161
+ };
1162
+ var useMarkAllNotificationsRead = () => {
1163
+ const [markAllNotificationsRead, { loading, error }] = (0, import_client21.useMutation)(
1164
+ MARK_ALL_NOTIFICATIONS_READ
1165
+ );
1166
+ return { error, loading, markAllNotificationsRead };
1167
+ };
1168
+
1169
+ // src/graphql/hooks/notifications/hooksQuery.ts
1170
+ var import_client22 = require("@apollo/client");
1171
+ var useGetUserNotifications = (userId, limit, offset, isRead) => {
1172
+ const { data, error, loading, refetch } = (0, import_client22.useQuery)(GET_USER_NOTIFICATIONS, {
1173
+ fetchPolicy: "no-cache",
1174
+ skip: !userId,
1175
+ variables: {
1176
+ isRead,
1177
+ limit: limit ?? 50,
1178
+ offset: offset ?? 0,
1179
+ userId
1180
+ }
1181
+ });
1182
+ const notifications = data?.userNotifications;
1183
+ return {
1184
+ error,
1185
+ loading,
1186
+ notifications,
1187
+ refetch
1188
+ };
1189
+ };
1190
+ var useGetUnreadNotifications = (userId, limit) => {
1191
+ const { data, error, loading, refetch } = (0, import_client22.useQuery)(GET_UNREAD_NOTIFICATIONS, {
1192
+ fetchPolicy: "no-cache",
1193
+ skip: !userId,
1194
+ variables: {
1195
+ limit: limit ?? 50,
1196
+ offset: 0,
1197
+ userId
1198
+ }
1199
+ });
1200
+ const notifications = data?.unreadNotifications;
1201
+ return {
1202
+ error,
1203
+ loading,
1204
+ notifications,
1205
+ refetch
1206
+ };
1207
+ };
1208
+ var useGetNotificationCount = (userId) => {
1209
+ const { data, error, loading, refetch } = (0, import_client22.useQuery)(GET_NOTIFICATION_COUNT, {
1210
+ fetchPolicy: "no-cache",
1211
+ skip: !userId,
1212
+ variables: {
1213
+ userId
1214
+ }
1215
+ });
1216
+ const notificationCount = data?.notificationCount;
1217
+ return {
1218
+ error,
1219
+ loading,
1220
+ notificationCount,
1221
+ refetch
1222
+ };
1223
+ };
1224
+
1225
+ // src/graphql/hooks/poster.ts
1226
+ var import_client24 = require("@apollo/client");
1227
+
1228
+ // src/graphql/mutations/poster.ts
1229
+ var import_client23 = require("@apollo/client");
1230
+ var CREATE_POSTER_MUTATION = import_client23.gql`
1064
1231
  mutation createPoster($input: PosterInputType!) {
1065
1232
  createPoster(input: $input) {
1066
1233
  message
@@ -1070,18 +1237,18 @@ var CREATE_POSTER_MUTATION = import_client19.gql`
1070
1237
 
1071
1238
  // src/graphql/hooks/poster.ts
1072
1239
  var useCreatePoster = () => {
1073
- const [createPoster, { loading, error }] = (0, import_client20.useMutation)(
1240
+ const [createPoster, { loading, error }] = (0, import_client24.useMutation)(
1074
1241
  CREATE_POSTER_MUTATION
1075
1242
  );
1076
1243
  return { createPoster, error, loading };
1077
1244
  };
1078
1245
 
1079
1246
  // src/graphql/hooks/pushToken.ts
1080
- var import_client22 = require("@apollo/client");
1247
+ var import_client26 = require("@apollo/client");
1081
1248
 
1082
1249
  // src/graphql/mutations/pushToken.ts
1083
- var import_client21 = require("@apollo/client");
1084
- var CREATE_PUSH_TOKEN_MUTATION = import_client21.gql`
1250
+ var import_client25 = require("@apollo/client");
1251
+ var CREATE_PUSH_TOKEN_MUTATION = import_client25.gql`
1085
1252
  mutation createPushToken($input: PushTokenInput!) {
1086
1253
  createPushToken(input: $input) {
1087
1254
  success
@@ -1091,21 +1258,21 @@ var CREATE_PUSH_TOKEN_MUTATION = import_client21.gql`
1091
1258
 
1092
1259
  // src/graphql/hooks/pushToken.ts
1093
1260
  var useCreatePushToken = () => {
1094
- const [createPushToken, { loading, error }] = (0, import_client22.useMutation)(
1261
+ const [createPushToken, { loading, error }] = (0, import_client26.useMutation)(
1095
1262
  CREATE_PUSH_TOKEN_MUTATION
1096
1263
  );
1097
1264
  return { createPushToken, error, loading };
1098
1265
  };
1099
1266
 
1100
1267
  // src/graphql/hooks/relation/hooksMutation.ts
1101
- var import_client25 = require("@apollo/client");
1268
+ var import_client29 = require("@apollo/client");
1102
1269
 
1103
1270
  // src/graphql/mutations/relation.ts
1104
- var import_client24 = require("@apollo/client");
1271
+ var import_client28 = require("@apollo/client");
1105
1272
 
1106
1273
  // src/graphql/queries/relation.ts
1107
- var import_client23 = require("@apollo/client");
1108
- var RELATION_DATES_FRAGMENT = import_client23.gql`
1274
+ var import_client27 = require("@apollo/client");
1275
+ var RELATION_DATES_FRAGMENT = import_client27.gql`
1109
1276
  fragment RelationDates on RelationDateType {
1110
1277
  lastUpdateBy
1111
1278
  paymentReference
@@ -1119,7 +1286,7 @@ var RELATION_DATES_FRAGMENT = import_client23.gql`
1119
1286
  status
1120
1287
  }
1121
1288
  `;
1122
- var RELATION_FIELDS_FRAGMENT = import_client23.gql`
1289
+ var RELATION_FIELDS_FRAGMENT = import_client27.gql`
1123
1290
  fragment RelationFields on RelationType {
1124
1291
  _id
1125
1292
  apiMessage
@@ -1136,7 +1303,7 @@ var RELATION_FIELDS_FRAGMENT = import_client23.gql`
1136
1303
  }
1137
1304
  ${RELATION_DATES_FRAGMENT}
1138
1305
  `;
1139
- var GET_RELATION = import_client23.gql`
1306
+ var GET_RELATION = import_client27.gql`
1140
1307
  query getRelation($id: ID!) {
1141
1308
  relation(_id: $id) {
1142
1309
  ...RelationFields
@@ -1144,7 +1311,7 @@ var GET_RELATION = import_client23.gql`
1144
1311
  }
1145
1312
  ${RELATION_FIELDS_FRAGMENT}
1146
1313
  `;
1147
- var GET_RELATION_BY_MARKET_AND_STALLHOLDER = import_client23.gql`
1314
+ var GET_RELATION_BY_MARKET_AND_STALLHOLDER = import_client27.gql`
1148
1315
  query getRelationByMarketAndStallholder($marketId: ID!, $stallholderId: ID!) {
1149
1316
  relationByMarketAndStallholder(
1150
1317
  marketId: $marketId
@@ -1155,7 +1322,7 @@ var GET_RELATION_BY_MARKET_AND_STALLHOLDER = import_client23.gql`
1155
1322
  }
1156
1323
  ${RELATION_FIELDS_FRAGMENT}
1157
1324
  `;
1158
- var GET_MARKET_RELATIONS = import_client23.gql`
1325
+ var GET_MARKET_RELATIONS = import_client27.gql`
1159
1326
  query getMarketRelations($marketId: ID!) {
1160
1327
  marketRelations(marketId: $marketId) {
1161
1328
  ...RelationFields
@@ -1163,7 +1330,7 @@ var GET_MARKET_RELATIONS = import_client23.gql`
1163
1330
  }
1164
1331
  ${RELATION_FIELDS_FRAGMENT}
1165
1332
  `;
1166
- var GET_STALLHOLDER_RELATIONS = import_client23.gql`
1333
+ var GET_STALLHOLDER_RELATIONS = import_client27.gql`
1167
1334
  query getStallholderRelations($stallholderId: ID!) {
1168
1335
  stallholderRelations(stallholderId: $stallholderId) {
1169
1336
  ...RelationFields
@@ -1171,7 +1338,7 @@ var GET_STALLHOLDER_RELATIONS = import_client23.gql`
1171
1338
  }
1172
1339
  ${RELATION_FIELDS_FRAGMENT}
1173
1340
  `;
1174
- var GET_RESOURCE_CONNECTIONS = import_client23.gql`
1341
+ var GET_RESOURCE_CONNECTIONS = import_client27.gql`
1175
1342
  query getResourceConnections(
1176
1343
  $resourceId: ID!
1177
1344
  $resourceType: ResourceTypeEnum!
@@ -1274,7 +1441,7 @@ var GET_RESOURCE_CONNECTIONS = import_client23.gql`
1274
1441
  `;
1275
1442
 
1276
1443
  // src/graphql/mutations/relation.ts
1277
- var CREATE_RELATION_MUTATION = import_client24.gql`
1444
+ var CREATE_RELATION_MUTATION = import_client28.gql`
1278
1445
  mutation createRelation($input: RelationInputType!) {
1279
1446
  createRelation(input: $input) {
1280
1447
  ...RelationFields
@@ -1282,7 +1449,7 @@ var CREATE_RELATION_MUTATION = import_client24.gql`
1282
1449
  }
1283
1450
  ${RELATION_FIELDS_FRAGMENT}
1284
1451
  `;
1285
- var UPDATE_RELATION_MUTATION = import_client24.gql`
1452
+ var UPDATE_RELATION_MUTATION = import_client28.gql`
1286
1453
  mutation updateRelation($_id: ID!, $input: RelationInputType!) {
1287
1454
  updateRelation(_id: $_id, input: $input) {
1288
1455
  ...RelationFields
@@ -1290,7 +1457,7 @@ var UPDATE_RELATION_MUTATION = import_client24.gql`
1290
1457
  }
1291
1458
  ${RELATION_FIELDS_FRAGMENT}
1292
1459
  `;
1293
- var DELETE_RELATION_MUTATION = import_client24.gql`
1460
+ var DELETE_RELATION_MUTATION = import_client28.gql`
1294
1461
  mutation deleteRelation($_id: ID!) {
1295
1462
  deleteRelation(_id: $_id) {
1296
1463
  ...RelationFields
@@ -1302,7 +1469,7 @@ var DELETE_RELATION_MUTATION = import_client24.gql`
1302
1469
  // src/graphql/hooks/relation/hooksMutation.ts
1303
1470
  var fetchPolicy = "no-cache";
1304
1471
  var useCreateRelation = () => {
1305
- const [createRelation, { loading, error }] = (0, import_client25.useMutation)(
1472
+ const [createRelation, { loading, error }] = (0, import_client29.useMutation)(
1306
1473
  CREATE_RELATION_MUTATION,
1307
1474
  {
1308
1475
  awaitRefetchQueries: true,
@@ -1354,7 +1521,7 @@ var useCreateRelation = () => {
1354
1521
  return { createRelation, error, loading };
1355
1522
  };
1356
1523
  var useUpdateRelation = () => {
1357
- const [updateRelation, { loading, error }] = (0, import_client25.useMutation)(
1524
+ const [updateRelation, { loading, error }] = (0, import_client29.useMutation)(
1358
1525
  UPDATE_RELATION_MUTATION,
1359
1526
  {
1360
1527
  awaitRefetchQueries: true,
@@ -1402,7 +1569,7 @@ var useUpdateRelation = () => {
1402
1569
  return { error, loading, updateRelation };
1403
1570
  };
1404
1571
  var useDeleteRelation = () => {
1405
- const [deleteRelation, { loading, error }] = (0, import_client25.useMutation)(
1572
+ const [deleteRelation, { loading, error }] = (0, import_client29.useMutation)(
1406
1573
  DELETE_RELATION_MUTATION,
1407
1574
  {
1408
1575
  awaitRefetchQueries: true,
@@ -1450,9 +1617,9 @@ var useDeleteRelation = () => {
1450
1617
  };
1451
1618
 
1452
1619
  // src/graphql/hooks/relation/hooksQuery.ts
1453
- var import_client26 = require("@apollo/client");
1620
+ var import_client30 = require("@apollo/client");
1454
1621
  var useGetRelation = (id) => {
1455
- const { loading, error, data, refetch } = (0, import_client26.useQuery)(GET_RELATION, {
1622
+ const { loading, error, data, refetch } = (0, import_client30.useQuery)(GET_RELATION, {
1456
1623
  fetchPolicy: "network-only",
1457
1624
  skip: id === "",
1458
1625
  variables: { id }
@@ -1461,7 +1628,7 @@ var useGetRelation = (id) => {
1461
1628
  return { error, loading, refetch, relation };
1462
1629
  };
1463
1630
  var useGetRelationByMarketAndStallholder = (marketId, stallholderId) => {
1464
- const { loading, error, data, refetch } = (0, import_client26.useQuery)(
1631
+ const { loading, error, data, refetch } = (0, import_client30.useQuery)(
1465
1632
  GET_RELATION_BY_MARKET_AND_STALLHOLDER,
1466
1633
  {
1467
1634
  fetchPolicy: "network-only",
@@ -1473,7 +1640,7 @@ var useGetRelationByMarketAndStallholder = (marketId, stallholderId) => {
1473
1640
  return { error, loading, refetch, relationByMarketAndStallholder };
1474
1641
  };
1475
1642
  var useGetMarketRelations = (marketId) => {
1476
- const { loading, error, data, refetch } = (0, import_client26.useQuery)(GET_MARKET_RELATIONS, {
1643
+ const { loading, error, data, refetch } = (0, import_client30.useQuery)(GET_MARKET_RELATIONS, {
1477
1644
  fetchPolicy: "network-only",
1478
1645
  skip: marketId === "",
1479
1646
  variables: { marketId }
@@ -1482,7 +1649,7 @@ var useGetMarketRelations = (marketId) => {
1482
1649
  return { error, loading, marketRelations, refetch };
1483
1650
  };
1484
1651
  var useGetStallholderRelations = (stallholderId) => {
1485
- const { loading, error, data, refetch } = (0, import_client26.useQuery)(
1652
+ const { loading, error, data, refetch } = (0, import_client30.useQuery)(
1486
1653
  GET_STALLHOLDER_RELATIONS,
1487
1654
  {
1488
1655
  fetchPolicy: "network-only",
@@ -1494,7 +1661,7 @@ var useGetStallholderRelations = (stallholderId) => {
1494
1661
  return { error, loading, refetch, stallholderRelations };
1495
1662
  };
1496
1663
  var useGetResourceConnections = (resourceId, resourceType) => {
1497
- const { loading, error, data, refetch } = (0, import_client26.useQuery)(GET_RESOURCE_CONNECTIONS, {
1664
+ const { loading, error, data, refetch } = (0, import_client30.useQuery)(GET_RESOURCE_CONNECTIONS, {
1498
1665
  fetchPolicy: "network-only",
1499
1666
  variables: { resourceId, resourceType }
1500
1667
  });
@@ -1503,11 +1670,11 @@ var useGetResourceConnections = (resourceId, resourceType) => {
1503
1670
  };
1504
1671
 
1505
1672
  // src/graphql/hooks/stallholder/hooksMutation.ts
1506
- var import_client28 = require("@apollo/client");
1673
+ var import_client32 = require("@apollo/client");
1507
1674
 
1508
1675
  // src/graphql/mutations/stallholder.ts
1509
- var import_client27 = require("@apollo/client");
1510
- var CREATE_STALLHOLDER_MUTATION = import_client27.gql`
1676
+ var import_client31 = require("@apollo/client");
1677
+ var CREATE_STALLHOLDER_MUTATION = import_client31.gql`
1511
1678
  mutation createStallholder($input: StallholderInputType!) {
1512
1679
  createStallholder(input: $input) {
1513
1680
  ...StallholderFields
@@ -1515,7 +1682,7 @@ var CREATE_STALLHOLDER_MUTATION = import_client27.gql`
1515
1682
  }
1516
1683
  ${STALLHOLDER}
1517
1684
  `;
1518
- var UPDATE_STALLHOLDER_MUTATION = import_client27.gql`
1685
+ var UPDATE_STALLHOLDER_MUTATION = import_client31.gql`
1519
1686
  mutation updateStallholder($_id: ID!, $input: StallholderInputType!) {
1520
1687
  updateStallholder(_id: $_id, input: $input) {
1521
1688
  ...StallholderFields
@@ -1523,12 +1690,12 @@ var UPDATE_STALLHOLDER_MUTATION = import_client27.gql`
1523
1690
  }
1524
1691
  ${STALLHOLDER}
1525
1692
  `;
1526
- var DELETE_STALLHOLDER_MUTATION = import_client27.gql`
1693
+ var DELETE_STALLHOLDER_MUTATION = import_client31.gql`
1527
1694
  mutation deleteStallholder($_id: ID!) {
1528
1695
  deleteStallholder(_id: $_id)
1529
1696
  }
1530
1697
  `;
1531
- var CREATE_STALLHOLDER_INFO_MUTATION = import_client27.gql`
1698
+ var CREATE_STALLHOLDER_INFO_MUTATION = import_client31.gql`
1532
1699
  mutation createStallholderInfo($input: StallholderInfoInputType!) {
1533
1700
  createStallholderInfo(input: $input) {
1534
1701
  ...StallholderInfoFields
@@ -1536,7 +1703,7 @@ var CREATE_STALLHOLDER_INFO_MUTATION = import_client27.gql`
1536
1703
  }
1537
1704
  ${STALLHOLDER_INFO}
1538
1705
  `;
1539
- var UPDATE_STALLHOLDER_INFO_MUTATION = import_client27.gql`
1706
+ var UPDATE_STALLHOLDER_INFO_MUTATION = import_client31.gql`
1540
1707
  mutation updateStallholderInfo($_id: ID!, $input: StallholderInfoInputType!) {
1541
1708
  updateStallholderInfo(_id: $_id, input: $input) {
1542
1709
  ...StallholderInfoFields
@@ -1547,7 +1714,7 @@ var UPDATE_STALLHOLDER_INFO_MUTATION = import_client27.gql`
1547
1714
 
1548
1715
  // src/graphql/hooks/stallholder/hooksMutation.ts
1549
1716
  var useCreateStallholder = () => {
1550
- const [createStallholder, { loading, error }] = (0, import_client28.useMutation)(
1717
+ const [createStallholder, { loading, error }] = (0, import_client32.useMutation)(
1551
1718
  CREATE_STALLHOLDER_MUTATION,
1552
1719
  {
1553
1720
  awaitRefetchQueries: true,
@@ -1559,7 +1726,7 @@ var useCreateStallholder = () => {
1559
1726
  return { createStallholder, error, loading };
1560
1727
  };
1561
1728
  var useUpdateStallholder = () => {
1562
- const [updateStallholder, { loading, error }] = (0, import_client28.useMutation)(
1729
+ const [updateStallholder, { loading, error }] = (0, import_client32.useMutation)(
1563
1730
  UPDATE_STALLHOLDER_MUTATION,
1564
1731
  {
1565
1732
  awaitRefetchQueries: true,
@@ -1571,7 +1738,7 @@ var useUpdateStallholder = () => {
1571
1738
  return { error, loading, updateStallholder };
1572
1739
  };
1573
1740
  var useDeleteStallholder = () => {
1574
- const [deleteStallholder, { loading, error }] = (0, import_client28.useMutation)(
1741
+ const [deleteStallholder, { loading, error }] = (0, import_client32.useMutation)(
1575
1742
  DELETE_STALLHOLDER_MUTATION,
1576
1743
  {
1577
1744
  awaitRefetchQueries: true,
@@ -1583,7 +1750,7 @@ var useDeleteStallholder = () => {
1583
1750
  return { deleteStallholder, error, loading };
1584
1751
  };
1585
1752
  var useCreateStallholderInfo = () => {
1586
- const [createStallholderInfo, { loading, error }] = (0, import_client28.useMutation)(
1753
+ const [createStallholderInfo, { loading, error }] = (0, import_client32.useMutation)(
1587
1754
  CREATE_STALLHOLDER_INFO_MUTATION,
1588
1755
  {
1589
1756
  awaitRefetchQueries: true,
@@ -1607,7 +1774,7 @@ var useCreateStallholderInfo = () => {
1607
1774
  return { createStallholderInfo, error, loading };
1608
1775
  };
1609
1776
  var useUpdateStallholderInfo = () => {
1610
- const [updateStallholderInfo, { loading, error }] = (0, import_client28.useMutation)(
1777
+ const [updateStallholderInfo, { loading, error }] = (0, import_client32.useMutation)(
1611
1778
  UPDATE_STALLHOLDER_INFO_MUTATION,
1612
1779
  {
1613
1780
  awaitRefetchQueries: true,
@@ -1628,9 +1795,9 @@ var useUpdateStallholderInfo = () => {
1628
1795
  };
1629
1796
 
1630
1797
  // src/graphql/hooks/stallholder/hooksQuery.ts
1631
- var import_client29 = require("@apollo/client");
1798
+ var import_client33 = require("@apollo/client");
1632
1799
  var useGetStallholders = () => {
1633
- const { loading, error, data, refetch } = (0, import_client29.useQuery)(GET_STALLHOLDERS, {
1800
+ const { loading, error, data, refetch } = (0, import_client33.useQuery)(GET_STALLHOLDERS, {
1634
1801
  fetchPolicy: "network-only"
1635
1802
  });
1636
1803
  const stallholders = data?.stallholders;
@@ -1642,7 +1809,7 @@ var useGetStallholders = () => {
1642
1809
  };
1643
1810
  };
1644
1811
  var useGetStallholder = (_id) => {
1645
- const { loading, error, data, refetch } = (0, import_client29.useQuery)(GET_STALLHOLDER, {
1812
+ const { loading, error, data, refetch } = (0, import_client33.useQuery)(GET_STALLHOLDER, {
1646
1813
  fetchPolicy: "network-only",
1647
1814
  skip: !_id,
1648
1815
  variables: { _id }
@@ -1651,7 +1818,7 @@ var useGetStallholder = (_id) => {
1651
1818
  return { error, loading, refetch, stallholder };
1652
1819
  };
1653
1820
  var useGetStallholdersByRegion = (region) => {
1654
- const { loading, error, data, refetch } = (0, import_client29.useQuery)(
1821
+ const { loading, error, data, refetch } = (0, import_client33.useQuery)(
1655
1822
  GET_STALLHOLDERS_BY_REGION,
1656
1823
  {
1657
1824
  fetchPolicy: "no-cache",
@@ -1663,7 +1830,7 @@ var useGetStallholdersByRegion = (region) => {
1663
1830
  return { error, loading, refetch, stallholdersByRegion };
1664
1831
  };
1665
1832
  var useSearchStallholders = (search, region) => {
1666
- const { loading, error, data, refetch } = (0, import_client29.useQuery)(SEARCH_STALLHOLDERS, {
1833
+ const { loading, error, data, refetch } = (0, import_client33.useQuery)(SEARCH_STALLHOLDERS, {
1667
1834
  fetchPolicy: "network-only",
1668
1835
  skip: search.length < 3,
1669
1836
  variables: { region, search }
@@ -1672,7 +1839,7 @@ var useSearchStallholders = (search, region) => {
1672
1839
  return { error, loading, refetch, stallholderSearch };
1673
1840
  };
1674
1841
  var useGetStallholderInfo = (stallholderId) => {
1675
- const { loading, error, data, refetch } = (0, import_client29.useQuery)(GET_STALLHOLDER_INFO, {
1842
+ const { loading, error, data, refetch } = (0, import_client33.useQuery)(GET_STALLHOLDER_INFO, {
1676
1843
  fetchPolicy: "network-only",
1677
1844
  skip: !stallholderId,
1678
1845
  variables: { stallholderId }
@@ -1687,14 +1854,14 @@ var useGetStallholderInfo = (stallholderId) => {
1687
1854
  };
1688
1855
 
1689
1856
  // src/graphql/hooks/testers/hooksMutation.ts
1690
- var import_client32 = require("@apollo/client");
1857
+ var import_client36 = require("@apollo/client");
1691
1858
 
1692
1859
  // src/graphql/mutations/testers.ts
1693
- var import_client31 = require("@apollo/client");
1860
+ var import_client35 = require("@apollo/client");
1694
1861
 
1695
1862
  // src/graphql/queries/testers.ts
1696
- var import_client30 = require("@apollo/client");
1697
- var TESTER_FIELDS_FRAGMENT = import_client30.gql`
1863
+ var import_client34 = require("@apollo/client");
1864
+ var TESTER_FIELDS_FRAGMENT = import_client34.gql`
1698
1865
  fragment TesterFields on TesterType {
1699
1866
  _id
1700
1867
  active
@@ -1707,7 +1874,7 @@ var TESTER_FIELDS_FRAGMENT = import_client30.gql`
1707
1874
  updatedAt
1708
1875
  }
1709
1876
  `;
1710
- var GET_TESTERS = import_client30.gql`
1877
+ var GET_TESTERS = import_client34.gql`
1711
1878
  query getTesters {
1712
1879
  testers {
1713
1880
  ...TesterFields
@@ -1715,7 +1882,7 @@ var GET_TESTERS = import_client30.gql`
1715
1882
  }
1716
1883
  ${TESTER_FIELDS_FRAGMENT}
1717
1884
  `;
1718
- var GET_TESTER = import_client30.gql`
1885
+ var GET_TESTER = import_client34.gql`
1719
1886
  query getTester($_id: ID!) {
1720
1887
  tester(_id: $_id) {
1721
1888
  ...TesterFields
@@ -1725,7 +1892,7 @@ var GET_TESTER = import_client30.gql`
1725
1892
  `;
1726
1893
 
1727
1894
  // src/graphql/mutations/testers.ts
1728
- var CREATE_TESTER_MUTATION = import_client31.gql`
1895
+ var CREATE_TESTER_MUTATION = import_client35.gql`
1729
1896
  mutation createTester($input: TesterInputType!) {
1730
1897
  createTester(input: $input) {
1731
1898
  ...TesterFields
@@ -1733,7 +1900,7 @@ var CREATE_TESTER_MUTATION = import_client31.gql`
1733
1900
  }
1734
1901
  ${TESTER_FIELDS_FRAGMENT}
1735
1902
  `;
1736
- var UPDATE_TESTER_MUTATION = import_client31.gql`
1903
+ var UPDATE_TESTER_MUTATION = import_client35.gql`
1737
1904
  mutation updateTester($_id: ID!, $input: TesterInputType!) {
1738
1905
  updateTester(_id: $_id, input: $input) {
1739
1906
  ...TesterFields
@@ -1741,7 +1908,7 @@ var UPDATE_TESTER_MUTATION = import_client31.gql`
1741
1908
  }
1742
1909
  ${TESTER_FIELDS_FRAGMENT}
1743
1910
  `;
1744
- var DELETE_TESTER_MUTATION = import_client31.gql`
1911
+ var DELETE_TESTER_MUTATION = import_client35.gql`
1745
1912
  mutation deleteTester($_id: ID!) {
1746
1913
  deleteTester(_id: $_id)
1747
1914
  }
@@ -1749,7 +1916,7 @@ var DELETE_TESTER_MUTATION = import_client31.gql`
1749
1916
 
1750
1917
  // src/graphql/hooks/testers/hooksMutation.ts
1751
1918
  var useCreateTester = () => {
1752
- const [createTester, { data, loading, error }] = (0, import_client32.useMutation)(
1919
+ const [createTester, { data, loading, error }] = (0, import_client36.useMutation)(
1753
1920
  CREATE_TESTER_MUTATION
1754
1921
  );
1755
1922
  return {
@@ -1760,7 +1927,7 @@ var useCreateTester = () => {
1760
1927
  };
1761
1928
  };
1762
1929
  var useUpdateTester = () => {
1763
- const [updateTester, { data, loading, error }] = (0, import_client32.useMutation)(
1930
+ const [updateTester, { data, loading, error }] = (0, import_client36.useMutation)(
1764
1931
  UPDATE_TESTER_MUTATION
1765
1932
  );
1766
1933
  return {
@@ -1771,16 +1938,16 @@ var useUpdateTester = () => {
1771
1938
  };
1772
1939
  };
1773
1940
  var useDeleteTester = () => {
1774
- const [deleteTester, { loading, error }] = (0, import_client32.useMutation)(
1941
+ const [deleteTester, { loading, error }] = (0, import_client36.useMutation)(
1775
1942
  DELETE_TESTER_MUTATION
1776
1943
  );
1777
1944
  return { deleteTester, error, loading };
1778
1945
  };
1779
1946
 
1780
1947
  // src/graphql/hooks/testers/hooksQuery.ts
1781
- var import_client33 = require("@apollo/client");
1948
+ var import_client37 = require("@apollo/client");
1782
1949
  var useGetTesters = () => {
1783
- const { data, loading, error, refetch } = (0, import_client33.useQuery)(GET_TESTERS);
1950
+ const { data, loading, error, refetch } = (0, import_client37.useQuery)(GET_TESTERS);
1784
1951
  const testers = data?.testers;
1785
1952
  return {
1786
1953
  error,
@@ -1790,7 +1957,7 @@ var useGetTesters = () => {
1790
1957
  };
1791
1958
  };
1792
1959
  var useGetTester = (_id) => {
1793
- const { data, loading, error, refetch } = (0, import_client33.useQuery)(GET_TESTER, {
1960
+ const { data, loading, error, refetch } = (0, import_client37.useQuery)(GET_TESTER, {
1794
1961
  skip: !_id,
1795
1962
  variables: { _id }
1796
1963
  });
@@ -1799,11 +1966,11 @@ var useGetTester = (_id) => {
1799
1966
  };
1800
1967
 
1801
1968
  // src/graphql/hooks/user/hooksMutation.ts
1802
- var import_client35 = require("@apollo/client");
1969
+ var import_client39 = require("@apollo/client");
1803
1970
 
1804
1971
  // src/graphql/mutations/user.ts
1805
- var import_client34 = require("@apollo/client");
1806
- var CREATE_USER_MUTATION = import_client34.gql`
1972
+ var import_client38 = require("@apollo/client");
1973
+ var CREATE_USER_MUTATION = import_client38.gql`
1807
1974
  mutation createUser($input: UserInputType!) {
1808
1975
  createUser(input: $input) {
1809
1976
  ...UserFields
@@ -1811,7 +1978,7 @@ var CREATE_USER_MUTATION = import_client34.gql`
1811
1978
  }
1812
1979
  ${USER_FIELDS_FRAGMENT}
1813
1980
  `;
1814
- var UPDATE_USER_MUTATION = import_client34.gql`
1981
+ var UPDATE_USER_MUTATION = import_client38.gql`
1815
1982
  mutation updateUser($_id: ID!, $input: UserInputType!) {
1816
1983
  updateUser(_id: $_id, input: $input) {
1817
1984
  ...UserFields
@@ -1819,12 +1986,12 @@ var UPDATE_USER_MUTATION = import_client34.gql`
1819
1986
  }
1820
1987
  ${USER_FIELDS_FRAGMENT}
1821
1988
  `;
1822
- var DELETE_USER_MUTATION = import_client34.gql`
1989
+ var DELETE_USER_MUTATION = import_client38.gql`
1823
1990
  mutation deleteUser($_id: ID!) {
1824
1991
  deleteUser(_id: $_id)
1825
1992
  }
1826
1993
  `;
1827
- var ADD_USER_FAVOURITE_RESOURCE_MUTATION = import_client34.gql`
1994
+ var ADD_USER_FAVOURITE_RESOURCE_MUTATION = import_client38.gql`
1828
1995
  mutation addUserFavouriteResource(
1829
1996
  $resourceId: ID!
1830
1997
  $resourceType: ResourceTypeEnum!
@@ -1840,7 +2007,7 @@ var ADD_USER_FAVOURITE_RESOURCE_MUTATION = import_client34.gql`
1840
2007
  }
1841
2008
  ${USER_FIELDS_FRAGMENT}
1842
2009
  `;
1843
- var REMOVE_USER_FAVOURITE_RESOURCE_MUTATION = import_client34.gql`
2010
+ var REMOVE_USER_FAVOURITE_RESOURCE_MUTATION = import_client38.gql`
1844
2011
  mutation removeUserFavouriteResource(
1845
2012
  $resourceId: ID!
1846
2013
  $resourceType: ResourceTypeEnum!
@@ -1859,11 +2026,11 @@ var REMOVE_USER_FAVOURITE_RESOURCE_MUTATION = import_client34.gql`
1859
2026
 
1860
2027
  // src/graphql/hooks/user/hooksMutation.ts
1861
2028
  var useCreateUser = () => {
1862
- const [createUser, { loading, error }] = (0, import_client35.useMutation)(CREATE_USER_MUTATION);
2029
+ const [createUser, { loading, error }] = (0, import_client39.useMutation)(CREATE_USER_MUTATION);
1863
2030
  return { createUser, error, loading };
1864
2031
  };
1865
2032
  var useUpdateUser = () => {
1866
- const [updateUser, { loading, error }] = (0, import_client35.useMutation)(UPDATE_USER_MUTATION, {
2033
+ const [updateUser, { loading, error }] = (0, import_client39.useMutation)(UPDATE_USER_MUTATION, {
1867
2034
  awaitRefetchQueries: true,
1868
2035
  refetchQueries: (mutationResult) => {
1869
2036
  const userId = mutationResult?.data?.updateUser?._id;
@@ -1874,11 +2041,11 @@ var useUpdateUser = () => {
1874
2041
  return { error, loading, updateUser };
1875
2042
  };
1876
2043
  var useDeleteUser = () => {
1877
- const [deleteUser, { loading, error }] = (0, import_client35.useMutation)(DELETE_USER_MUTATION);
2044
+ const [deleteUser, { loading, error }] = (0, import_client39.useMutation)(DELETE_USER_MUTATION);
1878
2045
  return { deleteUser, error, loading };
1879
2046
  };
1880
2047
  var useAddUserFavouriteResource = () => {
1881
- const [addUserFavouriteResource, { loading, error }] = (0, import_client35.useMutation)(
2048
+ const [addUserFavouriteResource, { loading, error }] = (0, import_client39.useMutation)(
1882
2049
  ADD_USER_FAVOURITE_RESOURCE_MUTATION,
1883
2050
  {
1884
2051
  awaitRefetchQueries: true,
@@ -1888,7 +2055,7 @@ var useAddUserFavouriteResource = () => {
1888
2055
  return { addUserFavouriteResource, error, loading };
1889
2056
  };
1890
2057
  var useRemoveUserFavouriteResource = () => {
1891
- const [removeUserFavouriteResource, { loading, error }] = (0, import_client35.useMutation)(
2058
+ const [removeUserFavouriteResource, { loading, error }] = (0, import_client39.useMutation)(
1892
2059
  REMOVE_USER_FAVOURITE_RESOURCE_MUTATION,
1893
2060
  {
1894
2061
  awaitRefetchQueries: true,
@@ -1899,37 +2066,37 @@ var useRemoveUserFavouriteResource = () => {
1899
2066
  };
1900
2067
 
1901
2068
  // src/graphql/hooks/user/hooksQuery.ts
1902
- var import_client36 = require("@apollo/client");
2069
+ var import_client40 = require("@apollo/client");
1903
2070
  var useGetUsers = () => {
1904
- const { loading, error, data, refetch } = (0, import_client36.useQuery)(GET_USERS, {
2071
+ const { loading, error, data, refetch } = (0, import_client40.useQuery)(GET_USERS, {
1905
2072
  fetchPolicy: "network-only"
1906
2073
  });
1907
2074
  const users = data?.users;
1908
2075
  return { error, loading, refetch, users };
1909
2076
  };
1910
2077
  var useGetUser = (_id) => {
1911
- const { loading, error, data, refetch } = (0, import_client36.useQuery)(GET_USER, {
2078
+ const { loading, error, data, refetch } = (0, import_client40.useQuery)(GET_USER, {
1912
2079
  variables: { _id }
1913
2080
  });
1914
2081
  const user = data?.user;
1915
2082
  return { error, loading, refetch, user };
1916
2083
  };
1917
2084
  var useGetUserMarkets = () => {
1918
- const { loading, error, data, refetch } = (0, import_client36.useQuery)(GET_USER_MARKETS, {
2085
+ const { loading, error, data, refetch } = (0, import_client40.useQuery)(GET_USER_MARKETS, {
1919
2086
  fetchPolicy: "network-only"
1920
2087
  });
1921
2088
  const userMarkets = data?.userMarkets;
1922
2089
  return { error, loading, refetch, userMarkets };
1923
2090
  };
1924
2091
  var useGetUserStallholder = () => {
1925
- const { loading, error, data, refetch } = (0, import_client36.useQuery)(GET_USER_STALLHOLDER, {
2092
+ const { loading, error, data, refetch } = (0, import_client40.useQuery)(GET_USER_STALLHOLDER, {
1926
2093
  fetchPolicy: "network-only"
1927
2094
  });
1928
2095
  const userStallholder = data?.userStallholder;
1929
2096
  return { error, loading, refetch, userStallholder };
1930
2097
  };
1931
2098
  var useGetUserFavourites = () => {
1932
- const { loading, error, data, refetch } = (0, import_client36.useQuery)(GET_USER_FAVOURITES, {
2099
+ const { loading, error, data, refetch } = (0, import_client40.useQuery)(GET_USER_FAVOURITES, {
1933
2100
  fetchPolicy: "network-only"
1934
2101
  });
1935
2102
  const markets = data?.userFavourites.markets;
@@ -1940,218 +2107,6 @@ var useGetUserFavourites = () => {
1940
2107
  };
1941
2108
  return { error, loading, refetch, userFavourites };
1942
2109
  };
1943
- var useGetUserNotifications = () => {
1944
- const { loading, error, data, refetch } = (0, import_client36.useQuery)(GET_USER_NOTIFICATIONS, {
1945
- fetchPolicy: "network-only"
1946
- });
1947
- const userNotifications = data?.userNotifications;
1948
- return { error, loading, refetch, userNotifications };
1949
- };
1950
-
1951
- // src/graphql/hooks/notifications.ts
1952
- var import_client39 = require("@apollo/client");
1953
-
1954
- // src/graphql/mutations/notification.ts
1955
- var import_client37 = require("@apollo/client");
1956
- var CREATE_NOTIFICATION = import_client37.gql`
1957
- mutation CreateNotification($input: CreateNotificationInput!) {
1958
- createNotification(input: $input) {
1959
- id
1960
- userId
1961
- title
1962
- message
1963
- type
1964
- isRead
1965
- data
1966
- createdAt
1967
- updatedAt
1968
- }
1969
- }
1970
- `;
1971
- var CREATE_BULK_NOTIFICATIONS = import_client37.gql`
1972
- mutation CreateBulkNotifications($input: CreateBulkNotificationInput!) {
1973
- createBulkNotifications(input: $input) {
1974
- id
1975
- userId
1976
- title
1977
- message
1978
- type
1979
- isRead
1980
- data
1981
- createdAt
1982
- updatedAt
1983
- }
1984
- }
1985
- `;
1986
- var MARK_NOTIFICATION_READ = import_client37.gql`
1987
- mutation MarkNotificationRead($input: MarkNotificationReadInput!) {
1988
- markNotificationRead(input: $input) {
1989
- id
1990
- userId
1991
- title
1992
- message
1993
- type
1994
- isRead
1995
- data
1996
- createdAt
1997
- updatedAt
1998
- }
1999
- }
2000
- `;
2001
- var MARK_ALL_NOTIFICATIONS_READ = import_client37.gql`
2002
- mutation MarkAllNotificationsRead($input: MarkAllNotificationsReadInput!) {
2003
- markAllNotificationsRead(input: $input)
2004
- }
2005
- `;
2006
-
2007
- // src/graphql/queries/notification.ts
2008
- var import_client38 = require("@apollo/client");
2009
- var GET_USER_NOTIFICATIONS2 = import_client38.gql`
2010
- query GetUserNotifications(
2011
- $userId: String!
2012
- $limit: Int
2013
- $offset: Int
2014
- $isRead: String
2015
- ) {
2016
- userNotifications(
2017
- userId: $userId
2018
- limit: $limit
2019
- offset: $offset
2020
- isRead: $isRead
2021
- ) {
2022
- id
2023
- userId
2024
- title
2025
- message
2026
- type
2027
- isRead
2028
- data
2029
- createdAt
2030
- updatedAt
2031
- }
2032
- }
2033
- `;
2034
- var GET_NOTIFICATION_COUNT = import_client38.gql`
2035
- query GetNotificationCount($userId: String!) {
2036
- notificationCount(userId: $userId) {
2037
- total
2038
- unread
2039
- }
2040
- }
2041
- `;
2042
- var GET_UNREAD_NOTIFICATIONS = import_client38.gql`
2043
- query GetUnreadNotifications($userId: String!, $limit: Int) {
2044
- unreadNotifications(userId: $userId, limit: $limit) {
2045
- id
2046
- userId
2047
- title
2048
- message
2049
- type
2050
- isRead
2051
- data
2052
- createdAt
2053
- updatedAt
2054
- }
2055
- }
2056
- `;
2057
-
2058
- // src/graphql/hooks/notifications.ts
2059
- var useNotifications = (userId) => {
2060
- const client = (0, import_client39.useApolloClient)();
2061
- const {
2062
- data: notificationsData,
2063
- loading: notificationsLoading,
2064
- error: notificationsError,
2065
- refetch: refetchNotifications
2066
- } = (0, import_client39.useQuery)(GET_USER_NOTIFICATIONS2, {
2067
- variables: { userId, limit: 50, offset: 0 },
2068
- fetchPolicy: "cache-and-network",
2069
- skip: !userId
2070
- });
2071
- const {
2072
- data: countData,
2073
- loading: countLoading,
2074
- error: countError,
2075
- refetch: refetchCount
2076
- } = (0, import_client39.useQuery)(GET_NOTIFICATION_COUNT, {
2077
- variables: { userId },
2078
- fetchPolicy: "cache-and-network",
2079
- skip: !userId
2080
- });
2081
- const {
2082
- data: unreadData,
2083
- loading: unreadLoading,
2084
- error: unreadError,
2085
- refetch: refetchUnread
2086
- } = (0, import_client39.useQuery)(GET_UNREAD_NOTIFICATIONS, {
2087
- variables: { userId, limit: 20 },
2088
- fetchPolicy: "cache-and-network",
2089
- skip: !userId
2090
- });
2091
- const [createNotification, { loading: createLoading }] = (0, import_client39.useMutation)(CREATE_NOTIFICATION);
2092
- const [createBulkNotifications, { loading: createBulkLoading }] = (0, import_client39.useMutation)(
2093
- CREATE_BULK_NOTIFICATIONS
2094
- );
2095
- const [markNotificationRead, { loading: markReadLoading }] = (0, import_client39.useMutation)(
2096
- MARK_NOTIFICATION_READ
2097
- );
2098
- const [markAllNotificationsRead, { loading: markAllReadLoading }] = (0, import_client39.useMutation)(MARK_ALL_NOTIFICATIONS_READ);
2099
- const refetchAll = () => {
2100
- if (userId) {
2101
- refetchNotifications();
2102
- refetchCount();
2103
- refetchUnread();
2104
- }
2105
- };
2106
- const invalidateCache = () => {
2107
- client.cache.evict({ fieldName: "userNotifications" });
2108
- client.cache.evict({ fieldName: "notificationCount" });
2109
- client.cache.evict({ fieldName: "unreadNotifications" });
2110
- client.cache.gc();
2111
- };
2112
- return {
2113
- // Data
2114
- notifications: notificationsData?.userNotifications || [],
2115
- count: countData?.notificationCount || { total: 0, unread: 0 },
2116
- unreadNotifications: unreadData?.unreadNotifications || [],
2117
- // Loading states
2118
- notificationsLoading,
2119
- countLoading,
2120
- unreadLoading,
2121
- createLoading,
2122
- createBulkLoading,
2123
- markReadLoading,
2124
- markAllReadLoading,
2125
- // Errors
2126
- notificationsError,
2127
- countError,
2128
- unreadError,
2129
- // Actions
2130
- createNotification: async (input) => {
2131
- const result = await createNotification({ variables: { input } });
2132
- refetchAll();
2133
- return result;
2134
- },
2135
- createBulkNotifications: async (input) => {
2136
- const result = await createBulkNotifications({ variables: { input } });
2137
- refetchAll();
2138
- return result;
2139
- },
2140
- markNotificationRead: async (input) => {
2141
- const result = await markNotificationRead({ variables: { input } });
2142
- refetchAll();
2143
- return result;
2144
- },
2145
- markAllNotificationsRead: async (input) => {
2146
- const result = await markAllNotificationsRead({ variables: { input } });
2147
- refetchAll();
2148
- return result;
2149
- },
2150
- // Utilities
2151
- refetchAll,
2152
- invalidateCache
2153
- };
2154
- };
2155
2110
  // Annotate the CommonJS export names for ESM import in node:
2156
2111
  0 && (module.exports = {
2157
2112
  GET_CHAT_MESSAGE,
@@ -2159,9 +2114,11 @@ var useNotifications = (userId) => {
2159
2114
  useAddUserFavouriteResource,
2160
2115
  useAdminUpdateResourceType,
2161
2116
  useContactUs,
2117
+ useCreateBulkNotifications,
2162
2118
  useCreateChat,
2163
2119
  useCreateMarket,
2164
2120
  useCreateMarketInfo,
2121
+ useCreateNotification,
2165
2122
  useCreatePoster,
2166
2123
  useCreatePushToken,
2167
2124
  useCreateRelation,
@@ -2183,6 +2140,7 @@ var useNotifications = (userId) => {
2183
2140
  useGetMarkets,
2184
2141
  useGetMarketsByRegion,
2185
2142
  useGetMarketsNearMe,
2143
+ useGetNotificationCount,
2186
2144
  useGetRelation,
2187
2145
  useGetRelationByMarketAndStallholder,
2188
2146
  useGetResourceConnections,
@@ -2193,6 +2151,7 @@ var useNotifications = (userId) => {
2193
2151
  useGetStallholdersByRegion,
2194
2152
  useGetTester,
2195
2153
  useGetTesters,
2154
+ useGetUnreadNotifications,
2196
2155
  useGetUser,
2197
2156
  useGetUserChats,
2198
2157
  useGetUserFavourites,
@@ -2202,7 +2161,8 @@ var useNotifications = (userId) => {
2202
2161
  useGetUsers,
2203
2162
  useLogin,
2204
2163
  useLogout,
2205
- useNotifications,
2164
+ useMarkAllNotificationsRead,
2165
+ useMarkNotificationRead,
2206
2166
  useRefreshToken,
2207
2167
  useRegister,
2208
2168
  useRemoveParticipantFromChat,