@timardex/cluemart-server-shared 1.0.101 → 1.0.103
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-UXSMDLHK.mjs → chunk-S3KEHFG3.mjs} +295 -316
- package/dist/chunk-S3KEHFG3.mjs.map +1 -0
- package/dist/index.cjs +292 -312
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +292 -312
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +290 -311
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +3 -3
- package/dist/mongoose/index.d.ts +3 -3
- package/dist/mongoose/index.mjs +1 -1
- package/dist/service/index.cjs +292 -312
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.mjs +3 -2
- package/dist/service/index.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-UXSMDLHK.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -6977,7 +6977,7 @@ var loginFields = [
|
|
|
6977
6977
|
...emailField
|
|
6978
6978
|
},
|
|
6979
6979
|
{
|
|
6980
|
-
helperText: "Enter password
|
|
6980
|
+
helperText: "Enter password",
|
|
6981
6981
|
keyboardType: "default",
|
|
6982
6982
|
name: "password",
|
|
6983
6983
|
placeholder: "Password",
|
|
@@ -6986,13 +6986,13 @@ var loginFields = [
|
|
|
6986
6986
|
];
|
|
6987
6987
|
var registerFields = [
|
|
6988
6988
|
{
|
|
6989
|
-
helperText: "Enter first name
|
|
6989
|
+
helperText: "Enter first name",
|
|
6990
6990
|
keyboardType: "default",
|
|
6991
6991
|
name: "firstName",
|
|
6992
6992
|
placeholder: "First Name"
|
|
6993
6993
|
},
|
|
6994
6994
|
{
|
|
6995
|
-
helperText: "Enter last name
|
|
6995
|
+
helperText: "Enter last name",
|
|
6996
6996
|
keyboardType: "default",
|
|
6997
6997
|
name: "lastName",
|
|
6998
6998
|
placeholder: "Last Name"
|
|
@@ -7001,7 +7001,7 @@ var registerFields = [
|
|
|
7001
7001
|
...emailField
|
|
7002
7002
|
},
|
|
7003
7003
|
{
|
|
7004
|
-
helperText: "Enter password
|
|
7004
|
+
helperText: "Enter password",
|
|
7005
7005
|
keyboardType: "default",
|
|
7006
7006
|
name: "password",
|
|
7007
7007
|
placeholder: "Password",
|
|
@@ -7011,17 +7011,17 @@ var registerFields = [
|
|
|
7011
7011
|
var requestPasswordResetFields = [
|
|
7012
7012
|
{
|
|
7013
7013
|
...emailField,
|
|
7014
|
-
helperText: "Enter email address to reset your password
|
|
7014
|
+
helperText: "Enter email address to reset your password"
|
|
7015
7015
|
}
|
|
7016
7016
|
];
|
|
7017
7017
|
var validateVerificationTokenFields = [
|
|
7018
7018
|
{
|
|
7019
7019
|
...emailField,
|
|
7020
7020
|
disabled: true,
|
|
7021
|
-
helperText: "Your email address
|
|
7021
|
+
helperText: "Your email address"
|
|
7022
7022
|
},
|
|
7023
7023
|
{
|
|
7024
|
-
helperText: "Enter the Verification code sent to you by email
|
|
7024
|
+
helperText: "Enter the Verification code sent to you by email",
|
|
7025
7025
|
keyboardType: "number-pad",
|
|
7026
7026
|
name: "verificationToken",
|
|
7027
7027
|
placeholder: "Verification code"
|
|
@@ -9597,29 +9597,27 @@ var AD_FIELDS_FRAGMENT = gql`
|
|
|
9597
9597
|
fragment AdFields on AdType {
|
|
9598
9598
|
_id
|
|
9599
9599
|
active
|
|
9600
|
-
adStyle
|
|
9601
|
-
adType
|
|
9602
9600
|
clicks
|
|
9603
9601
|
createdAt
|
|
9604
9602
|
end
|
|
9605
9603
|
impressions
|
|
9606
|
-
|
|
9607
|
-
|
|
9608
|
-
|
|
9609
|
-
|
|
9610
|
-
|
|
9611
|
-
|
|
9612
|
-
|
|
9613
|
-
|
|
9614
|
-
|
|
9615
|
-
|
|
9604
|
+
resource {
|
|
9605
|
+
adDescription
|
|
9606
|
+
adImage
|
|
9607
|
+
adStyle
|
|
9608
|
+
adTitle
|
|
9609
|
+
adType
|
|
9610
|
+
resourceId
|
|
9611
|
+
resourceName
|
|
9612
|
+
resourceRegion
|
|
9613
|
+
resourceType
|
|
9616
9614
|
}
|
|
9615
|
+
showOn
|
|
9617
9616
|
start
|
|
9618
9617
|
status
|
|
9619
9618
|
targetRegion
|
|
9620
9619
|
updatedAt
|
|
9621
9620
|
}
|
|
9622
|
-
${SOCIAL_MEDIA_FIELDS_FRAGMENT}
|
|
9623
9621
|
`;
|
|
9624
9622
|
var GET_ADS = gql`
|
|
9625
9623
|
query getAds {
|
|
@@ -10242,32 +10240,19 @@ var eventInfoSchema = create$3().shape({
|
|
|
10242
10240
|
}
|
|
10243
10241
|
).required("Refund policy is required")
|
|
10244
10242
|
});
|
|
10245
|
-
var
|
|
10246
|
-
description: create$6().
|
|
10247
|
-
name: create$6().
|
|
10248
|
-
|
|
10249
|
-
|
|
10250
|
-
|
|
10251
|
-
return value !== null && value !== void 0;
|
|
10252
|
-
}),
|
|
10253
|
-
priceUnit: create$6().trim().nullable().defined().test("unit-required", "Product unit is required", function(value) {
|
|
10254
|
-
return value !== null && value !== void 0 && value.trim().length > 0;
|
|
10255
|
-
}),
|
|
10256
|
-
productGroups: create$2().of(create$6().defined()).transform(
|
|
10257
|
-
(value, originalValue) => originalValue === void 0 ? null : value
|
|
10258
|
-
).nullable().test(
|
|
10259
|
-
"productGroups-required",
|
|
10260
|
-
"Product groups are required",
|
|
10261
|
-
function(value) {
|
|
10262
|
-
return value !== null && Array.isArray(value) && value.length > 0;
|
|
10263
|
-
}
|
|
10264
|
-
).defined()
|
|
10243
|
+
var vendorMenuSchema = create$3({
|
|
10244
|
+
description: create$6().nullable().optional(),
|
|
10245
|
+
name: create$6().nullable().required("Product name is required"),
|
|
10246
|
+
price: create$5().transform((v, o3) => o3 === "" ? null : v).min(1, "Product price must be greater than 0").required("Product price is required"),
|
|
10247
|
+
priceUnit: create$6().required("Product unit is required"),
|
|
10248
|
+
productGroups: create$2().of(create$6().defined()).min(1, "Product groups are required").required("Product groups are required")
|
|
10265
10249
|
});
|
|
10266
10250
|
var vendorSchema = globalResourceSchema.shape({
|
|
10267
10251
|
categories: categorySchema.min(1, "Category list must contain at least one item").required("Categories are required"),
|
|
10268
10252
|
foodTruck: create$7().label("Food Truck").required("Please specify if the vendor is a food truck"),
|
|
10269
10253
|
products: create$3().shape({
|
|
10270
|
-
|
|
10254
|
+
active: create$7().nullable().optional(),
|
|
10255
|
+
productsList: create$2().of(vendorMenuSchema).nullable().optional()
|
|
10271
10256
|
}).nullable().optional(),
|
|
10272
10257
|
vendorType: create$8().oneOf(Object.values(EnumVendorType)).required("Please select a Vendor type")
|
|
10273
10258
|
});
|
|
@@ -10411,12 +10396,12 @@ var validateVerificationTokenSchema = create$3().shape({
|
|
|
10411
10396
|
email: emailRequiredSchema,
|
|
10412
10397
|
verificationToken: create$6().required("Verification code is required").matches(/^\d{6}$/, "Verification code must be exactly 6 digits")
|
|
10413
10398
|
});
|
|
10414
|
-
var EnumAdShowOn = /* @__PURE__ */ ((
|
|
10415
|
-
|
|
10416
|
-
|
|
10417
|
-
|
|
10418
|
-
|
|
10419
|
-
return
|
|
10399
|
+
var EnumAdShowOn = /* @__PURE__ */ ((EnumAdShowOn3) => {
|
|
10400
|
+
EnumAdShowOn3["EVENTS_PAGE"] = "Events_page";
|
|
10401
|
+
EnumAdShowOn3["FRONT_PAGE"] = "Front_page";
|
|
10402
|
+
EnumAdShowOn3["PARTNERS_PAGE"] = "Partners_page";
|
|
10403
|
+
EnumAdShowOn3["VENDORS_PAGE"] = "Vendors_page";
|
|
10404
|
+
return EnumAdShowOn3;
|
|
10420
10405
|
})(EnumAdShowOn || {});
|
|
10421
10406
|
var EnumAdStatus = /* @__PURE__ */ ((EnumAdStatus2) => {
|
|
10422
10407
|
EnumAdStatus2["ACTIVE"] = "Active";
|
|
@@ -10424,21 +10409,18 @@ var EnumAdStatus = /* @__PURE__ */ ((EnumAdStatus2) => {
|
|
|
10424
10409
|
EnumAdStatus2["EXPIRED"] = "Expired";
|
|
10425
10410
|
return EnumAdStatus2;
|
|
10426
10411
|
})(EnumAdStatus || {});
|
|
10427
|
-
var EnumAdType = /* @__PURE__ */ ((
|
|
10428
|
-
|
|
10429
|
-
|
|
10430
|
-
return
|
|
10412
|
+
var EnumAdType = /* @__PURE__ */ ((EnumAdType3) => {
|
|
10413
|
+
EnumAdType3["SPONSORED"] = "Sponsored";
|
|
10414
|
+
EnumAdType3["FREE"] = "Free";
|
|
10415
|
+
return EnumAdType3;
|
|
10431
10416
|
})(EnumAdType || {});
|
|
10432
|
-
var EnumAdStyle = /* @__PURE__ */ ((
|
|
10433
|
-
|
|
10434
|
-
|
|
10435
|
-
return
|
|
10417
|
+
var EnumAdStyle = /* @__PURE__ */ ((EnumAdStyle3) => {
|
|
10418
|
+
EnumAdStyle3["BLOOM"] = "Bloom";
|
|
10419
|
+
EnumAdStyle3["RISE"] = "Rise";
|
|
10420
|
+
return EnumAdStyle3;
|
|
10436
10421
|
})(EnumAdStyle || {});
|
|
10437
10422
|
var adSchema = create$3().shape({
|
|
10438
10423
|
active: create$7().required("Active status is required"),
|
|
10439
|
-
adStyle: create$8().oneOf(Object.values(EnumAdStyle), "Please select a valid ad style").required("Ad style is required"),
|
|
10440
|
-
adType: create$8().oneOf(Object.values(EnumAdType), "Please select a valid ad type").required("Ad type is required"),
|
|
10441
|
-
clui: create$6().nullable().notRequired(),
|
|
10442
10424
|
end: create$4().required("End date is required").test("is-future-date", "End date must be in the future", (value) => {
|
|
10443
10425
|
if (!value) return false;
|
|
10444
10426
|
const endDate = new Date(value);
|
|
@@ -10456,18 +10438,18 @@ var adSchema = create$3().shape({
|
|
|
10456
10438
|
}
|
|
10457
10439
|
)
|
|
10458
10440
|
}),
|
|
10459
|
-
|
|
10460
|
-
|
|
10461
|
-
|
|
10462
|
-
|
|
10463
|
-
|
|
10464
|
-
|
|
10465
|
-
|
|
10466
|
-
|
|
10467
|
-
|
|
10468
|
-
"Please select
|
|
10469
|
-
).required("
|
|
10470
|
-
|
|
10441
|
+
resource: create$3().shape({
|
|
10442
|
+
adDescription: create$6().trim().required("Ad description is required").max(100, "Ad description must be at most 100 characters"),
|
|
10443
|
+
adImage: create$6().required("Ad image is required"),
|
|
10444
|
+
adStyle: create$8().oneOf(Object.values(EnumAdStyle), "Please select a valid ad style").required("Ad style is required"),
|
|
10445
|
+
adTitle: create$6().trim().required("Ad title is required").max(50, "Ad title must be at most 50 characters"),
|
|
10446
|
+
adType: create$8().oneOf(Object.values(EnumAdType), "Please select a valid ad type").required("Ad type is required"),
|
|
10447
|
+
resourceId: create$6().required("Resource ID is required"),
|
|
10448
|
+
resourceName: create$6().required("Resource name is required"),
|
|
10449
|
+
resourceRegion: create$6().required("Resource region is required"),
|
|
10450
|
+
resourceType: create$8().oneOf(Object.values(EnumResourceType), "Please select Event or Vendor").required("Resource Type is required")
|
|
10451
|
+
}).required("Resource information is required"),
|
|
10452
|
+
showOn: create$2().of(create$8().oneOf(Object.values(EnumAdShowOn)).required()).min(1, "At least one display location is required").required("Display location is required"),
|
|
10471
10453
|
status: create$8().oneOf(Object.values(EnumAdStatus)).required("Ad status is required"),
|
|
10472
10454
|
start: create$4().when("status", {
|
|
10473
10455
|
is: (status) => status !== "Active",
|
|
@@ -10477,7 +10459,7 @@ var adSchema = create$3().shape({
|
|
|
10477
10459
|
}),
|
|
10478
10460
|
otherwise: () => create$4().nullable().notRequired()
|
|
10479
10461
|
}),
|
|
10480
|
-
targetRegion: create$6().
|
|
10462
|
+
targetRegion: create$2().of(create$6().required()).min(1, "At least one target region is required").required("Target region is required")
|
|
10481
10463
|
});
|
|
10482
10464
|
var partnerSchema = globalResourceSchema.shape({
|
|
10483
10465
|
location: locationSchema,
|
|
@@ -10609,18 +10591,216 @@ var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
|
|
|
10609
10591
|
})(EnumActivity || {});
|
|
10610
10592
|
|
|
10611
10593
|
// src/mongoose/Ad.ts
|
|
10612
|
-
import
|
|
10594
|
+
import mongoose from "mongoose";
|
|
10595
|
+
var MongooseSchema = mongoose.Schema;
|
|
10596
|
+
var schemaAdresource = new MongooseSchema({
|
|
10597
|
+
adDescription: { required: true, type: String },
|
|
10598
|
+
adImage: { required: true, type: String },
|
|
10599
|
+
adStyle: {
|
|
10600
|
+
default: EnumAdStyle.BLOOM,
|
|
10601
|
+
enum: Object.values(EnumAdStyle),
|
|
10602
|
+
required: true,
|
|
10603
|
+
type: String
|
|
10604
|
+
},
|
|
10605
|
+
adTitle: { required: true, type: String },
|
|
10606
|
+
adType: {
|
|
10607
|
+
default: EnumAdType.SPONSORED,
|
|
10608
|
+
enum: Object.values(EnumAdType),
|
|
10609
|
+
required: true,
|
|
10610
|
+
type: String
|
|
10611
|
+
},
|
|
10612
|
+
resourceId: { required: true, type: String },
|
|
10613
|
+
resourceName: { required: true, type: String },
|
|
10614
|
+
resourceRegion: { required: true, type: String },
|
|
10615
|
+
resourceType: {
|
|
10616
|
+
enum: Object.values(EnumResourceType),
|
|
10617
|
+
required: true,
|
|
10618
|
+
type: String
|
|
10619
|
+
}
|
|
10620
|
+
});
|
|
10621
|
+
var schema = new MongooseSchema(
|
|
10622
|
+
{
|
|
10623
|
+
active: { default: true, type: Boolean },
|
|
10624
|
+
clicks: { default: 0, required: true, type: Number },
|
|
10625
|
+
end: { required: true, type: Date },
|
|
10626
|
+
impressions: { default: 0, required: true, type: Number },
|
|
10627
|
+
resource: { required: true, type: schemaAdresource },
|
|
10628
|
+
showOn: {
|
|
10629
|
+
default: [EnumAdShowOn.FRONT_PAGE],
|
|
10630
|
+
enum: Object.values(EnumAdShowOn),
|
|
10631
|
+
required: true,
|
|
10632
|
+
type: [String]
|
|
10633
|
+
},
|
|
10634
|
+
start: { required: true, type: Date },
|
|
10635
|
+
status: {
|
|
10636
|
+
default: EnumAdStatus.ACTIVE,
|
|
10637
|
+
enum: Object.values(EnumAdStatus),
|
|
10638
|
+
required: true,
|
|
10639
|
+
type: String
|
|
10640
|
+
},
|
|
10641
|
+
targetRegion: { required: false, type: [String] }
|
|
10642
|
+
},
|
|
10643
|
+
{
|
|
10644
|
+
timestamps: true
|
|
10645
|
+
}
|
|
10646
|
+
);
|
|
10647
|
+
schema.index({
|
|
10648
|
+
end: 1,
|
|
10649
|
+
start: 1,
|
|
10650
|
+
status: 1
|
|
10651
|
+
});
|
|
10652
|
+
var AdModel = mongoose.models.Ad || mongoose.model("Ad", schema);
|
|
10613
10653
|
|
|
10614
|
-
// src/mongoose/
|
|
10654
|
+
// src/mongoose/chat/Chat.ts
|
|
10655
|
+
import mongoose2 from "mongoose";
|
|
10656
|
+
var MongooseSchema2 = mongoose2.Schema;
|
|
10657
|
+
var MessageReplyPreviewSchema = new MongooseSchema2(
|
|
10658
|
+
{
|
|
10659
|
+
contentPreview: { required: true, type: String },
|
|
10660
|
+
senderId: {
|
|
10661
|
+
ref: "User",
|
|
10662
|
+
required: true,
|
|
10663
|
+
type: mongoose2.Schema.Types.ObjectId
|
|
10664
|
+
},
|
|
10665
|
+
senderName: { required: true, type: String }
|
|
10666
|
+
},
|
|
10667
|
+
{ _id: false }
|
|
10668
|
+
);
|
|
10669
|
+
var MessageReactionSchema = new MongooseSchema2(
|
|
10670
|
+
{
|
|
10671
|
+
createdAt: { required: true, type: Date },
|
|
10672
|
+
userId: {
|
|
10673
|
+
ref: "User",
|
|
10674
|
+
required: true,
|
|
10675
|
+
type: mongoose2.Schema.Types.ObjectId
|
|
10676
|
+
}
|
|
10677
|
+
},
|
|
10678
|
+
{ _id: false }
|
|
10679
|
+
);
|
|
10680
|
+
var MessageSeenSchema = new MongooseSchema2(
|
|
10681
|
+
{
|
|
10682
|
+
seenAt: { required: true, type: Date },
|
|
10683
|
+
userId: {
|
|
10684
|
+
ref: "User",
|
|
10685
|
+
required: true,
|
|
10686
|
+
type: mongoose2.Schema.Types.ObjectId
|
|
10687
|
+
}
|
|
10688
|
+
},
|
|
10689
|
+
{ _id: false }
|
|
10690
|
+
);
|
|
10691
|
+
var MessageSchema = new MongooseSchema2(
|
|
10692
|
+
{
|
|
10693
|
+
content: { required: true, type: String },
|
|
10694
|
+
likedBy: { default: [], required: false, type: [MessageReactionSchema] },
|
|
10695
|
+
replyPreview: {
|
|
10696
|
+
required: false,
|
|
10697
|
+
type: MessageReplyPreviewSchema
|
|
10698
|
+
},
|
|
10699
|
+
replyToMessageId: {
|
|
10700
|
+
ref: "Chat.messages",
|
|
10701
|
+
required: false,
|
|
10702
|
+
type: mongoose2.Schema.Types.ObjectId
|
|
10703
|
+
},
|
|
10704
|
+
seenBy: { default: [], required: false, type: [MessageSeenSchema] },
|
|
10705
|
+
senderId: {
|
|
10706
|
+
ref: "User",
|
|
10707
|
+
required: true,
|
|
10708
|
+
type: mongoose2.Schema.Types.ObjectId
|
|
10709
|
+
}
|
|
10710
|
+
},
|
|
10711
|
+
{ timestamps: true }
|
|
10712
|
+
);
|
|
10713
|
+
var ParticipantSchema = new MongooseSchema2(
|
|
10714
|
+
{
|
|
10715
|
+
active: { default: true, required: true, type: Boolean },
|
|
10716
|
+
userAvatar: { required: false, type: String },
|
|
10717
|
+
userEmail: { required: true, type: String },
|
|
10718
|
+
userId: {
|
|
10719
|
+
ref: "User",
|
|
10720
|
+
required: true,
|
|
10721
|
+
type: mongoose2.Schema.Types.ObjectId
|
|
10722
|
+
},
|
|
10723
|
+
userName: { required: true, type: String }
|
|
10724
|
+
},
|
|
10725
|
+
{ _id: false }
|
|
10726
|
+
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
10727
|
+
);
|
|
10728
|
+
var ChatSchema = new MongooseSchema2(
|
|
10729
|
+
{
|
|
10730
|
+
active: { default: true, required: true, type: Boolean },
|
|
10731
|
+
chatDescription: { required: false, type: String },
|
|
10732
|
+
chatName: { required: true, type: String },
|
|
10733
|
+
chatType: {
|
|
10734
|
+
enum: Object.values(EnumChatType),
|
|
10735
|
+
required: true,
|
|
10736
|
+
type: String
|
|
10737
|
+
},
|
|
10738
|
+
deletedAt: { default: null, required: false, type: Date },
|
|
10739
|
+
messages: [MessageSchema],
|
|
10740
|
+
participants: [ParticipantSchema],
|
|
10741
|
+
region: { default: null, required: false, type: String }
|
|
10742
|
+
},
|
|
10743
|
+
{
|
|
10744
|
+
timestamps: true
|
|
10745
|
+
}
|
|
10746
|
+
);
|
|
10747
|
+
ChatSchema.index({
|
|
10748
|
+
"participants.active": 1,
|
|
10749
|
+
"participants.userId": 1,
|
|
10750
|
+
updatedAt: -1
|
|
10751
|
+
});
|
|
10752
|
+
var ChatModel = mongoose2.models.Chat || mongoose2.model("Chat", ChatSchema);
|
|
10753
|
+
|
|
10754
|
+
// src/mongoose/chat/ChatReport.ts
|
|
10615
10755
|
import mongoose3 from "mongoose";
|
|
10756
|
+
var MongooseSchema3 = mongoose3.Schema;
|
|
10757
|
+
var ReasonSchema = new MongooseSchema3(
|
|
10758
|
+
{
|
|
10759
|
+
details: { default: null, required: false, type: String },
|
|
10760
|
+
reasonType: {
|
|
10761
|
+
enum: Object.values(EnumChatReportReason),
|
|
10762
|
+
required: true,
|
|
10763
|
+
type: String
|
|
10764
|
+
}
|
|
10765
|
+
},
|
|
10766
|
+
{ _id: false }
|
|
10767
|
+
);
|
|
10768
|
+
var ChatReportSchema = new MongooseSchema3(
|
|
10769
|
+
{
|
|
10770
|
+
chatId: {
|
|
10771
|
+
ref: "Chat",
|
|
10772
|
+
required: true,
|
|
10773
|
+
type: mongoose3.Schema.Types.ObjectId
|
|
10774
|
+
},
|
|
10775
|
+
reason: { required: true, type: ReasonSchema },
|
|
10776
|
+
reportedUserId: {
|
|
10777
|
+
ref: "User",
|
|
10778
|
+
required: true,
|
|
10779
|
+
type: mongoose3.Schema.Types.ObjectId
|
|
10780
|
+
},
|
|
10781
|
+
reporterUserId: {
|
|
10782
|
+
ref: "User",
|
|
10783
|
+
required: true,
|
|
10784
|
+
type: mongoose3.Schema.Types.ObjectId
|
|
10785
|
+
},
|
|
10786
|
+
resolved: { default: false, required: true, type: Boolean }
|
|
10787
|
+
},
|
|
10788
|
+
{ timestamps: true }
|
|
10789
|
+
);
|
|
10790
|
+
ChatReportSchema.index({ chatId: 1, reportedUserId: 1 });
|
|
10791
|
+
ChatReportSchema.index({ createdAt: -1, reporterUserId: 1 });
|
|
10792
|
+
var ChatReportModel = mongoose3.models.ChatReport || mongoose3.model("ChatReport", ChatReportSchema);
|
|
10793
|
+
|
|
10794
|
+
// src/mongoose/global.ts
|
|
10795
|
+
import mongoose6 from "mongoose";
|
|
10616
10796
|
|
|
10617
10797
|
// src/mongoose/Relation.ts
|
|
10618
|
-
import
|
|
10798
|
+
import mongoose5 from "mongoose";
|
|
10619
10799
|
|
|
10620
10800
|
// src/mongoose/event/EventInfo.ts
|
|
10621
|
-
import
|
|
10622
|
-
var
|
|
10623
|
-
var StallTypeSchema = new
|
|
10801
|
+
import mongoose4 from "mongoose";
|
|
10802
|
+
var MongooseSchema4 = mongoose4.Schema;
|
|
10803
|
+
var StallTypeSchema = new MongooseSchema4(
|
|
10624
10804
|
{
|
|
10625
10805
|
electricity: {
|
|
10626
10806
|
price: { required: false, type: Number },
|
|
@@ -10635,7 +10815,7 @@ var StallTypeSchema = new MongooseSchema(
|
|
|
10635
10815
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
10636
10816
|
}
|
|
10637
10817
|
);
|
|
10638
|
-
var dateTimeSchema2 = new
|
|
10818
|
+
var dateTimeSchema2 = new MongooseSchema4(
|
|
10639
10819
|
{
|
|
10640
10820
|
dateStatus: {
|
|
10641
10821
|
enum: Object.values(EnumEventDateStatus),
|
|
@@ -10651,7 +10831,7 @@ var dateTimeSchema2 = new MongooseSchema(
|
|
|
10651
10831
|
{ _id: false }
|
|
10652
10832
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
10653
10833
|
);
|
|
10654
|
-
var paymentInfoSchema2 = new
|
|
10834
|
+
var paymentInfoSchema2 = new MongooseSchema4(
|
|
10655
10835
|
{
|
|
10656
10836
|
accountHolderName: { required: false, type: String },
|
|
10657
10837
|
accountNumber: { required: false, type: String },
|
|
@@ -10665,7 +10845,7 @@ var paymentInfoSchema2 = new MongooseSchema(
|
|
|
10665
10845
|
{ _id: false }
|
|
10666
10846
|
// Prevents Mongoose from creating an additional _id field
|
|
10667
10847
|
);
|
|
10668
|
-
var requirementsSchema = new
|
|
10848
|
+
var requirementsSchema = new MongooseSchema4(
|
|
10669
10849
|
{
|
|
10670
10850
|
category: { required: true, type: String },
|
|
10671
10851
|
label: { required: true, type: String },
|
|
@@ -10676,7 +10856,7 @@ var requirementsSchema = new MongooseSchema(
|
|
|
10676
10856
|
// Prevents Mongoose from creating an additional _id field for
|
|
10677
10857
|
}
|
|
10678
10858
|
);
|
|
10679
|
-
var refundPolicySchema = new
|
|
10859
|
+
var refundPolicySchema = new MongooseSchema4(
|
|
10680
10860
|
{
|
|
10681
10861
|
category: { required: true, type: String },
|
|
10682
10862
|
label: { required: true, type: String },
|
|
@@ -10684,14 +10864,14 @@ var refundPolicySchema = new MongooseSchema(
|
|
|
10684
10864
|
},
|
|
10685
10865
|
{ _id: false }
|
|
10686
10866
|
);
|
|
10687
|
-
var
|
|
10867
|
+
var schema2 = new MongooseSchema4(
|
|
10688
10868
|
{
|
|
10689
10869
|
applicationDeadlineHours: { required: true, type: Number },
|
|
10690
10870
|
dateTime: { required: true, type: [dateTimeSchema2] },
|
|
10691
10871
|
eventId: {
|
|
10692
10872
|
ref: "Event",
|
|
10693
10873
|
required: true,
|
|
10694
|
-
type:
|
|
10874
|
+
type: mongoose4.Schema.Types.ObjectId
|
|
10695
10875
|
},
|
|
10696
10876
|
packInTime: { required: true, type: Number },
|
|
10697
10877
|
paymentDueHours: { required: true, type: Number },
|
|
@@ -10701,11 +10881,11 @@ var schema = new MongooseSchema(
|
|
|
10701
10881
|
},
|
|
10702
10882
|
{ timestamps: true }
|
|
10703
10883
|
);
|
|
10704
|
-
var EventInfoModel =
|
|
10884
|
+
var EventInfoModel = mongoose4.models.EventInfo || mongoose4.model("EventInfo", schema2);
|
|
10705
10885
|
|
|
10706
10886
|
// src/mongoose/Relation.ts
|
|
10707
|
-
var
|
|
10708
|
-
var relationDateTimeSchema = new
|
|
10887
|
+
var MongooseSchema5 = mongoose5.Schema;
|
|
10888
|
+
var relationDateTimeSchema = new MongooseSchema5(
|
|
10709
10889
|
{
|
|
10710
10890
|
dateStatus: {
|
|
10711
10891
|
enum: Object.values(EnumEventDateStatus),
|
|
@@ -10720,7 +10900,7 @@ var relationDateTimeSchema = new MongooseSchema2(
|
|
|
10720
10900
|
},
|
|
10721
10901
|
{ _id: false }
|
|
10722
10902
|
);
|
|
10723
|
-
var relationDatesSchema = new
|
|
10903
|
+
var relationDatesSchema = new MongooseSchema5(
|
|
10724
10904
|
{
|
|
10725
10905
|
dateTime: {
|
|
10726
10906
|
required: true,
|
|
@@ -10739,19 +10919,19 @@ var relationDatesSchema = new MongooseSchema2(
|
|
|
10739
10919
|
},
|
|
10740
10920
|
{ _id: false }
|
|
10741
10921
|
);
|
|
10742
|
-
var RelationTypeSchema = new
|
|
10922
|
+
var RelationTypeSchema = new MongooseSchema5(
|
|
10743
10923
|
{
|
|
10744
10924
|
active: { default: true, required: true, type: Boolean },
|
|
10745
10925
|
chatId: {
|
|
10746
10926
|
ref: "Chat",
|
|
10747
10927
|
required: true,
|
|
10748
|
-
type:
|
|
10928
|
+
type: mongoose5.Schema.Types.ObjectId
|
|
10749
10929
|
},
|
|
10750
10930
|
deletedAt: { default: null, required: false, type: Date },
|
|
10751
10931
|
eventId: {
|
|
10752
10932
|
ref: "Event",
|
|
10753
10933
|
required: true,
|
|
10754
|
-
type:
|
|
10934
|
+
type: mongoose5.Schema.Types.ObjectId
|
|
10755
10935
|
},
|
|
10756
10936
|
lastUpdateBy: {
|
|
10757
10937
|
enum: Object.values(EnumResourceType),
|
|
@@ -10767,7 +10947,7 @@ var RelationTypeSchema = new MongooseSchema2(
|
|
|
10767
10947
|
vendorId: {
|
|
10768
10948
|
ref: "Vendor",
|
|
10769
10949
|
required: true,
|
|
10770
|
-
type:
|
|
10950
|
+
type: mongoose5.Schema.Types.ObjectId
|
|
10771
10951
|
}
|
|
10772
10952
|
},
|
|
10773
10953
|
{ timestamps: true }
|
|
@@ -10779,23 +10959,23 @@ RelationTypeSchema.index({
|
|
|
10779
10959
|
"relationDates.status": 1,
|
|
10780
10960
|
vendorId: 1
|
|
10781
10961
|
});
|
|
10782
|
-
var RelationModel =
|
|
10962
|
+
var RelationModel = mongoose5.models.Relation || mongoose5.model("Relation", RelationTypeSchema);
|
|
10783
10963
|
|
|
10784
10964
|
// src/mongoose/global.ts
|
|
10785
|
-
var
|
|
10786
|
-
var OwnerTypeSchema = new
|
|
10965
|
+
var MongooseSchema6 = mongoose6.Schema;
|
|
10966
|
+
var OwnerTypeSchema = new MongooseSchema6(
|
|
10787
10967
|
{
|
|
10788
10968
|
email: { required: true, type: String },
|
|
10789
10969
|
userId: {
|
|
10790
10970
|
ref: "User",
|
|
10791
10971
|
required: true,
|
|
10792
|
-
type:
|
|
10972
|
+
type: mongoose6.Schema.Types.ObjectId
|
|
10793
10973
|
}
|
|
10794
10974
|
},
|
|
10795
10975
|
{ _id: false }
|
|
10796
10976
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
10797
10977
|
);
|
|
10798
|
-
var SocialMediaTypeSchema = new
|
|
10978
|
+
var SocialMediaTypeSchema = new MongooseSchema6(
|
|
10799
10979
|
{
|
|
10800
10980
|
link: { required: true, type: String },
|
|
10801
10981
|
name: { required: true, type: String }
|
|
@@ -10803,7 +10983,7 @@ var SocialMediaTypeSchema = new MongooseSchema3(
|
|
|
10803
10983
|
{ _id: false }
|
|
10804
10984
|
// Prevents Mongoose from creating an additional _id field
|
|
10805
10985
|
);
|
|
10806
|
-
var ResourceImageTypeSchema = new
|
|
10986
|
+
var ResourceImageTypeSchema = new MongooseSchema6(
|
|
10807
10987
|
{
|
|
10808
10988
|
active: { default: true, type: Boolean },
|
|
10809
10989
|
source: { required: false, type: String },
|
|
@@ -10812,7 +10992,7 @@ var ResourceImageTypeSchema = new MongooseSchema3(
|
|
|
10812
10992
|
{ _id: false }
|
|
10813
10993
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
10814
10994
|
);
|
|
10815
|
-
var SubCategorySchema = new
|
|
10995
|
+
var SubCategorySchema = new MongooseSchema6(
|
|
10816
10996
|
{
|
|
10817
10997
|
id: { required: false, type: String },
|
|
10818
10998
|
items: [
|
|
@@ -10826,7 +11006,7 @@ var SubCategorySchema = new MongooseSchema3(
|
|
|
10826
11006
|
{ _id: false }
|
|
10827
11007
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
10828
11008
|
);
|
|
10829
|
-
var CategorySchema = new
|
|
11009
|
+
var CategorySchema = new MongooseSchema6(
|
|
10830
11010
|
{
|
|
10831
11011
|
id: { required: true, type: String },
|
|
10832
11012
|
name: { required: true, type: String },
|
|
@@ -10835,7 +11015,7 @@ var CategorySchema = new MongooseSchema3(
|
|
|
10835
11015
|
{ _id: false }
|
|
10836
11016
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
10837
11017
|
);
|
|
10838
|
-
var PosterUsageTypeSchema = new
|
|
11018
|
+
var PosterUsageTypeSchema = new MongooseSchema6(
|
|
10839
11019
|
{
|
|
10840
11020
|
count: { default: 0, required: false, type: Number },
|
|
10841
11021
|
month: { required: false, type: String }
|
|
@@ -10843,7 +11023,7 @@ var PosterUsageTypeSchema = new MongooseSchema3(
|
|
|
10843
11023
|
{ _id: false }
|
|
10844
11024
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
10845
11025
|
);
|
|
10846
|
-
var userLicenseSchema = new
|
|
11026
|
+
var userLicenseSchema = new MongooseSchema6(
|
|
10847
11027
|
{
|
|
10848
11028
|
expiryDate: { required: true, type: Date },
|
|
10849
11029
|
issuedDate: { required: true, type: Date },
|
|
@@ -10860,7 +11040,7 @@ var userLicenseSchema = new MongooseSchema3(
|
|
|
10860
11040
|
},
|
|
10861
11041
|
{ _id: false, timestamps: false }
|
|
10862
11042
|
);
|
|
10863
|
-
var associatesSchema = new
|
|
11043
|
+
var associatesSchema = new MongooseSchema6(
|
|
10864
11044
|
{
|
|
10865
11045
|
email: { required: true, type: String },
|
|
10866
11046
|
licence: {
|
|
@@ -10880,7 +11060,7 @@ var associatesSchema = new MongooseSchema3(
|
|
|
10880
11060
|
{ _id: false }
|
|
10881
11061
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
10882
11062
|
);
|
|
10883
|
-
var ContactDetailsSchema = new
|
|
11063
|
+
var ContactDetailsSchema = new MongooseSchema6(
|
|
10884
11064
|
{
|
|
10885
11065
|
email: { required: false, type: String },
|
|
10886
11066
|
landlinePhone: { required: false, type: String },
|
|
@@ -10889,7 +11069,7 @@ var ContactDetailsSchema = new MongooseSchema3(
|
|
|
10889
11069
|
{ _id: false }
|
|
10890
11070
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
10891
11071
|
);
|
|
10892
|
-
var termsAgreementSchema = new
|
|
11072
|
+
var termsAgreementSchema = new MongooseSchema6(
|
|
10893
11073
|
{
|
|
10894
11074
|
appBuildNumber: { required: true, type: String },
|
|
10895
11075
|
appId: { required: true, type: String },
|
|
@@ -10906,7 +11086,7 @@ var termsAgreementSchema = new MongooseSchema3(
|
|
|
10906
11086
|
},
|
|
10907
11087
|
{ _id: false }
|
|
10908
11088
|
);
|
|
10909
|
-
var resourceRelationsSchema = new
|
|
11089
|
+
var resourceRelationsSchema = new MongooseSchema6(
|
|
10910
11090
|
{
|
|
10911
11091
|
relationDates: {
|
|
10912
11092
|
default: [],
|
|
@@ -10916,12 +11096,12 @@ var resourceRelationsSchema = new MongooseSchema3(
|
|
|
10916
11096
|
relationId: {
|
|
10917
11097
|
ref: "Relation",
|
|
10918
11098
|
required: false,
|
|
10919
|
-
type:
|
|
11099
|
+
type: mongoose6.Schema.Types.ObjectId
|
|
10920
11100
|
}
|
|
10921
11101
|
},
|
|
10922
11102
|
{ _id: false }
|
|
10923
11103
|
);
|
|
10924
|
-
var dateTimeSchema3 = new
|
|
11104
|
+
var dateTimeSchema3 = new MongooseSchema6(
|
|
10925
11105
|
{
|
|
10926
11106
|
dateStatus: {
|
|
10927
11107
|
enum: Object.values(EnumEventDateStatus),
|
|
@@ -10936,7 +11116,7 @@ var dateTimeSchema3 = new MongooseSchema3(
|
|
|
10936
11116
|
{ _id: false }
|
|
10937
11117
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
10938
11118
|
);
|
|
10939
|
-
var locationGeoSchema = new
|
|
11119
|
+
var locationGeoSchema = new MongooseSchema6(
|
|
10940
11120
|
{
|
|
10941
11121
|
coordinates: { required: true, type: [Number] },
|
|
10942
11122
|
// [longitude, latitude]
|
|
@@ -10945,7 +11125,7 @@ var locationGeoSchema = new MongooseSchema3(
|
|
|
10945
11125
|
{ _id: false }
|
|
10946
11126
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
10947
11127
|
);
|
|
10948
|
-
var locationsSchema = new
|
|
11128
|
+
var locationsSchema = new MongooseSchema6(
|
|
10949
11129
|
{
|
|
10950
11130
|
city: { required: true, type: String },
|
|
10951
11131
|
country: { required: true, type: String },
|
|
@@ -10966,7 +11146,7 @@ var baseResourceFields = {
|
|
|
10966
11146
|
adIds: {
|
|
10967
11147
|
ref: "Ad",
|
|
10968
11148
|
required: false,
|
|
10969
|
-
type: [
|
|
11149
|
+
type: [mongoose6.Schema.Types.ObjectId]
|
|
10970
11150
|
},
|
|
10971
11151
|
associates: {
|
|
10972
11152
|
required: false,
|
|
@@ -10995,207 +11175,6 @@ var baseResourceFields = {
|
|
|
10995
11175
|
termsAgreement: termsAgreementSchema
|
|
10996
11176
|
};
|
|
10997
11177
|
|
|
10998
|
-
// src/mongoose/Ad.ts
|
|
10999
|
-
var MongooseSchema4 = mongoose4.Schema;
|
|
11000
|
-
var schema2 = new MongooseSchema4(
|
|
11001
|
-
{
|
|
11002
|
-
active: { default: true, type: Boolean },
|
|
11003
|
-
adStyle: {
|
|
11004
|
-
default: EnumAdStyle.BLOOM,
|
|
11005
|
-
enum: Object.values(EnumAdStyle),
|
|
11006
|
-
required: true,
|
|
11007
|
-
type: String
|
|
11008
|
-
},
|
|
11009
|
-
adType: {
|
|
11010
|
-
default: EnumAdType.SPONSORED,
|
|
11011
|
-
enum: Object.values(EnumAdType),
|
|
11012
|
-
required: true,
|
|
11013
|
-
type: String
|
|
11014
|
-
},
|
|
11015
|
-
// TODO: similar to ViewSchema
|
|
11016
|
-
clicks: { default: 0, required: true, type: Number },
|
|
11017
|
-
clui: { required: false, type: String },
|
|
11018
|
-
end: { required: true, type: Date },
|
|
11019
|
-
// TODO: similar to ViewSchema
|
|
11020
|
-
impressions: { default: 0, required: true, type: Number },
|
|
11021
|
-
resourceCover: { required: true, type: String },
|
|
11022
|
-
resourceDescription: { required: true, type: String },
|
|
11023
|
-
resourceId: { required: true, type: String },
|
|
11024
|
-
resourceLogo: { required: false, type: String },
|
|
11025
|
-
resourceName: { required: true, type: String },
|
|
11026
|
-
resourceRegion: { required: true, type: String },
|
|
11027
|
-
resourceType: {
|
|
11028
|
-
enum: Object.values(EnumResourceType),
|
|
11029
|
-
required: true,
|
|
11030
|
-
type: String
|
|
11031
|
-
},
|
|
11032
|
-
showOn: {
|
|
11033
|
-
default: EnumAdShowOn.FRONT_PAGE,
|
|
11034
|
-
enum: Object.values(EnumAdShowOn),
|
|
11035
|
-
required: true,
|
|
11036
|
-
type: String
|
|
11037
|
-
},
|
|
11038
|
-
socialMedia: [SocialMediaTypeSchema],
|
|
11039
|
-
start: { required: true, type: Date },
|
|
11040
|
-
status: {
|
|
11041
|
-
default: EnumAdStatus.ACTIVE,
|
|
11042
|
-
enum: Object.values(EnumAdStatus),
|
|
11043
|
-
required: true,
|
|
11044
|
-
type: String
|
|
11045
|
-
},
|
|
11046
|
-
targetRegion: { required: false, type: String }
|
|
11047
|
-
},
|
|
11048
|
-
{
|
|
11049
|
-
timestamps: true
|
|
11050
|
-
}
|
|
11051
|
-
);
|
|
11052
|
-
schema2.index({
|
|
11053
|
-
end: 1,
|
|
11054
|
-
start: 1,
|
|
11055
|
-
status: 1
|
|
11056
|
-
});
|
|
11057
|
-
var AdModel = mongoose4.models.Ad || mongoose4.model("Ad", schema2);
|
|
11058
|
-
|
|
11059
|
-
// src/mongoose/chat/Chat.ts
|
|
11060
|
-
import mongoose5 from "mongoose";
|
|
11061
|
-
var MongooseSchema5 = mongoose5.Schema;
|
|
11062
|
-
var MessageReplyPreviewSchema = new MongooseSchema5(
|
|
11063
|
-
{
|
|
11064
|
-
contentPreview: { required: true, type: String },
|
|
11065
|
-
senderId: {
|
|
11066
|
-
ref: "User",
|
|
11067
|
-
required: true,
|
|
11068
|
-
type: mongoose5.Schema.Types.ObjectId
|
|
11069
|
-
},
|
|
11070
|
-
senderName: { required: true, type: String }
|
|
11071
|
-
},
|
|
11072
|
-
{ _id: false }
|
|
11073
|
-
);
|
|
11074
|
-
var MessageReactionSchema = new MongooseSchema5(
|
|
11075
|
-
{
|
|
11076
|
-
createdAt: { required: true, type: Date },
|
|
11077
|
-
userId: {
|
|
11078
|
-
ref: "User",
|
|
11079
|
-
required: true,
|
|
11080
|
-
type: mongoose5.Schema.Types.ObjectId
|
|
11081
|
-
}
|
|
11082
|
-
},
|
|
11083
|
-
{ _id: false }
|
|
11084
|
-
);
|
|
11085
|
-
var MessageSeenSchema = new MongooseSchema5(
|
|
11086
|
-
{
|
|
11087
|
-
seenAt: { required: true, type: Date },
|
|
11088
|
-
userId: {
|
|
11089
|
-
ref: "User",
|
|
11090
|
-
required: true,
|
|
11091
|
-
type: mongoose5.Schema.Types.ObjectId
|
|
11092
|
-
}
|
|
11093
|
-
},
|
|
11094
|
-
{ _id: false }
|
|
11095
|
-
);
|
|
11096
|
-
var MessageSchema = new MongooseSchema5(
|
|
11097
|
-
{
|
|
11098
|
-
content: { required: true, type: String },
|
|
11099
|
-
likedBy: { default: [], required: false, type: [MessageReactionSchema] },
|
|
11100
|
-
replyPreview: {
|
|
11101
|
-
required: false,
|
|
11102
|
-
type: MessageReplyPreviewSchema
|
|
11103
|
-
},
|
|
11104
|
-
replyToMessageId: {
|
|
11105
|
-
ref: "Chat.messages",
|
|
11106
|
-
required: false,
|
|
11107
|
-
type: mongoose5.Schema.Types.ObjectId
|
|
11108
|
-
},
|
|
11109
|
-
seenBy: { default: [], required: false, type: [MessageSeenSchema] },
|
|
11110
|
-
senderId: {
|
|
11111
|
-
ref: "User",
|
|
11112
|
-
required: true,
|
|
11113
|
-
type: mongoose5.Schema.Types.ObjectId
|
|
11114
|
-
}
|
|
11115
|
-
},
|
|
11116
|
-
{ timestamps: true }
|
|
11117
|
-
);
|
|
11118
|
-
var ParticipantSchema = new MongooseSchema5(
|
|
11119
|
-
{
|
|
11120
|
-
active: { default: true, required: true, type: Boolean },
|
|
11121
|
-
userAvatar: { required: false, type: String },
|
|
11122
|
-
userEmail: { required: true, type: String },
|
|
11123
|
-
userId: {
|
|
11124
|
-
ref: "User",
|
|
11125
|
-
required: true,
|
|
11126
|
-
type: mongoose5.Schema.Types.ObjectId
|
|
11127
|
-
},
|
|
11128
|
-
userName: { required: true, type: String }
|
|
11129
|
-
},
|
|
11130
|
-
{ _id: false }
|
|
11131
|
-
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
11132
|
-
);
|
|
11133
|
-
var ChatSchema = new MongooseSchema5(
|
|
11134
|
-
{
|
|
11135
|
-
active: { default: true, required: true, type: Boolean },
|
|
11136
|
-
chatDescription: { required: false, type: String },
|
|
11137
|
-
chatName: { required: true, type: String },
|
|
11138
|
-
chatType: {
|
|
11139
|
-
enum: Object.values(EnumChatType),
|
|
11140
|
-
required: true,
|
|
11141
|
-
type: String
|
|
11142
|
-
},
|
|
11143
|
-
deletedAt: { default: null, required: false, type: Date },
|
|
11144
|
-
messages: [MessageSchema],
|
|
11145
|
-
participants: [ParticipantSchema],
|
|
11146
|
-
region: { default: null, required: false, type: String }
|
|
11147
|
-
},
|
|
11148
|
-
{
|
|
11149
|
-
timestamps: true
|
|
11150
|
-
}
|
|
11151
|
-
);
|
|
11152
|
-
ChatSchema.index({
|
|
11153
|
-
"participants.active": 1,
|
|
11154
|
-
"participants.userId": 1,
|
|
11155
|
-
updatedAt: -1
|
|
11156
|
-
});
|
|
11157
|
-
var ChatModel = mongoose5.models.Chat || mongoose5.model("Chat", ChatSchema);
|
|
11158
|
-
|
|
11159
|
-
// src/mongoose/chat/ChatReport.ts
|
|
11160
|
-
import mongoose6 from "mongoose";
|
|
11161
|
-
var MongooseSchema6 = mongoose6.Schema;
|
|
11162
|
-
var ReasonSchema = new MongooseSchema6(
|
|
11163
|
-
{
|
|
11164
|
-
details: { default: null, required: false, type: String },
|
|
11165
|
-
reasonType: {
|
|
11166
|
-
enum: Object.values(EnumChatReportReason),
|
|
11167
|
-
required: true,
|
|
11168
|
-
type: String
|
|
11169
|
-
}
|
|
11170
|
-
},
|
|
11171
|
-
{ _id: false }
|
|
11172
|
-
);
|
|
11173
|
-
var ChatReportSchema = new MongooseSchema6(
|
|
11174
|
-
{
|
|
11175
|
-
chatId: {
|
|
11176
|
-
ref: "Chat",
|
|
11177
|
-
required: true,
|
|
11178
|
-
type: mongoose6.Schema.Types.ObjectId
|
|
11179
|
-
},
|
|
11180
|
-
reason: { required: true, type: ReasonSchema },
|
|
11181
|
-
reportedUserId: {
|
|
11182
|
-
ref: "User",
|
|
11183
|
-
required: true,
|
|
11184
|
-
type: mongoose6.Schema.Types.ObjectId
|
|
11185
|
-
},
|
|
11186
|
-
reporterUserId: {
|
|
11187
|
-
ref: "User",
|
|
11188
|
-
required: true,
|
|
11189
|
-
type: mongoose6.Schema.Types.ObjectId
|
|
11190
|
-
},
|
|
11191
|
-
resolved: { default: false, required: true, type: Boolean }
|
|
11192
|
-
},
|
|
11193
|
-
{ timestamps: true }
|
|
11194
|
-
);
|
|
11195
|
-
ChatReportSchema.index({ chatId: 1, reportedUserId: 1 });
|
|
11196
|
-
ChatReportSchema.index({ createdAt: -1, reporterUserId: 1 });
|
|
11197
|
-
var ChatReportModel = mongoose6.models.ChatReport || mongoose6.model("ChatReport", ChatReportSchema);
|
|
11198
|
-
|
|
11199
11178
|
// src/mongoose/GoogleImportedMarket.ts
|
|
11200
11179
|
import mongoose7 from "mongoose";
|
|
11201
11180
|
var MongooseSchema7 = mongoose7.Schema;
|
|
@@ -12014,7 +11993,8 @@ async function updateAdStatuses() {
|
|
|
12014
11993
|
{ start: { $exists: false } },
|
|
12015
11994
|
{ end: { $exists: false } },
|
|
12016
11995
|
{ $expr: { $gt: ["$start", "$end"] } }
|
|
12017
|
-
]
|
|
11996
|
+
],
|
|
11997
|
+
status: { $ne: EnumAdStatus.PAUSED }
|
|
12018
11998
|
},
|
|
12019
11999
|
{ $set: { status: EnumAdStatus.PAUSED } }
|
|
12020
12000
|
);
|