@timardex/cluemart-server-shared 1.1.38 → 2.0.0

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.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
2
- import { AdType, CreateBulkNotificationInput, NotificationType, EnumUserRole, ChatMessageType, ParticipantType, ChatType, ReportChatUser, RelatedPostType, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, ResourceContactDetailsType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, SocialShareResourceType, PosterUsageType, GoogleImportedMarket, PushTokenType, RelationType, ResourceActivityType, UserActivityEvent, UserType, VendorProductList, VendorType, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, PostResource, AppSettingsType, GameType, GameDocType, SchoolType, AffiliateRewardType, AffiliateResourceType, AffiliateType, CouponType, CouponDataType, CouponParticipantUserType, PromoCodeType, EnumAffiliateRewardType, EventListItemType, DateTimeWithPriceType, EnumUserLicence as EnumUserLicence$1, EnumNotificationResourceType, EnumNotificationType, EnumResourceType } from '@timardex/cluemart-shared';
2
+ import { AdType, ChatType, ParticipantType, ChatMessageType, NotificationType, CreateBulkNotificationInput, EnumUserRole, BillingCatalogEntryType, BillingCatalogPriceHistoryEntry, EnumBillingPeriod, EnumUserLicence, BILLING_CATALOG_KEYS, ReportChatUser, OwnerType, Category, ResourceContactDetailsType, ResourceImageType, RelatedPostType, SocialMediaType, PosterUsageType, SocialShareResourceType, TermsAgreement, DateTimeType, LocationGeoType, LocationType, RelationDate, UserLicenceType, GoogleImportedMarket, PushTokenType, RelationType, ResourceActivityType, StripeSubscription, UserActivityEvent, UserType, VendorType, VendorProductList, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, EventInfoType, StallType, RefundPolicy, PartnerType, PostType, PostContentType, PostResource, AppSettingsType, GameDocType, GameType, SchoolType, AffiliateType, AffiliateResourceType, AffiliateRewardType, CouponType, CouponDataType, CouponParticipantUserType, PromoCodeType, EnumAffiliateRewardType, EventListItemType, DateTimeWithPriceType, EnumNotificationResourceType, EnumNotificationType, EnumResourceType } from '@timardex/cluemart-shared';
3
3
  import * as mongoose from 'mongoose';
4
4
  import mongoose__default from 'mongoose';
5
5
  export { default as mongoose } from 'mongoose';
@@ -7,7 +7,7 @@ import { NotificationCount, DateTimeType as DateTimeType$1 } from '@timardex/clu
7
7
  import express from 'express';
8
8
  export { default as express } from 'express';
9
9
  import dayjs, { Dayjs } from 'dayjs';
10
- import { EnumUserLicence } from '@timardex/cluemart-shared/enums';
10
+ import { EnumUserLicence as EnumUserLicence$1 } from '@timardex/cluemart-shared/enums';
11
11
 
12
12
  declare const AdModel: mongoose__default.Model<AdType, {}, {}, {}, mongoose__default.Document<unknown, {}, AdType, {}, {}> & AdType & Required<{
13
13
  _id: string;
@@ -15,6 +15,38 @@ declare const AdModel: mongoose__default.Model<AdType, {}, {}, {}, mongoose__def
15
15
  __v: number;
16
16
  }, any>;
17
17
 
18
+ type SchemaChatMessageReplyPreviewType = Omit<NonNullable<ChatMessageType["replyPreview"]>, "senderId"> & {
19
+ senderId: ObjectId;
20
+ };
21
+ type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number], "userId"> & {
22
+ userId: ObjectId;
23
+ };
24
+ type SchemaChatMessageSeenType = Omit<NonNullable<ChatMessageType["seenBy"]>[number], "userId"> & {
25
+ userId: ObjectId;
26
+ };
27
+ type SchemaChatMessageType = Omit<ChatMessageType, "senderId" | "replyToMessageId" | "replyPreview" | "likedBy" | "seenBy"> & {
28
+ senderId: ObjectId;
29
+ replyToMessageId?: ObjectId | null;
30
+ replyPreview?: SchemaChatMessageReplyPreviewType | null;
31
+ likedBy?: SchemaChatMessageReactionType[];
32
+ seenBy?: SchemaChatMessageSeenType[];
33
+ };
34
+ type SchemaParticipantType = Omit<ParticipantType, "userId"> & {
35
+ userId: ObjectId;
36
+ };
37
+ type SchemaChatType = Omit<ChatType, "participants" | "messages"> & {
38
+ participants: SchemaParticipantType[];
39
+ messages: SchemaChatMessageType[];
40
+ };
41
+ declare const ChatModel: mongoose__default.Model<SchemaChatType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaChatType, {}, {}> & Omit<ChatType, "participants" | "messages"> & {
42
+ participants: SchemaParticipantType[];
43
+ messages: SchemaChatMessageType[];
44
+ } & Required<{
45
+ _id: string;
46
+ }> & {
47
+ __v: number;
48
+ }, any>;
49
+
18
50
  type SchemaCreateBulkNotificationInput = Omit<CreateBulkNotificationInput, "userIds"> & {
19
51
  userIds: ObjectId[];
20
52
  };
@@ -61,37 +93,45 @@ interface GraphQLContext {
61
93
  response: express.Response;
62
94
  }
63
95
 
