@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.
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
+ EnumNotificationType: () => EnumNotificationType,
35
36
  EnumOSType: () => EnumOSType,
36
37
  EnumPaymentMethod: () => EnumPaymentMethod,
37
38
  EnumRegions: () => EnumRegions,
@@ -115,9 +116,11 @@ __export(index_exports, {
115
116
  useAdminUpdateResourceType: () => useAdminUpdateResourceType,
116
117
  useContactUs: () => useContactUs,
117
118
  useContactUsForm: () => useContactUsForm,
119
+ useCreateBulkNotifications: () => useCreateBulkNotifications,
118
120
  useCreateChat: () => useCreateChat,
119
121
  useCreateMarket: () => useCreateMarket,
120
122
  useCreateMarketInfo: () => useCreateMarketInfo,
123
+ useCreateNotification: () => useCreateNotification,
121
124
  useCreatePoster: () => useCreatePoster,
122
125
  useCreatePushToken: () => useCreatePushToken,
123
126
  useCreateRelation: () => useCreateRelation,
@@ -139,6 +142,7 @@ __export(index_exports, {
139
142
  useGetMarkets: () => useGetMarkets,
140
143
  useGetMarketsByRegion: () => useGetMarketsByRegion,
141
144
  useGetMarketsNearMe: () => useGetMarketsNearMe,
145
+ useGetNotificationCount: () => useGetNotificationCount,
142
146
  useGetRelation: () => useGetRelation,
143
147
  useGetRelationByMarketAndStallholder: () => useGetRelationByMarketAndStallholder,
144
148
  useGetResourceConnections: () => useGetResourceConnections,
@@ -149,6 +153,7 @@ __export(index_exports, {
149
153
  useGetStallholdersByRegion: () => useGetStallholdersByRegion,
150
154
  useGetTester: () => useGetTester,
151
155
  useGetTesters: () => useGetTesters,
156
+ useGetUnreadNotifications: () => useGetUnreadNotifications,
152
157
  useGetUser: () => useGetUser,
153
158
  useGetUserChats: () => useGetUserChats,
154
159
  useGetUserFavourites: () => useGetUserFavourites,
@@ -160,9 +165,10 @@ __export(index_exports, {
160
165
  useLogin: () => useLogin,
161
166
  useLoginForm: () => useLoginForm,
162
167
  useLogout: () => useLogout,
168
+ useMarkAllNotificationsRead: () => useMarkAllNotificationsRead,
169
+ useMarkNotificationRead: () => useMarkNotificationRead,
163
170
  useMarketForm: () => useMarketForm,
164
171
  useMarketInfoForm: () => useMarketInfoForm,
165
- useNotifications: () => useNotifications,
166
172
  useRefreshToken: () => useRefreshToken,
167
173
  useRegister: () => useRegister,
168
174
  useRegisterForm: () => useRegisterForm,
@@ -2809,11 +2815,6 @@ var GET_USER_FAVOURITES = import_client16.gql`
2809
2815
  ${MARKET}
2810
2816
  ${STALLHOLDER}
2811
2817
  `;
2812
- var GET_USER_NOTIFICATIONS = import_client16.gql`
2813
- query getMissedNotifications {
2814
- userNotifications
2815
- }
2816
- `;
2817
2818
 
2818
2819
  // src/graphql/hooks/market/hooksMutation.ts
2819
2820
  var useCreateMarket = () => {
@@ -2958,12 +2959,179 @@ var useGetMarketInfo = (marketId) => {
2958
2959
  return { error, loading, marketInfo: marketInfo2, refetch };
2959
2960
  };
2960
2961
 
2961
- // src/graphql/hooks/poster.ts
2962
+ // src/graphql/hooks/notifications/hooksMutation.ts
2963
+ var import_client21 = require("@apollo/client");
2964
+
2965
+ // src/graphql/mutations/notification.ts
2962
2966
  var import_client20 = require("@apollo/client");
2963
2967
 
2964
- // src/graphql/mutations/poster.ts
2968
+ // src/graphql/queries/notification.ts
2965
2969
  var import_client19 = require("@apollo/client");
2966
- var CREATE_POSTER_MUTATION = import_client19.gql`
2970
+ var USER_NOTIFICATION_FRAGMENT = import_client19.gql`
2971
+ fragment UserNotificationFields on Notification {
2972
+ id
2973
+ userId
2974
+ title
2975
+ message
2976
+ type
2977
+ isRead
2978
+ data
2979
+ createdAt
2980
+ updatedAt
2981
+ }
2982
+ `;
2983
+ var GET_USER_NOTIFICATIONS = import_client19.gql`
2984
+ query getUserNotifications(
2985
+ $userId: String!
2986
+ $limit: Int
2987
+ $offset: Int
2988
+ $isRead: String
2989
+ ) {
2990
+ userNotifications(
2991
+ userId: $userId
2992
+ limit: $limit
2993
+ offset: $offset
2994
+ isRead: $isRead
2995
+ ) {
2996
+ ...UserNotificationFields
2997
+ }
2998
+ }
2999
+ ${USER_NOTIFICATION_FRAGMENT}
3000
+ `;
3001
+ var GET_UNREAD_NOTIFICATIONS = import_client19.gql`
3002
+ query getUnreadNotifications($userId: String!, $limit: Int) {
3003
+ unreadNotifications(userId: $userId, limit: $limit) {
3004
+ ...UserNotificationFields
3005
+ }
3006
+ }
3007
+ ${USER_NOTIFICATION_FRAGMENT}
3008
+ `;
3009
+ var GET_NOTIFICATION_COUNT = import_client19.gql`
3010
+ query getNotificationCount($userId: String!) {
3011
+ notificationCount(userId: $userId) {
3012
+ total
3013
+ unread
3014
+ }
3015
+ }
3016
+ `;
3017
+
3018
+ // src/graphql/mutations/notification.ts
3019
+ var CREATE_NOTIFICATION = import_client20.gql`
3020
+ mutation createNotification($input: CreateNotificationInput!) {
3021
+ createNotification(input: $input) {
3022
+ ...UserNotificationFields
3023
+ }
3024
+ }
3025
+ ${USER_NOTIFICATION_FRAGMENT}
3026
+ `;
3027
+ var CREATE_BULK_NOTIFICATIONS = import_client20.gql`
3028
+ mutation createBulkNotifications($input: CreateBulkNotificationInput!) {
3029
+ createBulkNotifications(input: $input) {
3030
+ ...UserNotificationFields
3031
+ }
3032
+ }
3033
+ ${USER_NOTIFICATION_FRAGMENT}
3034
+ `;
3035
+ var MARK_NOTIFICATION_READ = import_client20.gql`
3036
+ mutation markNotificationRead($input: MarkNotificationReadInput!) {
3037
+ markNotificationRead(input: $input) {
3038
+ ...UserNotificationFields
3039
+ }
3040
+ }
3041
+ ${USER_NOTIFICATION_FRAGMENT}
3042
+ `;
3043
+ var MARK_ALL_NOTIFICATIONS_READ = import_client20.gql`
3044
+ mutation markAllNotificationsRead($input: MarkAllNotificationsReadInput!) {
3045
+ markAllNotificationsRead(input: $input)
3046
+ }
3047
+ `;
3048
+
3049
+ // src/graphql/hooks/notifications/hooksMutation.ts
3050
+ var useCreateNotification = () => {
3051
+ const [createNotification, { loading, error }] = (0, import_client21.useMutation)(CREATE_NOTIFICATION);
3052
+ return { createNotification, error, loading };
3053
+ };
3054
+ var useCreateBulkNotifications = () => {
3055
+ const [createBulkNotifications, { loading, error }] = (0, import_client21.useMutation)(
3056
+ CREATE_BULK_NOTIFICATIONS
3057
+ );
3058
+ return { createBulkNotifications, error, loading };
3059
+ };
3060
+ var useMarkNotificationRead = () => {
3061
+ const [markNotificationRead, { loading, error }] = (0, import_client21.useMutation)(
3062
+ MARK_NOTIFICATION_READ
3063
+ );
3064
+ return { error, loading, markNotificationRead };
3065
+ };
3066
+ var useMarkAllNotificationsRead = () => {
3067
+ const [markAllNotificationsRead, { loading, error }] = (0, import_client21.useMutation)(
3068
+ MARK_ALL_NOTIFICATIONS_READ
3069
+ );
3070
+ return { error, loading, markAllNotificationsRead };
3071
+ };
3072
+
3073
+ // src/graphql/hooks/notifications/hooksQuery.ts
3074
+ var import_client22 = require("@apollo/client");
3075
+ var useGetUserNotifications = (userId, limit, offset, isRead) => {
3076
+ const { data, error, loading, refetch } = (0, import_client22.useQuery)(GET_USER_NOTIFICATIONS, {
3077
+ fetchPolicy: "no-cache",
3078
+ skip: !userId,
3079
+ variables: {
3080
+ isRead,
3081
+ limit: limit ?? 50,
3082
+ offset: offset ?? 0,
3083
+ userId
3084
+ }
3085
+ });
3086
+ const notifications = data?.userNotifications;
3087
+ return {
3088
+ error,
3089
+ loading,
3090
+ notifications,
3091
+ refetch
3092
+ };
3093
+ };
3094
+ var useGetUnreadNotifications = (userId, limit) => {
3095
+ const { data, error, loading, refetch } = (0, import_client22.useQuery)(GET_UNREAD_NOTIFICATIONS, {
3096
+ fetchPolicy: "no-cache",
3097
+ skip: !userId,
3098
+ variables: {
3099
+ limit: limit ?? 50,
3100
+ offset: 0,
3101
+ userId
3102
+ }
3103
+ });
3104
+ const notifications = data?.unreadNotifications;
3105
+ return {
3106
+ error,
3107
+ loading,
3108
+ notifications,
3109
+ refetch
3110
+ };
3111
+ };
3112
+ var useGetNotificationCount = (userId) => {
3113
+ const { data, error, loading, refetch } = (0, import_client22.useQuery)(GET_NOTIFICATION_COUNT, {
3114
+ fetchPolicy: "no-cache",
3115
+ skip: !userId,
3116
+ variables: {
3117
+ userId
3118
+ }
3119
+ });
3120
+ const notificationCount = data?.notificationCount;
3121
+ return {
3122
+ error,
3123
+ loading,
3124
+ notificationCount,
3125
+ refetch
3126
+ };
3127
+ };
3128
+
3129
+ // src/graphql/hooks/poster.ts
3130
+ var import_client24 = require("@apollo/client");
3131
+
3132
+ // src/graphql/mutations/poster.ts
3133
+ var import_client23 = require("@apollo/client");
3134
+ var CREATE_POSTER_MUTATION = import_client23.gql`
2967
3135
  mutation createPoster($input: PosterInputType!) {
2968
3136
  createPoster(input: $input) {
2969
3137
  message
@@ -2973,18 +3141,18 @@ var CREATE_POSTER_MUTATION = import_client19.gql`
2973
3141
 
2974
3142
  // src/graphql/hooks/poster.ts
2975
3143
  var useCreatePoster = () => {
2976
- const [createPoster, { loading, error }] = (0, import_client20.useMutation)(
3144
+ const [createPoster, { loading, error }] = (0, import_client24.useMutation)(
2977
3145
  CREATE_POSTER_MUTATION
2978
3146
  );
2979
3147
  return { createPoster, error, loading };
2980
3148
  };
2981
3149
 
2982
3150
  // src/graphql/hooks/pushToken.ts
2983
- var import_client22 = require("@apollo/client");
3151
+ var import_client26 = require("@apollo/client");
2984
3152
 
2985
3153
  // src/graphql/mutations/pushToken.ts
2986
- var import_client21 = require("@apollo/client");
2987
- var CREATE_PUSH_TOKEN_MUTATION = import_client21.gql`
3154
+ var import_client25 = require("@apollo/client");
3155
+ var CREATE_PUSH_TOKEN_MUTATION = import_client25.gql`
2988
3156
  mutation createPushToken($input: PushTokenInput!) {
2989
3157
  createPushToken(input: $input) {
2990
3158
  success
@@ -2994,21 +3162,21 @@ var CREATE_PUSH_TOKEN_MUTATION = import_client21.gql`
2994
3162
 
2995
3163
  // src/graphql/hooks/pushToken.ts
2996
3164
  var useCreatePushToken = () => {
2997
- const [createPushToken, { loading, error }] = (0, import_client22.useMutation)(
3165
+ const [createPushToken, { loading, error }] = (0, import_client26.useMutation)(
2998
3166
  CREATE_PUSH_TOKEN_MUTATION
2999
3167
  );
3000
3168
  return { createPushToken, error, loading };
3001
3169
  };
3002
3170
 
3003
3171
  // src/graphql/hooks/relation/hooksMutation.ts
3004
- var import_client25 = require("@apollo/client");
3172
+ var import_client29 = require("@apollo/client");
3005
3173
 
3006
3174
  // src/graphql/mutations/relation.ts
3007
- var import_client24 = require("@apollo/client");
3175
+ var import_client28 = require("@apollo/client");
3008
3176
 
3009
3177
  // src/graphql/queries/relation.ts
3010
- var import_client23 = require("@apollo/client");
3011
- var RELATION_DATES_FRAGMENT = import_client23.gql`
3178
+ var import_client27 = require("@apollo/client");
3179
+ var RELATION_DATES_FRAGMENT = import_client27.gql`
3012
3180
  fragment RelationDates on RelationDateType {
3013
3181
  lastUpdateBy
3014
3182
  paymentReference
@@ -3022,7 +3190,7 @@ var RELATION_DATES_FRAGMENT = import_client23.gql`
3022
3190
  status
3023
3191
  }
3024
3192
  `;
3025
- var RELATION_FIELDS_FRAGMENT = import_client23.gql`
3193
+ var RELATION_FIELDS_FRAGMENT = import_client27.gql`
3026
3194
  fragment RelationFields on RelationType {
3027
3195
  _id
3028
3196
  apiMessage
@@ -3039,7 +3207,7 @@ var RELATION_FIELDS_FRAGMENT = import_client23.gql`
3039
3207
  }
3040
3208
  ${RELATION_DATES_FRAGMENT}
3041
3209
  `;
3042
- var GET_RELATION = import_client23.gql`
3210
+ var GET_RELATION = import_client27.gql`
3043
3211
  query getRelation($id: ID!) {
3044
3212
  relation(_id: $id) {
3045
3213
  ...RelationFields
@@ -3047,7 +3215,7 @@ var GET_RELATION = import_client23.gql`
3047
3215
  }
3048
3216
  ${RELATION_FIELDS_FRAGMENT}
3049
3217
  `;
3050
- var GET_RELATION_BY_MARKET_AND_STALLHOLDER = import_client23.gql`
3218
+ var GET_RELATION_BY_MARKET_AND_STALLHOLDER = import_client27.gql`
3051
3219
  query getRelationByMarketAndStallholder($marketId: ID!, $stallholderId: ID!) {
3052
3220
  relationByMarketAndStallholder(
3053
3221
  marketId: $marketId
@@ -3058,7 +3226,7 @@ var GET_RELATION_BY_MARKET_AND_STALLHOLDER = import_client23.gql`
3058
3226
  }
3059
3227
  ${RELATION_FIELDS_FRAGMENT}
3060
3228
  `;
3061
- var GET_MARKET_RELATIONS = import_client23.gql`
3229
+ var GET_MARKET_RELATIONS = import_client27.gql`
3062
3230
  query getMarketRelations($marketId: ID!) {
3063
3231
  marketRelations(marketId: $marketId) {
3064
3232
  ...RelationFields
@@ -3066,7 +3234,7 @@ var GET_MARKET_RELATIONS = import_client23.gql`
3066
3234
  }
3067
3235
  ${RELATION_FIELDS_FRAGMENT}
3068
3236
  `;
3069
- var GET_STALLHOLDER_RELATIONS = import_client23.gql`
3237
+ var GET_STALLHOLDER_RELATIONS = import_client27.gql`
3070
3238
  query getStallholderRelations($stallholderId: ID!) {
3071
3239
  stallholderRelations(stallholderId: $stallholderId) {
3072
3240
  ...RelationFields
@@ -3074,7 +3242,7 @@ var GET_STALLHOLDER_RELATIONS = import_client23.gql`
3074
3242
  }
3075
3243
  ${RELATION_FIELDS_FRAGMENT}
3076
3244
  `;
3077
- var GET_RESOURCE_CONNECTIONS = import_client23.gql`
3245
+ var GET_RESOURCE_CONNECTIONS = import_client27.gql`
3078
3246
  query getResourceConnections(
3079
3247
  $resourceId: ID!
3080
3248
  $resourceType: ResourceTypeEnum!
@@ -3177,7 +3345,7 @@ var GET_RESOURCE_CONNECTIONS = import_client23.gql`
3177
3345
  `;
3178
3346
 
3179
3347
  // src/graphql/mutations/relation.ts
3180
- var CREATE_RELATION_MUTATION = import_client24.gql`
3348
+ var CREATE_RELATION_MUTATION = import_client28.gql`
3181
3349
  mutation createRelation($input: RelationInputType!) {
3182
3350
  createRelation(input: $input) {
3183
3351
  ...RelationFields
@@ -3185,7 +3353,7 @@ var CREATE_RELATION_MUTATION = import_client24.gql`
3185
3353
  }
3186
3354
  ${RELATION_FIELDS_FRAGMENT}
3187
3355
  `;
3188
- var UPDATE_RELATION_MUTATION = import_client24.gql`
3356
+ var UPDATE_RELATION_MUTATION = import_client28.gql`
3189
3357
  mutation updateRelation($_id: ID!, $input: RelationInputType!) {
3190
3358
  updateRelation(_id: $_id, input: $input) {
3191
3359
  ...RelationFields
@@ -3193,7 +3361,7 @@ var UPDATE_RELATION_MUTATION = import_client24.gql`
3193
3361
  }
3194
3362
  ${RELATION_FIELDS_FRAGMENT}
3195
3363
  `;
3196
- var DELETE_RELATION_MUTATION = import_client24.gql`
3364
+ var DELETE_RELATION_MUTATION = import_client28.gql`
3197
3365
  mutation deleteRelation($_id: ID!) {
3198
3366
  deleteRelation(_id: $_id) {
3199
3367
  ...RelationFields
@@ -3205,7 +3373,7 @@ var DELETE_RELATION_MUTATION = import_client24.gql`
3205
3373
  // src/graphql/hooks/relation/hooksMutation.ts
3206
3374
  var fetchPolicy = "no-cache";
3207
3375
  var useCreateRelation = () => {
3208
- const [createRelation, { loading, error }] = (0, import_client25.useMutation)(
3376
+ const [createRelation, { loading, error }] = (0, import_client29.useMutation)(
3209
3377
  CREATE_RELATION_MUTATION,
3210
3378
  {
3211
3379
  awaitRefetchQueries: true,
@@ -3257,7 +3425,7 @@ var useCreateRelation = () => {
3257
3425
  return { createRelation, error, loading };
3258
3426
  };
3259
3427
  var useUpdateRelation = () => {
3260
- const [updateRelation, { loading, error }] = (0, import_client25.useMutation)(
3428
+ const [updateRelation, { loading, error }] = (0, import_client29.useMutation)(
3261
3429
  UPDATE_RELATION_MUTATION,
3262
3430
  {
3263
3431
  awaitRefetchQueries: true,
@@ -3305,7 +3473,7 @@ var useUpdateRelation = () => {
3305
3473
  return { error, loading, updateRelation };
3306
3474
  };
3307
3475
  var useDeleteRelation = () => {
3308
- const [deleteRelation, { loading, error }] = (0, import_client25.useMutation)(
3476
+ const [deleteRelation, { loading, error }] = (0, import_client29.useMutation)(
3309
3477
  DELETE_RELATION_MUTATION,
3310
3478
  {
3311
3479
  awaitRefetchQueries: true,
@@ -3353,9 +3521,9 @@ var useDeleteRelation = () => {
3353
3521
  };
3354
3522
 
3355
3523
  // src/graphql/hooks/relation/hooksQuery.ts
3356
- var import_client26 = require("@apollo/client");
3524
+ var import_client30 = require("@apollo/client");
3357
3525
  var useGetRelation = (id) => {
3358
- const { loading, error, data, refetch } = (0, import_client26.useQuery)(GET_RELATION, {
3526
+ const { loading, error, data, refetch } = (0, import_client30.useQuery)(GET_RELATION, {
3359
3527
  fetchPolicy: "network-only",
3360
3528
  skip: id === "",
3361
3529
  variables: { id }
@@ -3364,7 +3532,7 @@ var useGetRelation = (id) => {
3364
3532
  return { error, loading, refetch, relation };
3365
3533
  };
3366
3534
  var useGetRelationByMarketAndStallholder = (marketId, stallholderId) => {
3367
- const { loading, error, data, refetch } = (0, import_client26.useQuery)(
3535
+ const { loading, error, data, refetch } = (0, import_client30.useQuery)(
3368
3536
  GET_RELATION_BY_MARKET_AND_STALLHOLDER,
3369
3537
  {
3370
3538
  fetchPolicy: "network-only",
@@ -3376,7 +3544,7 @@ var useGetRelationByMarketAndStallholder = (marketId, stallholderId) => {
3376
3544
  return { error, loading, refetch, relationByMarketAndStallholder };
3377
3545
  };
3378
3546
  var useGetMarketRelations = (marketId) => {
3379
- const { loading, error, data, refetch } = (0, import_client26.useQuery)(GET_MARKET_RELATIONS, {
3547
+ const { loading, error, data, refetch } = (0, import_client30.useQuery)(GET_MARKET_RELATIONS, {
3380
3548
  fetchPolicy: "network-only",
3381
3549
  skip: marketId === "",
3382
3550
  variables: { marketId }
@@ -3385,7 +3553,7 @@ var useGetMarketRelations = (marketId) => {
3385
3553
  return { error, loading, marketRelations, refetch };
3386
3554
  };
3387
3555
  var useGetStallholderRelations = (stallholderId) => {
3388
- const { loading, error, data, refetch } = (0, import_client26.useQuery)(
3556
+ const { loading, error, data, refetch } = (0, import_client30.useQuery)(
3389
3557
  GET_STALLHOLDER_RELATIONS,
3390
3558
  {
3391
3559
  fetchPolicy: "network-only",
@@ -3397,7 +3565,7 @@ var useGetStallholderRelations = (stallholderId) => {
3397
3565
  return { error, loading, refetch, stallholderRelations };
3398
3566
  };
3399
3567
  var useGetResourceConnections = (resourceId, resourceType) => {
3400
- const { loading, error, data, refetch } = (0, import_client26.useQuery)(GET_RESOURCE_CONNECTIONS, {
3568
+ const { loading, error, data, refetch } = (0, import_client30.useQuery)(GET_RESOURCE_CONNECTIONS, {
3401
3569
  fetchPolicy: "network-only",
3402
3570
  variables: { resourceId, resourceType }
3403
3571
  });
@@ -3406,11 +3574,11 @@ var useGetResourceConnections = (resourceId, resourceType) => {
3406
3574
  };
3407
3575
 
3408
3576
  // src/graphql/hooks/stallholder/hooksMutation.ts
3409
- var import_client28 = require("@apollo/client");
3577
+ var import_client32 = require("@apollo/client");
3410
3578
 
3411
3579
  // src/graphql/mutations/stallholder.ts
3412
- var import_client27 = require("@apollo/client");
3413
- var CREATE_STALLHOLDER_MUTATION = import_client27.gql`
3580
+ var import_client31 = require("@apollo/client");
3581
+ var CREATE_STALLHOLDER_MUTATION = import_client31.gql`
3414
3582
  mutation createStallholder($input: StallholderInputType!) {
3415
3583
  createStallholder(input: $input) {
3416
3584
  ...StallholderFields
@@ -3418,7 +3586,7 @@ var CREATE_STALLHOLDER_MUTATION = import_client27.gql`
3418
3586
  }
3419
3587
  ${STALLHOLDER}
3420
3588
  `;
3421
- var UPDATE_STALLHOLDER_MUTATION = import_client27.gql`
3589
+ var UPDATE_STALLHOLDER_MUTATION = import_client31.gql`
3422
3590
  mutation updateStallholder($_id: ID!, $input: StallholderInputType!) {
3423
3591
  updateStallholder(_id: $_id, input: $input) {
3424
3592
  ...StallholderFields
@@ -3426,12 +3594,12 @@ var UPDATE_STALLHOLDER_MUTATION = import_client27.gql`
3426
3594
  }
3427
3595
  ${STALLHOLDER}
3428
3596
  `;
3429
- var DELETE_STALLHOLDER_MUTATION = import_client27.gql`
3597
+ var DELETE_STALLHOLDER_MUTATION = import_client31.gql`
3430
3598
  mutation deleteStallholder($_id: ID!) {
3431
3599
  deleteStallholder(_id: $_id)
3432
3600
  }
3433
3601
  `;
3434
- var CREATE_STALLHOLDER_INFO_MUTATION = import_client27.gql`
3602
+ var CREATE_STALLHOLDER_INFO_MUTATION = import_client31.gql`
3435
3603
  mutation createStallholderInfo($input: StallholderInfoInputType!) {
3436
3604
  createStallholderInfo(input: $input) {
3437
3605
  ...StallholderInfoFields
@@ -3439,7 +3607,7 @@ var CREATE_STALLHOLDER_INFO_MUTATION = import_client27.gql`
3439
3607
  }
3440
3608
  ${STALLHOLDER_INFO}
3441
3609
  `;
3442
- var UPDATE_STALLHOLDER_INFO_MUTATION = import_client27.gql`
3610
+ var UPDATE_STALLHOLDER_INFO_MUTATION = import_client31.gql`
3443
3611
  mutation updateStallholderInfo($_id: ID!, $input: StallholderInfoInputType!) {
3444
3612
  updateStallholderInfo(_id: $_id, input: $input) {
3445
3613
  ...StallholderInfoFields
@@ -3450,7 +3618,7 @@ var UPDATE_STALLHOLDER_INFO_MUTATION = import_client27.gql`
3450
3618
 
3451
3619
  // src/graphql/hooks/stallholder/hooksMutation.ts
3452
3620
  var useCreateStallholder = () => {
3453
- const [createStallholder, { loading, error }] = (0, import_client28.useMutation)(
3621
+ const [createStallholder, { loading, error }] = (0, import_client32.useMutation)(
3454
3622
  CREATE_STALLHOLDER_MUTATION,
3455
3623
  {
3456
3624
  awaitRefetchQueries: true,
@@ -3462,7 +3630,7 @@ var useCreateStallholder = () => {
3462
3630
  return { createStallholder, error, loading };
3463
3631
  };
3464
3632
  var useUpdateStallholder = () => {
3465
- const [updateStallholder, { loading, error }] = (0, import_client28.useMutation)(
3633
+ const [updateStallholder, { loading, error }] = (0, import_client32.useMutation)(
3466
3634
  UPDATE_STALLHOLDER_MUTATION,
3467
3635
  {
3468
3636
  awaitRefetchQueries: true,
@@ -3474,7 +3642,7 @@ var useUpdateStallholder = () => {
3474
3642
  return { error, loading, updateStallholder };
3475
3643
  };
3476
3644
  var useDeleteStallholder = () => {
3477
- const [deleteStallholder, { loading, error }] = (0, import_client28.useMutation)(
3645
+ const [deleteStallholder, { loading, error }] = (0, import_client32.useMutation)(
3478
3646
  DELETE_STALLHOLDER_MUTATION,
3479
3647
  {
3480
3648
  awaitRefetchQueries: true,
@@ -3486,7 +3654,7 @@ var useDeleteStallholder = () => {
3486
3654
  return { deleteStallholder, error, loading };
3487
3655
  };
3488
3656
  var useCreateStallholderInfo = () => {
3489
- const [createStallholderInfo, { loading, error }] = (0, import_client28.useMutation)(
3657
+ const [createStallholderInfo, { loading, error }] = (0, import_client32.useMutation)(
3490
3658
  CREATE_STALLHOLDER_INFO_MUTATION,
3491
3659
  {
3492
3660
  awaitRefetchQueries: true,
@@ -3510,7 +3678,7 @@ var useCreateStallholderInfo = () => {
3510
3678
  return { createStallholderInfo, error, loading };
3511
3679
  };
3512
3680
  var useUpdateStallholderInfo = () => {
3513
- const [updateStallholderInfo, { loading, error }] = (0, import_client28.useMutation)(
3681
+ const [updateStallholderInfo, { loading, error }] = (0, import_client32.useMutation)(
3514
3682
  UPDATE_STALLHOLDER_INFO_MUTATION,
3515
3683
  {
3516
3684
  awaitRefetchQueries: true,
@@ -3531,9 +3699,9 @@ var useUpdateStallholderInfo = () => {
3531
3699
  };
3532
3700
 
3533
3701
  // src/graphql/hooks/stallholder/hooksQuery.ts
3534
- var import_client29 = require("@apollo/client");
3702
+ var import_client33 = require("@apollo/client");
3535
3703
  var useGetStallholders = () => {
3536
- const { loading, error, data, refetch } = (0, import_client29.useQuery)(GET_STALLHOLDERS, {
3704
+ const { loading, error, data, refetch } = (0, import_client33.useQuery)(GET_STALLHOLDERS, {
3537
3705
  fetchPolicy: "network-only"
3538
3706
  });
3539
3707
  const stallholders = data?.stallholders;
@@ -3545,7 +3713,7 @@ var useGetStallholders = () => {
3545
3713
  };
3546
3714
  };
3547
3715
  var useGetStallholder = (_id) => {
3548
- const { loading, error, data, refetch } = (0, import_client29.useQuery)(GET_STALLHOLDER, {
3716
+ const { loading, error, data, refetch } = (0, import_client33.useQuery)(GET_STALLHOLDER, {
3549
3717
  fetchPolicy: "network-only",
3550
3718
  skip: !_id,
3551
3719
  variables: { _id }
@@ -3554,7 +3722,7 @@ var useGetStallholder = (_id) => {
3554
3722
  return { error, loading, refetch, stallholder };
3555
3723
  };
3556
3724
  var useGetStallholdersByRegion = (region) => {
3557
- const { loading, error, data, refetch } = (0, import_client29.useQuery)(
3725
+ const { loading, error, data, refetch } = (0, import_client33.useQuery)(
3558
3726
  GET_STALLHOLDERS_BY_REGION,
3559
3727
  {
3560
3728
  fetchPolicy: "no-cache",
@@ -3566,7 +3734,7 @@ var useGetStallholdersByRegion = (region) => {
3566
3734
  return { error, loading, refetch, stallholdersByRegion };
3567
3735
  };
3568
3736
  var useSearchStallholders = (search, region) => {
3569
- const { loading, error, data, refetch } = (0, import_client29.useQuery)(SEARCH_STALLHOLDERS, {
3737
+ const { loading, error, data, refetch } = (0, import_client33.useQuery)(SEARCH_STALLHOLDERS, {
3570
3738
  fetchPolicy: "network-only",
3571
3739
  skip: search.length < 3,
3572
3740
  variables: { region, search }
@@ -3575,7 +3743,7 @@ var useSearchStallholders = (search, region) => {
3575
3743
  return { error, loading, refetch, stallholderSearch };
3576
3744
  };
3577
3745
  var useGetStallholderInfo = (stallholderId) => {
3578
- const { loading, error, data, refetch } = (0, import_client29.useQuery)(GET_STALLHOLDER_INFO, {
3746
+ const { loading, error, data, refetch } = (0, import_client33.useQuery)(GET_STALLHOLDER_INFO, {
3579
3747
  fetchPolicy: "network-only",
3580
3748
  skip: !stallholderId,
3581
3749
  variables: { stallholderId }
@@ -3590,14 +3758,14 @@ var useGetStallholderInfo = (stallholderId) => {
3590
3758
  };
3591
3759
 
3592
3760
  // src/graphql/hooks/testers/hooksMutation.ts
3593
- var import_client32 = require("@apollo/client");
3761
+ var import_client36 = require("@apollo/client");
3594
3762
 
3595
3763
  // src/graphql/mutations/testers.ts
3596
- var import_client31 = require("@apollo/client");
3764
+ var import_client35 = require("@apollo/client");
3597
3765
 
3598
3766
  // src/graphql/queries/testers.ts
3599
- var import_client30 = require("@apollo/client");
3600
- var TESTER_FIELDS_FRAGMENT = import_client30.gql`
3767
+ var import_client34 = require("@apollo/client");
3768
+ var TESTER_FIELDS_FRAGMENT = import_client34.gql`
3601
3769
  fragment TesterFields on TesterType {
3602
3770
  _id
3603
3771
  active
@@ -3610,7 +3778,7 @@ var TESTER_FIELDS_FRAGMENT = import_client30.gql`
3610
3778
  updatedAt
3611
3779
  }
3612
3780
  `;
3613
- var GET_TESTERS = import_client30.gql`
3781
+ var GET_TESTERS = import_client34.gql`
3614
3782
  query getTesters {
3615
3783
  testers {
3616
3784
  ...TesterFields
@@ -3618,7 +3786,7 @@ var GET_TESTERS = import_client30.gql`
3618
3786
  }
3619
3787
  ${TESTER_FIELDS_FRAGMENT}
3620
3788
  `;
3621
- var GET_TESTER = import_client30.gql`
3789
+ var GET_TESTER = import_client34.gql`
3622
3790
  query getTester($_id: ID!) {
3623
3791
  tester(_id: $_id) {
3624
3792
  ...TesterFields
@@ -3628,7 +3796,7 @@ var GET_TESTER = import_client30.gql`
3628
3796
  `;
3629
3797
 
3630
3798
  // src/graphql/mutations/testers.ts
3631
- var CREATE_TESTER_MUTATION = import_client31.gql`
3799
+ var CREATE_TESTER_MUTATION = import_client35.gql`
3632
3800
  mutation createTester($input: TesterInputType!) {
3633
3801
  createTester(input: $input) {
3634
3802
  ...TesterFields
@@ -3636,7 +3804,7 @@ var CREATE_TESTER_MUTATION = import_client31.gql`
3636
3804
  }
3637
3805
  ${TESTER_FIELDS_FRAGMENT}
3638
3806
  `;
3639
- var UPDATE_TESTER_MUTATION = import_client31.gql`
3807
+ var UPDATE_TESTER_MUTATION = import_client35.gql`
3640
3808
  mutation updateTester($_id: ID!, $input: TesterInputType!) {
3641
3809
  updateTester(_id: $_id, input: $input) {
3642
3810
  ...TesterFields
@@ -3644,7 +3812,7 @@ var UPDATE_TESTER_MUTATION = import_client31.gql`
3644
3812
  }
3645
3813
  ${TESTER_FIELDS_FRAGMENT}
3646
3814
  `;
3647
- var DELETE_TESTER_MUTATION = import_client31.gql`
3815
+ var DELETE_TESTER_MUTATION = import_client35.gql`
3648
3816
  mutation deleteTester($_id: ID!) {
3649
3817
  deleteTester(_id: $_id)
3650
3818
  }
@@ -3652,7 +3820,7 @@ var DELETE_TESTER_MUTATION = import_client31.gql`
3652
3820
 
3653
3821
  // src/graphql/hooks/testers/hooksMutation.ts
3654
3822
  var useCreateTester = () => {
3655
- const [createTester, { data, loading, error }] = (0, import_client32.useMutation)(
3823
+ const [createTester, { data, loading, error }] = (0, import_client36.useMutation)(
3656
3824
  CREATE_TESTER_MUTATION
3657
3825
  );
3658
3826
  return {
@@ -3663,7 +3831,7 @@ var useCreateTester = () => {
3663
3831
  };
3664
3832
  };
3665
3833
  var useUpdateTester = () => {
3666
- const [updateTester, { data, loading, error }] = (0, import_client32.useMutation)(
3834
+ const [updateTester, { data, loading, error }] = (0, import_client36.useMutation)(
3667
3835
  UPDATE_TESTER_MUTATION
3668
3836
  );
3669
3837
  return {
@@ -3674,16 +3842,16 @@ var useUpdateTester = () => {
3674
3842
  };
3675
3843
  };
3676
3844
  var useDeleteTester = () => {
3677
- const [deleteTester, { loading, error }] = (0, import_client32.useMutation)(
3845
+ const [deleteTester, { loading, error }] = (0, import_client36.useMutation)(
3678
3846
  DELETE_TESTER_MUTATION
3679
3847
  );
3680
3848
  return { deleteTester, error, loading };
3681
3849
  };
3682
3850
 
3683
3851
  // src/graphql/hooks/testers/hooksQuery.ts
3684
- var import_client33 = require("@apollo/client");
3852
+ var import_client37 = require("@apollo/client");
3685
3853
  var useGetTesters = () => {
3686
- const { data, loading, error, refetch } = (0, import_client33.useQuery)(GET_TESTERS);
3854
+ const { data, loading, error, refetch } = (0, import_client37.useQuery)(GET_TESTERS);
3687
3855
  const testers = data?.testers;
3688
3856
  return {
3689
3857
  error,
@@ -3693,7 +3861,7 @@ var useGetTesters = () => {
3693
3861
  };
3694
3862
  };
3695
3863
  var useGetTester = (_id) => {
3696
- const { data, loading, error, refetch } = (0, import_client33.useQuery)(GET_TESTER, {
3864
+ const { data, loading, error, refetch } = (0, import_client37.useQuery)(GET_TESTER, {
3697
3865
  skip: !_id,
3698
3866
  variables: { _id }
3699
3867
  });
@@ -3702,11 +3870,11 @@ var useGetTester = (_id) => {
3702
3870
  };
3703
3871
 
3704
3872
  // src/graphql/hooks/user/hooksMutation.ts
3705
- var import_client35 = require("@apollo/client");
3873
+ var import_client39 = require("@apollo/client");
3706
3874
 
3707
3875
  // src/graphql/mutations/user.ts
3708
- var import_client34 = require("@apollo/client");
3709
- var CREATE_USER_MUTATION = import_client34.gql`
3876
+ var import_client38 = require("@apollo/client");
3877
+ var CREATE_USER_MUTATION = import_client38.gql`
3710
3878
  mutation createUser($input: UserInputType!) {
3711
3879
  createUser(input: $input) {
3712
3880
  ...UserFields
@@ -3714,7 +3882,7 @@ var CREATE_USER_MUTATION = import_client34.gql`
3714
3882
  }
3715
3883
  ${USER_FIELDS_FRAGMENT}
3716
3884
  `;
3717
- var UPDATE_USER_MUTATION = import_client34.gql`
3885
+ var UPDATE_USER_MUTATION = import_client38.gql`
3718
3886
  mutation updateUser($_id: ID!, $input: UserInputType!) {
3719
3887
  updateUser(_id: $_id, input: $input) {
3720
3888
  ...UserFields
@@ -3722,12 +3890,12 @@ var UPDATE_USER_MUTATION = import_client34.gql`
3722
3890
  }
3723
3891
  ${USER_FIELDS_FRAGMENT}
3724
3892
  `;
3725
- var DELETE_USER_MUTATION = import_client34.gql`
3893
+ var DELETE_USER_MUTATION = import_client38.gql`
3726
3894
  mutation deleteUser($_id: ID!) {
3727
3895
  deleteUser(_id: $_id)
3728
3896
  }
3729
3897
  `;
3730
- var ADD_USER_FAVOURITE_RESOURCE_MUTATION = import_client34.gql`
3898
+ var ADD_USER_FAVOURITE_RESOURCE_MUTATION = import_client38.gql`
3731
3899
  mutation addUserFavouriteResource(
3732
3900
  $resourceId: ID!
3733
3901
  $resourceType: ResourceTypeEnum!
@@ -3743,7 +3911,7 @@ var ADD_USER_FAVOURITE_RESOURCE_MUTATION = import_client34.gql`
3743
3911
  }
3744
3912
  ${USER_FIELDS_FRAGMENT}
3745
3913
  `;
3746
- var REMOVE_USER_FAVOURITE_RESOURCE_MUTATION = import_client34.gql`
3914
+ var REMOVE_USER_FAVOURITE_RESOURCE_MUTATION = import_client38.gql`
3747
3915
  mutation removeUserFavouriteResource(
3748
3916
  $resourceId: ID!
3749
3917
  $resourceType: ResourceTypeEnum!
@@ -3762,11 +3930,11 @@ var REMOVE_USER_FAVOURITE_RESOURCE_MUTATION = import_client34.gql`
3762
3930
 
3763
3931
  // src/graphql/hooks/user/hooksMutation.ts
3764
3932
  var useCreateUser = () => {
3765
- const [createUser, { loading, error }] = (0, import_client35.useMutation)(CREATE_USER_MUTATION);
3933
+ const [createUser, { loading, error }] = (0, import_client39.useMutation)(CREATE_USER_MUTATION);
3766
3934
  return { createUser, error, loading };
3767
3935
  };
3768
3936
  var useUpdateUser = () => {
3769
- const [updateUser, { loading, error }] = (0, import_client35.useMutation)(UPDATE_USER_MUTATION, {
3937
+ const [updateUser, { loading, error }] = (0, import_client39.useMutation)(UPDATE_USER_MUTATION, {
3770
3938
  awaitRefetchQueries: true,
3771
3939
  refetchQueries: (mutationResult) => {
3772
3940
  const userId = mutationResult?.data?.updateUser?._id;
@@ -3777,11 +3945,11 @@ var useUpdateUser = () => {
3777
3945
  return { error, loading, updateUser };
3778
3946
  };
3779
3947
  var useDeleteUser = () => {
3780
- const [deleteUser, { loading, error }] = (0, import_client35.useMutation)(DELETE_USER_MUTATION);
3948
+ const [deleteUser, { loading, error }] = (0, import_client39.useMutation)(DELETE_USER_MUTATION);
3781
3949
  return { deleteUser, error, loading };
3782
3950
  };
3783
3951
  var useAddUserFavouriteResource = () => {
3784
- const [addUserFavouriteResource, { loading, error }] = (0, import_client35.useMutation)(
3952
+ const [addUserFavouriteResource, { loading, error }] = (0, import_client39.useMutation)(
3785
3953
  ADD_USER_FAVOURITE_RESOURCE_MUTATION,
3786
3954
  {
3787
3955
  awaitRefetchQueries: true,
@@ -3791,7 +3959,7 @@ var useAddUserFavouriteResource = () => {
3791
3959
  return { addUserFavouriteResource, error, loading };
3792
3960
  };
3793
3961
  var useRemoveUserFavouriteResource = () => {
3794
- const [removeUserFavouriteResource, { loading, error }] = (0, import_client35.useMutation)(
3962
+ const [removeUserFavouriteResource, { loading, error }] = (0, import_client39.useMutation)(
3795
3963
  REMOVE_USER_FAVOURITE_RESOURCE_MUTATION,
3796
3964
  {
3797
3965
  awaitRefetchQueries: true,
@@ -3802,37 +3970,37 @@ var useRemoveUserFavouriteResource = () => {
3802
3970
  };
3803
3971
 
3804
3972
  // src/graphql/hooks/user/hooksQuery.ts
3805
- var import_client36 = require("@apollo/client");
3973
+ var import_client40 = require("@apollo/client");
3806
3974
  var useGetUsers = () => {
3807
- const { loading, error, data, refetch } = (0, import_client36.useQuery)(GET_USERS, {
3975
+ const { loading, error, data, refetch } = (0, import_client40.useQuery)(GET_USERS, {
3808
3976
  fetchPolicy: "network-only"
3809
3977
  });
3810
3978
  const users = data?.users;
3811
3979
  return { error, loading, refetch, users };
3812
3980
  };
3813
3981
  var useGetUser = (_id) => {
3814
- const { loading, error, data, refetch } = (0, import_client36.useQuery)(GET_USER, {
3982
+ const { loading, error, data, refetch } = (0, import_client40.useQuery)(GET_USER, {
3815
3983
  variables: { _id }
3816
3984
  });
3817
3985
  const user = data?.user;
3818
3986
  return { error, loading, refetch, user };
3819
3987
  };
3820
3988
  var useGetUserMarkets = () => {
3821
- const { loading, error, data, refetch } = (0, import_client36.useQuery)(GET_USER_MARKETS, {
3989
+ const { loading, error, data, refetch } = (0, import_client40.useQuery)(GET_USER_MARKETS, {
3822
3990
  fetchPolicy: "network-only"
3823
3991
  });
3824
3992
  const userMarkets = data?.userMarkets;
3825
3993
  return { error, loading, refetch, userMarkets };
3826
3994
  };
3827
3995
  var useGetUserStallholder = () => {
3828
- const { loading, error, data, refetch } = (0, import_client36.useQuery)(GET_USER_STALLHOLDER, {
3996
+ const { loading, error, data, refetch } = (0, import_client40.useQuery)(GET_USER_STALLHOLDER, {
3829
3997
  fetchPolicy: "network-only"
3830
3998
  });
3831
3999
  const userStallholder = data?.userStallholder;
3832
4000
  return { error, loading, refetch, userStallholder };
3833
4001
  };
3834
4002
  var useGetUserFavourites = () => {
3835
- const { loading, error, data, refetch } = (0, import_client36.useQuery)(GET_USER_FAVOURITES, {
4003
+ const { loading, error, data, refetch } = (0, import_client40.useQuery)(GET_USER_FAVOURITES, {
3836
4004
  fetchPolicy: "network-only"
3837
4005
  });
3838
4006
  const markets = data?.userFavourites.markets;
@@ -3843,218 +4011,6 @@ var useGetUserFavourites = () => {
3843
4011
  };
3844
4012
  return { error, loading, refetch, userFavourites };
3845
4013
  };
3846
- var useGetUserNotifications = () => {
3847
- const { loading, error, data, refetch } = (0, import_client36.useQuery)(GET_USER_NOTIFICATIONS, {
3848
- fetchPolicy: "network-only"
3849
- });
3850
- const userNotifications = data?.userNotifications;
3851
- return { error, loading, refetch, userNotifications };
3852
- };
3853
-
3854
- // src/graphql/hooks/notifications.ts
3855
- var import_client39 = require("@apollo/client");
3856
-
3857
- // src/graphql/mutations/notification.ts
3858
- var import_client37 = require("@apollo/client");
3859
- var CREATE_NOTIFICATION = import_client37.gql`
3860
- mutation CreateNotification($input: CreateNotificationInput!) {
3861
- createNotification(input: $input) {
3862
- id
3863
- userId
3864
- title
3865
- message
3866
- type
3867
- isRead
3868
- data
3869
- createdAt
3870
- updatedAt
3871
- }
3872
- }
3873
- `;
3874
- var CREATE_BULK_NOTIFICATIONS = import_client37.gql`
3875
- mutation CreateBulkNotifications($input: CreateBulkNotificationInput!) {
3876
- createBulkNotifications(input: $input) {
3877
- id
3878
- userId
3879
- title
3880
- message
3881
- type
3882
- isRead
3883
- data
3884
- createdAt
3885
- updatedAt
3886
- }
3887
- }
3888
- `;
3889
- var MARK_NOTIFICATION_READ = import_client37.gql`
3890
- mutation MarkNotificationRead($input: MarkNotificationReadInput!) {
3891
- markNotificationRead(input: $input) {
3892
- id
3893
- userId
3894
- title
3895
- message
3896
- type
3897
- isRead
3898
- data
3899
- createdAt
3900
- updatedAt
3901
- }
3902
- }
3903
- `;
3904
- var MARK_ALL_NOTIFICATIONS_READ = import_client37.gql`
3905
- mutation MarkAllNotificationsRead($input: MarkAllNotificationsReadInput!) {
3906
- markAllNotificationsRead(input: $input)
3907
- }
3908
- `;
3909
-
3910
- // src/graphql/queries/notification.ts
3911
- var import_client38 = require("@apollo/client");
3912
- var GET_USER_NOTIFICATIONS2 = import_client38.gql`
3913
- query GetUserNotifications(
3914
- $userId: String!
3915
- $limit: Int
3916
- $offset: Int
3917
- $isRead: String
3918
- ) {
3919
- userNotifications(
3920
- userId: $userId
3921
- limit: $limit
3922
- offset: $offset
3923
- isRead: $isRead
3924
- ) {
3925
- id
3926
- userId
3927
- title
3928
- message
3929
- type
3930
- isRead
3931
- data
3932
- createdAt
3933
- updatedAt
3934
- }
3935
- }
3936
- `;
3937
- var GET_NOTIFICATION_COUNT = import_client38.gql`
3938
- query GetNotificationCount($userId: String!) {
3939
- notificationCount(userId: $userId) {
3940
- total
3941
- unread
3942
- }
3943
- }
3944
- `;
3945
- var GET_UNREAD_NOTIFICATIONS = import_client38.gql`
3946
- query GetUnreadNotifications($userId: String!, $limit: Int) {
3947
- unreadNotifications(userId: $userId, limit: $limit) {
3948
- id
3949
- userId
3950
- title
3951
- message
3952
- type
3953
- isRead
3954
- data
3955
- createdAt
3956
- updatedAt
3957
- }
3958
- }
3959
- `;
3960
-
3961
- // src/graphql/hooks/notifications.ts
3962
- var useNotifications = (userId) => {
3963
- const client = (0, import_client39.useApolloClient)();
3964
- const {
3965
- data: notificationsData,
3966
- loading: notificationsLoading,
3967
- error: notificationsError,
3968
- refetch: refetchNotifications
3969
- } = (0, import_client39.useQuery)(GET_USER_NOTIFICATIONS2, {
3970
- variables: { userId, limit: 50, offset: 0 },
3971
- fetchPolicy: "cache-and-network",
3972
- skip: !userId
3973
- });
3974
- const {
3975
- data: countData,
3976
- loading: countLoading,
3977
- error: countError,
3978
- refetch: refetchCount
3979
- } = (0, import_client39.useQuery)(GET_NOTIFICATION_COUNT, {
3980
- variables: { userId },
3981
- fetchPolicy: "cache-and-network",
3982
- skip: !userId
3983
- });
3984
- const {
3985
- data: unreadData,
3986
- loading: unreadLoading,
3987
- error: unreadError,
3988
- refetch: refetchUnread
3989
- } = (0, import_client39.useQuery)(GET_UNREAD_NOTIFICATIONS, {
3990
- variables: { userId, limit: 20 },
3991
- fetchPolicy: "cache-and-network",
3992
- skip: !userId
3993
- });
3994
- const [createNotification, { loading: createLoading }] = (0, import_client39.useMutation)(CREATE_NOTIFICATION);
3995
- const [createBulkNotifications, { loading: createBulkLoading }] = (0, import_client39.useMutation)(
3996
- CREATE_BULK_NOTIFICATIONS
3997
- );
3998
- const [markNotificationRead, { loading: markReadLoading }] = (0, import_client39.useMutation)(
3999
- MARK_NOTIFICATION_READ
4000
- );
4001
- const [markAllNotificationsRead, { loading: markAllReadLoading }] = (0, import_client39.useMutation)(MARK_ALL_NOTIFICATIONS_READ);
4002
- const refetchAll = () => {
4003
- if (userId) {
4004
- refetchNotifications();
4005
- refetchCount();
4006
- refetchUnread();
4007
- }
4008
- };
4009
- const invalidateCache = () => {
4010
- client.cache.evict({ fieldName: "userNotifications" });
4011
- client.cache.evict({ fieldName: "notificationCount" });
4012
- client.cache.evict({ fieldName: "unreadNotifications" });
4013
- client.cache.gc();
4014
- };
4015
- return {
4016
- // Data
4017
- notifications: notificationsData?.userNotifications || [],
4018
- count: countData?.notificationCount || { total: 0, unread: 0 },
4019
- unreadNotifications: unreadData?.unreadNotifications || [],
4020
- // Loading states
4021
- notificationsLoading,
4022
- countLoading,
4023
- unreadLoading,
4024
- createLoading,
4025
- createBulkLoading,
4026
- markReadLoading,
4027
- markAllReadLoading,
4028
- // Errors
4029
- notificationsError,
4030
- countError,
4031
- unreadError,
4032
- // Actions
4033
- createNotification: async (input) => {
4034
- const result = await createNotification({ variables: { input } });
4035
- refetchAll();
4036
- return result;
4037
- },
4038
- createBulkNotifications: async (input) => {
4039
- const result = await createBulkNotifications({ variables: { input } });
4040
- refetchAll();
4041
- return result;
4042
- },
4043
- markNotificationRead: async (input) => {
4044
- const result = await markNotificationRead({ variables: { input } });
4045
- refetchAll();
4046
- return result;
4047
- },
4048
- markAllNotificationsRead: async (input) => {
4049
- const result = await markAllNotificationsRead({ variables: { input } });
4050
- refetchAll();
4051
- return result;
4052
- },
4053
- // Utilities
4054
- refetchAll,
4055
- invalidateCache
4056
- };
4057
- };
4058
4014
 
4059
4015
  // src/hooks/useLocationSearch.ts
4060
4016
  var handleApiError = (error, message) => {
@@ -5280,10 +5236,21 @@ var fonts = {
5280
5236
  fontWeight: "400"
5281
5237
  }
5282
5238
  };
5239
+
5240
+ // src/types/notification.ts
5241
+ var EnumNotificationType = ((EnumNotificationType2) => {
5242
+ EnumNotificationType2[EnumNotificationType2["MARKET"] = "market" /* MARKET */] = "MARKET";
5243
+ EnumNotificationType2[EnumNotificationType2["STALLHOLDER"] = "stallholder" /* STALLHOLDER */] = "STALLHOLDER";
5244
+ EnumNotificationType2["RELATION"] = "relation";
5245
+ EnumNotificationType2["CHAT"] = "chat";
5246
+ EnumNotificationType2["SYSTEM"] = "system";
5247
+ return EnumNotificationType2;
5248
+ })(EnumNotificationType || {});
5283
5249
  // Annotate the CommonJS export names for ESM import in node:
5284
5250
  0 && (module.exports = {
5285
5251
  EnumInviteStatus,
5286
5252
  EnumNotification,
5253
+ EnumNotificationType,
5287
5254
  EnumOSType,
5288
5255
  EnumPaymentMethod,
5289
5256
  EnumRegions,
@@ -5367,9 +5334,11 @@ var fonts = {
5367
5334
  useAdminUpdateResourceType,
5368
5335
  useContactUs,
5369
5336
  useContactUsForm,
5337
+ useCreateBulkNotifications,
5370
5338
  useCreateChat,
5371
5339
  useCreateMarket,
5372
5340
  useCreateMarketInfo,
5341
+ useCreateNotification,
5373
5342
  useCreatePoster,
5374
5343
  useCreatePushToken,
5375
5344
  useCreateRelation,
@@ -5391,6 +5360,7 @@ var fonts = {
5391
5360
  useGetMarkets,
5392
5361
  useGetMarketsByRegion,
5393
5362
  useGetMarketsNearMe,
5363
+ useGetNotificationCount,
5394
5364
  useGetRelation,
5395
5365
  useGetRelationByMarketAndStallholder,
5396
5366
  useGetResourceConnections,
@@ -5401,6 +5371,7 @@ var fonts = {
5401
5371
  useGetStallholdersByRegion,
5402
5372
  useGetTester,
5403
5373
  useGetTesters,
5374
+ useGetUnreadNotifications,
5404
5375
  useGetUser,
5405
5376
  useGetUserChats,
5406
5377
  useGetUserFavourites,
@@ -5412,9 +5383,10 @@ var fonts = {
5412
5383
  useLogin,
5413
5384
  useLoginForm,
5414
5385
  useLogout,
5386
+ useMarkAllNotificationsRead,
5387
+ useMarkNotificationRead,
5415
5388
  useMarketForm,
5416
5389
  useMarketInfoForm,
5417
- useNotifications,
5418
5390
  useRefreshToken,
5419
5391
  useRegister,
5420
5392
  useRegisterForm,