@timardex/cluemart-server-shared 2.1.0 → 2.1.1
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/{Affiliate-CMJdECzs.d.mts → Affiliate-B1mxoMeD.d.mts} +3 -0
- package/dist/{Affiliate-VLZdlt5K.d.ts → Affiliate-Dlf_OLIh.d.ts} +3 -0
- package/dist/{chunk-BEUTBR4H.mjs → chunk-MEEBCSMJ.mjs} +517 -206
- package/dist/chunk-MEEBCSMJ.mjs.map +1 -0
- package/dist/index.cjs +790 -414
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +53 -5
- package/dist/index.d.ts +53 -5
- package/dist/index.mjs +621 -238
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +593 -284
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +47 -4
- package/dist/mongoose/index.d.ts +47 -4
- package/dist/mongoose/index.mjs +15 -1
- package/dist/service/index.cjs +765 -411
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.d.mts +6 -4
- package/dist/service/index.d.ts +6 -4
- package/dist/service/index.mjs +99 -27
- package/dist/service/index.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-BEUTBR4H.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _timardex_cluemart_shared 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';
|
|
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 } 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';
|
|
@@ -9,12 +9,55 @@ export { default as express } from 'express';
|
|
|
9
9
|
import dayjs, { Dayjs } from 'dayjs';
|
|
10
10
|
import { EnumUserLicence as EnumUserLicence$1 } from '@timardex/cluemart-shared/enums';
|
|
11
11
|
|
|
12
|
+
declare const schemaAdresource: mongoose__default.Schema<_timardex_cluemart_shared.AdResource, mongoose__default.Model<_timardex_cluemart_shared.AdResource, any, any, any, mongoose__default.Document<unknown, any, _timardex_cluemart_shared.AdResource, any, {}> & _timardex_cluemart_shared.AdResource & {
|
|
13
|
+
_id: mongoose__default.Types.ObjectId;
|
|
14
|
+
} & {
|
|
15
|
+
__v: number;
|
|
16
|
+
}, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, _timardex_cluemart_shared.AdResource, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<_timardex_cluemart_shared.AdResource>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<_timardex_cluemart_shared.AdResource> & {
|
|
17
|
+
_id: mongoose__default.Types.ObjectId;
|
|
18
|
+
} & {
|
|
19
|
+
__v: number;
|
|
20
|
+
}>;
|
|
12
21
|
declare const AdModel: mongoose__default.Model<AdType, {}, {}, {}, mongoose__default.Document<unknown, {}, AdType, {}, {}> & AdType & Required<{
|
|
13
22
|
_id: string;
|
|
14
23
|
}> & {
|
|
15
24
|
__v: number;
|
|
16
25
|
}, any>;
|
|
17
26
|
|
|
27
|
+
declare const AD_BILLING_CATALOG_COLLECTION_NAME = "adBillingCatalog";
|
|
28
|
+
declare const AdBillingCatalogModel: mongoose__default.Model<AdDailyPriceType, {}, {}, {}, mongoose__default.Document<unknown, {}, AdDailyPriceType, {}, {}> & AdDailyPriceType & Required<{
|
|
29
|
+
_id: string;
|
|
30
|
+
}> & {
|
|
31
|
+
__v: number;
|
|
32
|
+
}, any>;
|
|
33
|
+
|
|
34
|
+
declare const AdBookingModel: mongoose__default.Model<AdBookingType, {}, {}, {}, mongoose__default.Document<unknown, {}, AdBookingType, {}, {}> & AdBookingType & Required<{
|
|
35
|
+
_id: string;
|
|
36
|
+
}> & {
|
|
37
|
+
__v: number;
|
|
38
|
+
}, any>;
|
|
39
|
+
|
|
40
|
+
type AdImpressionEntry = {
|
|
41
|
+
_id: string;
|
|
42
|
+
adId: string;
|
|
43
|
+
dayKey: string;
|
|
44
|
+
placement: EnumAdShowOn.FRONT_PAGE | EnumAdShowOn.MARKET_SEARCH;
|
|
45
|
+
recordedAt: Date;
|
|
46
|
+
viewerSlotKey: string;
|
|
47
|
+
};
|
|
48
|
+
declare const AdImpressionModel: mongoose__default.Model<AdImpressionEntry, {}, {}, {}, mongoose__default.Document<unknown, {}, AdImpressionEntry, {}, {}> & AdImpressionEntry & Required<{
|
|
49
|
+
_id: string;
|
|
50
|
+
}> & {
|
|
51
|
+
__v: number;
|
|
52
|
+
}, any>;
|
|
53
|
+
|
|
54
|
+
declare const DEFAULT_AD_SETTINGS: AdSettingsType;
|
|
55
|
+
declare const AdSettingsModel: mongoose__default.Model<AdSettingsType, {}, {}, {}, mongoose__default.Document<unknown, {}, AdSettingsType, {}, {}> & AdSettingsType & Required<{
|
|
56
|
+
_id: "default";
|
|
57
|
+
}> & {
|
|
58
|
+
__v: number;
|
|
59
|
+
}, any>;
|
|
60
|
+
|
|
18
61
|
type SchemaChatMessageReplyPreviewType = Omit<NonNullable<ChatMessageType["replyPreview"]>, "senderId"> & {
|
|
19
62
|
senderId: ObjectId;
|
|
20
63
|
};
|
|
@@ -584,6 +627,9 @@ type SchemaUserType = Omit<UserType, "vendor" | "coupon" | "events" | "partner"
|
|
|
584
627
|
type SchemaStripeSubscription = StripeSubscription & {
|
|
585
628
|
billingPeriod?: EnumBillingPeriod;
|
|
586
629
|
cancelAtPeriodEnd?: boolean;
|
|
630
|
+
paymentFailedAt?: Date;
|
|
631
|
+
paymentGracePeriodEndsAt?: Date;
|
|
632
|
+
paymentGraceSubscriptionId?: string;
|
|
587
633
|
pendingBillingPeriod?: EnumBillingPeriod;
|
|
588
634
|
pendingChangeEffectiveAt?: Date;
|
|
589
635
|
pendingPlan?: EnumUserLicence;
|
|
@@ -882,13 +928,14 @@ type AwardAffiliateVendorSubscriptionRewardsResult = {
|
|
|
882
928
|
* - `affiliateResources.resourceOwner` has a non-expired Standard / Pro / Pro+ vendor licence
|
|
883
929
|
*
|
|
884
930
|
* Reward type follows the owner's highest valid licence + Stripe paying status:
|
|
885
|
-
* - Pro / Pro+ with paying Stripe (ACTIVE
|
|
931
|
+
* - Pro / Pro+ with paying Stripe (ACTIVE) → `ACTIVE_VENDOR_PRO_SUBSCRIPTION` (3 pts)
|
|
886
932
|
* - Pro / Pro+ without paying Stripe → `ACTIVE_VENDOR_STANDARD_SUBSCRIPTION` (1 pt)
|
|
887
933
|
* - Standard → `ACTIVE_VENDOR_STANDARD_SUBSCRIPTION` (1 pt)
|
|
888
934
|
*
|
|
889
935
|
* Idempotent per affiliate + vendor + calendar month — a mid-month licence
|
|
890
936
|
* upgrade (Standard → paying Pro) takes effect from the following month.
|
|
891
|
-
* On successful
|
|
937
|
+
* On successful awards, sends the affiliate owner a single aggregated
|
|
938
|
+
* notification per run (best-effort).
|
|
892
939
|
*
|
|
893
940
|
* @param now - Reference time for month bounds and licence expiry (defaults to now).
|
|
894
941
|
* @returns Counts of awarded and skipped candidates.
|
|
@@ -1050,7 +1097,8 @@ type PayingStripeSubscriptionPlanResult = {
|
|
|
1050
1097
|
};
|
|
1051
1098
|
/**
|
|
1052
1099
|
* Returns the paying Stripe plan when `currentPlan` is any PRO plan
|
|
1053
|
-
* (event or vendor)
|
|
1100
|
+
* (event or vendor), the subscription is active, and its finite paid-through
|
|
1101
|
+
* `endDate` is later than `now`. Status alone does not establish paid access.
|
|
1054
1102
|
*/
|
|
1055
1103
|
declare function getPayingStripeSubscriptionPlan(userId: ObjectId | string, now?: Date): Promise<PayingStripeSubscriptionPlanResult>;
|
|
1056
1104
|
/**
|
|
@@ -1323,4 +1371,4 @@ declare function checkOwnerHasLicence({ userId, resourceType, }: {
|
|
|
1323
1371
|
resourceType: EnumResourceType;
|
|
1324
1372
|
}): Promise<void>;
|
|
1325
1373
|
|
|
1326
|
-
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, 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, sendDeactivationNotification, sendLicenseReminder, sendPushNotifications, sendReminderSafely, socialShareResourceSchema, syncUserLicencesAfterExpiry, termsAgreementSchema, updateAdStatuses, updateAllEventDateTimeStatuses, updateRelationDatesToUnavailable, updateSingleDateTimeStatus, upgradeUserToLicence, userLicenseSchema, vendorLicences, vendorOwnerHasProLicence, vendorProductTypeSchema };
|
|
1374
|
+
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, 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, 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, vendorLicences, 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, 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';
|
|
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 } 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';
|
|
@@ -9,12 +9,55 @@ export { default as express } from 'express';
|
|
|
9
9
|
import dayjs, { Dayjs } from 'dayjs';
|
|
10
10
|
import { EnumUserLicence as EnumUserLicence$1 } from '@timardex/cluemart-shared/enums';
|
|
11
11
|
|
|
12
|
+
declare const schemaAdresource: mongoose__default.Schema<_timardex_cluemart_shared.AdResource, mongoose__default.Model<_timardex_cluemart_shared.AdResource, any, any, any, mongoose__default.Document<unknown, any, _timardex_cluemart_shared.AdResource, any, {}> & _timardex_cluemart_shared.AdResource & {
|
|
13
|
+
_id: mongoose__default.Types.ObjectId;
|
|
14
|
+
} & {
|
|
15
|
+
__v: number;
|
|
16
|
+
}, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, _timardex_cluemart_shared.AdResource, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<_timardex_cluemart_shared.AdResource>, {}, mongoose__default.DefaultSchemaOptions> & mongoose__default.FlatRecord<_timardex_cluemart_shared.AdResource> & {
|
|
17
|
+
_id: mongoose__default.Types.ObjectId;
|
|
18
|
+
} & {
|
|
19
|
+
__v: number;
|
|
20
|
+
}>;
|
|
12
21
|
declare const AdModel: mongoose__default.Model<AdType, {}, {}, {}, mongoose__default.Document<unknown, {}, AdType, {}, {}> & AdType & Required<{
|
|
13
22
|
_id: string;
|
|
14
23
|
}> & {
|
|
15
24
|
__v: number;
|
|
16
25
|
}, any>;
|
|
17
26
|
|
|
27
|
+
declare const AD_BILLING_CATALOG_COLLECTION_NAME = "adBillingCatalog";
|
|
28
|
+
declare const AdBillingCatalogModel: mongoose__default.Model<AdDailyPriceType, {}, {}, {}, mongoose__default.Document<unknown, {}, AdDailyPriceType, {}, {}> & AdDailyPriceType & Required<{
|
|
29
|
+
_id: string;
|
|
30
|
+
}> & {
|
|
31
|
+
__v: number;
|
|
32
|
+
}, any>;
|
|
33
|
+
|
|
34
|
+
declare const AdBookingModel: mongoose__default.Model<AdBookingType, {}, {}, {}, mongoose__default.Document<unknown, {}, AdBookingType, {}, {}> & AdBookingType & Required<{
|
|
35
|
+
_id: string;
|
|
36
|
+
}> & {
|
|
37
|
+
__v: number;
|
|
38
|
+
}, any>;
|
|
39
|
+
|
|
40
|
+
type AdImpressionEntry = {
|
|
41
|
+
_id: string;
|
|
42
|
+
adId: string;
|
|
43
|
+
dayKey: string;
|
|
44
|
+
placement: EnumAdShowOn.FRONT_PAGE | EnumAdShowOn.MARKET_SEARCH;
|
|
45
|
+
recordedAt: Date;
|
|
46
|
+
viewerSlotKey: string;
|
|
47
|
+
};
|
|
48
|
+
declare const AdImpressionModel: mongoose__default.Model<AdImpressionEntry, {}, {}, {}, mongoose__default.Document<unknown, {}, AdImpressionEntry, {}, {}> & AdImpressionEntry & Required<{
|
|
49
|
+
_id: string;
|
|
50
|
+
}> & {
|
|
51
|
+
__v: number;
|
|
52
|
+
}, any>;
|
|
53
|
+
|
|
54
|
+
declare const DEFAULT_AD_SETTINGS: AdSettingsType;
|
|
55
|
+
declare const AdSettingsModel: mongoose__default.Model<AdSettingsType, {}, {}, {}, mongoose__default.Document<unknown, {}, AdSettingsType, {}, {}> & AdSettingsType & Required<{
|
|
56
|
+
_id: "default";
|
|
57
|
+
}> & {
|
|
58
|
+
__v: number;
|
|
59
|
+
}, any>;
|
|
60
|
+
|
|
18
61
|
type SchemaChatMessageReplyPreviewType = Omit<NonNullable<ChatMessageType["replyPreview"]>, "senderId"> & {
|
|
19
62
|
senderId: ObjectId;
|
|
20
63
|
};
|
|
@@ -584,6 +627,9 @@ type SchemaUserType = Omit<UserType, "vendor" | "coupon" | "events" | "partner"
|
|
|
584
627
|
type SchemaStripeSubscription = StripeSubscription & {
|
|
585
628
|
billingPeriod?: EnumBillingPeriod;
|
|
586
629
|
cancelAtPeriodEnd?: boolean;
|
|
630
|
+
paymentFailedAt?: Date;
|
|
631
|
+
paymentGracePeriodEndsAt?: Date;
|
|
632
|
+
paymentGraceSubscriptionId?: string;
|
|
587
633
|
pendingBillingPeriod?: EnumBillingPeriod;
|
|
588
634
|
pendingChangeEffectiveAt?: Date;
|
|
589
635
|
pendingPlan?: EnumUserLicence;
|
|
@@ -882,13 +928,14 @@ type AwardAffiliateVendorSubscriptionRewardsResult = {
|
|
|
882
928
|
* - `affiliateResources.resourceOwner` has a non-expired Standard / Pro / Pro+ vendor licence
|
|
883
929
|
*
|
|
884
930
|
* Reward type follows the owner's highest valid licence + Stripe paying status:
|
|
885
|
-
* - Pro / Pro+ with paying Stripe (ACTIVE
|
|
931
|
+
* - Pro / Pro+ with paying Stripe (ACTIVE) → `ACTIVE_VENDOR_PRO_SUBSCRIPTION` (3 pts)
|
|
886
932
|
* - Pro / Pro+ without paying Stripe → `ACTIVE_VENDOR_STANDARD_SUBSCRIPTION` (1 pt)
|
|
887
933
|
* - Standard → `ACTIVE_VENDOR_STANDARD_SUBSCRIPTION` (1 pt)
|
|
888
934
|
*
|
|
889
935
|
* Idempotent per affiliate + vendor + calendar month — a mid-month licence
|
|
890
936
|
* upgrade (Standard → paying Pro) takes effect from the following month.
|
|
891
|
-
* On successful
|
|
937
|
+
* On successful awards, sends the affiliate owner a single aggregated
|
|
938
|
+
* notification per run (best-effort).
|
|
892
939
|
*
|
|
893
940
|
* @param now - Reference time for month bounds and licence expiry (defaults to now).
|
|
894
941
|
* @returns Counts of awarded and skipped candidates.
|
|
@@ -1050,7 +1097,8 @@ type PayingStripeSubscriptionPlanResult = {
|
|
|
1050
1097
|
};
|
|
1051
1098
|
/**
|
|
1052
1099
|
* Returns the paying Stripe plan when `currentPlan` is any PRO plan
|
|
1053
|
-
* (event or vendor)
|
|
1100
|
+
* (event or vendor), the subscription is active, and its finite paid-through
|
|
1101
|
+
* `endDate` is later than `now`. Status alone does not establish paid access.
|
|
1054
1102
|
*/
|
|
1055
1103
|
declare function getPayingStripeSubscriptionPlan(userId: ObjectId | string, now?: Date): Promise<PayingStripeSubscriptionPlanResult>;
|
|
1056
1104
|
/**
|
|
@@ -1323,4 +1371,4 @@ declare function checkOwnerHasLicence({ userId, resourceType, }: {
|
|
|
1323
1371
|
resourceType: EnumResourceType;
|
|
1324
1372
|
}): Promise<void>;
|
|
1325
1373
|
|
|
1326
|
-
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, 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, sendDeactivationNotification, sendLicenseReminder, sendPushNotifications, sendReminderSafely, socialShareResourceSchema, syncUserLicencesAfterExpiry, termsAgreementSchema, updateAdStatuses, updateAllEventDateTimeStatuses, updateRelationDatesToUnavailable, updateSingleDateTimeStatus, upgradeUserToLicence, userLicenseSchema, vendorLicences, vendorOwnerHasProLicence, vendorProductTypeSchema };
|
|
1374
|
+
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, 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, 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, vendorLicences, vendorOwnerHasProLicence, vendorProductTypeSchema };
|