@timardex/cluemart-server-shared 1.0.310 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
2
- import { AdType, CreateBulkNotificationInput, NotificationType, EnumUserRole, ChatMessageType, ParticipantType, ChatType, ReportChatUser, RelatedPostType, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, ResourceContactDetailsType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, SocialShareResourceType, PosterUsageType, GoogleImportedMarket, PushTokenType, RelationType, ResourceActivityType, UserActivityEvent, UserType, 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';
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';
3
3
  import * as mongoose from 'mongoose';
4
4
  import mongoose__default from 'mongoose';
5
5
  export { default as mongoose } from 'mongoose';
@@ -8,8 +8,21 @@ import express from 'express';
8
8
  export { default as express } from 'express';
9
9
  import dayjs from 'dayjs';
10
10
 
11
- declare const AdModel: mongoose__default.Model<AdType, {}, {}, {}, mongoose__default.Document<unknown, {}, AdType, {}, {}> & AdType & Required<{
12
- _id: string;
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;
13
26
  }> & {
14
27
  __v: number;
15
28
  }, any>;
@@ -37,7 +50,7 @@ declare enum EnumPubSubEvents {
37
50
  }
38
51
  interface AuthUser {
39
52
  email: string;
40
- roles: EnumUserRole[];
53
+ roles: UserRoleEnumType[];
41
54
  userId: ObjectId;
42
55
  }
43
56
  interface SubscriptionPayload {
@@ -63,10 +76,12 @@ interface GraphQLContext {
63
76
  type SchemaChatMessageReplyPreviewType = Omit<NonNullable<ChatMessageType["replyPreview"]>, "senderId"> & {
64
77
  senderId: ObjectId;
65
78
  };
66
- type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number], "userId"> & {
79
+ type SchemaChatMessageReactionType = Omit<NonNullable<NonNullable<ChatMessageType["likedBy"]>[number]>, "userId" | "createdAt"> & {
80
+ createdAt: Date;
67
81
  userId: ObjectId;
68
82
  };
69
- type SchemaChatMessageSeenType = Omit<NonNullable<ChatMessageType["seenBy"]>[number], "userId"> & {
83
+ type SchemaChatMessageSeenType = Omit<NonNullable<NonNullable<ChatMessageType["seenBy"]>[number]>, "userId" | "seenAt"> & {
84
+ seenAt: Date;
70
85
  userId: ObjectId;
71
86
  };
72
87
  type SchemaChatMessageType = Omit<ChatMessageType, "senderId" | "replyToMessageId" | "replyPreview" | "likedBy" | "seenBy"> & {
@@ -76,7 +91,7 @@ type SchemaChatMessageType = Omit<ChatMessageType, "senderId" | "replyToMessageI
76
91
  likedBy?: SchemaChatMessageReactionType[];
77
92
  seenBy?: SchemaChatMessageSeenType[];
78
93
  };
79
- type SchemaParticipantType = Omit<ParticipantType, "userId"> & {
94
+ type SchemaParticipantType = Omit<ChatParticipantType, "userId"> & {
80
95
  userId: ObjectId;
81
96
  };
82
97
  type SchemaChatType = Omit<ChatType, "participants" | "messages"> & {
@@ -92,12 +107,12 @@ declare const ChatModel: mongoose__default.Model<SchemaChatType, {}, {}, {}, mon
92
107
  __v: number;
93
108
  }, any>;
94
109
 
95
- type SchemaChatReportType = Omit<ReportChatUser, "reporterUserId" | "reportedUserId" | "chatId"> & {
110
+ type SchemaChatReportType = Omit<ReportChatUserType, "reporterUserId" | "reportedUserId" | "chatId"> & {
96
111
  reporterUserId: ObjectId;
97
112
  reportedUserId: ObjectId;
98
113
  chatId: ObjectId;
99
114
  };
100
- declare const ChatReportModel: mongoose__default.Model<SchemaChatReportType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaChatReportType, {}, {}> & Omit<ReportChatUser, "reporterUserId" | "reportedUserId" | "chatId"> & {
115
+ declare const ChatReportModel: mongoose__default.Model<SchemaChatReportType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaChatReportType, {}, {}> & Omit<ReportChatUserType, "reporterUserId" | "reportedUserId" | "chatId"> & {
101
116
  reporterUserId: ObjectId;
102
117
  reportedUserId: ObjectId;
103
118
  chatId: ObjectId;
@@ -450,7 +465,7 @@ declare const GoogleImportedMarketModel: mongoose__default.Model<SchemaGoogleImp
450
465
  type SchemaPushTokenType = Omit<PushTokenType, "userId"> & {
451
466
  userId: ObjectId;
452
467
  };
453
- declare const PushTokenModel: mongoose__default.Model<SchemaPushTokenType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaPushTokenType, {}, {}> & Omit<PushTokenType, "userId"> & {
468
+ declare const PushTokenModel: mongoose__default.Model<SchemaPushTokenType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaPushTokenType, {}, {}> & Omit<_timardex_cluemart_shared.PushTokenDocument, "userId"> & {
454
469
  userId: ObjectId;
455
470
  } & Required<{
456
471
  _id: string;
@@ -509,14 +524,28 @@ declare const ResourceActivityModel: mongoose__default.Model<ResourceActivityTyp
509
524
  type SchemaUserActivityEvent = Omit<UserActivityEvent, "resourceId"> & {
510
525
  resourceId: ObjectId;
511
526
  };
512
- type SchemaUserType = Omit<UserType, "vendor" | "events" | "partner" | "userActivity" | "_id" | "game" | "school" | "affiliate" | "permissions"> & {
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"> & {
513
533
  _id: ObjectId;
514
- affiliate: ObjectId;
515
- events: ObjectId[];
516
- game: ObjectId;
517
- partner: ObjectId;
518
- school: ObjectId;
519
- vendor: 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;
520
549
  userActivity: {
521
550
  favourites: {
522
551
  events: ObjectId[];
@@ -534,14 +563,23 @@ type SchemaUserType = Omit<UserType, "vendor" | "events" | "partner" | "userActi
534
563
  };
535
564
  };
536
565
  };
537
- declare const UserModel: mongoose__default.Model<SchemaUserType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaUserType, {}, {}> & Omit<UserType, "_id" | "vendor" | "events" | "partner" | "userActivity" | "game" | "school" | "affiliate" | "permissions"> & {
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"> & {
538
567
  _id: ObjectId;
539
- affiliate: ObjectId;
540
- events: ObjectId[];
541
- game: ObjectId;
542
- partner: ObjectId;
543
- school: ObjectId;
544
- vendor: 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;
545
583
  userActivity: {
546
584
  favourites: {
547
585
  events: ObjectId[];
@@ -568,6 +606,7 @@ interface VerificationTokenType {
568
606
  email: string;
569
607
  verificationToken: string;
570
608
  createdAt: Date;
609
+ updatedAt: Date;
571
610
  }
572
611
  declare const VerificationTokenModel: mongoose__default.Model<VerificationTokenType, {}, {}, {}, mongoose__default.Document<unknown, {}, VerificationTokenType, {}, {}> & VerificationTokenType & {
573
612
  _id: mongoose__default.Types.ObjectId;
@@ -575,27 +614,43 @@ declare const VerificationTokenModel: mongoose__default.Model<VerificationTokenT
575
614
  __v: number;
576
615
  }, any>;
577
616
 
578
- type SchemaVendorType = Omit<VendorType, "vendorInfoId" | "owner" | "adIds" | "unregisteredVendorId"> & {
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"> & {
579
622
  adIds?: ObjectId[];
623
+ approvedAt?: Date | null;
624
+ createdAt: Date;
625
+ deletedAt?: Date | null;
580
626
  owner: SchemaOwnerType;
581
- vendorInfoId: ObjectId;
582
627
  unregisteredVendorId?: ObjectId | null;
628
+ updatedAt: Date;
629
+ vendorInfoId?: ObjectId;
583
630
  };
584
- declare const VendorModel: mongoose__default.Model<SchemaVendorType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaVendorType, {}, {}> & Omit<VendorType, "adIds" | "owner" | "vendorInfoId" | "unregisteredVendorId"> & {
631
+ declare const VendorModel: mongoose__default.Model<SchemaVendorType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaVendorType, {}, {}> & Omit<VendorType, "createdAt" | "updatedAt" | "deletedAt" | "approvedAt" | "adIds" | "owner" | "unregisteredVendorId" | "vendorInfoId"> & {
585
632
  adIds?: ObjectId[];
633
+ approvedAt?: Date | null;
634
+ createdAt: Date;
635
+ deletedAt?: Date | null;
586
636
  owner: SchemaOwnerType;
587
- vendorInfoId: ObjectId;
588
637
  unregisteredVendorId?: ObjectId | null;
638
+ updatedAt: Date;
639
+ vendorInfoId?: ObjectId;
589
640
  } & Required<{
590
641
  _id: string;
591
642
  }> & {
592
643
  __v: number;
593
644
  }, any>;
594
645
 
595
- type SchemaVendorInfoType = Omit<VendorInfoType, "vendorId"> & {
646
+ type SchemaVendorInfoType = Omit<VendorInfoType, "vendorId" | "createdAt" | "updatedAt"> & {
647
+ createdAt: Date;
648
+ updatedAt: Date;
596
649
  vendorId: ObjectId;
597
650
  };
598
- declare const VendorInfoModel: mongoose__default.Model<SchemaVendorInfoType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaVendorInfoType, {}, {}> & Omit<VendorInfoType, "vendorId"> & {
651
+ declare const VendorInfoModel: mongoose__default.Model<SchemaVendorInfoType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaVendorInfoType, {}, {}> & Omit<VendorInfoType, "createdAt" | "updatedAt" | "vendorId"> & {
652
+ createdAt: Date;
653
+ updatedAt: Date;
599
654
  vendorId: ObjectId;
600
655
  } & Required<{
601
656
  _id: string;
@@ -606,28 +661,52 @@ declare const VendorInfoModel: mongoose__default.Model<SchemaVendorInfoType, {},
606
661
  type SchemaUnregisteredVendorInvitationType = Omit<UnregisteredVendorInvitationType, "inviterId"> & {
607
662
  inviterId: ObjectId;
608
663
  };
609
- type SchemaUnregisteredVendorType = Omit<UnregisteredVendorType, "invitations" | "claimedByUserId"> & {
610
- invitations: SchemaUnregisteredVendorInvitationType[];
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;
611
670
  claimedByUserId?: mongoose__default.Types.ObjectId;
612
- };
613
- declare const UnregisteredVendorModel: mongoose__default.Model<SchemaUnregisteredVendorType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaUnregisteredVendorType, {}, {}> & Omit<UnregisteredVendorType, "claimedByUserId" | "invitations"> & {
671
+ createdAt: Date;
672
+ deletedAt?: Date | null;
614
673
  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;
615
678
  claimedByUserId?: mongoose__default.Types.ObjectId;
679
+ createdAt: Date;
680
+ deletedAt?: Date | null;
681
+ invitations: SchemaUnregisteredVendorInvitationType[];
682
+ updatedAt: Date;
616
683
  } & Required<{
617
684
  _id: string;
618
685
  }> & {
619
686
  __v: number;
620
687
  }, any>;
621
688
 
622
- type SchemaEventType = Omit<EventType, "eventInfoId" | "owner" | "adIds"> & {
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"> & {
623
694
  adIds?: ObjectId[];
624
- eventInfoId: ObjectId;
695
+ approvedAt?: Date | null;
696
+ createdAt: Date;
697
+ deletedAt?: Date | null;
698
+ eventInfoId?: ObjectId;
625
699
  owner: SchemaOwnerType;
700
+ updatedAt: Date;
626
701
  };
627
- declare const EventModel: mongoose__default.Model<SchemaEventType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaEventType, {}, {}> & Omit<EventType, "adIds" | "eventInfoId" | "owner"> & {
702
+ declare const EventModel: mongoose__default.Model<SchemaEventType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaEventType, {}, {}> & Omit<EventType, "createdAt" | "updatedAt" | "deletedAt" | "approvedAt" | "adIds" | "owner" | "eventInfoId"> & {
628
703
  adIds?: ObjectId[];
629
- eventInfoId: ObjectId;
704
+ approvedAt?: Date | null;
705
+ createdAt: Date;
706
+ deletedAt?: Date | null;
707
+ eventInfoId?: ObjectId;
630
708
  owner: SchemaOwnerType;
709
+ updatedAt: Date;
631
710
  } & Required<{
632
711
  _id: string;
633
712
  }> & {
@@ -652,24 +731,40 @@ declare const refundPolicySchema: mongoose__default.Schema<RefundPolicy, mongoos
652
731
  } & {
653
732
  __v: number;
654
733
  }>;
655
- type SchemaEventInfoType = Omit<EventInfoType, "eventId"> & {
734
+ type SchemaEventInfoType = Omit<EventInfoType, "eventId" | "createdAt" | "updatedAt"> & {
735
+ createdAt: Date;
656
736
  eventId: ObjectId;
737
+ updatedAt: Date;
657
738
  };
658
- declare const EventInfoModel: mongoose__default.Model<SchemaEventInfoType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaEventInfoType, {}, {}> & Omit<EventInfoType, "eventId"> & {
739
+ declare const EventInfoModel: mongoose__default.Model<SchemaEventInfoType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaEventInfoType, {}, {}> & Omit<EventInfoType, "createdAt" | "updatedAt" | "eventId"> & {
740
+ createdAt: Date;
659
741
  eventId: ObjectId;
742
+ updatedAt: Date;
660
743
  } & Required<{
661
744
  _id: string;
662
745
  }> & {
663
746
  __v: number;
664
747
  }, any>;
665
748
 
666
- type SchemaPartnerType = Omit<PartnerType, "owner" | "adIds"> & {
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"> & {
667
754
  adIds?: ObjectId[];
755
+ approvedAt?: Date | null;
756
+ createdAt: Date;
757
+ deletedAt?: Date | null;
668
758
  owner: SchemaOwnerType;
759
+ updatedAt: Date;
669
760
  };
670
- declare const PartnerModel: mongoose__default.Model<SchemaPartnerType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaPartnerType, {}, {}> & Omit<PartnerType, "adIds" | "owner"> & {
761
+ declare const PartnerModel: mongoose__default.Model<SchemaPartnerType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaPartnerType, {}, {}> & Omit<PartnerType, "createdAt" | "updatedAt" | "deletedAt" | "approvedAt" | "adIds" | "owner"> & {
671
762
  adIds?: ObjectId[];
763
+ approvedAt?: Date | null;
764
+ createdAt: Date;
765
+ deletedAt?: Date | null;
672
766
  owner: SchemaOwnerType;
767
+ updatedAt: Date;
673
768
  } & Required<{
674
769
  _id: string;
675
770
  }> & {
@@ -677,17 +772,7 @@ declare const PartnerModel: mongoose__default.Model<SchemaPartnerType, {}, {}, {
677
772
  }, any>;
678
773
 
679
774
  type SchemaPostType = PostType;
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<{
775
+ declare const PostModel: mongoose__default.Model<PostType, {}, {}, {}, mongoose__default.Document<unknown, {}, PostType, {}, {}> & PostType & Required<{
691
776
  _id: string;
692
777
  }> & {
693
778
  __v: number;
@@ -716,25 +801,80 @@ declare const GameModel: mongoose__default.Model<GameDocType, {}, {}, {}, mongoo
716
801
  __v: number;
717
802
  }, any>;
718
803
 
719
- type SchoolDocument = Omit<SchoolType, "ranking">;
720
- declare const SchoolModel: mongoose__default.Model<SchoolDocument, {}, {}, {}, mongoose__default.Document<unknown, {}, SchoolDocument, {}, {}> & SchoolDocument & Required<{
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<{
721
830
  _id: string;
722
831
  }> & {
723
832
  __v: number;
724
833
  }, any>;
725
834
 
726
- type SchemaAffiliateReward = AffiliateRewardType;
727
- type SchemaAffiliateResourceType = Omit<AffiliateResourceType, "resourceId" | "resourceOwner"> & {
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;
728
845
  resourceId: ObjectId;
729
846
  resourceOwner: SchemaOwnerType;
847
+ rewards?: SchemaAffiliateReward[];
730
848
  };
731
- type AffiliateDocument = Omit<AffiliateType, "_id" | "owner" | "affiliateResources"> & {
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[];
732
861
  affiliateResources: SchemaAffiliateResourceType[];
862
+ approvedAt?: Date | null;
863
+ createdAt: Date;
864
+ deletedAt?: Date | null;
733
865
  owner: SchemaOwnerType;
866
+ redeemHistory?: SchemaRedeemHistory[];
867
+ updatedAt: Date;
734
868
  };
735
- declare const AffiliateModel: mongoose__default.Model<AffiliateDocument, {}, {}, {}, mongoose__default.Document<unknown, {}, AffiliateDocument, {}, {}> & Omit<AffiliateType, "_id" | "owner" | "affiliateResources"> & {
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[];
736
871
  affiliateResources: SchemaAffiliateResourceType[];
872
+ approvedAt?: Date | null;
873
+ createdAt: Date;
874
+ deletedAt?: Date | null;
737
875
  owner: SchemaOwnerType;
876
+ redeemHistory?: SchemaRedeemHistory[];
877
+ updatedAt: Date;
738
878
  } & {
739
879
  _id: mongoose__default.Types.ObjectId;
740
880
  } & {
@@ -788,12 +928,19 @@ declare function awardAffiliateVendorSubscriptionRewards(now?: Date): Promise<Aw
788
928
  * @param promoCode - Normalized affiliate promo code to resolve.
789
929
  * @returns The matching affiliate document, or `null` when not found.
790
930
  */
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"> & {
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[];
795
933
  affiliateResources: SchemaAffiliateResourceType[];
934
+ approvedAt?: Date | null;
935
+ createdAt: Date;
936
+ deletedAt?: Date | null;
796
937
  owner: SchemaOwnerType;
938
+ redeemHistory?: {
939
+ paidAt?: Date | null;
940
+ redeemedAt: Date;
941
+ rewardValue: number;
942
+ }[];
943
+ updatedAt: Date;
797
944
  } & {
798
945
  _id: mongoose.Types.ObjectId;
799
946
  } & {
@@ -816,7 +963,7 @@ declare function normalizeAffiliatePromoCodes(promoCodes: PromoCodeType[] | null
816
963
  * otherwise falls back to the Standard subscription reward.
817
964
  * Returns `null` when no non-expired vendor licence applies.
818
965
  */
819
- declare function mapVendorLicenceToSubscriptionRewardType(licences: UserLicenceType[] | null | undefined, now?: Date, stripe?: UserType["stripe"] | null): EnumAffiliateRewardType | null;
966
+ declare function mapVendorLicenceToSubscriptionRewardType(licences: UserLicenceType[] | null | undefined, now?: Date, stripe?: UserType["stripe"] | null): AffiliateRewardEnumType | null;
820
967
  /** Inclusive start / exclusive end of the UTC calendar month containing `now`. */
821
968
  declare function getSubscriptionRewardPeriodBounds(now?: Date): {
822
969
  periodEnd: Date;
@@ -878,7 +1025,7 @@ declare function sendPushNotifications({ data, message, title, userIds, }: Schem
878
1025
  */
879
1026
  declare function updateAdStatuses(): Promise<void>;
880
1027
 
881
- declare function updateVendorBasedOnUserLicense(userId: ObjectId, licenceType: EnumUserLicence): Promise<void>;
1028
+ declare function updateVendorBasedOnUserLicense(userId: ObjectId, licenceType: LicencesEnumType): Promise<void>;
882
1029
 
883
1030
  /**
884
1031
  * True when `value` is a valid Mongo ObjectId string.
@@ -924,4 +1071,4 @@ declare function didRemoveAnyEventDates(previousDateTime: EventDateSlot[] | unde
924
1071
  */
925
1072
  declare function updateRelationDatesToUnavailable(relationDates: SchemaRelationType["relationDates"], eventDateTime: DateTimeWithPriceType[] | undefined): SchemaRelationType["relationDates"];
926
1073
 
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 };
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 };