@timardex/cluemart-server-shared 1.1.12 → 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-ICAMGPFE.mjs → chunk-VS3WIV6D.mjs} +172 -7
- package/dist/chunk-VS3WIV6D.mjs.map +1 -0
- package/dist/index.cjs +183 -16
- 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 +180 -15
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +174 -7
- 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 +176 -13
- 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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
|
|
2
|
-
import { AdType, ReportChatUser, GoogleImportedMarket, PushTokenType, ResourceActivityType, UserActivityEvent, UserType, VendorType, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, PostResource, AppSettingsType, GameType, GameDocType, SchoolType } from '@timardex/cluemart-shared';
|
|
2
|
+
import { AdType, ReportChatUser, GoogleImportedMarket, PushTokenType, ResourceActivityType, UserActivityEvent, UserType, VendorProductList, VendorType, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, PostResource, AppSettingsType, GameType, GameDocType, SchoolType, CouponType, ProductCouponType, CouponParticipantUserType } from '@timardex/cluemart-shared';
|
|
3
3
|
import mongoose__default from 'mongoose';
|
|
4
4
|
import { O as ObjectId } from '../Chat-Wn7yfc3v.mjs';
|
|
5
5
|
export { C as ChatModel, N as NotificationModel, a as SchemaChatMessageReactionType, S as SchemaChatMessageReplyPreviewType, b as SchemaChatMessageSeenType, c as SchemaChatMessageType, e as SchemaChatType, f as SchemaCreateBulkNotificationInput, g as SchemaNotificationType, d as SchemaParticipantType } from '../Chat-Wn7yfc3v.mjs';
|
|
@@ -128,6 +128,15 @@ declare const VerificationTokenModel: mongoose__default.Model<VerificationTokenT
|
|
|
128
128
|
__v: number;
|
|
129
129
|
}, any>;
|
|
130
130
|
|
|
131
|
+
declare const vendorProductTypeSchema: mongoose__default.Schema<VendorProductList, mongoose__default.Model<VendorProductList, any, any, any, mongoose__default.Document<unknown, any, VendorProductList, any, {}> & VendorProductList & Required<{
|
|
132
|
+
_id: string;
|
|
133
|
+
}> & {
|
|
134
|
+
__v: number;
|
|
135
|
+
}, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, VendorProductList, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<VendorProductList>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<VendorProductList> & Required<{
|
|
136
|
+
_id: string;
|
|
137
|
+
}> & {
|
|
138
|
+
__v: number;
|
|
139
|
+
}>;
|
|
131
140
|
type SchemaVendorType = Omit<VendorType, "vendorInfoId" | "owner" | "adIds" | "unregisteredVendorId"> & {
|
|
132
141
|
adIds?: ObjectId[];
|
|
133
142
|
owner: SchemaOwnerType;
|
|
@@ -282,4 +291,21 @@ declare const SchoolModel: mongoose__default.Model<SchoolDocument, {}, {}, {}, m
|
|
|
282
291
|
__v: number;
|
|
283
292
|
}, any>;
|
|
284
293
|
|
|
285
|
-
|
|
294
|
+
type SchemaCouponParticipantUserType = Omit<CouponParticipantUserType, "userId"> & {
|
|
295
|
+
userId: ObjectId;
|
|
296
|
+
};
|
|
297
|
+
type SchemaProductCouponType = Omit<ProductCouponType, "participantUsers"> & {
|
|
298
|
+
participantUsers: SchemaCouponParticipantUserType[] | null;
|
|
299
|
+
};
|
|
300
|
+
type CouponDocument = Omit<CouponType, "productCoupons"> & {
|
|
301
|
+
productCoupons: SchemaProductCouponType[];
|
|
302
|
+
};
|
|
303
|
+
declare const CouponModel: mongoose__default.Model<CouponDocument, {}, {}, {}, mongoose__default.Document<unknown, {}, CouponDocument, {}, {}> & Omit<CouponType, "productCoupons"> & {
|
|
304
|
+
productCoupons: SchemaProductCouponType[];
|
|
305
|
+
} & Required<{
|
|
306
|
+
_id: string;
|
|
307
|
+
}> & {
|
|
308
|
+
__v: number;
|
|
309
|
+
}, any>;
|
|
310
|
+
|
|
311
|
+
export { APP_SETTINGS_ID, AdModel, AppSettingModel, ChatReportModel, type CouponDocument, CouponModel, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, PartnerModel, PostModel, PushTokenModel, ResourceActivityModel, type SchemaChatReportType, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, SchemaOwnerType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaUnregisteredVendorInvitationType, type SchemaUnregisteredVendorType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SchoolModel, StallTypeSchema, UnregisteredVendorModel, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, refundPolicySchema, vendorProductTypeSchema };
|
package/dist/mongoose/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
|
|
2
|
-
import { AdType, ReportChatUser, GoogleImportedMarket, PushTokenType, ResourceActivityType, UserActivityEvent, UserType, VendorType, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, PostResource, AppSettingsType, GameType, GameDocType, SchoolType } from '@timardex/cluemart-shared';
|
|
2
|
+
import { AdType, ReportChatUser, GoogleImportedMarket, PushTokenType, ResourceActivityType, UserActivityEvent, UserType, VendorProductList, VendorType, VendorInfoType, UnregisteredVendorInvitationType, UnregisteredVendorType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, PostResource, AppSettingsType, GameType, GameDocType, SchoolType, CouponType, ProductCouponType, CouponParticipantUserType } from '@timardex/cluemart-shared';
|
|
3
3
|
import mongoose__default from 'mongoose';
|
|
4
4
|
import { O as ObjectId } from '../Chat-Wn7yfc3v.js';
|
|
5
5
|
export { C as ChatModel, N as NotificationModel, a as SchemaChatMessageReactionType, S as SchemaChatMessageReplyPreviewType, b as SchemaChatMessageSeenType, c as SchemaChatMessageType, e as SchemaChatType, f as SchemaCreateBulkNotificationInput, g as SchemaNotificationType, d as SchemaParticipantType } from '../Chat-Wn7yfc3v.js';
|
|
@@ -128,6 +128,15 @@ declare const VerificationTokenModel: mongoose__default.Model<VerificationTokenT
|
|
|
128
128
|
__v: number;
|
|
129
129
|
}, any>;
|
|
130
130
|
|
|
131
|
+
declare const vendorProductTypeSchema: mongoose__default.Schema<VendorProductList, mongoose__default.Model<VendorProductList, any, any, any, mongoose__default.Document<unknown, any, VendorProductList, any, {}> & VendorProductList & Required<{
|
|
132
|
+
_id: string;
|
|
133
|
+
}> & {
|
|
134
|
+
__v: number;
|
|
135
|
+
}, any>, {}, {}, {}, {}, mongoose__default.DefaultSchemaOptions, VendorProductList, mongoose__default.Document<unknown, {}, mongoose__default.FlatRecord<VendorProductList>, {}, mongoose__default.ResolveSchemaOptions<mongoose__default.DefaultSchemaOptions>> & mongoose__default.FlatRecord<VendorProductList> & Required<{
|
|
136
|
+
_id: string;
|
|
137
|
+
}> & {
|
|
138
|
+
__v: number;
|
|
139
|
+
}>;
|
|
131
140
|
type SchemaVendorType = Omit<VendorType, "vendorInfoId" | "owner" | "adIds" | "unregisteredVendorId"> & {
|
|
132
141
|
adIds?: ObjectId[];
|
|
133
142
|
owner: SchemaOwnerType;
|
|
@@ -282,4 +291,21 @@ declare const SchoolModel: mongoose__default.Model<SchoolDocument, {}, {}, {}, m
|
|
|
282
291
|
__v: number;
|
|
283
292
|
}, any>;
|
|
284
293
|
|
|
285
|
-
|
|
294
|
+
type SchemaCouponParticipantUserType = Omit<CouponParticipantUserType, "userId"> & {
|
|
295
|
+
userId: ObjectId;
|
|
296
|
+
};
|
|
297
|
+
type SchemaProductCouponType = Omit<ProductCouponType, "participantUsers"> & {
|
|
298
|
+
participantUsers: SchemaCouponParticipantUserType[] | null;
|
|
299
|
+
};
|
|
300
|
+
type CouponDocument = Omit<CouponType, "productCoupons"> & {
|
|
301
|
+
productCoupons: SchemaProductCouponType[];
|
|
302
|
+
};
|
|
303
|
+
declare const CouponModel: mongoose__default.Model<CouponDocument, {}, {}, {}, mongoose__default.Document<unknown, {}, CouponDocument, {}, {}> & Omit<CouponType, "productCoupons"> & {
|
|
304
|
+
productCoupons: SchemaProductCouponType[];
|
|
305
|
+
} & Required<{
|
|
306
|
+
_id: string;
|
|
307
|
+
}> & {
|
|
308
|
+
__v: number;
|
|
309
|
+
}, any>;
|
|
310
|
+
|
|
311
|
+
export { APP_SETTINGS_ID, AdModel, AppSettingModel, ChatReportModel, type CouponDocument, CouponModel, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, PartnerModel, PostModel, PushTokenModel, ResourceActivityModel, type SchemaChatReportType, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, SchemaOwnerType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaUnregisteredVendorInvitationType, type SchemaUnregisteredVendorType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SchoolModel, StallTypeSchema, UnregisteredVendorModel, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, refundPolicySchema, vendorProductTypeSchema };
|
package/dist/mongoose/index.mjs
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
ChatModel,
|
|
8
8
|
ChatReportModel,
|
|
9
9
|
ContactDetailsSchema,
|
|
10
|
+
CouponModel,
|
|
10
11
|
EventInfoModel,
|
|
11
12
|
EventModel,
|
|
12
13
|
GameModel,
|
|
@@ -38,8 +39,9 @@ import {
|
|
|
38
39
|
resourceRelationsSchema,
|
|
39
40
|
socialShareResourceSchema,
|
|
40
41
|
termsAgreementSchema,
|
|
41
|
-
userLicenseSchema
|
|
42
|
-
|
|
42
|
+
userLicenseSchema,
|
|
43
|
+
vendorProductTypeSchema
|
|
44
|
+
} from "../chunk-VS3WIV6D.mjs";
|
|
43
45
|
export {
|
|
44
46
|
APP_SETTINGS_ID,
|
|
45
47
|
AdModel,
|
|
@@ -49,6 +51,7 @@ export {
|
|
|
49
51
|
ChatModel,
|
|
50
52
|
ChatReportModel,
|
|
51
53
|
ContactDetailsSchema,
|
|
54
|
+
CouponModel,
|
|
52
55
|
EventInfoModel,
|
|
53
56
|
EventModel,
|
|
54
57
|
GameModel,
|
|
@@ -80,6 +83,7 @@ export {
|
|
|
80
83
|
resourceRelationsSchema,
|
|
81
84
|
socialShareResourceSchema,
|
|
82
85
|
termsAgreementSchema,
|
|
83
|
-
userLicenseSchema
|
|
86
|
+
userLicenseSchema,
|
|
87
|
+
vendorProductTypeSchema
|
|
84
88
|
};
|
|
85
89
|
//# sourceMappingURL=index.mjs.map
|
package/dist/service/index.cjs
CHANGED
|
@@ -5459,11 +5459,14 @@ var VENDOR_DATETIME_FIELDS_FRAGMENT = gql`
|
|
|
5459
5459
|
`;
|
|
5460
5460
|
var VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT = gql`
|
|
5461
5461
|
fragment VendorProductListFields on VendorProductListType {
|
|
5462
|
+
_id
|
|
5463
|
+
createdAt
|
|
5462
5464
|
description
|
|
5463
5465
|
name
|
|
5464
5466
|
price
|
|
5465
5467
|
priceUnit
|
|
5466
5468
|
productGroups
|
|
5469
|
+
updatedAt
|
|
5467
5470
|
}
|
|
5468
5471
|
`;
|
|
5469
5472
|
var VENDOR = gql`
|
|
@@ -7766,6 +7769,109 @@ var ASSIGN_AFFILIATE_BONUS_REWARD_MUTATION = gql`
|
|
|
7766
7769
|
}
|
|
7767
7770
|
${AFFILIATE_FIELDS_FRAGMENT}
|
|
7768
7771
|
`;
|
|
7772
|
+
var COUPON_CODE_FIELDS_FRAGMENT = gql`
|
|
7773
|
+
fragment CouponCodeFields on CouponCodeType {
|
|
7774
|
+
code
|
|
7775
|
+
qrCode {
|
|
7776
|
+
...ResourceImageFields
|
|
7777
|
+
}
|
|
7778
|
+
}
|
|
7779
|
+
${RESOURCE_IMAGE_FIELDS_FRAGMENT}
|
|
7780
|
+
`;
|
|
7781
|
+
var COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT = gql`
|
|
7782
|
+
fragment CouponParticipantUserFields on CouponParticipantUserType {
|
|
7783
|
+
couponCount
|
|
7784
|
+
couponRedeemedAt
|
|
7785
|
+
createdAt
|
|
7786
|
+
updatedAt
|
|
7787
|
+
userId
|
|
7788
|
+
}
|
|
7789
|
+
`;
|
|
7790
|
+
var PRODUCT_COUPON_FIELDS_FRAGMENT = gql`
|
|
7791
|
+
fragment ProductCouponFields on ProductCouponType {
|
|
7792
|
+
_id
|
|
7793
|
+
active
|
|
7794
|
+
couponCode {
|
|
7795
|
+
...CouponCodeFields
|
|
7796
|
+
}
|
|
7797
|
+
couponDescription
|
|
7798
|
+
couponOption
|
|
7799
|
+
createdAt
|
|
7800
|
+
endDate
|
|
7801
|
+
participantProduct {
|
|
7802
|
+
...VendorProductListFields
|
|
7803
|
+
}
|
|
7804
|
+
participantUsers {
|
|
7805
|
+
...CouponParticipantUserFields
|
|
7806
|
+
}
|
|
7807
|
+
startDate
|
|
7808
|
+
updatedAt
|
|
7809
|
+
}
|
|
7810
|
+
${COUPON_CODE_FIELDS_FRAGMENT}
|
|
7811
|
+
${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
|
|
7812
|
+
${VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT}
|
|
7813
|
+
`;
|
|
7814
|
+
var COUPON = gql`
|
|
7815
|
+
fragment CouponFields on CouponType {
|
|
7816
|
+
_id
|
|
7817
|
+
active
|
|
7818
|
+
productCoupons {
|
|
7819
|
+
...ProductCouponFields
|
|
7820
|
+
}
|
|
7821
|
+
createdAt
|
|
7822
|
+
deletedAt
|
|
7823
|
+
updatedAt
|
|
7824
|
+
}
|
|
7825
|
+
${PRODUCT_COUPON_FIELDS_FRAGMENT}
|
|
7826
|
+
${COUPON_CODE_FIELDS_FRAGMENT}
|
|
7827
|
+
${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
|
|
7828
|
+
`;
|
|
7829
|
+
var GET_COUPONS = gql`
|
|
7830
|
+
query getCoupons {
|
|
7831
|
+
coupons {
|
|
7832
|
+
...CouponFields
|
|
7833
|
+
}
|
|
7834
|
+
}
|
|
7835
|
+
${COUPON}
|
|
7836
|
+
`;
|
|
7837
|
+
var GET_COUPON = gql`
|
|
7838
|
+
query getCoupon($_id: ID!) {
|
|
7839
|
+
coupon(_id: $_id) {
|
|
7840
|
+
...CouponFields
|
|
7841
|
+
}
|
|
7842
|
+
}
|
|
7843
|
+
${COUPON}
|
|
7844
|
+
`;
|
|
7845
|
+
var CREATE_COUPON_MUTATION = gql`
|
|
7846
|
+
mutation createCoupon($input: CouponInputType!) {
|
|
7847
|
+
createCoupon(input: $input) {
|
|
7848
|
+
data {
|
|
7849
|
+
...CouponFields
|
|
7850
|
+
}
|
|
7851
|
+
message
|
|
7852
|
+
}
|
|
7853
|
+
}
|
|
7854
|
+
${COUPON}
|
|
7855
|
+
`;
|
|
7856
|
+
var UPDATE_COUPON_MUTATION = gql`
|
|
7857
|
+
mutation updateCoupon($_id: ID!, $input: CouponInputType!) {
|
|
7858
|
+
updateCoupon(_id: $_id, input: $input) {
|
|
7859
|
+
data {
|
|
7860
|
+
...CouponFields
|
|
7861
|
+
}
|
|
7862
|
+
message
|
|
7863
|
+
}
|
|
7864
|
+
}
|
|
7865
|
+
${COUPON}
|
|
7866
|
+
`;
|
|
7867
|
+
var DELETE_COUPON_MUTATION = gql`
|
|
7868
|
+
mutation deleteCoupon($_id: ID!) {
|
|
7869
|
+
deleteCoupon(_id: $_id) {
|
|
7870
|
+
data
|
|
7871
|
+
message
|
|
7872
|
+
}
|
|
7873
|
+
}
|
|
7874
|
+
`;
|
|
7769
7875
|
var PKG = "@timardex/cluemart-shared";
|
|
7770
7876
|
var IMAGE_EXTENSION = ".webp";
|
|
7771
7877
|
var posterIds = [
|
|
@@ -8902,7 +9008,7 @@ var VerificationTokenModel = import_mongoose12.default.models.VerificationToken
|
|
|
8902
9008
|
// src/mongoose/vendor/Vendor.ts
|
|
8903
9009
|
var import_mongoose13 = __toESM(require("mongoose"));
|
|
8904
9010
|
var MongooseSchema13 = import_mongoose13.default.Schema;
|
|
8905
|
-
var
|
|
9011
|
+
var vendorProductTypeSchema = new MongooseSchema13(
|
|
8906
9012
|
{
|
|
8907
9013
|
description: { required: false, type: String },
|
|
8908
9014
|
name: { required: false, type: String },
|
|
@@ -8910,12 +9016,12 @@ var productTypeSchema = new MongooseSchema13(
|
|
|
8910
9016
|
priceUnit: { required: false, type: String },
|
|
8911
9017
|
productGroups: { required: false, type: [String] }
|
|
8912
9018
|
},
|
|
8913
|
-
{
|
|
9019
|
+
{ timestamps: true }
|
|
8914
9020
|
);
|
|
8915
9021
|
var productWrapperSchema = new MongooseSchema13(
|
|
8916
9022
|
{
|
|
8917
9023
|
active: { default: false, type: Boolean },
|
|
8918
|
-
productsList: { required: false, type: [
|
|
9024
|
+
productsList: { required: false, type: [vendorProductTypeSchema] }
|
|
8919
9025
|
},
|
|
8920
9026
|
{ _id: false }
|
|
8921
9027
|
);
|
|
@@ -9367,9 +9473,9 @@ var gameDataSchemas = {
|
|
|
9367
9473
|
[EnumGameType.ODD_ONE_OUT]: schemaPuzzleGameData
|
|
9368
9474
|
};
|
|
9369
9475
|
var gameDataDefinition = Object.fromEntries(
|
|
9370
|
-
Object.entries(gameDataSchemas).map(([key,
|
|
9476
|
+
Object.entries(gameDataSchemas).map(([key, schema19]) => [
|
|
9371
9477
|
key,
|
|
9372
|
-
{ default: null, required: false, type:
|
|
9478
|
+
{ default: null, required: false, type: schema19 }
|
|
9373
9479
|
])
|
|
9374
9480
|
);
|
|
9375
9481
|
var gameHistorySchema = new MongooseSchema23(
|
|
@@ -9594,6 +9700,63 @@ schema17.index(
|
|
|
9594
9700
|
);
|
|
9595
9701
|
var AffiliateModel = import_mongoose25.default.models.Affiliate || import_mongoose25.default.model("Affiliate", schema17);
|
|
9596
9702
|
|
|
9703
|
+
// src/mongoose/Coupon.ts
|
|
9704
|
+
var import_mongoose26 = __toESM(require("mongoose"));
|
|
9705
|
+
var MongooseSchema26 = import_mongoose26.default.Schema;
|
|
9706
|
+
var couponOptionSchema = new MongooseSchema26(
|
|
9707
|
+
{
|
|
9708
|
+
buy: { required: true, type: Number },
|
|
9709
|
+
get: { required: true, type: Number },
|
|
9710
|
+
unit: { required: true, type: String }
|
|
9711
|
+
},
|
|
9712
|
+
{ _id: false }
|
|
9713
|
+
);
|
|
9714
|
+
var couponCodeSchema = new MongooseSchema26(
|
|
9715
|
+
{
|
|
9716
|
+
code: { required: true, type: String },
|
|
9717
|
+
qrCode: { required: true, type: ResourceImageTypeSchema }
|
|
9718
|
+
},
|
|
9719
|
+
{ _id: false }
|
|
9720
|
+
);
|
|
9721
|
+
var couponParticipantUserSchema = new MongooseSchema26(
|
|
9722
|
+
{
|
|
9723
|
+
couponCount: { default: 0, required: true, type: Number },
|
|
9724
|
+
couponRedeemedAt: { default: null, required: false, type: Date },
|
|
9725
|
+
userId: {
|
|
9726
|
+
ref: "User",
|
|
9727
|
+
required: true,
|
|
9728
|
+
type: import_mongoose26.default.Schema.Types.ObjectId
|
|
9729
|
+
}
|
|
9730
|
+
},
|
|
9731
|
+
{ timestamps: true }
|
|
9732
|
+
);
|
|
9733
|
+
var productCouponSchema = new MongooseSchema26(
|
|
9734
|
+
{
|
|
9735
|
+
active: { default: true, required: true, type: Boolean },
|
|
9736
|
+
couponCode: { required: true, type: couponCodeSchema },
|
|
9737
|
+
couponDescription: { required: true, type: String },
|
|
9738
|
+
couponOption: { required: true, type: couponOptionSchema },
|
|
9739
|
+
endDate: { required: true, type: Date },
|
|
9740
|
+
participantProduct: { required: true, type: vendorProductTypeSchema },
|
|
9741
|
+
participantUsers: {
|
|
9742
|
+
default: null,
|
|
9743
|
+
required: false,
|
|
9744
|
+
type: [couponParticipantUserSchema]
|
|
9745
|
+
},
|
|
9746
|
+
startDate: { required: true, type: Date }
|
|
9747
|
+
},
|
|
9748
|
+
{ timestamps: true }
|
|
9749
|
+
);
|
|
9750
|
+
var schema18 = new MongooseSchema26(
|
|
9751
|
+
{
|
|
9752
|
+
active: { default: true, required: true, type: Boolean },
|
|
9753
|
+
deletedAt: { default: null, required: false, type: Date },
|
|
9754
|
+
productCoupons: { required: false, type: [productCouponSchema] }
|
|
9755
|
+
},
|
|
9756
|
+
{ timestamps: true }
|
|
9757
|
+
);
|
|
9758
|
+
var CouponModel = import_mongoose26.default.models.Coupon || import_mongoose26.default.model("Coupon", schema18);
|
|
9759
|
+
|
|
9597
9760
|
// src/service/promoCode/constants.ts
|
|
9598
9761
|
var ACTIVE_NOT_DELETED_FILTER = {
|
|
9599
9762
|
active: true,
|
|
@@ -9664,7 +9827,7 @@ var SHARE_RESOURCE_LABEL2 = {
|
|
|
9664
9827
|
school: "School"
|
|
9665
9828
|
};
|
|
9666
9829
|
|
|
9667
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
9830
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-7TL4ZSUO.mjs
|
|
9668
9831
|
var PROMO_CODE_PREFIX2 = "CM-";
|
|
9669
9832
|
var OBJECT_ID_PATH_SEGMENT2 = "[a-f0-9]{24}";
|
|
9670
9833
|
var OBJECT_ID_PATH_SEGMENT_END2 = `${OBJECT_ID_PATH_SEGMENT2}$`;
|
|
@@ -9766,7 +9929,7 @@ var gameScreenIdentifierList2 = [
|
|
|
9766
9929
|
}
|
|
9767
9930
|
];
|
|
9768
9931
|
|
|
9769
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
9932
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-4G4OFSBZ.mjs
|
|
9770
9933
|
var import_dayjs4 = __toESM(require("dayjs"), 1);
|
|
9771
9934
|
var statusOptions2 = [
|
|
9772
9935
|
...Object.values(EnumInviteStatus2).map((status) => ({
|
|
@@ -11179,7 +11342,7 @@ function normalizeAffiliatePromoCodes(promoCodes) {
|
|
|
11179
11342
|
}
|
|
11180
11343
|
|
|
11181
11344
|
// src/service/database.ts
|
|
11182
|
-
var
|
|
11345
|
+
var import_mongoose30 = __toESM(require("mongoose"));
|
|
11183
11346
|
var connectToDatabase = async ({
|
|
11184
11347
|
appName,
|
|
11185
11348
|
dbName,
|
|
@@ -11192,7 +11355,7 @@ var connectToDatabase = async ({
|
|
|
11192
11355
|
// Fallback to MongoDB Atlas connection string
|
|
11193
11356
|
`mongodb+srv://${dbUser}:${dbPassword}@${dbName}.mongodb.net/?retryWrites=true&w=majority&appName=${appName}`
|
|
11194
11357
|
);
|
|
11195
|
-
await
|
|
11358
|
+
await import_mongoose30.default.connect(mongoUri);
|
|
11196
11359
|
const connectionType = mongodbUri ? "Local MongoDB" : "MongoDB Atlas";
|
|
11197
11360
|
console.log(
|
|
11198
11361
|
`${connectionType} connected from server/src/service/database.ts`
|
|
@@ -11205,7 +11368,7 @@ var connectToDatabase = async ({
|
|
|
11205
11368
|
|
|
11206
11369
|
// src/types/index.ts
|
|
11207
11370
|
var import_express = __toESM(require("express"));
|
|
11208
|
-
var
|
|
11371
|
+
var import_mongoose31 = __toESM(require("mongoose"));
|
|
11209
11372
|
|
|
11210
11373
|
// src/service/notifyUsers.ts
|
|
11211
11374
|
async function publishNotificationEvents(userId, pubsub) {
|
|
@@ -11328,15 +11491,15 @@ async function updateVendorBasedOnUserLicense(userId, licenceType) {
|
|
|
11328
11491
|
}
|
|
11329
11492
|
|
|
11330
11493
|
// src/service/objectIdToString.ts
|
|
11331
|
-
var
|
|
11494
|
+
var import_mongoose34 = __toESM(require("mongoose"));
|
|
11332
11495
|
function isValidObjectId(value) {
|
|
11333
|
-
return
|
|
11496
|
+
return import_mongoose34.default.Types.ObjectId.isValid(value);
|
|
11334
11497
|
}
|
|
11335
11498
|
function convertObjectIdsToStrings(obj) {
|
|
11336
11499
|
if (obj === null || obj === void 0) {
|
|
11337
11500
|
return obj;
|
|
11338
11501
|
}
|
|
11339
|
-
if (obj instanceof
|
|
11502
|
+
if (obj instanceof import_mongoose34.default.Types.ObjectId) {
|
|
11340
11503
|
return obj.toString();
|
|
11341
11504
|
}
|
|
11342
11505
|
if (obj instanceof Date) {
|