@timardex/cluemart-server-shared 2.1.7 → 2.1.11

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.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
2
- import { AdType, AdDailyPriceType, AdBookingType, EnumAdShowOn, AdSettingsType, 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, LicenceExpiryDate } from '@timardex/cluemart-shared';
2
+ import { AdType, AdDailyPriceType, AdBookingType, EnumAdShowOn, AdSettingsType, 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, UserLicenceType, GoogleImportedMarket, PushTokenType, RelationType, RelationDate, 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, LicenceExpiryDate } 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';
@@ -264,36 +264,6 @@ declare const termsAgreementSchema: mongoose__default.Schema<TermsAgreement, mon
264
264
  } & {
265
265
  __v: number;
266
266
  }>;
267
- declare const resourceRelationsSchema: mongoose__default.Schema<{
268
- relationId: ObjectId;
269
- relationDates: RelationDate[];
270
- }, mongoose__default.Model<{
271
- relationId: ObjectId;
272
- relationDates: RelationDate[];
273
- }, any, any, any, mongoose__default.Document<unknown, any, {
274
- relationId: ObjectId;
275
- relationDates: RelationDate[];
276
- }, any, {}> & {
277
- relationId: ObjectId;
278
- relationDates: RelationDate[];
279
- } & {
280
- _id: mongoose__default.Types.ObjectId;
281
- } & {
282
- __v: number;
283
- }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, {
284
- relationId: ObjectId;
285
- relationDates: RelationDate[];
286
- }, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<{
287
- relationId: ObjectId;
288
- relationDates: RelationDate[];
289
- }>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<{
290
- relationId: ObjectId;
291
- relationDates: RelationDate[];
292
- }> & {
293
- _id: mongoose__default.Types.ObjectId;
294
- } & {
295
- __v: number;
296
- }>;
297
267
  declare const dateTimeSchema: mongoose__default.Schema<DateTimeType, mongoose__default.Model<DateTimeType, any, any, any, mongoose__default.Document<unknown, any, DateTimeType, any, {}> & DateTimeType & {
298
268
  _id: mongoose__default.Types.ObjectId;
299
269
  } & {
@@ -796,6 +766,16 @@ declare const EventInfoModel: mongoose__default.Model<SchemaEventInfoType, {}, {
796
766
  __v: number;
797
767
  }, any>;
798
768
 
769
+ type SchemaEventDateArchiveType = {
770
+ dateTime: DateTimeType[];
771
+ eventId: ObjectId;
772
+ };
773
+ declare const EventDateArchiveModel: mongoose__default.Model<SchemaEventDateArchiveType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaEventDateArchiveType, {}, {}> & SchemaEventDateArchiveType & {
774
+ _id: mongoose__default.Types.ObjectId;
775
+ } & {
776
+ __v: number;
777
+ }, any>;
778
+
799
779
  type SchemaPartnerType = Omit<PartnerType, "owner" | "adIds"> & {
800
780
  adIds?: ObjectId[];
801
781
  owner: SchemaOwnerType;
@@ -1071,10 +1051,38 @@ declare function convertObjectIdsToStrings(obj: any): any;
1071
1051
  */
1072
1052
  declare function updateSingleDateTimeStatus<T extends DateTimeType>(dateTime: T, now?: dayjs.Dayjs): T;
1073
1053
  /**
1074
- * Recomputes dateStatus for every dateTime slot on events and google imported markets.
1054
+ * Recomputes dateStatus for every dateTime slot on events and google imported
1055
+ * markets, moves ended event date slots into the event date archive, and keeps
1056
+ * `EventInfo.dateTime` future-only.
1075
1057
  */
1076
1058
  declare function updateAllEventDateTimeStatuses(): Promise<void>;
1077
1059
 
1060
+ /**
1061
+ * Splits a recomputed event schedule into three buckets: slots to keep on the
1062
+ * Event document (future + STARTED), ended slots to archive (`ENDED`), and
1063
+ * invalid slots to discard (`INVALID` — removed from the Event but *not*
1064
+ * archived). `Event.dateTime` may become empty once an event has no future or
1065
+ * in-progress dates.
1066
+ */
1067
+ declare function splitEventDatesForArchive(dateTime: DateTimeType[]): {
1068
+ archive: DateTimeType[];
1069
+ discard: DateTimeType[];
1070
+ keep: DateTimeType[];
1071
+ };
1072
+ /**
1073
+ * De-duplicates the *input* slots on (startDate, startTime), keeping the first
1074
+ * occurrence. This prevents a single write from appending near-duplicate
1075
+ * history (the archive's `$addToSet` only de-dupes by deep equality, not by
1076
+ * startDate/startTime). It does not scan or clean duplicates already stored in
1077
+ * the archive document.
1078
+ */
1079
+ declare function dedupeArchivedSlotsByStartDateTime(slots: DateTimeType[]): DateTimeType[];
1080
+ /**
1081
+ * Persists archived slots into the event's archive document. Idempotent: the
1082
+ * archive document is keyed per event and slots are appended with `$addToSet`.
1083
+ */
1084
+ declare function persistArchivedEventDates(eventId: ObjectId | string, slots: DateTimeType[]): Promise<void>;
1085
+
1078
1086
  type EventOrMarket = (Pick<EventListItemType, "_id" | "name" | "dateTime"> & {
1079
1087
  /** Present on owned EventModel docs; absent on Google-imported markets. */
1080
1088
  owner?: SchemaOwnerType;
@@ -1376,4 +1384,4 @@ declare function checkOwnerHasLicence({ userId, resourceType, }: {
1376
1384
  resourceType: EnumResourceType;
1377
1385
  }): Promise<void>;
1378
1386
 
1379
- export { ACTIVE_NOT_DELETED_FILTER, AD_BILLING_CATALOG_COLLECTION_NAME, APP_SETTINGS_ID, AdBillingCatalogModel, AdBookingModel, type AdImpressionEntry, AdImpressionModel, AdModel, AdSettingsModel, AffiliateModel, AppSettingModel, type AuthUser, type AwardAffiliateVendorSubscriptionRewardsResult, BILLING_CATALOG_COLLECTION_NAME, BillingCatalogModel, CategorySchema, ChatModel, ChatReportModel, ContactDetailsSchema, type CouponDocument, CouponModel, DEFAULT_AD_SETTINGS, EnumPubSubEvents, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, type GraphQLContext, LicenceCategory, 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 SchemaAppSettingsType, 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, downgradeVendorProFeatures, 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, restoreVendorProFeatures, saveNotificationsInDb, schemaAdresource, sendDeactivationNotification, sendLicenseReminder, sendPushNotifications, sendReminderSafely, socialShareResourceSchema, syncUserLicencesAfterExpiry, termsAgreementSchema, updateAdStatuses, updateAllEventDateTimeStatuses, updateRelationDatesToUnavailable, updateSingleDateTimeStatus, upgradeUserToLicence, userLicenseSchema, vendorOwnerHasProLicence, vendorProductTypeSchema };
1387
+ export { ACTIVE_NOT_DELETED_FILTER, AD_BILLING_CATALOG_COLLECTION_NAME, APP_SETTINGS_ID, AdBillingCatalogModel, AdBookingModel, type AdImpressionEntry, AdImpressionModel, AdModel, AdSettingsModel, AffiliateModel, AppSettingModel, type AuthUser, type AwardAffiliateVendorSubscriptionRewardsResult, BILLING_CATALOG_COLLECTION_NAME, BillingCatalogModel, CategorySchema, ChatModel, ChatReportModel, ContactDetailsSchema, type CouponDocument, CouponModel, DEFAULT_AD_SETTINGS, EnumPubSubEvents, EventDateArchiveModel, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, type GraphQLContext, LicenceCategory, 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 SchemaAppSettingsType, type SchemaBillingCatalogEntry, type SchemaBillingCatalogPriceHistoryEntry, type SchemaChatMessageReactionType, type SchemaChatMessageReplyPreviewType, type SchemaChatMessageSeenType, type SchemaChatMessageType, type SchemaChatReportType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventDateArchiveType, 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, dedupeArchivedSlotsByStartDateTime, didRemoveAnyEventDates, downgradeVendorProFeatures, 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, persistArchivedEventDates, processLicenseReminder, processUserCompliance, processUserLicenseReminders, publishNotificationEvents, refundPolicySchema, relatedPostSchema, relationDatesSchema, remindUsersAboutLicenseExpiration, replaceUserLicenceWithObject, restoreVendorProFeatures, saveNotificationsInDb, schemaAdresource, sendDeactivationNotification, sendLicenseReminder, sendPushNotifications, sendReminderSafely, socialShareResourceSchema, splitEventDatesForArchive, syncUserLicencesAfterExpiry, termsAgreementSchema, updateAdStatuses, updateAllEventDateTimeStatuses, updateRelationDatesToUnavailable, updateSingleDateTimeStatus, upgradeUserToLicence, userLicenseSchema, vendorOwnerHasProLicence, vendorProductTypeSchema };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
2
- import { AdType, AdDailyPriceType, AdBookingType, EnumAdShowOn, AdSettingsType, 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, LicenceExpiryDate } from '@timardex/cluemart-shared';
2
+ import { AdType, AdDailyPriceType, AdBookingType, EnumAdShowOn, AdSettingsType, 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, UserLicenceType, GoogleImportedMarket, PushTokenType, RelationType, RelationDate, 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, LicenceExpiryDate } 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';
@@ -264,36 +264,6 @@ declare const termsAgreementSchema: mongoose__default.Schema<TermsAgreement, mon
264
264
  } & {
265
265
  __v: number;
266
266
  }>;
267
- declare const resourceRelationsSchema: mongoose__default.Schema<{
268
- relationId: ObjectId;
269
- relationDates: RelationDate[];
270
- }, mongoose__default.Model<{
271
- relationId: ObjectId;
272
- relationDates: RelationDate[];
273
- }, any, any, any, mongoose__default.Document<unknown, any, {
274
- relationId: ObjectId;
275
- relationDates: RelationDate[];
276
- }, any, {}> & {
277
- relationId: ObjectId;
278
- relationDates: RelationDate[];
279
- } & {
280
- _id: mongoose__default.Types.ObjectId;
281
- } & {
282
- __v: number;
283
- }, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, {
284
- relationId: ObjectId;
285
- relationDates: RelationDate[];
286
- }, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<{
287
- relationId: ObjectId;
288
- relationDates: RelationDate[];
289
- }>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<{
290
- relationId: ObjectId;
291
- relationDates: RelationDate[];
292
- }> & {
293
- _id: mongoose__default.Types.ObjectId;
294
- } & {
295
- __v: number;
296
- }>;
297
267
  declare const dateTimeSchema: mongoose__default.Schema<DateTimeType, mongoose__default.Model<DateTimeType, any, any, any, mongoose__default.Document<unknown, any, DateTimeType, any, {}> & DateTimeType & {
298
268
  _id: mongoose__default.Types.ObjectId;
299
269
  } & {
@@ -796,6 +766,16 @@ declare const EventInfoModel: mongoose__default.Model<SchemaEventInfoType, {}, {
796
766
  __v: number;
797
767
  }, any>;
798
768
 
769
+ type SchemaEventDateArchiveType = {
770
+ dateTime: DateTimeType[];
771
+ eventId: ObjectId;
772
+ };
773
+ declare const EventDateArchiveModel: mongoose__default.Model<SchemaEventDateArchiveType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaEventDateArchiveType, {}, {}> & SchemaEventDateArchiveType & {
774
+ _id: mongoose__default.Types.ObjectId;
775
+ } & {
776
+ __v: number;
777
+ }, any>;
778
+
799
779
  type SchemaPartnerType = Omit<PartnerType, "owner" | "adIds"> & {
800
780
  adIds?: ObjectId[];
801
781
  owner: SchemaOwnerType;
@@ -1071,10 +1051,38 @@ declare function convertObjectIdsToStrings(obj: any): any;
1071
1051
  */
1072
1052
  declare function updateSingleDateTimeStatus<T extends DateTimeType>(dateTime: T, now?: dayjs.Dayjs): T;
1073
1053
  /**
1074
- * Recomputes dateStatus for every dateTime slot on events and google imported markets.
1054
+ * Recomputes dateStatus for every dateTime slot on events and google imported
1055
+ * markets, moves ended event date slots into the event date archive, and keeps
1056
+ * `EventInfo.dateTime` future-only.
1075
1057
  */
1076
1058
  declare function updateAllEventDateTimeStatuses(): Promise<void>;
1077
1059
 
1060
+ /**
1061
+ * Splits a recomputed event schedule into three buckets: slots to keep on the
1062
+ * Event document (future + STARTED), ended slots to archive (`ENDED`), and
1063
+ * invalid slots to discard (`INVALID` — removed from the Event but *not*
1064
+ * archived). `Event.dateTime` may become empty once an event has no future or
1065
+ * in-progress dates.
1066
+ */
1067
+ declare function splitEventDatesForArchive(dateTime: DateTimeType[]): {
1068
+ archive: DateTimeType[];
1069
+ discard: DateTimeType[];
1070
+ keep: DateTimeType[];
1071
+ };
1072
+ /**
1073
+ * De-duplicates the *input* slots on (startDate, startTime), keeping the first
1074
+ * occurrence. This prevents a single write from appending near-duplicate
1075
+ * history (the archive's `$addToSet` only de-dupes by deep equality, not by
1076
+ * startDate/startTime). It does not scan or clean duplicates already stored in
1077
+ * the archive document.
1078
+ */
1079
+ declare function dedupeArchivedSlotsByStartDateTime(slots: DateTimeType[]): DateTimeType[];
1080
+ /**
1081
+ * Persists archived slots into the event's archive document. Idempotent: the
1082
+ * archive document is keyed per event and slots are appended with `$addToSet`.
1083
+ */
1084
+ declare function persistArchivedEventDates(eventId: ObjectId | string, slots: DateTimeType[]): Promise<void>;
1085
+
1078
1086
  type EventOrMarket = (Pick<EventListItemType, "_id" | "name" | "dateTime"> & {
1079
1087
  /** Present on owned EventModel docs; absent on Google-imported markets. */
1080
1088
  owner?: SchemaOwnerType;
@@ -1376,4 +1384,4 @@ declare function checkOwnerHasLicence({ userId, resourceType, }: {
1376
1384
  resourceType: EnumResourceType;
1377
1385
  }): Promise<void>;
1378
1386
 
1379
- export { ACTIVE_NOT_DELETED_FILTER, AD_BILLING_CATALOG_COLLECTION_NAME, APP_SETTINGS_ID, AdBillingCatalogModel, AdBookingModel, type AdImpressionEntry, AdImpressionModel, AdModel, AdSettingsModel, AffiliateModel, AppSettingModel, type AuthUser, type AwardAffiliateVendorSubscriptionRewardsResult, BILLING_CATALOG_COLLECTION_NAME, BillingCatalogModel, CategorySchema, ChatModel, ChatReportModel, ContactDetailsSchema, type CouponDocument, CouponModel, DEFAULT_AD_SETTINGS, EnumPubSubEvents, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, type GraphQLContext, LicenceCategory, 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 SchemaAppSettingsType, 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, downgradeVendorProFeatures, 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, restoreVendorProFeatures, saveNotificationsInDb, schemaAdresource, sendDeactivationNotification, sendLicenseReminder, sendPushNotifications, sendReminderSafely, socialShareResourceSchema, syncUserLicencesAfterExpiry, termsAgreementSchema, updateAdStatuses, updateAllEventDateTimeStatuses, updateRelationDatesToUnavailable, updateSingleDateTimeStatus, upgradeUserToLicence, userLicenseSchema, vendorOwnerHasProLicence, vendorProductTypeSchema };
1387
+ export { ACTIVE_NOT_DELETED_FILTER, AD_BILLING_CATALOG_COLLECTION_NAME, APP_SETTINGS_ID, AdBillingCatalogModel, AdBookingModel, type AdImpressionEntry, AdImpressionModel, AdModel, AdSettingsModel, AffiliateModel, AppSettingModel, type AuthUser, type AwardAffiliateVendorSubscriptionRewardsResult, BILLING_CATALOG_COLLECTION_NAME, BillingCatalogModel, CategorySchema, ChatModel, ChatReportModel, ContactDetailsSchema, type CouponDocument, CouponModel, DEFAULT_AD_SETTINGS, EnumPubSubEvents, EventDateArchiveModel, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, type GraphQLContext, LicenceCategory, 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 SchemaAppSettingsType, type SchemaBillingCatalogEntry, type SchemaBillingCatalogPriceHistoryEntry, type SchemaChatMessageReactionType, type SchemaChatMessageReplyPreviewType, type SchemaChatMessageSeenType, type SchemaChatMessageType, type SchemaChatReportType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventDateArchiveType, 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, dedupeArchivedSlotsByStartDateTime, didRemoveAnyEventDates, downgradeVendorProFeatures, 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, persistArchivedEventDates, processLicenseReminder, processUserCompliance, processUserLicenseReminders, publishNotificationEvents, refundPolicySchema, relatedPostSchema, relationDatesSchema, remindUsersAboutLicenseExpiration, replaceUserLicenceWithObject, restoreVendorProFeatures, saveNotificationsInDb, schemaAdresource, sendDeactivationNotification, sendLicenseReminder, sendPushNotifications, sendReminderSafely, socialShareResourceSchema, splitEventDatesForArchive, syncUserLicencesAfterExpiry, termsAgreementSchema, updateAdStatuses, updateAllEventDateTimeStatuses, updateRelationDatesToUnavailable, updateSingleDateTimeStatus, upgradeUserToLicence, userLicenseSchema, vendorOwnerHasProLicence, vendorProductTypeSchema };