@timardex/cluemart-server-shared 1.1.11 → 1.1.15
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/{chunk-3J26U4GN.mjs → chunk-VS3WIV6D.mjs} +173 -8
- package/dist/chunk-VS3WIV6D.mjs.map +1 -0
- package/dist/index.cjs +184 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +28 -2
- package/dist/index.d.ts +28 -2
- package/dist/index.mjs +181 -16
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +175 -8
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +28 -2
- package/dist/mongoose/index.d.ts +28 -2
- package/dist/mongoose/index.mjs +7 -3
- package/dist/service/index.cjs +177 -14
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.mjs +3 -3
- package/dist/service/index.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-3J26U4GN.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, 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, EnumUserRole, ChatMessageType, ParticipantType, ChatType, ReportChatUser, RelatedPostType, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, ResourceContactDetailsType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, SocialShareResourceType, PosterUsageType, GoogleImportedMarket, PushTokenType, RelationType, ResourceActivityType, UserActivityEvent, UserType, VendorProductList, VendorType, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, PostResource, AppSettingsType, GameType, GameDocType, SchoolType, AffiliateRewardType, AffiliateResourceType, AffiliateType, CouponType, ProductCouponType, CouponParticipantUserType, 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';
|
|
@@ -575,6 +575,15 @@ declare const VerificationTokenModel: mongoose__default.Model<VerificationTokenT
|
|
|
575
575
|
__v: number;
|
|
576
576
|
}, any>;
|
|
577
577
|
|
|
578
|
+
declare const vendorProductTypeSchema: mongoose__default.Schema<VendorProductList, mongoose__default.Model<VendorProductList, any, any, any, mongoose__default.Document<unknown, any, VendorProductList, any, {}> & VendorProductList & Required<{
|
|
579
|
+
_id: string;
|
|
580
|
+
}> & {
|
|
581
|
+
__v: number;
|
|
582
|
+
}, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, VendorProductList, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<VendorProductList>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<VendorProductList> & Required<{
|
|
583
|
+
_id: string;
|
|
584
|
+
}> & {
|
|
585
|
+
__v: number;
|
|
586
|
+
}>;
|
|
578
587
|
type SchemaVendorType = Omit<VendorType, "vendorInfoId" | "owner" | "adIds" | "unregisteredVendorId"> & {
|
|
579
588
|
adIds?: ObjectId[];
|
|
580
589
|
owner: SchemaOwnerType;
|
|
@@ -747,6 +756,23 @@ declare const AffiliateModel: mongoose__default.Model<AffiliateDocument, {}, {},
|
|
|
747
756
|
__v: number;
|
|
748
757
|
}, any>;
|
|
749
758
|
|
|
759
|
+
type SchemaCouponParticipantUserType = Omit<CouponParticipantUserType, "userId"> & {
|
|
760
|
+
userId: ObjectId;
|
|
761
|
+
};
|
|
762
|
+
type SchemaProductCouponType = Omit<ProductCouponType, "participantUsers"> & {
|
|
763
|
+
participantUsers: SchemaCouponParticipantUserType[] | null;
|
|
764
|
+
};
|
|
765
|
+
type CouponDocument = Omit<CouponType, "productCoupons"> & {
|
|
766
|
+
productCoupons: SchemaProductCouponType[];
|
|
767
|
+
};
|
|
768
|
+
declare const CouponModel: mongoose__default.Model<CouponDocument, {}, {}, {}, mongoose__default.Document<unknown, {}, CouponDocument, {}, {}> & Omit<CouponType, "productCoupons"> & {
|
|
769
|
+
productCoupons: SchemaProductCouponType[];
|
|
770
|
+
} & Required<{
|
|
771
|
+
_id: string;
|
|
772
|
+
}> & {
|
|
773
|
+
__v: number;
|
|
774
|
+
}, any>;
|
|
775
|
+
|
|
750
776
|
/**
|
|
751
777
|
* Checks whether an affiliate code is already taken by an active, non-deleted affiliate.
|
|
752
778
|
*
|
|
@@ -930,4 +956,4 @@ declare function didRemoveAnyEventDates(previousDateTime: EventDateSlot[] | unde
|
|
|
930
956
|
*/
|
|
931
957
|
declare function updateRelationDatesToUnavailable(relationDates: SchemaRelationType["relationDates"], eventDateTime: DateTimeWithPriceType[] | undefined): SchemaRelationType["relationDates"];
|
|
932
958
|
|
|
933
|
-
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 };
|
|
959
|
+
export { ACTIVE_NOT_DELETED_FILTER, APP_SETTINGS_ID, AdModel, AffiliateModel, AppSettingModel, type AuthUser, type AwardAffiliateVendorSubscriptionRewardsResult, CategorySchema, ChatModel, ChatReportModel, ContactDetailsSchema, type CouponDocument, CouponModel, EnumPubSubEvents, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, type GraphQLContext, 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, 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, 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, EnumUserRole, ChatMessageType, ParticipantType, ChatType, ReportChatUser, RelatedPostType, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, ResourceContactDetailsType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, SocialShareResourceType, PosterUsageType, GoogleImportedMarket, PushTokenType, RelationType, ResourceActivityType, UserActivityEvent, UserType, VendorProductList, VendorType, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, PostResource, AppSettingsType, GameType, GameDocType, SchoolType, AffiliateRewardType, AffiliateResourceType, AffiliateType, CouponType, ProductCouponType, CouponParticipantUserType, 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';
|
|
@@ -575,6 +575,15 @@ declare const VerificationTokenModel: mongoose__default.Model<VerificationTokenT
|
|
|
575
575
|
__v: number;
|
|
576
576
|
}, any>;
|
|
577
577
|
|
|
578
|
+
declare const vendorProductTypeSchema: mongoose__default.Schema<VendorProductList, mongoose__default.Model<VendorProductList, any, any, any, mongoose__default.Document<unknown, any, VendorProductList, any, {}> & VendorProductList & Required<{
|
|
579
|
+
_id: string;
|
|
580
|
+
}> & {
|
|
581
|
+
__v: number;
|
|
582
|
+
}, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, VendorProductList, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<VendorProductList>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<VendorProductList> & Required<{
|
|
583
|
+
_id: string;
|
|
584
|
+
}> & {
|
|
585
|
+
__v: number;
|
|
586
|
+
}>;
|
|
578
587
|
type SchemaVendorType = Omit<VendorType, "vendorInfoId" | "owner" | "adIds" | "unregisteredVendorId"> & {
|
|
579
588
|
adIds?: ObjectId[];
|
|
580
589
|
owner: SchemaOwnerType;
|
|
@@ -747,6 +756,23 @@ declare const AffiliateModel: mongoose__default.Model<AffiliateDocument, {}, {},
|
|
|
747
756
|
__v: number;
|
|
748
757
|
}, any>;
|
|
749
758
|
|
|
759
|
+
type SchemaCouponParticipantUserType = Omit<CouponParticipantUserType, "userId"> & {
|
|
760
|
+
userId: ObjectId;
|
|
761
|
+
};
|
|
762
|
+
type SchemaProductCouponType = Omit<ProductCouponType, "participantUsers"> & {
|
|
763
|
+
participantUsers: SchemaCouponParticipantUserType[] | null;
|
|
764
|
+
};
|
|
765
|
+
type CouponDocument = Omit<CouponType, "productCoupons"> & {
|
|
766
|
+
productCoupons: SchemaProductCouponType[];
|
|
767
|
+
};
|
|
768
|
+
declare const CouponModel: mongoose__default.Model<CouponDocument, {}, {}, {}, mongoose__default.Document<unknown, {}, CouponDocument, {}, {}> & Omit<CouponType, "productCoupons"> & {
|
|
769
|
+
productCoupons: SchemaProductCouponType[];
|
|
770
|
+
} & Required<{
|
|
771
|
+
_id: string;
|
|
772
|
+
}> & {
|
|
773
|
+
__v: number;
|
|
774
|
+
}, any>;
|
|
775
|
+
|
|
750
776
|
/**
|
|
751
777
|
* Checks whether an affiliate code is already taken by an active, non-deleted affiliate.
|
|
752
778
|
*
|
|
@@ -930,4 +956,4 @@ declare function didRemoveAnyEventDates(previousDateTime: EventDateSlot[] | unde
|
|
|
930
956
|
*/
|
|
931
957
|
declare function updateRelationDatesToUnavailable(relationDates: SchemaRelationType["relationDates"], eventDateTime: DateTimeWithPriceType[] | undefined): SchemaRelationType["relationDates"];
|
|
932
958
|
|
|
933
|
-
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 };
|
|
959
|
+
export { ACTIVE_NOT_DELETED_FILTER, APP_SETTINGS_ID, AdModel, AffiliateModel, AppSettingModel, type AuthUser, type AwardAffiliateVendorSubscriptionRewardsResult, CategorySchema, ChatModel, ChatReportModel, ContactDetailsSchema, type CouponDocument, CouponModel, EnumPubSubEvents, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, type GraphQLContext, 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, vendorProductTypeSchema };
|
package/dist/index.mjs
CHANGED
|
@@ -5402,11 +5402,14 @@ var VENDOR_DATETIME_FIELDS_FRAGMENT = gql`
|
|
|
5402
5402
|
`;
|
|
5403
5403
|
var VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT = gql`
|
|
5404
5404
|
fragment VendorProductListFields on VendorProductListType {
|
|
5405
|
+
_id
|
|
5406
|
+
createdAt
|
|
5405
5407
|
description
|
|
5406
5408
|
name
|
|
5407
5409
|
price
|
|
5408
5410
|
priceUnit
|
|
5409
5411
|
productGroups
|
|
5412
|
+
updatedAt
|
|
5410
5413
|
}
|
|
5411
5414
|
`;
|
|
5412
5415
|
var VENDOR = gql`
|
|
@@ -7709,6 +7712,109 @@ var ASSIGN_AFFILIATE_BONUS_REWARD_MUTATION = gql`
|
|
|
7709
7712
|
}
|
|
7710
7713
|
${AFFILIATE_FIELDS_FRAGMENT}
|
|
7711
7714
|
`;
|
|
7715
|
+
var COUPON_CODE_FIELDS_FRAGMENT = gql`
|
|
7716
|
+
fragment CouponCodeFields on CouponCodeType {
|
|
7717
|
+
code
|
|
7718
|
+
qrCode {
|
|
7719
|
+
...ResourceImageFields
|
|
7720
|
+
}
|
|
7721
|
+
}
|
|
7722
|
+
${RESOURCE_IMAGE_FIELDS_FRAGMENT}
|
|
7723
|
+
`;
|
|
7724
|
+
var COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT = gql`
|
|
7725
|
+
fragment CouponParticipantUserFields on CouponParticipantUserType {
|
|
7726
|
+
couponCount
|
|
7727
|
+
couponRedeemedAt
|
|
7728
|
+
createdAt
|
|
7729
|
+
updatedAt
|
|
7730
|
+
userId
|
|
7731
|
+
}
|
|
7732
|
+
`;
|
|
7733
|
+
var PRODUCT_COUPON_FIELDS_FRAGMENT = gql`
|
|
7734
|
+
fragment ProductCouponFields on ProductCouponType {
|
|
7735
|
+
_id
|
|
7736
|
+
active
|
|
7737
|
+
couponCode {
|
|
7738
|
+
...CouponCodeFields
|
|
7739
|
+
}
|
|
7740
|
+
couponDescription
|
|
7741
|
+
couponOption
|
|
7742
|
+
createdAt
|
|
7743
|
+
endDate
|
|
7744
|
+
participantProduct {
|
|
7745
|
+
...VendorProductListFields
|
|
7746
|
+
}
|
|
7747
|
+
participantUsers {
|
|
7748
|
+
...CouponParticipantUserFields
|
|
7749
|
+
}
|
|
7750
|
+
startDate
|
|
7751
|
+
updatedAt
|
|
7752
|
+
}
|
|
7753
|
+
${COUPON_CODE_FIELDS_FRAGMENT}
|
|
7754
|
+
${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
|
|
7755
|
+
${VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT}
|
|
7756
|
+
`;
|
|
7757
|
+
var COUPON = gql`
|
|
7758
|
+
fragment CouponFields on CouponType {
|
|
7759
|
+
_id
|
|
7760
|
+
active
|
|
7761
|
+
productCoupons {
|
|
7762
|
+
...ProductCouponFields
|
|
7763
|
+
}
|
|
7764
|
+
createdAt
|
|
7765
|
+
deletedAt
|
|
7766
|
+
updatedAt
|
|
7767
|
+
}
|
|
7768
|
+
${PRODUCT_COUPON_FIELDS_FRAGMENT}
|
|
7769
|
+
${COUPON_CODE_FIELDS_FRAGMENT}
|
|
7770
|
+
${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
|
|
7771
|
+
`;
|
|
7772
|
+
var GET_COUPONS = gql`
|
|
7773
|
+
query getCoupons {
|
|
7774
|
+
coupons {
|
|
7775
|
+
...CouponFields
|
|
7776
|
+
}
|
|
7777
|
+
}
|
|
7778
|
+
${COUPON}
|
|
7779
|
+
`;
|
|
7780
|
+
var GET_COUPON = gql`
|
|
7781
|
+
query getCoupon($_id: ID!) {
|
|
7782
|
+
coupon(_id: $_id) {
|
|
7783
|
+
...CouponFields
|
|
7784
|
+
}
|
|
7785
|
+
}
|
|
7786
|
+
${COUPON}
|
|
7787
|
+
`;
|
|
7788
|
+
var CREATE_COUPON_MUTATION = gql`
|
|
7789
|
+
mutation createCoupon($input: CouponInputType!) {
|
|
7790
|
+
createCoupon(input: $input) {
|
|
7791
|
+
data {
|
|
7792
|
+
...CouponFields
|
|
7793
|
+
}
|
|
7794
|
+
message
|
|
7795
|
+
}
|
|
7796
|
+
}
|
|
7797
|
+
${COUPON}
|
|
7798
|
+
`;
|
|
7799
|
+
var UPDATE_COUPON_MUTATION = gql`
|
|
7800
|
+
mutation updateCoupon($_id: ID!, $input: CouponInputType!) {
|
|
7801
|
+
updateCoupon(_id: $_id, input: $input) {
|
|
7802
|
+
data {
|
|
7803
|
+
...CouponFields
|
|
7804
|
+
}
|
|
7805
|
+
message
|
|
7806
|
+
}
|
|
7807
|
+
}
|
|
7808
|
+
${COUPON}
|
|
7809
|
+
`;
|
|
7810
|
+
var DELETE_COUPON_MUTATION = gql`
|
|
7811
|
+
mutation deleteCoupon($_id: ID!) {
|
|
7812
|
+
deleteCoupon(_id: $_id) {
|
|
7813
|
+
data
|
|
7814
|
+
message
|
|
7815
|
+
}
|
|
7816
|
+
}
|
|
7817
|
+
`;
|
|
7712
7818
|
var PKG = "@timardex/cluemart-shared";
|
|
7713
7819
|
var IMAGE_EXTENSION = ".webp";
|
|
7714
7820
|
var posterIds = [
|
|
@@ -8845,7 +8951,7 @@ var VerificationTokenModel = mongoose12.models.VerificationToken || mongoose12.m
|
|
|
8845
8951
|
// src/mongoose/vendor/Vendor.ts
|
|
8846
8952
|
import mongoose13 from "mongoose";
|
|
8847
8953
|
var MongooseSchema13 = mongoose13.Schema;
|
|
8848
|
-
var
|
|
8954
|
+
var vendorProductTypeSchema = new MongooseSchema13(
|
|
8849
8955
|
{
|
|
8850
8956
|
description: { required: false, type: String },
|
|
8851
8957
|
name: { required: false, type: String },
|
|
@@ -8853,12 +8959,12 @@ var productTypeSchema = new MongooseSchema13(
|
|
|
8853
8959
|
priceUnit: { required: false, type: String },
|
|
8854
8960
|
productGroups: { required: false, type: [String] }
|
|
8855
8961
|
},
|
|
8856
|
-
{
|
|
8962
|
+
{ timestamps: true }
|
|
8857
8963
|
);
|
|
8858
8964
|
var productWrapperSchema = new MongooseSchema13(
|
|
8859
8965
|
{
|
|
8860
8966
|
active: { default: false, type: Boolean },
|
|
8861
|
-
productsList: { required: false, type: [
|
|
8967
|
+
productsList: { required: false, type: [vendorProductTypeSchema] }
|
|
8862
8968
|
},
|
|
8863
8969
|
{ _id: false }
|
|
8864
8970
|
);
|
|
@@ -9019,7 +9125,7 @@ var schema11 = new MongooseSchema15(
|
|
|
9019
9125
|
claimToken: { default: null, required: false, type: String },
|
|
9020
9126
|
claimTokenExpiresAt: { default: null, required: false, type: Date },
|
|
9021
9127
|
deletedAt: { default: null, required: false, type: Date },
|
|
9022
|
-
email: { required:
|
|
9128
|
+
email: { required: true, type: String },
|
|
9023
9129
|
invitations: { required: true, type: [invitationSchema] },
|
|
9024
9130
|
name: { required: true, type: String },
|
|
9025
9131
|
region: { required: true, type: String }
|
|
@@ -9310,9 +9416,9 @@ var gameDataSchemas = {
|
|
|
9310
9416
|
[EnumGameType.ODD_ONE_OUT]: schemaPuzzleGameData
|
|
9311
9417
|
};
|
|
9312
9418
|
var gameDataDefinition = Object.fromEntries(
|
|
9313
|
-
Object.entries(gameDataSchemas).map(([key,
|
|
9419
|
+
Object.entries(gameDataSchemas).map(([key, schema19]) => [
|
|
9314
9420
|
key,
|
|
9315
|
-
{ default: null, required: false, type:
|
|
9421
|
+
{ default: null, required: false, type: schema19 }
|
|
9316
9422
|
])
|
|
9317
9423
|
);
|
|
9318
9424
|
var gameHistorySchema = new MongooseSchema23(
|
|
@@ -9537,6 +9643,63 @@ schema17.index(
|
|
|
9537
9643
|
);
|
|
9538
9644
|
var AffiliateModel = mongoose25.models.Affiliate || mongoose25.model("Affiliate", schema17);
|
|
9539
9645
|
|
|
9646
|
+
// src/mongoose/Coupon.ts
|
|
9647
|
+
import mongoose26 from "mongoose";
|
|
9648
|
+
var MongooseSchema26 = mongoose26.Schema;
|
|
9649
|
+
var couponOptionSchema = new MongooseSchema26(
|
|
9650
|
+
{
|
|
9651
|
+
buy: { required: true, type: Number },
|
|
9652
|
+
get: { required: true, type: Number },
|
|
9653
|
+
unit: { required: true, type: String }
|
|
9654
|
+
},
|
|
9655
|
+
{ _id: false }
|
|
9656
|
+
);
|
|
9657
|
+
var couponCodeSchema = new MongooseSchema26(
|
|
9658
|
+
{
|
|
9659
|
+
code: { required: true, type: String },
|
|
9660
|
+
qrCode: { required: true, type: ResourceImageTypeSchema }
|
|
9661
|
+
},
|
|
9662
|
+
{ _id: false }
|
|
9663
|
+
);
|
|
9664
|
+
var couponParticipantUserSchema = new MongooseSchema26(
|
|
9665
|
+
{
|
|
9666
|
+
couponCount: { default: 0, required: true, type: Number },
|
|
9667
|
+
couponRedeemedAt: { default: null, required: false, type: Date },
|
|
9668
|
+
userId: {
|
|
9669
|
+
ref: "User",
|
|
9670
|
+
required: true,
|
|
9671
|
+
type: mongoose26.Schema.Types.ObjectId
|
|
9672
|
+
}
|
|
9673
|
+
},
|
|
9674
|
+
{ timestamps: true }
|
|
9675
|
+
);
|
|
9676
|
+
var productCouponSchema = new MongooseSchema26(
|
|
9677
|
+
{
|
|
9678
|
+
active: { default: true, required: true, type: Boolean },
|
|
9679
|
+
couponCode: { required: true, type: couponCodeSchema },
|
|
9680
|
+
couponDescription: { required: true, type: String },
|
|
9681
|
+
couponOption: { required: true, type: couponOptionSchema },
|
|
9682
|
+
endDate: { required: true, type: Date },
|
|
9683
|
+
participantProduct: { required: true, type: vendorProductTypeSchema },
|
|
9684
|
+
participantUsers: {
|
|
9685
|
+
default: null,
|
|
9686
|
+
required: false,
|
|
9687
|
+
type: [couponParticipantUserSchema]
|
|
9688
|
+
},
|
|
9689
|
+
startDate: { required: true, type: Date }
|
|
9690
|
+
},
|
|
9691
|
+
{ timestamps: true }
|
|
9692
|
+
);
|
|
9693
|
+
var schema18 = new MongooseSchema26(
|
|
9694
|
+
{
|
|
9695
|
+
active: { default: true, required: true, type: Boolean },
|
|
9696
|
+
deletedAt: { default: null, required: false, type: Date },
|
|
9697
|
+
productCoupons: { required: false, type: [productCouponSchema] }
|
|
9698
|
+
},
|
|
9699
|
+
{ timestamps: true }
|
|
9700
|
+
);
|
|
9701
|
+
var CouponModel = mongoose26.models.Coupon || mongoose26.model("Coupon", schema18);
|
|
9702
|
+
|
|
9540
9703
|
// src/service/promoCode/constants.ts
|
|
9541
9704
|
var ACTIVE_NOT_DELETED_FILTER = {
|
|
9542
9705
|
active: true,
|
|
@@ -9607,7 +9770,7 @@ var SHARE_RESOURCE_LABEL2 = {
|
|
|
9607
9770
|
school: "School"
|
|
9608
9771
|
};
|
|
9609
9772
|
|
|
9610
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
9773
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-7TL4ZSUO.mjs
|
|
9611
9774
|
var PROMO_CODE_PREFIX2 = "CM-";
|
|
9612
9775
|
var OBJECT_ID_PATH_SEGMENT2 = "[a-f0-9]{24}";
|
|
9613
9776
|
var OBJECT_ID_PATH_SEGMENT_END2 = `${OBJECT_ID_PATH_SEGMENT2}$`;
|
|
@@ -9709,7 +9872,7 @@ var gameScreenIdentifierList2 = [
|
|
|
9709
9872
|
}
|
|
9710
9873
|
];
|
|
9711
9874
|
|
|
9712
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
9875
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-4G4OFSBZ.mjs
|
|
9713
9876
|
import dayjs4 from "dayjs";
|
|
9714
9877
|
var statusOptions2 = [
|
|
9715
9878
|
...Object.values(EnumInviteStatus2).map((status) => ({
|
|
@@ -11122,7 +11285,7 @@ function normalizeAffiliatePromoCodes(promoCodes) {
|
|
|
11122
11285
|
}
|
|
11123
11286
|
|
|
11124
11287
|
// src/service/database.ts
|
|
11125
|
-
import
|
|
11288
|
+
import mongoose27 from "mongoose";
|
|
11126
11289
|
var connectToDatabase = async ({
|
|
11127
11290
|
appName,
|
|
11128
11291
|
dbName,
|
|
@@ -11135,7 +11298,7 @@ var connectToDatabase = async ({
|
|
|
11135
11298
|
// Fallback to MongoDB Atlas connection string
|
|
11136
11299
|
`mongodb+srv://${dbUser}:${dbPassword}@${dbName}.mongodb.net/?retryWrites=true&w=majority&appName=${appName}`
|
|
11137
11300
|
);
|
|
11138
|
-
await
|
|
11301
|
+
await mongoose27.connect(mongoUri);
|
|
11139
11302
|
const connectionType = mongodbUri ? "Local MongoDB" : "MongoDB Atlas";
|
|
11140
11303
|
console.log(
|
|
11141
11304
|
`${connectionType} connected from server/src/service/database.ts`
|
|
@@ -11148,7 +11311,7 @@ var connectToDatabase = async ({
|
|
|
11148
11311
|
|
|
11149
11312
|
// src/types/index.ts
|
|
11150
11313
|
import express from "express";
|
|
11151
|
-
import
|
|
11314
|
+
import mongoose28 from "mongoose";
|
|
11152
11315
|
var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
|
|
11153
11316
|
EnumPubSubEvents2["GET_CHAT_MESSAGE"] = "GET_CHAT_MESSAGE";
|
|
11154
11317
|
EnumPubSubEvents2["GET_NOTIFICATIONS"] = "GET_NOTIFICATIONS";
|
|
@@ -11278,15 +11441,15 @@ async function updateVendorBasedOnUserLicense(userId, licenceType) {
|
|
|
11278
11441
|
}
|
|
11279
11442
|
|
|
11280
11443
|
// src/service/objectIdToString.ts
|
|
11281
|
-
import
|
|
11444
|
+
import mongoose29 from "mongoose";
|
|
11282
11445
|
function isValidObjectId(value) {
|
|
11283
|
-
return
|
|
11446
|
+
return mongoose29.Types.ObjectId.isValid(value);
|
|
11284
11447
|
}
|
|
11285
11448
|
function convertObjectIdsToStrings(obj) {
|
|
11286
11449
|
if (obj === null || obj === void 0) {
|
|
11287
11450
|
return obj;
|
|
11288
11451
|
}
|
|
11289
|
-
if (obj instanceof
|
|
11452
|
+
if (obj instanceof mongoose29.Types.ObjectId) {
|
|
11290
11453
|
return obj.toString();
|
|
11291
11454
|
}
|
|
11292
11455
|
if (obj instanceof Date) {
|
|
@@ -11477,6 +11640,7 @@ export {
|
|
|
11477
11640
|
ChatModel,
|
|
11478
11641
|
ChatReportModel,
|
|
11479
11642
|
ContactDetailsSchema,
|
|
11643
|
+
CouponModel,
|
|
11480
11644
|
EnumPubSubEvents,
|
|
11481
11645
|
EventInfoModel,
|
|
11482
11646
|
EventModel,
|
|
@@ -11514,7 +11678,7 @@ export {
|
|
|
11514
11678
|
locationGeoSchema,
|
|
11515
11679
|
locationsSchema,
|
|
11516
11680
|
mapVendorLicenceToSubscriptionRewardType,
|
|
11517
|
-
|
|
11681
|
+
mongoose28 as mongoose,
|
|
11518
11682
|
normalizeAffiliatePromoCodes,
|
|
11519
11683
|
normalizePromoCode,
|
|
11520
11684
|
notifyUsers,
|
|
@@ -11532,6 +11696,7 @@ export {
|
|
|
11532
11696
|
updateRelationDatesToUnavailable,
|
|
11533
11697
|
updateSingleDateTimeStatus,
|
|
11534
11698
|
updateVendorBasedOnUserLicense,
|
|
11535
|
-
userLicenseSchema
|
|
11699
|
+
userLicenseSchema,
|
|
11700
|
+
vendorProductTypeSchema
|
|
11536
11701
|
};
|
|
11537
11702
|
//# sourceMappingURL=index.mjs.map
|