@timardex/cluemart-server-shared 1.1.0 → 1.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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
2
- import { AdType, CreateBulkNotificationInput, NotificationType, UserRoleEnumType, ChatMessageType, ChatParticipantType, ChatType, ReportChatUserType, RelatedPostType, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, ResourceContactDetailsType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, SocialShareResourceType, PosterUsageType, GoogleImportedMarket, PushTokenType, RelationType, ResourceActivityType, UserActivityEvent, UserType, NotificationResourceEnumType, RedeemedReward, StripeSubscription, VendorType, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, AppSettingsType, GameType, GameDocType, SchoolType, AffiliateRewardEnumType, AffiliateResourceType, AffiliateType, PromoCodeType, LicencesEnumType, EventListItemType, DateTimeWithPriceType } 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, VendorType, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, PostResource, AppSettingsType, GameType, GameDocType, SchoolType, AffiliateRewardType, AffiliateResourceType, AffiliateType, PromoCodeType, EnumAffiliateRewardType, EnumUserLicence, EventListItemType, DateTimeWithPriceType } 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';
@@ -8,21 +8,8 @@ import express from 'express';
8
8
  export { default as express } from 'express';
9
9
  import dayjs from 'dayjs';
10
10
 
11
- type SchemaAdType = Omit<AdType, "_id" | "end" | "start" | "createdAt" | "updatedAt"> & {
12
- _id: mongoose__default.Types.ObjectId;
13
- end: Date;
14
- start: Date;
15
- createdAt: Date;
16
- updatedAt: Date;
17
- };
18
- declare const AdModel: mongoose__default.Model<SchemaAdType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaAdType, {}, {}> & Omit<AdType, "_id" | "end" | "start" | "createdAt" | "updatedAt"> & {
19
- _id: mongoose__default.Types.ObjectId;
20
- end: Date;
21
- start: Date;
22
- createdAt: Date;
23
- updatedAt: Date;
24
- } & Required<{
25
- _id: mongoose__default.Types.ObjectId;
11
+ declare const AdModel: mongoose__default.Model<AdType, {}, {}, {}, mongoose__default.Document<unknown, {}, AdType, {}, {}> & AdType & Required<{
12
+ _id: string;
26
13
  }> & {
27
14
  __v: number;
28
15
  }, any>;
@@ -50,7 +37,7 @@ declare enum EnumPubSubEvents {
50
37
  }
51
38
  interface AuthUser {
52
39
  email: string;
53
- roles: UserRoleEnumType[];
40
+ roles: EnumUserRole[];
54
41
  userId: ObjectId;
55
42
  }
56
43
  interface SubscriptionPayload {
@@ -76,12 +63,10 @@ interface GraphQLContext {
76
63
  type SchemaChatMessageReplyPreviewType = Omit<NonNullable<ChatMessageType["replyPreview"]>, "senderId"> & {
77
64
  senderId: ObjectId;
78
65
  };
79
- type SchemaChatMessageReactionType = Omit<NonNullable<NonNullable<ChatMessageType["likedBy"]>[number]>, "userId" | "createdAt"> & {
80
- createdAt: Date;
66
+ type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number], "userId"> & {
81
67
  userId: ObjectId;
82
68
  };
83
- type SchemaChatMessageSeenType = Omit<NonNullable<NonNullable<ChatMessageType["seenBy"]>[number]>, "userId" | "seenAt"> & {
84
- seenAt: Date;
69
+ type SchemaChatMessageSeenType = Omit<NonNullable<ChatMessageType["seenBy"]>[number], "userId"> & {
85
70
  userId: ObjectId;
86
71
  };
87
72
  type SchemaChatMessageType = Omit<ChatMessageType, "senderId" | "replyToMessageId" | "replyPreview" | "likedBy" | "seenBy"> & {
@@ -91,7 +76,7 @@ type SchemaChatMessageType = Omit<ChatMessageType, "senderId" | "replyToMessageI
91
76
  likedBy?: SchemaChatMessageReactionType[];
92
77
  seenBy?: SchemaChatMessageSeenType[];
93
78
  };
94
- type SchemaParticipantType = Omit<ChatParticipantType, "userId"> & {
79
+ type SchemaParticipantType = Omit<ParticipantType, "userId"> & {
95
80
  userId: ObjectId;
96
81
  };
97
82
  type SchemaChatType = Omit<ChatType, "participants" | "messages"> & {
@@ -107,12 +92,12 @@ declare const ChatModel: mongoose__default.Model<SchemaChatType, {}, {}, {}, mon
107
92
  __v: number;
108
93
  }, any>;
109
94
 
110
- type SchemaChatReportType = Omit<ReportChatUserType, "reporterUserId" | "reportedUserId" | "chatId"> & {
95
+ type SchemaChatReportType = Omit<ReportChatUser, "reporterUserId" | "reportedUserId" | "chatId"> & {
111
96
  reporterUserId: ObjectId;
112
97
  reportedUserId: ObjectId;
113
98
  chatId: ObjectId;
114
99
  };
115
- declare const ChatReportModel: mongoose__default.Model<SchemaChatReportType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaChatReportType, {}, {}> & Omit<ReportChatUserType, "reporterUserId" | "reportedUserId" | "chatId"> & {
100
+ declare const ChatReportModel: mongoose__default.Model<SchemaChatReportType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaChatReportType, {}, {}> & Omit<ReportChatUser, "reporterUserId" | "reportedUserId" | "chatId"> & {
116
101
  reporterUserId: ObjectId;
117
102
  reportedUserId: ObjectId;
118
103
  chatId: ObjectId;
@@ -465,7 +450,7 @@ declare const GoogleImportedMarketModel: mongoose__default.Model<SchemaGoogleImp
465
450
  type SchemaPushTokenType = Omit<PushTokenType, "userId"> & {
466
451
  userId: ObjectId;
467
452
  };
468
- declare const PushTokenModel: mongoose__default.Model<SchemaPushTokenType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaPushTokenType, {}, {}> & Omit<_timardex_cluemart_shared.PushTokenDocument, "userId"> & {
453
+ declare const PushTokenModel: mongoose__default.Model<SchemaPushTokenType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaPushTokenType, {}, {}> & Omit<PushTokenType, "userId"> & {
469
454
  userId: ObjectId;
470
455
  } & Required<{
471
456
  _id: string;
@@ -524,28 +509,14 @@ declare const ResourceActivityModel: mongoose__default.Model<ResourceActivityTyp
524
509
  type SchemaUserActivityEvent = Omit<UserActivityEvent, "resourceId"> & {
525
510
  resourceId: ObjectId;
526
511
  };
527
- /**
528
- * Mongoose user document. GraphQL UserType is the redacted client shape
529
- * (ISO Date strings, no secrets). Persistence keeps JS Date + password /
530
- * refreshToken / emailSentFor. Dual-shape — do not collapse.
531
- */
532
- type SchemaUserType = Omit<UserType, "affiliate" | "createdAt" | "deletedAt" | "events" | "game" | "licences" | "partner" | "permissions" | "redeemedRewards" | "school" | "stripe" | "updatedAt" | "userActivity" | "vendor" | "_id"> & {
512
+ type SchemaUserType = Omit<UserType, "vendor" | "events" | "partner" | "userActivity" | "_id" | "game" | "school" | "affiliate" | "permissions"> & {
533
513
  _id: ObjectId;
534
- affiliate?: ObjectId;
535
- createdAt: Date;
536
- deletedAt?: Date | null;
537
- emailSentFor?: NotificationResourceEnumType[] | null;
538
- events?: ObjectId[];
539
- game?: ObjectId;
540
- licences?: UserLicenceType[] | null;
541
- partner?: ObjectId;
542
- password: string;
543
- redeemedRewards?: RedeemedReward[] | null;
544
- refreshToken?: string | null;
545
- school?: ObjectId;
546
- stripe?: StripeSubscription;
547
- updatedAt: Date;
548
- vendor?: ObjectId;
514
+ affiliate: ObjectId;
515
+ events: ObjectId[];
516
+ game: ObjectId;
517
+ partner: ObjectId;
518
+ school: ObjectId;
519
+ vendor: ObjectId;
549
520
  userActivity: {
550
521
  favourites: {
551
522
  events: ObjectId[];
@@ -563,23 +534,14 @@ type SchemaUserType = Omit<UserType, "affiliate" | "createdAt" | "deletedAt" | "
563
534
  };
564
535
  };
565
536
  };
566
- declare const UserModel: mongoose__default.Model<SchemaUserType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaUserType, {}, {}> & Omit<UserType, "_id" | "createdAt" | "updatedAt" | "deletedAt" | "affiliate" | "events" | "game" | "licences" | "partner" | "permissions" | "redeemedRewards" | "school" | "stripe" | "userActivity" | "vendor"> & {
537
+ declare const UserModel: mongoose__default.Model<SchemaUserType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaUserType, {}, {}> & Omit<UserType, "_id" | "vendor" | "events" | "partner" | "userActivity" | "game" | "school" | "affiliate" | "permissions"> & {
567
538
  _id: ObjectId;
568
- affiliate?: ObjectId;
569
- createdAt: Date;
570
- deletedAt?: Date | null;
571
- emailSentFor?: NotificationResourceEnumType[] | null;
572
- events?: ObjectId[];
573
- game?: ObjectId;
574
- licences?: UserLicenceType[] | null;
575
- partner?: ObjectId;
576
- password: string;
577
- redeemedRewards?: RedeemedReward[] | null;
578
- refreshToken?: string | null;
579
- school?: ObjectId;
580
- stripe?: StripeSubscription;
581
- updatedAt: Date;
582
- vendor?: ObjectId;
539
+ affiliate: ObjectId;
540
+ events: ObjectId[];
541
+ game: ObjectId;
542
+ partner: ObjectId;
543
+ school: ObjectId;
544
+ vendor: ObjectId;
583
545
  userActivity: {
584
546
  favourites: {
585
547
  events: ObjectId[];
@@ -606,7 +568,6 @@ interface VerificationTokenType {
606
568
  email: string;
607
569
  verificationToken: string;
608
570
  createdAt: Date;
609
- updatedAt: Date;
610
571
  }
611
572
  declare const VerificationTokenModel: mongoose__default.Model<VerificationTokenType, {}, {}, {}, mongoose__default.Document<unknown, {}, VerificationTokenType, {}, {}> & VerificationTokenType & {
612
573
  _id: mongoose__default.Types.ObjectId;
@@ -614,43 +575,27 @@ declare const VerificationTokenModel: mongoose__default.Model<VerificationTokenT
614
575
  __v: number;
615
576
  }, any>;
616
577
 
617
- /**
618
- * Mongoose vendor document. GraphQL `Date` is an ISO string at the wire;
619
- * documents store JS Date. Dual-shape vs generated VendorType — do not collapse.
620
- */
621
- type SchemaVendorType = Omit<VendorType, "adIds" | "approvedAt" | "createdAt" | "deletedAt" | "owner" | "unregisteredVendorId" | "updatedAt" | "vendorInfoId"> & {
578
+ type SchemaVendorType = Omit<VendorType, "vendorInfoId" | "owner" | "adIds" | "unregisteredVendorId"> & {
622
579
  adIds?: ObjectId[];
623
- approvedAt?: Date | null;
624
- createdAt: Date;
625
- deletedAt?: Date | null;
626
580
  owner: SchemaOwnerType;
581
+ vendorInfoId: ObjectId;
627
582
  unregisteredVendorId?: ObjectId | null;
628
- updatedAt: Date;
629
- vendorInfoId?: ObjectId;
630
583
  };
631
- declare const VendorModel: mongoose__default.Model<SchemaVendorType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaVendorType, {}, {}> & Omit<VendorType, "createdAt" | "updatedAt" | "deletedAt" | "approvedAt" | "adIds" | "owner" | "unregisteredVendorId" | "vendorInfoId"> & {
584
+ declare const VendorModel: mongoose__default.Model<SchemaVendorType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaVendorType, {}, {}> & Omit<VendorType, "adIds" | "owner" | "vendorInfoId" | "unregisteredVendorId"> & {
632
585
  adIds?: ObjectId[];
633
- approvedAt?: Date | null;
634
- createdAt: Date;
635
- deletedAt?: Date | null;
636
586
  owner: SchemaOwnerType;
587
+ vendorInfoId: ObjectId;
637
588
  unregisteredVendorId?: ObjectId | null;
638
- updatedAt: Date;
639
- vendorInfoId?: ObjectId;
640
589
  } & Required<{
641
590
  _id: string;
642
591
  }> & {
643
592
  __v: number;
644
593
  }, any>;
645
594
 
646
- type SchemaVendorInfoType = Omit<VendorInfoType, "vendorId" | "createdAt" | "updatedAt"> & {
647
- createdAt: Date;
648
- updatedAt: Date;
595
+ type SchemaVendorInfoType = Omit<VendorInfoType, "vendorId"> & {
649
596
  vendorId: ObjectId;
650
597
  };
651
- declare const VendorInfoModel: mongoose__default.Model<SchemaVendorInfoType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaVendorInfoType, {}, {}> & Omit<VendorInfoType, "createdAt" | "updatedAt" | "vendorId"> & {
652
- createdAt: Date;
653
- updatedAt: Date;
598
+ declare const VendorInfoModel: mongoose__default.Model<SchemaVendorInfoType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaVendorInfoType, {}, {}> & Omit<VendorInfoType, "vendorId"> & {
654
599
  vendorId: ObjectId;
655
600
  } & Required<{
656
601
  _id: string;
@@ -661,52 +606,28 @@ declare const VendorInfoModel: mongoose__default.Model<SchemaVendorInfoType, {},
661
606
  type SchemaUnregisteredVendorInvitationType = Omit<UnregisteredVendorInvitationType, "inviterId"> & {
662
607
  inviterId: ObjectId;
663
608
  };
664
- /**
665
- * Mongoose unregistered-vendor document. GraphQL `Date` is an ISO string at
666
- * the wire; documents store JS Date. Dual-shape — do not collapse.
667
- */
668
- type SchemaUnregisteredVendorType = Omit<UnregisteredVendorType, "claimedAt" | "claimedByUserId" | "createdAt" | "deletedAt" | "invitations" | "updatedAt"> & {
669
- claimedAt?: Date | null;
670
- claimedByUserId?: mongoose__default.Types.ObjectId;
671
- createdAt: Date;
672
- deletedAt?: Date | null;
609
+ type SchemaUnregisteredVendorType = Omit<UnregisteredVendorType, "invitations" | "claimedByUserId"> & {
673
610
  invitations: SchemaUnregisteredVendorInvitationType[];
674
- updatedAt: Date;
675
- };
676
- declare const UnregisteredVendorModel: mongoose__default.Model<SchemaUnregisteredVendorType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaUnregisteredVendorType, {}, {}> & Omit<UnregisteredVendorType, "createdAt" | "updatedAt" | "deletedAt" | "claimedByUserId" | "claimedAt" | "invitations"> & {
677
- claimedAt?: Date | null;
678
611
  claimedByUserId?: mongoose__default.Types.ObjectId;
679
- createdAt: Date;
680
- deletedAt?: Date | null;
612
+ };
613
+ declare const UnregisteredVendorModel: mongoose__default.Model<SchemaUnregisteredVendorType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaUnregisteredVendorType, {}, {}> & Omit<UnregisteredVendorType, "claimedByUserId" | "invitations"> & {
681
614
  invitations: SchemaUnregisteredVendorInvitationType[];
682
- updatedAt: Date;
615
+ claimedByUserId?: mongoose__default.Types.ObjectId;
683
616
  } & Required<{
684
617
  _id: string;
685
618
  }> & {
686
619
  __v: number;
687
620
  }, any>;
688
621
 
689
- /**
690
- * Mongoose event document. GraphQL `Date` is an ISO string at the wire;
691
- * documents store JS Date. Dual-shape vs generated EventType — do not collapse.
692
- */
693
- type SchemaEventType = Omit<EventType, "adIds" | "approvedAt" | "createdAt" | "deletedAt" | "eventInfoId" | "owner" | "updatedAt"> & {
622
+ type SchemaEventType = Omit<EventType, "eventInfoId" | "owner" | "adIds"> & {
694
623
  adIds?: ObjectId[];
695
- approvedAt?: Date | null;
696
- createdAt: Date;
697
- deletedAt?: Date | null;
698
- eventInfoId?: ObjectId;
624
+ eventInfoId: ObjectId;
699
625
  owner: SchemaOwnerType;
700
- updatedAt: Date;
701
626
  };
702
- declare const EventModel: mongoose__default.Model<SchemaEventType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaEventType, {}, {}> & Omit<EventType, "createdAt" | "updatedAt" | "deletedAt" | "approvedAt" | "adIds" | "owner" | "eventInfoId"> & {
627
+ declare const EventModel: mongoose__default.Model<SchemaEventType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaEventType, {}, {}> & Omit<EventType, "adIds" | "eventInfoId" | "owner"> & {
703
628
  adIds?: ObjectId[];
704
- approvedAt?: Date | null;
705
- createdAt: Date;
706
- deletedAt?: Date | null;
707
- eventInfoId?: ObjectId;
629
+ eventInfoId: ObjectId;
708
630
  owner: SchemaOwnerType;
709
- updatedAt: Date;
710
631
  } & Required<{
711
632
  _id: string;
712
633
  }> & {
@@ -731,40 +652,24 @@ declare const refundPolicySchema: mongoose__default.Schema<RefundPolicy, mongoos
731
652
  } & {
732
653
  __v: number;
733
654
  }>;
734
- type SchemaEventInfoType = Omit<EventInfoType, "eventId" | "createdAt" | "updatedAt"> & {
735
- createdAt: Date;
655
+ type SchemaEventInfoType = Omit<EventInfoType, "eventId"> & {
736
656
  eventId: ObjectId;
737
- updatedAt: Date;
738
657
  };
739
- declare const EventInfoModel: mongoose__default.Model<SchemaEventInfoType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaEventInfoType, {}, {}> & Omit<EventInfoType, "createdAt" | "updatedAt" | "eventId"> & {
740
- createdAt: Date;
658
+ declare const EventInfoModel: mongoose__default.Model<SchemaEventInfoType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaEventInfoType, {}, {}> & Omit<EventInfoType, "eventId"> & {
741
659
  eventId: ObjectId;
742
- updatedAt: Date;
743
660
  } & Required<{
744
661
  _id: string;
745
662
  }> & {
746
663
  __v: number;
747
664
  }, any>;
748
665
 
749
- /**
750
- * Mongoose partner document. GraphQL `Date` is an ISO string at the wire;
751
- * documents store JS Date. Dual-shape vs generated PartnerType — do not collapse.
752
- */
753
- type SchemaPartnerType = Omit<PartnerType, "adIds" | "approvedAt" | "createdAt" | "deletedAt" | "owner" | "updatedAt"> & {
666
+ type SchemaPartnerType = Omit<PartnerType, "owner" | "adIds"> & {
754
667
  adIds?: ObjectId[];
755
- approvedAt?: Date | null;
756
- createdAt: Date;
757
- deletedAt?: Date | null;
758
668
  owner: SchemaOwnerType;
759
- updatedAt: Date;
760
669
  };
761
- declare const PartnerModel: mongoose__default.Model<SchemaPartnerType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaPartnerType, {}, {}> & Omit<PartnerType, "createdAt" | "updatedAt" | "deletedAt" | "approvedAt" | "adIds" | "owner"> & {
670
+ declare const PartnerModel: mongoose__default.Model<SchemaPartnerType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaPartnerType, {}, {}> & Omit<PartnerType, "adIds" | "owner"> & {
762
671
  adIds?: ObjectId[];
763
- approvedAt?: Date | null;
764
- createdAt: Date;
765
- deletedAt?: Date | null;
766
672
  owner: SchemaOwnerType;
767
- updatedAt: Date;
768
673
  } & Required<{
769
674
  _id: string;
770
675
  }> & {
@@ -772,7 +677,17 @@ declare const PartnerModel: mongoose__default.Model<SchemaPartnerType, {}, {}, {
772
677
  }, any>;
773
678
 
774
679
  type SchemaPostType = PostType;
775
- declare const PostModel: mongoose__default.Model<PostType, {}, {}, {}, mongoose__default.Document<unknown, {}, PostType, {}, {}> & PostType & Required<{
680
+ declare const PostModel: mongoose__default.Model<PostType, {}, {}, {}, mongoose__default.Document<unknown, {}, PostType, {}, {}> & Omit<_timardex_cluemart_shared.PostFormData, "resource" | "content" | "coverUpload"> & {
681
+ _id: string;
682
+ approvedAt?: Date | null;
683
+ content: PostContentType[];
684
+ createdAt: Date;
685
+ deletedAt: Date | null;
686
+ resource?: PostResource | null;
687
+ slug: string;
688
+ sharePublic?: _timardex_cluemart_shared.SocialShareResourceType | null;
689
+ updatedAt: Date | null;
690
+ } & Required<{
776
691
  _id: string;
777
692
  }> & {
778
693
  __v: number;
@@ -801,80 +716,25 @@ declare const GameModel: mongoose__default.Model<GameDocType, {}, {}, {}, mongoo
801
716
  __v: number;
802
717
  }, any>;
803
718
 
804
- /** Persistence campaign dates are JS Date; GraphQL SchoolCampaignType uses ISO strings. */
805
- type SchemaSchoolCampaign = {
806
- endDate: Date;
807
- name: string;
808
- startDate: Date;
809
- };
810
- /**
811
- * Mongoose school document. GraphQL `Date` is an ISO string at the wire;
812
- * documents store JS Date. Dual-shape vs generated SchoolType — do not collapse.
813
- */
814
- type SchemaSchoolType = Omit<SchoolType, "approvedAt" | "campaigns" | "createdAt" | "deletedAt" | "owner" | "ranking" | "updatedAt"> & {
815
- approvedAt?: Date | null;
816
- campaigns?: SchemaSchoolCampaign[];
817
- createdAt: Date;
818
- deletedAt?: Date | null;
819
- owner: SchemaOwnerType;
820
- updatedAt: Date;
821
- };
822
- declare const SchoolModel: mongoose__default.Model<SchemaSchoolType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaSchoolType, {}, {}> & Omit<SchoolType, "createdAt" | "updatedAt" | "deletedAt" | "approvedAt" | "owner" | "campaigns" | "ranking"> & {
823
- approvedAt?: Date | null;
824
- campaigns?: SchemaSchoolCampaign[];
825
- createdAt: Date;
826
- deletedAt?: Date | null;
827
- owner: SchemaOwnerType;
828
- updatedAt: Date;
829
- } & Required<{
719
+ type SchoolDocument = Omit<SchoolType, "ranking">;
720
+ declare const SchoolModel: mongoose__default.Model<SchoolDocument, {}, {}, {}, mongoose__default.Document<unknown, {}, SchoolDocument, {}, {}> & SchoolDocument & Required<{
830
721
  _id: string;
831
722
  }> & {
832
723
  __v: number;
833
724
  }, any>;
834
725
 
835
- /** Persistence reward dates are JS Date; GraphQL AffiliateRewardType uses ISO strings. */
836
- type SchemaAffiliateReward = {
837
- createdAt: Date;
838
- redeemedAt?: Date | null;
839
- rewardDescription: string;
840
- rewardType: AffiliateRewardEnumType;
841
- rewardValue: number;
842
- };
843
- type SchemaAffiliateResourceType = Omit<AffiliateResourceType, "resourceDeletedAt" | "resourceId" | "resourceOwner" | "rewards"> & {
844
- resourceDeletedAt?: Date | null;
726
+ type SchemaAffiliateReward = AffiliateRewardType;
727
+ type SchemaAffiliateResourceType = Omit<AffiliateResourceType, "resourceId" | "resourceOwner"> & {
845
728
  resourceId: ObjectId;
846
729
  resourceOwner: SchemaOwnerType;
847
- rewards?: SchemaAffiliateReward[];
848
730
  };
849
- /** Persistence redeem-history dates are JS Date; GraphQL RedeemHistoryType uses ISO strings. */
850
- type SchemaRedeemHistory = {
851
- paidAt?: Date | null;
852
- redeemedAt: Date;
853
- rewardValue: number;
854
- };
855
- /**
856
- * Mongoose affiliate document. GraphQL `Date` is an ISO string at the wire;
857
- * documents store JS Date. Dual-shape vs generated AffiliateType — do not collapse.
858
- */
859
- type SchemaAffiliateType = Omit<AffiliateType, "_id" | "affiliateBonusRewards" | "affiliateResources" | "approvedAt" | "createdAt" | "deletedAt" | "owner" | "redeemHistory" | "updatedAt"> & {
860
- affiliateBonusRewards?: SchemaAffiliateReward[];
731
+ type AffiliateDocument = Omit<AffiliateType, "_id" | "owner" | "affiliateResources"> & {
861
732
  affiliateResources: SchemaAffiliateResourceType[];
862
- approvedAt?: Date | null;
863
- createdAt: Date;
864
- deletedAt?: Date | null;
865
733
  owner: SchemaOwnerType;
866
- redeemHistory?: SchemaRedeemHistory[];
867
- updatedAt: Date;
868
734
  };
869
- declare const AffiliateModel: mongoose__default.Model<SchemaAffiliateType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaAffiliateType, {}, {}> & Omit<AffiliateType, "_id" | "createdAt" | "updatedAt" | "deletedAt" | "approvedAt" | "owner" | "affiliateBonusRewards" | "affiliateResources" | "redeemHistory"> & {
870
- affiliateBonusRewards?: SchemaAffiliateReward[];
735
+ declare const AffiliateModel: mongoose__default.Model<AffiliateDocument, {}, {}, {}, mongoose__default.Document<unknown, {}, AffiliateDocument, {}, {}> & Omit<AffiliateType, "_id" | "owner" | "affiliateResources"> & {
871
736
  affiliateResources: SchemaAffiliateResourceType[];
872
- approvedAt?: Date | null;
873
- createdAt: Date;
874
- deletedAt?: Date | null;
875
737
  owner: SchemaOwnerType;
876
- redeemHistory?: SchemaRedeemHistory[];
877
- updatedAt: Date;
878
738
  } & {
879
739
  _id: mongoose__default.Types.ObjectId;
880
740
  } & {
@@ -928,19 +788,12 @@ declare function awardAffiliateVendorSubscriptionRewards(now?: Date): Promise<Aw
928
788
  * @param promoCode - Normalized affiliate promo code to resolve.
929
789
  * @returns The matching affiliate document, or `null` when not found.
930
790
  */
931
- declare function findAffiliateByPromoCode(promoCode: PromoCodeType): Promise<(mongoose.Document<unknown, {}, SchemaAffiliateType, {}, {}> & Omit<_timardex_cluemart_shared.AffiliateType, "_id" | "createdAt" | "updatedAt" | "deletedAt" | "approvedAt" | "owner" | "affiliateBonusRewards" | "affiliateResources" | "redeemHistory"> & {
932
- affiliateBonusRewards?: SchemaAffiliateReward[];
791
+ declare function findAffiliateByPromoCode(promoCode: PromoCodeType): Promise<(mongoose.Document<unknown, {}, Omit<_timardex_cluemart_shared.AffiliateType, "_id" | "owner" | "affiliateResources"> & {
792
+ affiliateResources: SchemaAffiliateResourceType[];
793
+ owner: SchemaOwnerType;
794
+ }, {}, {}> & Omit<_timardex_cluemart_shared.AffiliateType, "_id" | "owner" | "affiliateResources"> & {
933
795
  affiliateResources: SchemaAffiliateResourceType[];
934
- approvedAt?: Date | null;
935
- createdAt: Date;
936
- deletedAt?: Date | null;
937
796
  owner: SchemaOwnerType;
938
- redeemHistory?: {
939
- paidAt?: Date | null;
940
- redeemedAt: Date;
941
- rewardValue: number;
942
- }[];
943
- updatedAt: Date;
944
797
  } & {
945
798
  _id: mongoose.Types.ObjectId;
946
799
  } & {
@@ -963,7 +816,7 @@ declare function normalizeAffiliatePromoCodes(promoCodes: PromoCodeType[] | null
963
816
  * otherwise falls back to the Standard subscription reward.
964
817
  * Returns `null` when no non-expired vendor licence applies.
965
818
  */
966
- declare function mapVendorLicenceToSubscriptionRewardType(licences: UserLicenceType[] | null | undefined, now?: Date, stripe?: UserType["stripe"] | null): AffiliateRewardEnumType | null;
819
+ declare function mapVendorLicenceToSubscriptionRewardType(licences: UserLicenceType[] | null | undefined, now?: Date, stripe?: UserType["stripe"] | null): EnumAffiliateRewardType | null;
967
820
  /** Inclusive start / exclusive end of the UTC calendar month containing `now`. */
968
821
  declare function getSubscriptionRewardPeriodBounds(now?: Date): {
969
822
  periodEnd: Date;
@@ -1025,7 +878,7 @@ declare function sendPushNotifications({ data, message, title, userIds, }: Schem
1025
878
  */
1026
879
  declare function updateAdStatuses(): Promise<void>;
1027
880
 
1028
- declare function updateVendorBasedOnUserLicense(userId: ObjectId, licenceType: LicencesEnumType): Promise<void>;
881
+ declare function updateVendorBasedOnUserLicense(userId: ObjectId, licenceType: EnumUserLicence): Promise<void>;
1029
882
 
1030
883
  /**
1031
884
  * True when `value` is a valid Mongo ObjectId string.
@@ -1071,4 +924,4 @@ declare function didRemoveAnyEventDates(previousDateTime: EventDateSlot[] | unde
1071
924
  */
1072
925
  declare function updateRelationDatesToUnavailable(relationDates: SchemaRelationType["relationDates"], eventDateTime: DateTimeWithPriceType[] | undefined): SchemaRelationType["relationDates"];
1073
926
 
1074
- export { ACTIVE_NOT_DELETED_FILTER, APP_SETTINGS_ID, AdModel, AffiliateModel, AppSettingModel, type AuthUser, type AwardAffiliateVendorSubscriptionRewardsResult, CategorySchema, ChatModel, ChatReportModel, ContactDetailsSchema, EnumPubSubEvents, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, type GraphQLContext, NotificationModel, type NotificationPubSub, type ObjectId, OwnerTypeSchema, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, type SchemaAdType, type SchemaAffiliateResourceType, type SchemaAffiliateReward, type SchemaAffiliateType, 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 SchemaSchoolType, 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, connectToDatabase, convertObjectIdsToStrings, dateTimeSchema, didRemoveAnyEventDates, findAffiliateByPromoCode, findEventOrImportedMarketById, getSubscriptionRewardPeriodBounds, isValidObjectId, locationGeoSchema, locationsSchema, mapVendorLicenceToSubscriptionRewardType, normalizeAffiliatePromoCodes, normalizePromoCode, notifyUsers, publishNotificationEvents, refundPolicySchema, relatedPostSchema, relationDatesSchema, resourceRelationsSchema, saveNotificationsInDb, sendPushNotifications, socialShareResourceSchema, termsAgreementSchema, updateAdStatuses, updateAllEventDateTimeStatuses, updateRelationDatesToUnavailable, updateSingleDateTimeStatus, updateVendorBasedOnUserLicense, userLicenseSchema };
927
+ export { ACTIVE_NOT_DELETED_FILTER, APP_SETTINGS_ID, AdModel, AffiliateModel, AppSettingModel, type AuthUser, type AwardAffiliateVendorSubscriptionRewardsResult, CategorySchema, ChatModel, ChatReportModel, ContactDetailsSchema, EnumPubSubEvents, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, type GraphQLContext, NotificationModel, type NotificationPubSub, type ObjectId, OwnerTypeSchema, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, 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, connectToDatabase, convertObjectIdsToStrings, dateTimeSchema, didRemoveAnyEventDates, findAffiliateByPromoCode, findEventOrImportedMarketById, getSubscriptionRewardPeriodBounds, isValidObjectId, locationGeoSchema, locationsSchema, mapVendorLicenceToSubscriptionRewardType, normalizeAffiliatePromoCodes, normalizePromoCode, notifyUsers, publishNotificationEvents, refundPolicySchema, relatedPostSchema, relationDatesSchema, resourceRelationsSchema, saveNotificationsInDb, sendPushNotifications, socialShareResourceSchema, termsAgreementSchema, updateAdStatuses, updateAllEventDateTimeStatuses, updateRelationDatesToUnavailable, updateSingleDateTimeStatus, updateVendorBasedOnUserLicense, userLicenseSchema };