64
- type SchemaChatMessageReplyPreviewType = Omit<NonNullable<ChatMessageType["replyPreview"]>, "senderId"> & {
65
- senderId: ObjectId;
66
- };
67
- type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number], "userId"> & {
68
- userId: ObjectId;
69
- };
70
- type SchemaChatMessageSeenType = Omit<NonNullable<ChatMessageType["seenBy"]>[number], "userId"> & {
71
- userId: ObjectId;
72
- };
73
- type SchemaChatMessageType = Omit<ChatMessageType, "senderId" | "replyToMessageId" | "replyPreview" | "likedBy" | "seenBy"> & {
74
- senderId: ObjectId;
75
- replyToMessageId?: ObjectId | null;
76
- replyPreview?: SchemaChatMessageReplyPreviewType | null;
77
- likedBy?: SchemaChatMessageReactionType[];
78
- seenBy?: SchemaChatMessageSeenType[];
96
+ declare const BILLING_CATALOG_COLLECTION_NAME = "billingCatalog";
97
+ type SchemaBillingCatalogPriceHistoryEntry = Omit<BillingCatalogPriceHistoryEntry, "changedBy"> & {
98
+ changedBy?: ObjectId | null;
79
99
  };
80
- type SchemaParticipantType = Omit<ParticipantType, "userId"> & {
81
- userId: ObjectId;
82
- };
83
- type SchemaChatType = Omit<ChatType, "participants" | "messages"> & {
84
- participants: SchemaParticipantType[];
85
- messages: SchemaChatMessageType[];
100
+ type SchemaBillingCatalogEntry = Omit<BillingCatalogEntryType, "_id" | "priceHistory" | "updatedBy"> & {
101
+ _id: ObjectId;
102
+ priceHistory: SchemaBillingCatalogPriceHistoryEntry[];
103
+ updatedBy?: ObjectId | null;
86
104
  };
87
- declare const ChatModel: mongoose__default.Model<SchemaChatType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaChatType, {}, {}> & Omit<ChatType, "participants" | "messages"> & {
88
- participants: SchemaParticipantType[];
89
- messages: SchemaChatMessageType[];
105
+ declare const BillingCatalogModel: mongoose__default.Model<SchemaBillingCatalogEntry, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaBillingCatalogEntry, {}, {}> & Omit<BillingCatalogEntryType, "_id" | "priceHistory" | "updatedBy"> & {
106
+ _id: ObjectId;
107
+ priceHistory: SchemaBillingCatalogPriceHistoryEntry[];
108
+ updatedBy?: ObjectId | null;
90
109
  } & Required<{
91
- _id: string;
110
+ _id: mongoose__default.Types.ObjectId;
92
111
  }> & {
93
112
  __v: number;
94
113
  }, any>;
114
+ /**
115
+ * Produces the four records used for an idempotent `$setOnInsert` catalogue
116
+ * initialisation. Stripe identifiers deliberately start empty and are attached
117
+ * only after Stripe successfully creates the matching Product and Price.
118
+ */
119
+ declare function buildInitialBillingCatalogEntries(now?: Date): {
120
+ active: boolean;
121
+ billingPeriod: EnumBillingPeriod;
122
+ currency: "nzd";
123
+ effectiveFrom: Date;
124
+ key: _timardex_cluemart_shared.BillingCatalogKey;
125
+ licenceType: EnumUserLicence.PRO_PLUS_VENDOR | EnumUserLicence.PRO_VENDOR;
126
+ priceHistory: never[];
127
+ revision: number;
128
+ stripePriceId: null;
129
+ stripeProductId: null;
130
+ taxInclusive: boolean;
131
+ unitAmount: number;
132
+ updatedBy: null;
133
+ }[];
134
+ declare function getBillingCatalogDefinition(key: (typeof BILLING_CATALOG_KEYS)[number]): _timardex_cluemart_shared.BillingCatalogDefinition;
95
135
 
96
136
  type SchemaChatReportType = Omit<ReportChatUser, "reporterUserId" | "reportedUserId" | "chatId"> & {
97
137
  reporterUserId: ObjectId;
@@ -120,7 +160,7 @@ declare const OwnerTypeSchema: mongoose__default.Schema<SchemaOwnerType, mongoos
120
160
  _id: mongoose__default.Types.ObjectId;
121
161
  } & {
122
162
  __v: number;
123
- }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, SchemaOwnerType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<SchemaOwnerType>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<SchemaOwnerType> & {
163
+ }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, SchemaOwnerType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<SchemaOwnerType>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<SchemaOwnerType> & {
124
164
  _id: mongoose__default.Types.ObjectId;
125
165
  } & {
126
166
  __v: number;
@@ -129,7 +169,7 @@ declare const SocialMediaTypeSchema: mongoose__default.Schema<SocialMediaType, m
129
169
  _id: mongoose__default.Types.ObjectId;
130
170
  } & {
131
171
  __v: number;
132
- }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, SocialMediaType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<SocialMediaType>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<SocialMediaType> & {
172
+ }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, SocialMediaType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<SocialMediaType>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<SocialMediaType> & {
133
173
  _id: mongoose__default.Types.ObjectId;
134
174
  } & {
135
175
  __v: number;
@@ -138,7 +178,7 @@ declare const ResourceImageTypeSchema: mongoose__default.Schema<ResourceImageTyp
138
178
  _id: mongoose__default.Types.ObjectId;
139
179
  } & {
140
180
  __v: number;
141
- }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, ResourceImageType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<ResourceImageType>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<ResourceImageType> & {
181
+ }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, ResourceImageType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<ResourceImageType>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<ResourceImageType> & {
142
182
  _id: mongoose__default.Types.ObjectId;
143
183
  } & {
144
184
  __v: number;
@@ -147,7 +187,7 @@ declare const CategorySchema: mongoose__default.Schema<Category, mongoose__defau
147
187
  _id: mongoose__default.Types.ObjectId;
148
188
  } & {
149
189
  __v: number;
150
- }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, Category, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<Category>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<Category> & {
190
+ }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, Category, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<Category>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<Category> & {
151
191
  _id: mongoose__default.Types.ObjectId;
152
192
  } & {
153
193
  __v: number;
@@ -156,7 +196,7 @@ declare const userLicenseSchema: mongoose__default.Schema<UserLicenceType, mongo
156
196
  _id: mongoose__default.Types.ObjectId;
157
197
  } & {
158
198
  __v: number;
159
- }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, UserLicenceType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<UserLicenceType>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<UserLicenceType> & {
199
+ }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, UserLicenceType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<UserLicenceType>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<UserLicenceType> & {
160
200
  _id: mongoose__default.Types.ObjectId;
161
201
  } & {
162
202
  __v: number;
@@ -165,7 +205,7 @@ declare const ContactDetailsSchema: mongoose__default.Schema<ResourceContactDeta
165
205
  _id: mongoose__default.Types.ObjectId;
166
206
  } & {
167
207
  __v: number;
168
- }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, ResourceContactDetailsType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<ResourceContactDetailsType>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<ResourceContactDetailsType> & {
208
+ }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, ResourceContactDetailsType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<ResourceContactDetailsType>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<ResourceContactDetailsType> & {
169
209
  _id: mongoose__default.Types.ObjectId;
170
210
  } & {
171
211
  __v: number;
@@ -176,7 +216,7 @@ declare const termsAgreementSchema: mongoose__default.Schema<TermsAgreement, mon
176
216
  _id: mongoose__default.Types.ObjectId;
177
217
  } & {
178
218
  __v: number;
179
- }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, TermsAgreement, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<TermsAgreement>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<TermsAgreement> & {
219
+ }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, TermsAgreement, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<TermsAgreement>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<TermsAgreement> & {
180
220
  _id: mongoose__default.Types.ObjectId;
181
221
  } & {
182
222
  __v: number;
@@ -203,7 +243,7 @@ declare const resourceRelationsSchema: mongoose__default.Schema<{
203
243
  }, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<{
204
244
  relationId: ObjectId;
205
245
  relationDates: RelationDate[];
206
- }>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<{
246
+ }>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<{
207
247
  relationId: ObjectId;
208
248
  relationDates: RelationDate[];
209
249
  }> & {
@@ -215,7 +255,7 @@ declare const dateTimeSchema: mongoose__default.Schema<DateTimeType, mongoose__d
215
255
  _id: mongoose__default.Types.ObjectId;
216
256
  } & {
217
257
  __v: number;
218
- }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, DateTimeType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<DateTimeType>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<DateTimeType> & {
258
+ }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, DateTimeType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<DateTimeType>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<DateTimeType> & {
219
259
  _id: mongoose__default.Types.ObjectId;
220
260
  } & {
221
261
  __v: number;
@@ -224,7 +264,7 @@ declare const locationGeoSchema: mongoose__default.Schema<LocationGeoType, mongo
224
264
  _id: mongoose__default.Types.ObjectId;
225
265
  } & {
226
266
  __v: number;
227
- }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, LocationGeoType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<LocationGeoType>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<LocationGeoType> & {
267
+ }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, LocationGeoType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<LocationGeoType>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<LocationGeoType> & {
228
268
  _id: mongoose__default.Types.ObjectId;
229
269
  } & {
230
270
  __v: number;
@@ -233,7 +273,7 @@ declare const locationsSchema: mongoose__default.Schema<LocationType, mongoose__
233
273
  _id: mongoose__default.Types.ObjectId;
234
274
  } & {
235
275
  __v: number;
236
- }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, LocationType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<LocationType>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<LocationType> & {
276
+ }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, LocationType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<LocationType>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<LocationType> & {
237
277
  _id: mongoose__default.Types.ObjectId;
238
278
  } & {
239
279
  __v: number;
@@ -244,7 +284,7 @@ declare const relatedPostSchema: mongoose__default.Schema<SchemaRelatedPostType,
244
284
  _id: mongoose__default.Types.ObjectId;
245
285
  } & {
246
286
  __v: number;
247
- }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, SchemaRelatedPostType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<SchemaRelatedPostType>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<SchemaRelatedPostType> & {
287
+ }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, SchemaRelatedPostType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<SchemaRelatedPostType>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<SchemaRelatedPostType> & {
248
288
  _id: mongoose__default.Types.ObjectId;
249
289
  } & {
250
290
  __v: number;
@@ -253,7 +293,7 @@ declare const socialShareResourceSchema: mongoose__default.Schema<SocialShareRes
253
293
  _id: mongoose__default.Types.ObjectId;
254
294
  } & {
255
295
  __v: number;
256
- }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, SocialShareResourceType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<SocialShareResourceType>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<SocialShareResourceType> & {
296
+ }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, SocialShareResourceType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<SocialShareResourceType>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<SocialShareResourceType> & {
257
297
  _id: mongoose__default.Types.ObjectId;
258
298
  } & {
259
299
  __v: number;
@@ -280,7 +320,7 @@ declare const baseResourceFields: {
280
320
  _id: mongoose__default.Types.ObjectId;
281
321
  } & {
282
322
  __v: number;
283
- }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, ResourceContactDetailsType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<ResourceContactDetailsType>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<ResourceContactDetailsType> & {
323
+ }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, ResourceContactDetailsType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<ResourceContactDetailsType>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<ResourceContactDetailsType> & {
284
324
  _id: mongoose__default.Types.ObjectId;
285
325
  } & {
286
326
  __v: number;
@@ -292,7 +332,7 @@ declare const baseResourceFields: {
292
332
  _id: mongoose__default.Types.ObjectId;
293
333
  } & {
294
334
  __v: number;
295
- }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, ResourceImageType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<ResourceImageType>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<ResourceImageType> & {
335
+ }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, ResourceImageType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<ResourceImageType>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<ResourceImageType> & {
296
336
  _id: mongoose__default.Types.ObjectId;
297
337
  } & {
298
338
  __v: number;
@@ -313,7 +353,7 @@ declare const baseResourceFields: {
313
353
  _id: mongoose__default.Types.ObjectId;
314
354
  } & {
315
355
  __v: number;
316
- }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, ResourceImageType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<ResourceImageType>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<ResourceImageType> & {
356
+ }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, ResourceImageType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<ResourceImageType>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<ResourceImageType> & {
317
357
  _id: mongoose__default.Types.ObjectId;
318
358
  } & {
319
359
  __v: number;
@@ -325,7 +365,7 @@ declare const baseResourceFields: {
325
365
  _id: mongoose__default.Types.ObjectId;
326
366
  } & {
327
367
  __v: number;
328
- }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, ResourceImageType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<ResourceImageType>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<ResourceImageType> & {
368
+ }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, ResourceImageType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<ResourceImageType>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<ResourceImageType> & {
329
369
  _id: mongoose__default.Types.ObjectId;
330
370
  } & {
331
371
  __v: number;
@@ -343,7 +383,7 @@ declare const baseResourceFields: {
343
383
  _id: mongoose__default.Types.ObjectId;
344
384
  } & {
345
385
  __v: number;
346
- }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, SchemaOwnerType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<SchemaOwnerType>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<SchemaOwnerType> & {
386
+ }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, SchemaOwnerType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<SchemaOwnerType>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<SchemaOwnerType> & {
347
387
  _id: mongoose__default.Types.ObjectId;
348
388
  } & {
349
389
  __v: number;
@@ -355,7 +395,7 @@ declare const baseResourceFields: {
355
395
  _id: mongoose__default.Types.ObjectId;
356
396
  } & {
357
397
  __v: number;
358
- }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, PosterUsageType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<PosterUsageType>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<PosterUsageType> & {
398
+ }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, PosterUsageType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<PosterUsageType>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<PosterUsageType> & {
359
399
  _id: mongoose__default.Types.ObjectId;
360
400
  } & {
361
401
  __v: number;
@@ -381,7 +421,7 @@ declare const baseResourceFields: {
381
421
  _id: mongoose__default.Types.ObjectId;
382
422
  } & {
383
423
  __v: number;
384
- }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, SchemaRelatedPostType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<SchemaRelatedPostType>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<SchemaRelatedPostType> & {
424
+ }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, SchemaRelatedPostType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<SchemaRelatedPostType>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<SchemaRelatedPostType> & {
385
425
  _id: mongoose__default.Types.ObjectId;
386
426
  } & {
387
427
  __v: number;
@@ -397,7 +437,7 @@ declare const baseResourceFields: {
397
437
  _id: mongoose__default.Types.ObjectId;
398
438
  } & {
399
439
  __v: number;
400
- }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, SocialShareResourceType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<SocialShareResourceType>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<SocialShareResourceType> & {
440
+ }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, SocialShareResourceType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<SocialShareResourceType>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<SocialShareResourceType> & {
401
441
  _id: mongoose__default.Types.ObjectId;
402
442
  } & {
403
443
  __v: number;
@@ -413,7 +453,7 @@ declare const baseResourceFields: {
413
453
  _id: mongoose__default.Types.ObjectId;
414
454
  } & {
415
455
  __v: number;
416
- }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, SocialMediaType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<SocialMediaType>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<SocialMediaType> & {
456
+ }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, SocialMediaType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<SocialMediaType>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<SocialMediaType> & {
417
457
  _id: mongoose__default.Types.ObjectId;
418
458
  } & {
419
459
  __v: number;
@@ -427,7 +467,7 @@ declare const baseResourceFields: {
427
467
  _id: mongoose__default.Types.ObjectId;
428
468
  } & {
429
469
  __v: number;
430
- }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, TermsAgreement, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<TermsAgreement>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<TermsAgreement> & {
470
+ }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, TermsAgreement, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<TermsAgreement>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<TermsAgreement> & {
431
471
  _id: mongoose__default.Types.ObjectId;
432
472
  } & {
433
473
  __v: number;
@@ -438,10 +478,14 @@ declare const baseResourceFields: {
438
478
  type SchemaGoogleImportedMarket = Omit<GoogleImportedMarket, "eventId" | "claimedByUserId"> & {
439
479
  eventId?: mongoose__default.Types.ObjectId;
440
480
  claimedByUserId?: mongoose__default.Types.ObjectId;
481
+ /** Lowercase `name` mirror for prefix type-ahead (see searchNamePlugin). */
482
+ searchName?: string;
441
483
  };
442
484
  declare const GoogleImportedMarketModel: mongoose__default.Model<SchemaGoogleImportedMarket, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaGoogleImportedMarket, {}, {}> & Omit<GoogleImportedMarket, "eventId" | "claimedByUserId"> & {
443
485
  eventId?: mongoose__default.Types.ObjectId;
444
486
  claimedByUserId?: mongoose__default.Types.ObjectId;
487
+ /** Lowercase `name` mirror for prefix type-ahead (see searchNamePlugin). */
488
+ searchName?: string;
445
489
  } & Required<{
446
490
  _id: string;
447
491
  }> & {
@@ -463,7 +507,7 @@ declare const relationDatesSchema: mongoose__default.Schema<RelationDate, mongoo
463
507
  _id: mongoose__default.Types.ObjectId;
464
508
  } & {
465
509
  __v: number;
466
- }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, RelationDate, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<RelationDate>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<RelationDate> & {
510
+ }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, RelationDate, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<RelationDate>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<RelationDate> & {
467
511
  _id: mongoose__default.Types.ObjectId;
468
512
  } & {
469
513
  __v: number;
@@ -486,7 +530,7 @@ declare const RelationTypeSchema: mongoose__default.Schema<SchemaRelationType, m
486
530
  _id: string;
487
531
  }> & {
488
532
  __v: number;
489
- }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, SchemaRelationType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<SchemaRelationType>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<SchemaRelationType> & Required<{
533
+ }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, SchemaRelationType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<SchemaRelationType>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<SchemaRelationType> & Required<{
490
534
  _id: string;
491
535
  }> & {
492
536
  __v: number;
@@ -510,7 +554,7 @@ declare const ResourceActivityModel: mongoose__default.Model<ResourceActivityTyp
510
554
  type SchemaUserActivityEvent = Omit<UserActivityEvent, "resourceId"> & {
511
555
  resourceId: ObjectId;
512
556
  };
513
- type SchemaUserType = Omit<UserType, "vendor" | "coupon" | "events" | "partner" | "userActivity" | "_id" | "game" | "school" | "affiliate" | "permissions"> & {
557
+ type SchemaUserType = Omit<UserType, "vendor" | "coupon" | "events" | "partner" | "userActivity" | "_id" | "game" | "school" | "affiliate" | "permissions" | "stripe"> & {
514
558
  _id: ObjectId;
515
559
  affiliate: ObjectId;
516
560
  coupon: ObjectId;
@@ -518,6 +562,7 @@ type SchemaUserType = Omit<UserType, "vendor" | "coupon" | "events" | "partner"
518
562
  game: ObjectId;
519
563
  partner: ObjectId;
520
564
  school: ObjectId;
565
+ stripe?: SchemaStripeSubscription;
521
566
  vendor: ObjectId;
522
567
  userActivity: {
523
568
  favourites: {
@@ -536,7 +581,18 @@ type SchemaUserType = Omit<UserType, "vendor" | "coupon" | "events" | "partner"
536
581
  };
537
582
  };
538
583
  };
539
- declare const UserModel: mongoose__default.Model<SchemaUserType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaUserType, {}, {}> & Omit<UserType, "_id" | "vendor" | "coupon" | "events" | "partner" | "userActivity" | "game" | "school" | "affiliate" | "permissions"> & {
584
+ type SchemaStripeSubscription = StripeSubscription & {
585
+ billingPeriod?: EnumBillingPeriod;
586
+ cancelAtPeriodEnd?: boolean;
587
+ pendingBillingPeriod?: EnumBillingPeriod;
588
+ pendingChangeEffectiveAt?: Date;
589
+ pendingPlan?: EnumUserLicence;
590
+ priceId?: string;
591
+ scheduleId?: string;
592
+ subscriptionMutationLockExpiresAt?: Date;
593
+ subscriptionMutationLockId?: string;
594
+ };
595
+ declare const UserModel: mongoose__default.Model<SchemaUserType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaUserType, {}, {}> & Omit<UserType, "_id" | "vendor" | "coupon" | "events" | "partner" | "userActivity" | "game" | "school" | "affiliate" | "permissions" | "stripe"> & {
540
596
  _id: ObjectId;
541
597
  affiliate: ObjectId;
542
598
  coupon: ObjectId;
@@ -544,6 +600,7 @@ declare const UserModel: mongoose__default.Model<SchemaUserType, {}, {}, {}, mon
544
600
  game: ObjectId;
545
601
  partner: ObjectId;
546
602
  school: ObjectId;
603
+ stripe?: SchemaStripeSubscription;
547
604
  vendor: ObjectId;
548
605
  userActivity: {
549
606
  favourites: {
@@ -582,20 +639,28 @@ declare const vendorProductTypeSchema: mongoose__default.Schema<VendorProductLis
582
639
  _id: string;
583
640
  }> & {
584
641
  __v: number;
585
- }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, VendorProductList, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<VendorProductList>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<VendorProductList> & Required<{
642
+ }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, VendorProductList, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<VendorProductList>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<VendorProductList> & Required<{
586
643
  _id: string;
587
644
  }> & {
588
645
  __v: number;
589
646
  }>;
590
647
  type SchemaVendorType = Omit<VendorType, "vendorInfoId" | "owner" | "adIds" | "unregisteredVendorId"> & {
591
648
  adIds?: ObjectId[];
649
+ /** Mirror of `categories[].name` for $text search (see vendorSearch). */
650
+ categoriesNames?: string[];
592
651
  owner: SchemaOwnerType;
652
+ /** Lowercase `name` mirror for prefix type-ahead (see searchNamePlugin). */
653
+ searchName?: string;
593
654
  vendorInfoId: ObjectId;
594
655
  unregisteredVendorId?: ObjectId | null;
595
656
  };
596
657
  declare const VendorModel: mongoose__default.Model<SchemaVendorType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaVendorType, {}, {}> & Omit<VendorType, "adIds" | "owner" | "vendorInfoId" | "unregisteredVendorId"> & {
597
658
  adIds?: ObjectId[];
659
+ /** Mirror of `categories[].name` for $text search (see vendorSearch). */
660
+ categoriesNames?: string[];
598
661
  owner: SchemaOwnerType;
662
+ /** Lowercase `name` mirror for prefix type-ahead (see searchNamePlugin). */
663
+ searchName?: string;
599
664
  vendorInfoId: ObjectId;
600
665
  unregisteredVendorId?: ObjectId | null;
601
666
  } & Required<{
@@ -641,11 +706,15 @@ type SchemaEventType = Omit<EventType, "eventInfoId" | "owner" | "adIds"> & {
641
706
  adIds?: ObjectId[];
642
707
  eventInfoId: ObjectId;
643
708
  owner: SchemaOwnerType;
709
+ /** Lowercase `name` mirror for prefix type-ahead (see searchNamePlugin). */
710
+ searchName?: string;
644
711
  };
645
712
  declare const EventModel: mongoose__default.Model<SchemaEventType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaEventType, {}, {}> & Omit<EventType, "adIds" | "eventInfoId" | "owner"> & {
646
713
  adIds?: ObjectId[];
647
714
  eventInfoId: ObjectId;
648
715
  owner: SchemaOwnerType;
716
+ /** Lowercase `name` mirror for prefix type-ahead (see searchNamePlugin). */
717
+ searchName?: string;
649
718
  } & Required<{
650
719
  _id: string;
651
720
  }> & {
@@ -656,7 +725,7 @@ declare const StallTypeSchema: mongoose__default.Schema<StallType, mongoose__def
656
725
  _id: mongoose__default.Types.ObjectId;
657
726
  } & {
658
727
  __v: number;
659
- }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, StallType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<StallType>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<StallType> & {
728
+ }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, StallType, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<StallType>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<StallType> & {
660
729
  _id: mongoose__default.Types.ObjectId;
661
730
  } & {
662
731
  __v: number;
@@ -665,7 +734,7 @@ declare const refundPolicySchema: mongoose__default.Schema<RefundPolicy, mongoos
665
734
  _id: mongoose__default.Types.ObjectId;
666
735
  } & {
667
736
  __v: number;
668
- }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, RefundPolicy, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<RefundPolicy>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<RefundPolicy> & {
737
+ }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, RefundPolicy, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<RefundPolicy>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<RefundPolicy> & {
669
738
  _id: mongoose__default.Types.ObjectId;
670
739
  } & {
671
740
  __v: number;
@@ -684,10 +753,14 @@ declare const EventInfoModel: mongoose__default.Model<SchemaEventInfoType, {}, {
684
753
  type SchemaPartnerType = Omit<PartnerType, "owner" | "adIds"> & {
685
754
  adIds?: ObjectId[];
686
755
  owner: SchemaOwnerType;
756
+ /** Lowercase `name` mirror for prefix type-ahead (see searchNamePlugin). */
757
+ searchName?: string;
687
758
  };
688
759
  declare const PartnerModel: mongoose__default.Model<SchemaPartnerType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaPartnerType, {}, {}> & Omit<PartnerType, "adIds" | "owner"> & {
689
760
  adIds?: ObjectId[];
690
761
  owner: SchemaOwnerType;
762
+ /** Lowercase `name` mirror for prefix type-ahead (see searchNamePlugin). */
763
+ searchName?: string;
691
764
  } & Required<{
692
765
  _id: string;
693
766
  }> & {
@@ -969,8 +1042,8 @@ declare function updateRelationDatesToUnavailable(relationDates: SchemaRelationT
969
1042
 
970
1043
  type PayingStripeSubscriptionPlanResult = {
971
1044
  hasSubscription: boolean;
972
- plan: EnumUserLicence | null;
973
- validTypes: Set<EnumUserLicence>;
1045
+ plan: EnumUserLicence$1 | null;
1046
+ validTypes: Set<EnumUserLicence$1>;
974
1047
  };
975
1048
  /**
976
1049
  * Returns the paying Stripe plan when `currentPlan` is any PRO plan
@@ -988,9 +1061,15 @@ declare function getPayingVendorStripeSubscriptionPlan(userId: ObjectId | string
988
1061
  */
989
1062
  declare function getPayingEventStripeSubscriptionPlan(userId: ObjectId | string, now?: Date): Promise<PayingStripeSubscriptionPlanResult>;
990
1063
 
1064
+ /**
1065
+ * Runs the established compliance pipeline for one freshly loaded user.
1066
+ * Stripe webhooks use this at the actual paid-through boundary; the global
1067
+ * scheduled scan remains the fallback for missed or delayed webhook handling.
1068
+ */
1069
+ declare function ensureUserLicenseComplianceForUser(userId: ObjectId, now?: Dayjs): Promise<void>;
991
1070
  declare function ensureUserLicenseCompliance(): Promise<void>;
992
1071
 
993
- declare const eventLicences: EnumUserLicence$1[];
1072
+ declare const eventLicences: EnumUserLicence[];
994
1073
  /**
995
1074
  * Handles event licence compliance for a single user.
996
1075
  *
@@ -1031,7 +1110,7 @@ declare function buildLicenceExpiryPipeline(params: {
1031
1110
  oneYearFromNow: Date;
1032
1111
  }): object[];
1033
1112
 
1034
- declare const partnerLicences: EnumUserLicence$1[];
1113
+ declare const partnerLicences: EnumUserLicence[];
1035
1114
  /**
1036
1115
  * Handles partner licence compliance for a single user.
1037
1116
  *
@@ -1052,11 +1131,11 @@ declare function handlePartnerLicenceCompliance(user: SchemaUserType, now: Dayjs
1052
1131
  * is extended to one year from now
1053
1132
  * - Non-expired or non-targeted licences are unchanged in both modes
1054
1133
  */
1055
- declare function syncUserLicencesAfterExpiry(userId: ObjectId, licenceTypes: EnumUserLicence$1[], now: dayjs.Dayjs, mode?: "downgrade" | "extend"): Promise<void>;
1134
+ declare function syncUserLicencesAfterExpiry(userId: ObjectId, licenceTypes: EnumUserLicence[], now: dayjs.Dayjs, mode?: "downgrade" | "extend"): Promise<void>;
1056
1135
  /**
1057
1136
  * Checks if user has a valid licence of the given types
1058
1137
  */
1059
- declare function hasValidLicence(licences: UserLicenceType[], licenceTypes: EnumUserLicence$1[], now: dayjs.Dayjs): boolean;
1138
+ declare function hasValidLicence(licences: UserLicenceType[], licenceTypes: EnumUserLicence[], now: dayjs.Dayjs): boolean;
1060
1139
  /**
1061
1140
  * Sends a deactivation notification to the user
1062
1141
  */
@@ -1076,8 +1155,8 @@ declare function sendDeactivationNotification(payload: {
1076
1155
  */
1077
1156
  declare function processUserCompliance(user: SchemaUserType, now: dayjs.Dayjs): Promise<void>;
1078
1157
 
1079
- declare function updateVendorBasedOnUserLicense(userId: ObjectId, licenceType: EnumUserLicence$1): Promise<void>;
1080
- declare const vendorLicences: EnumUserLicence$1[];
1158
+ declare function updateVendorBasedOnUserLicense(userId: ObjectId, licenceType: EnumUserLicence): Promise<void>;
1159
+ declare const vendorLicences: EnumUserLicence[];
1081
1160
  /**
1082
1161
  * Handles vendor licence compliance for a single user
1083
1162
  */
@@ -1131,7 +1210,7 @@ declare const REMINDER_WINDOW_MAX_HOURS: number;
1131
1210
  * (ModelHelpers/licenses/index.ts) is a SEPARATE concern (entitlement priority,
1132
1211
  * not expiry behaviour) and is intentionally not merged here.
1133
1212
  */
1134
- declare function getLicenceExpiryMode(licenceType: EnumUserLicence$1): "downgrade" | "extend";
1213
+ declare function getLicenceExpiryMode(licenceType: EnumUserLicence): "downgrade" | "extend";
1135
1214
  /**
1136
1215
  * Sends a reminder notification for a license.
1137
1216
  *
@@ -1148,7 +1227,7 @@ declare function sendLicenseReminder(user: {
1148
1227
  events?: ObjectId[];
1149
1228
  partner?: ObjectId;
1150
1229
  }, licence: {
1151
- licenceType: EnumUserLicence$1;
1230
+ licenceType: EnumUserLicence;
1152
1231
  expiryDate: Date | string;
1153
1232
  }): Promise<void>;
1154
1233
  /**
@@ -1159,13 +1238,8 @@ declare function sendLicenseReminder(user: {
1159
1238
  *
1160
1239
  * @returns true if a reminder should be sent, false otherwise
1161
1240
  */
1162
- declare function processLicenseReminder(user: {
1163
- _id: ObjectId;
1164
- vendor?: ObjectId;
1165
- events?: ObjectId[];
1166
- partner?: ObjectId;
1167
- }, licence: {
1168
- licenceType: EnumUserLicence$1;
1241
+ declare function processLicenseReminder(licence: {
1242
+ licenceType: EnumUserLicence;
1169
1243
  expiryDate: Date | string;
1170
1244
  }, now: dayjs.Dayjs): Promise<boolean>;
1171
1245
  /**
@@ -1202,26 +1276,27 @@ declare enum LicenceCategory {
1202
1276
  AFFILIATE = "affiliate",
1203
1277
  SCHOOL = "school"
1204
1278
  }
1205
- declare const licenceCategoryMapping: Record<EnumUserLicence$1, LicenceCategory>;
1206
- declare const licencePriority: Record<EnumUserLicence$1, number>;
1207
- declare const standardLicences: readonly [EnumUserLicence$1.STANDARD_VENDOR, EnumUserLicence$1.STANDARD_EVENT, EnumUserLicence$1.STANDARD_PARTNER];
1208
- declare function isStandardLicence(licence: EnumUserLicence$1): licence is (typeof standardLicences)[number];
1279
+ declare const licenceCategoryMapping: Record<EnumUserLicence, LicenceCategory>;
1280
+ declare const licencePriority: Record<EnumUserLicence, number>;
1281
+ declare const standardLicences: readonly [EnumUserLicence.STANDARD_VENDOR, EnumUserLicence.STANDARD_EVENT, EnumUserLicence.STANDARD_PARTNER];
1282
+ declare function isStandardLicence(licence: EnumUserLicence): licence is (typeof standardLicences)[number];
1209
1283
  type LicenceUpgradeArgs = {
1210
1284
  expiryDate: LicenceExpiryDate;
1211
- licenceType: EnumUserLicence$1;
1285
+ licenceType: EnumUserLicence;
1212
1286
  userId: ObjectId;
1213
1287
  };
1214
1288
  type LicenceUpgradeResult = {
1215
1289
  licenceObject: UserLicenceType;
1216
1290
  updatedUser: SchemaUserType | null;
1217
1291
  };
1218
- declare function getLicenceCategory(licence: EnumUserLicence$1): LicenceCategory;
1219
- declare function getHighestLicenceForCategory(licences: UserLicenceType[] | null | undefined, category: LicenceCategory): EnumUserLicence$1 | null;
1220
- declare function createLicenceObject(expiryDate: LicenceExpiryDate, licenceType: EnumUserLicence$1): UserLicenceType;
1221
- declare function replaceUserLicenceWithObject({ userId, licenceObject, protectHigherLicence, }: {
1292
+ declare function getLicenceCategory(licence: EnumUserLicence): LicenceCategory;
1293
+ declare function getHighestLicenceForCategory(licences: UserLicenceType[] | null | undefined, category: LicenceCategory): EnumUserLicence | null;
1294
+ declare function createLicenceObject(expiryDate: LicenceExpiryDate, licenceType: EnumUserLicence): UserLicenceType;
1295
+ declare function replaceUserLicenceWithObject({ userId, licenceObject, protectHigherLicence, refreshExistingLicence, }: {
1222
1296
  userId: ObjectId;
1223
1297
  licenceObject: UserLicenceType;
1224
1298
  protectHigherLicence?: boolean;
1299
+ refreshExistingLicence?: boolean;
1225
1300
  }): Promise<void>;
1226
1301
  /**
1227
1302
  * Upgrades a user's license by adding a new license object to their account.
@@ -1237,4 +1312,4 @@ declare function checkOwnerHasLicence({ userId, resourceType, }: {
1237
1312
  resourceType: EnumResourceType;
1238
1313
  }): Promise<void>;
1239
1314
 
1240
- export { ACTIVE_NOT_DELETED_FILTER, APP_SETTINGS_ID, AdModel, AffiliateModel, AppSettingModel, type AuthUser, type AwardAffiliateVendorSubscriptionRewardsResult, CategorySchema, ChatModel, ChatReportModel, ContactDetailsSchema, type CouponDocument, CouponModel, EnumPubSubEvents, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, type GraphQLContext, LicenceCategory, LicenceExpiryDate, NotificationModel, type NotificationPubSub, type ObjectId, OwnerTypeSchema, PartnerModel, PostModel, PushTokenModel, REMINDER_WINDOW_MAX_HOURS, REMINDER_WINDOW_MIN_HOURS, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, SUBSCRIPTION_REWARD_TIMEZONE, type SchemaAffiliateResourceType, type SchemaAffiliateReward, type SchemaChatMessageReactionType, type SchemaChatMessageReplyPreviewType, type SchemaChatMessageSeenType, type SchemaChatMessageType, type SchemaChatReportType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelatedPostType, type SchemaRelationType, type SchemaUnregisteredVendorInvitationType, type SchemaUnregisteredVendorType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SchoolModel, SocialMediaTypeSchema, StallTypeSchema, type SubscriptionPayload, UnregisteredVendorModel, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, activeAffiliateCodeExists, awardAffiliateVendorSubscriptionRewards, baseResourceFields, buildLicenceExpiryPipeline, checkOwnerHasLicence, connectToDatabase, convertObjectIdsToStrings, createLicenceObject, dateTimeSchema, didRemoveAnyEventDates, ensureUserLicenseCompliance, eventLicences, findAffiliateByPromoCode, findEventOrImportedMarketById, getEventResourceInfo, getHighestLicenceForCategory, getLicenceCategory, getLicenceExpiryMode, getPartnerResourceInfo, getPayingEventStripeSubscriptionPlan, getPayingStripeSubscriptionPlan, getPayingVendorStripeSubscriptionPlan, getSubscriptionRewardPeriodBounds, getVendorResourceInfo, handleEventLicenceCompliance, handlePartnerLicenceCompliance, handleVendorLicenceCompliance, hasValidLicence, isStandardLicence, isValidObjectId, licenceCategoryMapping, licencePriority, locationGeoSchema, locationsSchema, mapVendorLicenceToSubscriptionRewardType, normalizeAffiliatePromoCodes, normalizePromoCode, notifyUsers, partnerLicences, processLicenseReminder, processUserCompliance, processUserLicenseReminders, publishNotificationEvents, refundPolicySchema, relatedPostSchema, relationDatesSchema, remindUsersAboutLicenseExpiration, replaceUserLicenceWithObject, resourceRelationsSchema, saveNotificationsInDb, sendDeactivationNotification, sendLicenseReminder, sendPushNotifications, sendReminderSafely, socialShareResourceSchema, syncUserLicencesAfterExpiry, termsAgreementSchema, updateAdStatuses, updateAllEventDateTimeStatuses, updateRelationDatesToUnavailable, updateSingleDateTimeStatus, updateVendorBasedOnUserLicense, upgradeUserToLicence, userLicenseSchema, vendorLicences, vendorOwnerHasProLicence, vendorProductTypeSchema };
1315
+ export { ACTIVE_NOT_DELETED_FILTER, APP_SETTINGS_ID, AdModel, AffiliateModel, AppSettingModel, type AuthUser, type AwardAffiliateVendorSubscriptionRewardsResult, BILLING_CATALOG_COLLECTION_NAME, BillingCatalogModel, CategorySchema, ChatModel, ChatReportModel, ContactDetailsSchema, type CouponDocument, CouponModel, EnumPubSubEvents, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, type GraphQLContext, LicenceCategory, LicenceExpiryDate, NotificationModel, type NotificationPubSub, type ObjectId, OwnerTypeSchema, PartnerModel, PostModel, PushTokenModel, REMINDER_WINDOW_MAX_HOURS, REMINDER_WINDOW_MIN_HOURS, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, SUBSCRIPTION_REWARD_TIMEZONE, type SchemaAffiliateResourceType, type SchemaAffiliateReward, type SchemaBillingCatalogEntry, type SchemaBillingCatalogPriceHistoryEntry, type SchemaChatMessageReactionType, type SchemaChatMessageReplyPreviewType, type SchemaChatMessageSeenType, type SchemaChatMessageType, type SchemaChatReportType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelatedPostType, type SchemaRelationType, type SchemaStripeSubscription, type SchemaUnregisteredVendorInvitationType, type SchemaUnregisteredVendorType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SchoolModel, SocialMediaTypeSchema, StallTypeSchema, type SubscriptionPayload, UnregisteredVendorModel, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, activeAffiliateCodeExists, awardAffiliateVendorSubscriptionRewards, baseResourceFields, buildInitialBillingCatalogEntries, buildLicenceExpiryPipeline, checkOwnerHasLicence, connectToDatabase, convertObjectIdsToStrings, createLicenceObject, dateTimeSchema, didRemoveAnyEventDates, ensureUserLicenseCompliance, ensureUserLicenseComplianceForUser, eventLicences, findAffiliateByPromoCode, findEventOrImportedMarketById, getBillingCatalogDefinition, getEventResourceInfo, getHighestLicenceForCategory, getLicenceCategory, getLicenceExpiryMode, getPartnerResourceInfo, getPayingEventStripeSubscriptionPlan, getPayingStripeSubscriptionPlan, getPayingVendorStripeSubscriptionPlan, getSubscriptionRewardPeriodBounds, getVendorResourceInfo, handleEventLicenceCompliance, handlePartnerLicenceCompliance, handleVendorLicenceCompliance, hasValidLicence, isStandardLicence, isValidObjectId, licenceCategoryMapping, licencePriority, locationGeoSchema, locationsSchema, mapVendorLicenceToSubscriptionRewardType, normalizeAffiliatePromoCodes, normalizePromoCode, notifyUsers, partnerLicences, processLicenseReminder, processUserCompliance, processUserLicenseReminders, publishNotificationEvents, refundPolicySchema, relatedPostSchema, relationDatesSchema, remindUsersAboutLicenseExpiration, replaceUserLicenceWithObject, resourceRelationsSchema, saveNotificationsInDb, sendDeactivationNotification, sendLicenseReminder, sendPushNotifications, sendReminderSafely, socialShareResourceSchema, syncUserLicencesAfterExpiry, termsAgreementSchema, updateAdStatuses, updateAllEventDateTimeStatuses, updateRelationDatesToUnavailable, updateSingleDateTimeStatus, updateVendorBasedOnUserLicense, upgradeUserToLicence, userLicenseSchema, vendorLicences, vendorOwnerHasProLicence, vendorProductTypeSchema };