@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
|
@@ -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-7GXZS3LI.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,15 @@ 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
|
|
5465
|
+
hasCoupon
|
|
5463
5466
|
name
|
|
5464
5467
|
price
|
|
5465
5468
|
priceUnit
|
|
5466
5469
|
productGroups
|
|
5470
|
+
updatedAt
|
|
5467
5471
|
}
|
|
5468
5472
|
`;
|
|
5469
5473
|
var VENDOR = gql`
|
|
@@ -7766,6 +7770,109 @@ var ASSIGN_AFFILIATE_BONUS_REWARD_MUTATION = gql`
|
|
|
7766
7770
|
}
|
|
7767
7771
|
${AFFILIATE_FIELDS_FRAGMENT}
|
|
7768
7772
|
`;
|
|
7773
|
+
var COUPON_CODE_FIELDS_FRAGMENT = gql`
|
|
7774
|
+
fragment CouponCodeFields on CouponCodeType {
|
|
7775
|
+
code
|
|
7776
|
+
qrCode {
|
|
7777
|
+
...ResourceImageFields
|
|
7778
|
+
}
|
|
7779
|
+
}
|
|
7780
|
+
${RESOURCE_IMAGE_FIELDS_FRAGMENT}
|
|
7781
|
+
`;
|
|
7782
|
+
var COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT = gql`
|
|
7783
|
+
fragment CouponParticipantUserFields on CouponParticipantUserType {
|
|
7784
|
+
couponCount
|
|
7785
|
+
couponRedeemedAt
|
|
7786
|
+
createdAt
|
|
7787
|
+
updatedAt
|
|
7788
|
+
userId
|
|
7789
|
+
}
|
|
7790
|
+
`;
|
|
7791
|
+
var PRODUCT_COUPON_FIELDS_FRAGMENT = gql`
|
|
7792
|
+
fragment ProductCouponFields on ProductCouponType {
|
|
7793
|
+
_id
|
|
7794
|
+
active
|
|
7795
|
+
couponCode {
|
|
7796
|
+
...CouponCodeFields
|
|
7797
|
+
}
|
|
7798
|
+
couponDescription
|
|
7799
|
+
couponOption
|
|
7800
|
+
createdAt
|
|
7801
|
+
endDate
|
|
7802
|
+
participantProduct {
|
|
7803
|
+
...VendorProductListFields
|
|
7804
|
+
}
|
|
7805
|
+
participantUsers {
|
|
7806
|
+
...CouponParticipantUserFields
|
|
7807
|
+
}
|
|
7808
|
+
startDate
|
|
7809
|
+
updatedAt
|
|
7810
|
+
}
|
|
7811
|
+
${COUPON_CODE_FIELDS_FRAGMENT}
|
|
7812
|
+
${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
|
|
7813
|
+
${VENDOR_PRODUCT_LIST_FIELDS_FRAGMENT}
|
|
7814
|
+
`;
|
|
7815
|
+
var COUPON = gql`
|
|
7816
|
+
fragment CouponFields on CouponType {
|
|
7817
|
+
_id
|
|
7818
|
+
active
|
|
7819
|
+
productCoupons {
|
|
7820
|
+
...ProductCouponFields
|
|
7821
|
+
}
|
|
7822
|
+
createdAt
|
|
7823
|
+
deletedAt
|
|
7824
|
+
updatedAt
|
|
7825
|
+
}
|
|
7826
|
+
${PRODUCT_COUPON_FIELDS_FRAGMENT}
|
|
7827
|
+
${COUPON_CODE_FIELDS_FRAGMENT}
|
|
7828
|
+
${COUPON_PARTICIPANT_USER_FIELDS_FRAGMENT}
|
|
7829
|
+
`;
|
|
7830
|
+
var GET_COUPONS = gql`
|
|
7831
|
+
query getCoupons {
|
|
7832
|
+
coupons {
|
|
7833
|
+
...CouponFields
|
|
7834
|
+
}
|
|
7835
|
+
}
|
|
7836
|
+
${COUPON}
|
|
7837
|
+
`;
|
|
7838
|
+
var GET_COUPON = gql`
|
|
7839
|
+
query getCoupon($_id: ID!) {
|
|
7840
|
+
coupon(_id: $_id) {
|
|
7841
|
+
...CouponFields
|
|
7842
|
+
}
|
|
7843
|
+
}
|
|
7844
|
+
${COUPON}
|
|
7845
|
+
`;
|
|
7846
|
+
var CREATE_COUPON_MUTATION = gql`
|
|
7847
|
+
mutation createCoupon($input: CouponInputType!) {
|
|
7848
|
+
createCoupon(input: $input) {
|
|
7849
|
+
data {
|
|
7850
|
+
...CouponFields
|
|
7851
|
+
}
|
|
7852
|
+
message
|
|
7853
|
+
}
|
|
7854
|
+
}
|
|
7855
|
+
${COUPON}
|
|
7856
|
+
`;
|
|
7857
|
+
var UPDATE_COUPON_MUTATION = gql`
|
|
7858
|
+
mutation updateCoupon($_id: ID!, $input: CouponInputType!) {
|
|
7859
|
+
updateCoupon(_id: $_id, input: $input) {
|
|
7860
|
+
data {
|
|
7861
|
+
...CouponFields
|
|
7862
|
+
}
|
|
7863
|
+
message
|
|
7864
|
+
}
|
|
7865
|
+
}
|
|
7866
|
+
${COUPON}
|
|
7867
|
+
`;
|
|
7868
|
+
var DELETE_COUPON_MUTATION = gql`
|
|
7869
|
+
mutation deleteCoupon($_id: ID!) {
|
|
7870
|
+
deleteCoupon(_id: $_id) {
|
|
7871
|
+
data
|
|
7872
|
+
message
|
|
7873
|
+
}
|
|
7874
|
+
}
|
|
7875
|
+
`;
|
|
7769
7876
|
var PKG = "@timardex/cluemart-shared";
|
|
7770
7877
|
var IMAGE_EXTENSION = ".webp";
|
|
7771
7878
|
var posterIds = [
|
|
@@ -8902,20 +9009,21 @@ var VerificationTokenModel = import_mongoose12.default.models.VerificationToken
|
|
|
8902
9009
|
// src/mongoose/vendor/Vendor.ts
|
|
8903
9010
|
var import_mongoose13 = __toESM(require("mongoose"));
|
|
8904
9011
|
var MongooseSchema13 = import_mongoose13.default.Schema;
|
|
8905
|
-
var
|
|
9012
|
+
var vendorProductTypeSchema = new MongooseSchema13(
|
|
8906
9013
|
{
|
|
8907
9014
|
description: { required: false, type: String },
|
|
8908
|
-
|
|
8909
|
-
|
|
8910
|
-
|
|
9015
|
+
hasCoupon: { default: false, required: false, type: Boolean },
|
|
9016
|
+
name: { required: true, type: String },
|
|
9017
|
+
price: { required: true, type: Number },
|
|
9018
|
+
priceUnit: { required: true, type: String },
|
|
8911
9019
|
productGroups: { required: false, type: [String] }
|
|
8912
9020
|
},
|
|
8913
|
-
{
|
|
9021
|
+
{ timestamps: true }
|
|
8914
9022
|
);
|
|
8915
9023
|
var productWrapperSchema = new MongooseSchema13(
|
|
8916
9024
|
{
|
|
8917
|
-
active: { default: false, type: Boolean },
|
|
8918
|
-
productsList: { required: false, type: [
|
|
9025
|
+
active: { default: false, required: true, type: Boolean },
|
|
9026
|
+
productsList: { required: false, type: [vendorProductTypeSchema] }
|
|
8919
9027
|
},
|
|
8920
9028
|
{ _id: false }
|
|
8921
9029
|
);
|
|
@@ -8942,7 +9050,7 @@ var calendarSchema = new MongooseSchema13(
|
|
|
8942
9050
|
);
|
|
8943
9051
|
var calendarWrapperSchema = new MongooseSchema13(
|
|
8944
9052
|
{
|
|
8945
|
-
active: { default: false, type: Boolean },
|
|
9053
|
+
active: { default: false, required: true, type: Boolean },
|
|
8946
9054
|
calendarData: { required: false, type: [calendarSchema] }
|
|
8947
9055
|
},
|
|
8948
9056
|
{ _id: false }
|
|
@@ -9367,9 +9475,9 @@ var gameDataSchemas = {
|
|
|
9367
9475
|
[EnumGameType.ODD_ONE_OUT]: schemaPuzzleGameData
|
|
9368
9476
|
};
|
|
9369
9477
|
var gameDataDefinition = Object.fromEntries(
|
|
9370
|
-
Object.entries(gameDataSchemas).map(([key,
|
|
9478
|
+
Object.entries(gameDataSchemas).map(([key, schema19]) => [
|
|
9371
9479
|
key,
|
|
9372
|
-
{ default: null, required: false, type:
|
|
9480
|
+
{ default: null, required: false, type: schema19 }
|
|
9373
9481
|
])
|
|
9374
9482
|
);
|
|
9375
9483
|
var gameHistorySchema = new MongooseSchema23(
|
|
@@ -9594,6 +9702,63 @@ schema17.index(
|
|
|
9594
9702
|
);
|
|
9595
9703
|
var AffiliateModel = import_mongoose25.default.models.Affiliate || import_mongoose25.default.model("Affiliate", schema17);
|
|
9596
9704
|
|
|
9705
|
+
// src/mongoose/Coupon.ts
|
|
9706
|
+
var import_mongoose26 = __toESM(require("mongoose"));
|
|
9707
|
+
var MongooseSchema26 = import_mongoose26.default.Schema;
|
|
9708
|
+
var couponOptionSchema = new MongooseSchema26(
|
|
9709
|
+
{
|
|
9710
|
+
buy: { required: true, type: Number },
|
|
9711
|
+
get: { required: true, type: Number },
|
|
9712
|
+
unit: { required: true, type: String }
|
|
9713
|
+
},
|
|
9714
|
+
{ _id: false }
|
|
9715
|
+
);
|
|
9716
|
+
var couponCodeSchema = new MongooseSchema26(
|
|
9717
|
+
{
|
|
9718
|
+
code: { required: true, type: String },
|
|
9719
|
+
qrCode: { required: true, type: ResourceImageTypeSchema }
|
|
9720
|
+
},
|
|
9721
|
+
{ _id: false }
|
|
9722
|
+
);
|
|
9723
|
+
var couponParticipantUserSchema = new MongooseSchema26(
|
|
9724
|
+
{
|
|
9725
|
+
couponCount: { default: 0, required: true, type: Number },
|
|
9726
|
+
couponRedeemedAt: { default: null, required: false, type: Date },
|
|
9727
|
+
userId: {
|
|
9728
|
+
ref: "User",
|
|
9729
|
+
required: true,
|
|
9730
|
+
type: import_mongoose26.default.Schema.Types.ObjectId
|
|
9731
|
+
}
|
|
9732
|
+
},
|
|
9733
|
+
{ timestamps: true }
|
|
9734
|
+
);
|
|
9735
|
+
var productCouponSchema = new MongooseSchema26(
|
|
9736
|
+
{
|
|
9737
|
+
active: { default: true, required: true, type: Boolean },
|
|
9738
|
+
couponCode: { required: true, type: couponCodeSchema },
|
|
9739
|
+
couponDescription: { required: true, type: String },
|
|
9740
|
+
couponOption: { required: true, type: couponOptionSchema },
|
|
9741
|
+
endDate: { required: true, type: Date },
|
|
9742
|
+
participantProduct: { required: true, type: vendorProductTypeSchema },
|
|
9743
|
+
participantUsers: {
|
|
9744
|
+
default: null,
|
|
9745
|
+
required: false,
|
|
9746
|
+
type: [couponParticipantUserSchema]
|
|
9747
|
+
},
|
|
9748
|
+
startDate: { required: true, type: Date }
|
|
9749
|
+
},
|
|
9750
|
+
{ timestamps: true }
|
|
9751
|
+
);
|
|
9752
|
+
var schema18 = new MongooseSchema26(
|
|
9753
|
+
{
|
|
9754
|
+
active: { default: true, required: true, type: Boolean },
|
|
9755
|
+
deletedAt: { default: null, required: false, type: Date },
|
|
9756
|
+
productCoupons: { required: false, type: [productCouponSchema] }
|
|
9757
|
+
},
|
|
9758
|
+
{ timestamps: true }
|
|
9759
|
+
);
|
|
9760
|
+
var CouponModel = import_mongoose26.default.models.Coupon || import_mongoose26.default.model("Coupon", schema18);
|
|
9761
|
+
|
|
9597
9762
|
// src/service/promoCode/constants.ts
|
|
9598
9763
|
var ACTIVE_NOT_DELETED_FILTER = {
|
|
9599
9764
|
active: true,
|
|
@@ -9664,7 +9829,7 @@ var SHARE_RESOURCE_LABEL2 = {
|
|
|
9664
9829
|
school: "School"
|
|
9665
9830
|
};
|
|
9666
9831
|
|
|
9667
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
9832
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-7TL4ZSUO.mjs
|
|
9668
9833
|
var PROMO_CODE_PREFIX2 = "CM-";
|
|
9669
9834
|
var OBJECT_ID_PATH_SEGMENT2 = "[a-f0-9]{24}";
|
|
9670
9835
|
var OBJECT_ID_PATH_SEGMENT_END2 = `${OBJECT_ID_PATH_SEGMENT2}$`;
|
|
@@ -9766,7 +9931,7 @@ var gameScreenIdentifierList2 = [
|
|
|
9766
9931
|
}
|
|
9767
9932
|
];
|
|
9768
9933
|
|
|
9769
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
9934
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-4G4OFSBZ.mjs
|
|
9770
9935
|
var import_dayjs4 = __toESM(require("dayjs"), 1);
|
|
9771
9936
|
var statusOptions2 = [
|
|
9772
9937
|
...Object.values(EnumInviteStatus2).map((status) => ({
|
|
@@ -11179,7 +11344,7 @@ function normalizeAffiliatePromoCodes(promoCodes) {
|
|
|
11179
11344
|
}
|
|
11180
11345
|
|
|
11181
11346
|
// src/service/database.ts
|
|
11182
|
-
var
|
|
11347
|
+
var import_mongoose30 = __toESM(require("mongoose"));
|
|
11183
11348
|
var connectToDatabase = async ({
|
|
11184
11349
|
appName,
|
|
11185
11350
|
dbName,
|
|
@@ -11192,7 +11357,7 @@ var connectToDatabase = async ({
|
|
|
11192
11357
|
// Fallback to MongoDB Atlas connection string
|
|
11193
11358
|
`mongodb+srv://${dbUser}:${dbPassword}@${dbName}.mongodb.net/?retryWrites=true&w=majority&appName=${appName}`
|
|
11194
11359
|
);
|
|
11195
|
-
await
|
|
11360
|
+
await import_mongoose30.default.connect(mongoUri);
|
|
11196
11361
|
const connectionType = mongodbUri ? "Local MongoDB" : "MongoDB Atlas";
|
|
11197
11362
|
console.log(
|
|
11198
11363
|
`${connectionType} connected from server/src/service/database.ts`
|
|
@@ -11205,7 +11370,7 @@ var connectToDatabase = async ({
|
|
|
11205
11370
|
|
|
11206
11371
|
// src/types/index.ts
|
|
11207
11372
|
var import_express = __toESM(require("express"));
|
|
11208
|
-
var
|
|
11373
|
+
var import_mongoose31 = __toESM(require("mongoose"));
|
|
11209
11374
|
|
|
11210
11375
|
// src/service/notifyUsers.ts
|
|
11211
11376
|
async function publishNotificationEvents(userId, pubsub) {
|
|
@@ -11328,15 +11493,15 @@ async function updateVendorBasedOnUserLicense(userId, licenceType) {
|
|
|
11328
11493
|
}
|
|
11329
11494
|
|
|
11330
11495
|
// src/service/objectIdToString.ts
|
|
11331
|
-
var
|
|
11496
|
+
var import_mongoose34 = __toESM(require("mongoose"));
|
|
11332
11497
|
function isValidObjectId(value) {
|
|
11333
|
-
return
|
|
11498
|
+
return import_mongoose34.default.Types.ObjectId.isValid(value);
|
|
11334
11499
|
}
|
|
11335
11500
|
function convertObjectIdsToStrings(obj) {
|
|
11336
11501
|
if (obj === null || obj === void 0) {
|
|
11337
11502
|
return obj;
|
|
11338
11503
|
}
|
|
11339
|
-
if (obj instanceof
|
|
11504
|
+
if (obj instanceof import_mongoose34.default.Types.ObjectId) {
|
|
11340
11505
|
return obj.toString();
|
|
11341
11506
|
}
|
|
11342
11507
|
if (obj instanceof Date) {
|