@timardex/cluemart-server-shared 1.1.12 → 1.1.16
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-ICAMGPFE.mjs → chunk-7GXZS3LI.mjs} +179 -12
- package/dist/chunk-7GXZS3LI.mjs.map +1 -0
- package/dist/index.cjs +190 -21
- 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 +187 -20
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +181 -12
- 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 +183 -18
- 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-ICAMGPFE.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,15 @@ 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
|
|
5408
|
+
hasCoupon
|
|
5406
5409
|
name
|
|
5407
5410
|
price
|
|
5408
5411
|
priceUnit
|
|
5409
5412
|
productGroups
|
|
5413
|
+
updatedAt
|
|
5410
5414
|
}
|
|
5411
5415
|
`;
|
|
5412
5416
|
var VENDOR = gql`
|
|
@@ -7709,6 +7713,109 @@ var ASSIGN_AFFILIATE_BONUS_REWARD_MUTATION = gql`
|
|
|
7709
7713
|
}
|
|
7710
7714
|
${AFFILIATE_FIELDS_FRAGMENT}
|
|
7711
7715
|
`;
|
|
7716
|
+
var COUPON_CODE_FIELDS_FRAGMENT = gql`
|
|
7717
|
+
fragment CouponCodeFields on CouponCodeType {
|
|
7718
|
+
code
|
|
7719
|
+
qrCode {
|
|
7720
|
+
...ResourceImageFields
|
|
7721
|
+
}
|
|
7722
|
+
}
|
|
7723
|
+
${RESOURCE_IMAGE_FIELDS_FRAGMENT}
|
|
7724
|
+
`;
|
|
7725
|
+
var COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT = gql`
|
|
7726
|
+
fragment CouponParticipantUserFields on CouponParticipantUserType {
|
|
7727
|
+
couponCount
|
|
7728
|
+
couponRedeemedAt
|
|
7729
|
+
createdAt
|
|
7730
|
+
updatedAt
|
|
7731
|
+
userId
|
|
7732
|
+
}
|
|
7733
|
+
`;
|
|
7734
|
+
var PRODUCT_COUPON_FIELDS_FRAGMENT = gql`
|
|
7735
|
+
fragment ProductCouponFields on ProductCouponType {
|
|
7736
|
+
_id
|
|
7737
|
+
active
|
|
7738
|
+
couponCode {
|
|
7739
|
+
...CouponCodeFields
|
|
7740
|
+
}
|
|
7741
|
+
couponDescription
|
|
7742
|
+
couponOption
|
|
7743
|
+
createdAt
|
|
7744
|
+
endDate
|
|
7745
|
+
participantProduct {
|
|
7746
|
+
...VendorProductListFields
|
|
7747
|
+
}
|
|
7748
|
+
participantUsers {
|
|
7749
|
+
...CouponParticipantUserFields
|
|
7750
|
+
}
|
|
7751
|
+
startDate
|
|
7752
|
+
updatedAt
|
|
7753
|
+
}
|
|
7754
|
+
${COUPON_CODE_FIELDS_FRAGMENT}
|
|
7755
|
+
${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
|
|
7756
|
+
${VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT}
|
|
7757
|
+
`;
|
|
7758
|
+
var COUPON = gql`
|
|
7759
|
+
fragment CouponFields on CouponType {
|
|
7760
|
+
_id
|
|
7761
|
+
active
|
|
7762
|
+
productCoupons {
|
|
7763
|
+
...ProductCouponFields
|
|
7764
|
+
}
|
|
7765
|
+
createdAt
|
|
7766
|
+
deletedAt
|
|
7767
|
+
updatedAt
|
|
7768
|
+
}
|
|
7769
|
+
${PRODUCT_COUPON_FIELDS_FRAGMENT}
|
|
7770
|
+
${COUPON_CODE_FIELDS_FRAGMENT}
|
|
7771
|
+
${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
|
|
7772
|
+
`;
|
|
7773
|
+
var GET_COUPONS = gql`
|
|
7774
|
+
query getCoupons {
|
|
7775
|
+
coupons {
|
|
7776
|
+
...CouponFields
|
|
7777
|
+
}
|
|
7778
|
+
}
|
|
7779
|
+
${COUPON}
|
|
7780
|
+
`;
|
|
7781
|
+
var GET_COUPON = gql`
|
|
7782
|
+
query getCoupon($_id: ID!) {
|
|
7783
|
+
coupon(_id: $_id) {
|
|
7784
|
+
...CouponFields
|
|
7785
|
+
}
|
|
7786
|
+
}
|
|
7787
|
+
${COUPON}
|
|
7788
|
+
`;
|
|
7789
|
+
var CREATE_COUPON_MUTATION = gql`
|
|
7790
|
+
mutation createCoupon($input: CouponInputType!) {
|
|
7791
|
+
createCoupon(input: $input) {
|
|
7792
|
+
data {
|
|
7793
|
+
...CouponFields
|
|
7794
|
+
}
|
|
7795
|
+
message
|
|
7796
|
+
}
|
|
7797
|
+
}
|
|
7798
|
+
${COUPON}
|
|
7799
|
+
`;
|
|
7800
|
+
var UPDATE_COUPON_MUTATION = gql`
|
|
7801
|
+
mutation updateCoupon($_id: ID!, $input: CouponInputType!) {
|
|
7802
|
+
updateCoupon(_id: $_id, input: $input) {
|
|
7803
|
+
data {
|
|
7804
|
+
...CouponFields
|
|
7805
|
+
}
|
|
7806
|
+
message
|
|
7807
|
+
}
|
|
7808
|
+
}
|
|
7809
|
+
${COUPON}
|
|
7810
|
+
`;
|
|
7811
|
+
var DELETE_COUPON_MUTATION = gql`
|
|
7812
|
+
mutation deleteCoupon($_id: ID!) {
|
|
7813
|
+
deleteCoupon(_id: $_id) {
|
|
7814
|
+
data
|
|
7815
|
+
message
|
|
7816
|
+
}
|
|
7817
|
+
}
|
|
7818
|
+
`;
|
|
7712
7819
|
var PKG = "@timardex/cluemart-shared";
|
|
7713
7820
|
var IMAGE_EXTENSION = ".webp";
|
|
7714
7821
|
var posterIds = [
|
|
@@ -8845,20 +8952,21 @@ var VerificationTokenModel = mongoose12.models.VerificationToken || mongoose12.m
|
|
|
8845
8952
|
// src/mongoose/vendor/Vendor.ts
|
|
8846
8953
|
import mongoose13 from "mongoose";
|
|
8847
8954
|
var MongooseSchema13 = mongoose13.Schema;
|
|
8848
|
-
var
|
|
8955
|
+
var vendorProductTypeSchema = new MongooseSchema13(
|
|
8849
8956
|
{
|
|
8850
8957
|
description: { required: false, type: String },
|
|
8851
|
-
|
|
8852
|
-
|
|
8853
|
-
|
|
8958
|
+
hasCoupon: { default: false, required: false, type: Boolean },
|
|
8959
|
+
name: { required: true, type: String },
|
|
8960
|
+
price: { required: true, type: Number },
|
|
8961
|
+
priceUnit: { required: true, type: String },
|
|
8854
8962
|
productGroups: { required: false, type: [String] }
|
|
8855
8963
|
},
|
|
8856
|
-
{
|
|
8964
|
+
{ timestamps: true }
|
|
8857
8965
|
);
|
|
8858
8966
|
var productWrapperSchema = new MongooseSchema13(
|
|
8859
8967
|
{
|
|
8860
|
-
active: { default: false, type: Boolean },
|
|
8861
|
-
productsList: { required: false, type: [
|
|
8968
|
+
active: { default: false, required: true, type: Boolean },
|
|
8969
|
+
productsList: { required: false, type: [vendorProductTypeSchema] }
|
|
8862
8970
|
},
|
|
8863
8971
|
{ _id: false }
|
|
8864
8972
|
);
|
|
@@ -8885,7 +8993,7 @@ var calendarSchema = new MongooseSchema13(
|
|
|
8885
8993
|
);
|
|
8886
8994
|
var calendarWrapperSchema = new MongooseSchema13(
|
|
8887
8995
|
{
|
|
8888
|
-
active: { default: false, type: Boolean },
|
|
8996
|
+
active: { default: false, required: true, type: Boolean },
|
|
8889
8997
|
calendarData: { required: false, type: [calendarSchema] }
|
|
8890
8998
|
},
|
|
8891
8999
|
{ _id: false }
|
|
@@ -9310,9 +9418,9 @@ var gameDataSchemas = {
|
|
|
9310
9418
|
[EnumGameType.ODD_ONE_OUT]: schemaPuzzleGameData
|
|
9311
9419
|
};
|
|
9312
9420
|
var gameDataDefinition = Object.fromEntries(
|
|
9313
|
-
Object.entries(gameDataSchemas).map(([key,
|
|
9421
|
+
Object.entries(gameDataSchemas).map(([key, schema19]) => [
|
|
9314
9422
|
key,
|
|
9315
|
-
{ default: null, required: false, type:
|
|
9423
|
+
{ default: null, required: false, type: schema19 }
|
|
9316
9424
|
])
|
|
9317
9425
|
);
|
|
9318
9426
|
var gameHistorySchema = new MongooseSchema23(
|
|
@@ -9537,6 +9645,63 @@ schema17.index(
|
|
|
9537
9645
|
);
|
|
9538
9646
|
var AffiliateModel = mongoose25.models.Affiliate || mongoose25.model("Affiliate", schema17);
|
|
9539
9647
|
|
|
9648
|
+
// src/mongoose/Coupon.ts
|
|
9649
|
+
import mongoose26 from "mongoose";
|
|
9650
|
+
var MongooseSchema26 = mongoose26.Schema;
|
|
9651
|
+
var couponOptionSchema = new MongooseSchema26(
|
|
9652
|
+
{
|
|
9653
|
+
buy: { required: true, type: Number },
|
|
9654
|
+
get: { required: true, type: Number },
|
|
9655
|
+
unit: { required: true, type: String }
|
|
9656
|
+
},
|
|
9657
|
+
{ _id: false }
|
|
9658
|
+
);
|
|
9659
|
+
var couponCodeSchema = new MongooseSchema26(
|
|
9660
|
+
{
|
|
9661
|
+
code: { required: true, type: String },
|
|
9662
|
+
qrCode: { required: true, type: ResourceImageTypeSchema }
|
|
9663
|
+
},
|
|
9664
|
+
{ _id: false }
|
|
9665
|
+
);
|
|
9666
|
+
var couponParticipantUserSchema = new MongooseSchema26(
|
|
9667
|
+
{
|
|
9668
|
+
couponCount: { default: 0, required: true, type: Number },
|
|
9669
|
+
couponRedeemedAt: { default: null, required: false, type: Date },
|
|
9670
|
+
userId: {
|
|
9671
|
+
ref: "User",
|
|
9672
|
+
required: true,
|
|
9673
|
+
type: mongoose26.Schema.Types.ObjectId
|
|
9674
|
+
}
|
|
9675
|
+
},
|
|
9676
|
+
{ timestamps: true }
|
|
9677
|
+
);
|
|
9678
|
+
var productCouponSchema = new MongooseSchema26(
|
|
9679
|
+
{
|
|
9680
|
+
active: { default: true, required: true, type: Boolean },
|
|
9681
|
+
couponCode: { required: true, type: couponCodeSchema },
|
|
9682
|
+
couponDescription: { required: true, type: String },
|
|
9683
|
+
couponOption: { required: true, type: couponOptionSchema },
|
|
9684
|
+
endDate: { required: true, type: Date },
|
|
9685
|
+
participantProduct: { required: true, type: vendorProductTypeSchema },
|
|
9686
|
+
participantUsers: {
|
|
9687
|
+
default: null,
|
|
9688
|
+
required: false,
|
|
9689
|
+
type: [couponParticipantUserSchema]
|
|
9690
|
+
},
|
|
9691
|
+
startDate: { required: true, type: Date }
|
|
9692
|
+
},
|
|
9693
|
+
{ timestamps: true }
|
|
9694
|
+
);
|
|
9695
|
+
var schema18 = new MongooseSchema26(
|
|
9696
|
+
{
|
|
9697
|
+
active: { default: true, required: true, type: Boolean },
|
|
9698
|
+
deletedAt: { default: null, required: false, type: Date },
|
|
9699
|
+
productCoupons: { required: false, type: [productCouponSchema] }
|
|
9700
|
+
},
|
|
9701
|
+
{ timestamps: true }
|
|
9702
|
+
);
|
|
9703
|
+
var CouponModel = mongoose26.models.Coupon || mongoose26.model("Coupon", schema18);
|
|
9704
|
+
|
|
9540
9705
|
// src/service/promoCode/constants.ts
|
|
9541
9706
|
var ACTIVE_NOT_DELETED_FILTER = {
|
|
9542
9707
|
active: true,
|
|
@@ -9607,7 +9772,7 @@ var SHARE_RESOURCE_LABEL2 = {
|
|
|
9607
9772
|
school: "School"
|
|
9608
9773
|
};
|
|
9609
9774
|
|
|
9610
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
9775
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-7TL4ZSUO.mjs
|
|
9611
9776
|
var PROMO_CODE_PREFIX2 = "CM-";
|
|
9612
9777
|
var OBJECT_ID_PATH_SEGMENT2 = "[a-f0-9]{24}";
|
|
9613
9778
|
var OBJECT_ID_PATH_SEGMENT_END2 = `${OBJECT_ID_PATH_SEGMENT2}$`;
|
|
@@ -9709,7 +9874,7 @@ var gameScreenIdentifierList2 = [
|
|
|
9709
9874
|
}
|
|
9710
9875
|
];
|
|
9711
9876
|
|
|
9712
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
9877
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-4G4OFSBZ.mjs
|
|
9713
9878
|
import dayjs4 from "dayjs";
|
|
9714
9879
|
var statusOptions2 = [
|
|
9715
9880
|
...Object.values(EnumInviteStatus2).map((status) => ({
|
|
@@ -11122,7 +11287,7 @@ function normalizeAffiliatePromoCodes(promoCodes) {
|
|
|
11122
11287
|
}
|
|
11123
11288
|
|
|
11124
11289
|
// src/service/database.ts
|
|
11125
|
-
import
|
|
11290
|
+
import mongoose27 from "mongoose";
|
|
11126
11291
|
var connectToDatabase = async ({
|
|
11127
11292
|
appName,
|
|
11128
11293
|
dbName,
|
|
@@ -11135,7 +11300,7 @@ var connectToDatabase = async ({
|
|
|
11135
11300
|
// Fallback to MongoDB Atlas connection string
|
|
11136
11301
|
`mongodb+srv://${dbUser}:${dbPassword}@${dbName}.mongodb.net/?retryWrites=true&w=majority&appName=${appName}`
|
|
11137
11302
|
);
|
|
11138
|
-
await
|
|
11303
|
+
await mongoose27.connect(mongoUri);
|
|
11139
11304
|
const connectionType = mongodbUri ? "Local MongoDB" : "MongoDB Atlas";
|
|
11140
11305
|
console.log(
|
|
11141
11306
|
`${connectionType} connected from server/src/service/database.ts`
|
|
@@ -11148,7 +11313,7 @@ var connectToDatabase = async ({
|
|
|
11148
11313
|
|
|
11149
11314
|
// src/types/index.ts
|
|
11150
11315
|
import express from "express";
|
|
11151
|
-
import
|
|
11316
|
+
import mongoose28 from "mongoose";
|
|
11152
11317
|
var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
|
|
11153
11318
|
EnumPubSubEvents2["GET_CHAT_MESSAGE"] = "GET_CHAT_MESSAGE";
|
|
11154
11319
|
EnumPubSubEvents2["GET_NOTIFICATIONS"] = "GET_NOTIFICATIONS";
|
|
@@ -11278,15 +11443,15 @@ async function updateVendorBasedOnUserLicense(userId, licenceType) {
|
|
|
11278
11443
|
}
|
|
11279
11444
|
|
|
11280
11445
|
// src/service/objectIdToString.ts
|
|
11281
|
-
import
|
|
11446
|
+
import mongoose29 from "mongoose";
|
|
11282
11447
|
function isValidObjectId(value) {
|
|
11283
|
-
return
|
|
11448
|
+
return mongoose29.Types.ObjectId.isValid(value);
|
|
11284
11449
|
}
|
|
11285
11450
|
function convertObjectIdsToStrings(obj) {
|
|
11286
11451
|
if (obj === null || obj === void 0) {
|
|
11287
11452
|
return obj;
|
|
11288
11453
|
}
|
|
11289
|
-
if (obj instanceof
|
|
11454
|
+
if (obj instanceof mongoose29.Types.ObjectId) {
|
|
11290
11455
|
return obj.toString();
|
|
11291
11456
|
}
|
|
11292
11457
|
if (obj instanceof Date) {
|
|
@@ -11477,6 +11642,7 @@ export {
|
|
|
11477
11642
|
ChatModel,
|
|
11478
11643
|
ChatReportModel,
|
|
11479
11644
|
ContactDetailsSchema,
|
|
11645
|
+
CouponModel,
|
|
11480
11646
|
EnumPubSubEvents,
|
|
11481
11647
|
EventInfoModel,
|
|
11482
11648
|
EventModel,
|
|
@@ -11514,7 +11680,7 @@ export {
|
|
|
11514
11680
|
locationGeoSchema,
|
|
11515
11681
|
locationsSchema,
|
|
11516
11682
|
mapVendorLicenceToSubscriptionRewardType,
|
|
11517
|
-
|
|
11683
|
+
mongoose28 as mongoose,
|
|
11518
11684
|
normalizeAffiliatePromoCodes,
|
|
11519
11685
|
normalizePromoCode,
|
|
11520
11686
|
notifyUsers,
|
|
@@ -11532,6 +11698,7 @@ export {
|
|
|
11532
11698
|
updateRelationDatesToUnavailable,
|
|
11533
11699
|
updateSingleDateTimeStatus,
|
|
11534
11700
|
updateVendorBasedOnUserLicense,
|
|
11535
|
-
userLicenseSchema
|
|
11701
|
+
userLicenseSchema,
|
|
11702
|
+
vendorProductTypeSchema
|
|
11536
11703
|
};
|
|
11537
11704
|
//# sourceMappingURL=index.mjs.map
|