@timardex/cluemart-server-shared 1.1.38 → 1.1.39
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/{Affiliate-xCVhO2Cy.d.mts → Affiliate-BLh0EcNI.d.mts} +18 -5
- package/dist/{Affiliate-CZKOOaz_.d.ts → Affiliate-CBp0M850.d.ts} +18 -5
- package/dist/{chunk-DJHOLZ3J.mjs → chunk-6RUQHYTK.mjs} +636 -287
- package/dist/chunk-6RUQHYTK.mjs.map +1 -0
- package/dist/{Chat-Wn7yfc3v.d.mts → index-zC8a3adw.d.mts} +34 -34
- package/dist/{Chat-Wn7yfc3v.d.ts → index-zC8a3adw.d.ts} +34 -34
- package/dist/index.cjs +694 -307
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +111 -56
- package/dist/index.d.ts +111 -56
- package/dist/index.mjs +688 -306
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +638 -286
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +46 -6
- package/dist/mongoose/index.d.ts +46 -6
- package/dist/mongoose/index.mjs +9 -1
- package/dist/service/index.cjs +627 -306
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.d.mts +12 -10
- package/dist/service/index.d.ts +12 -10
- package/dist/service/index.mjs +51 -16
- package/dist/service/index.mjs.map +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
- package/dist/chunk-DJHOLZ3J.mjs.map +0 -1
package/dist/mongoose/index.cjs
CHANGED
|
@@ -34,6 +34,8 @@ __export(mongoose_exports, {
|
|
|
34
34
|
AdModel: () => AdModel,
|
|
35
35
|
AffiliateModel: () => AffiliateModel,
|
|
36
36
|
AppSettingModel: () => AppSettingModel,
|
|
37
|
+
BILLING_CATALOG_COLLECTION_NAME: () => BILLING_CATALOG_COLLECTION_NAME,
|
|
38
|
+
BillingCatalogModel: () => BillingCatalogModel,
|
|
37
39
|
CategorySchema: () => CategorySchema,
|
|
38
40
|
ChatModel: () => ChatModel,
|
|
39
41
|
ChatReportModel: () => ChatReportModel,
|
|
@@ -61,7 +63,9 @@ __export(mongoose_exports, {
|
|
|
61
63
|
VendorModel: () => VendorModel,
|
|
62
64
|
VerificationTokenModel: () => VerificationTokenModel,
|
|
63
65
|
baseResourceFields: () => baseResourceFields,
|
|
66
|
+
buildInitialBillingCatalogEntries: () => buildInitialBillingCatalogEntries,
|
|
64
67
|
dateTimeSchema: () => dateTimeSchema2,
|
|
68
|
+
getBillingCatalogDefinition: () => getBillingCatalogDefinition,
|
|
65
69
|
locationGeoSchema: () => locationGeoSchema,
|
|
66
70
|
locationsSchema: () => locationsSchema,
|
|
67
71
|
refundPolicySchema: () => refundPolicySchema,
|
|
@@ -366,8 +370,8 @@ var EnumRelationResource = /* @__PURE__ */ ((EnumRelationResource22) => {
|
|
|
366
370
|
return EnumRelationResource22;
|
|
367
371
|
})(EnumRelationResource || {});
|
|
368
372
|
var EnumNotificationResourceType = /* @__PURE__ */ ((EnumNotificationResourceType22) => {
|
|
369
|
-
EnumNotificationResourceType22["APPROVED_AFFILIATE"] = "approved_affiliate";
|
|
370
373
|
EnumNotificationResourceType22["AFFILIATE_REWARD_RECEIVED"] = "affiliate_reward_received";
|
|
374
|
+
EnumNotificationResourceType22["APPROVED_AFFILIATE"] = "approved_affiliate";
|
|
371
375
|
EnumNotificationResourceType22["APPROVED_EVENT"] = "approved_event";
|
|
372
376
|
EnumNotificationResourceType22["APPROVED_PARTNER"] = "approved_partner";
|
|
373
377
|
EnumNotificationResourceType22["APPROVED_SCHOOL"] = "approved_school";
|
|
@@ -395,6 +399,7 @@ var EnumNotificationResourceType = /* @__PURE__ */ ((EnumNotificationResourceTyp
|
|
|
395
399
|
EnumNotificationResourceType22["NEW_POST_CREATED"] = "new_post_created";
|
|
396
400
|
EnumNotificationResourceType22["REGISTERED_USER_BY_SCHOOL_CODE"] = "registered_user_by_school_code";
|
|
397
401
|
EnumNotificationResourceType22["SYSTEM_ALERT"] = "system_alert";
|
|
402
|
+
EnumNotificationResourceType22["USER_COUPON_REDEEMED"] = "user_coupon_redeemed";
|
|
398
403
|
EnumNotificationResourceType22["VENDOR_APPLICATION_TO_EVENT"] = "vendor_application_to_event";
|
|
399
404
|
EnumNotificationResourceType22["VENDOR_UPDATE_RELATION_TO_EVENT"] = "vendor_update_relation_to_event";
|
|
400
405
|
return EnumNotificationResourceType22;
|
|
@@ -469,6 +474,11 @@ var EnumSubscriptionStatus = /* @__PURE__ */ ((EnumSubscriptionStatus22) => {
|
|
|
469
474
|
EnumSubscriptionStatus22["TRIALING"] = "trialing";
|
|
470
475
|
return EnumSubscriptionStatus22;
|
|
471
476
|
})(EnumSubscriptionStatus || {});
|
|
477
|
+
var EnumBillingPeriod = /* @__PURE__ */ ((EnumBillingPeriod22) => {
|
|
478
|
+
EnumBillingPeriod22["MONTHLY_CANCEL_ANYTIME"] = "monthly_cancel_anytime";
|
|
479
|
+
EnumBillingPeriod22["YEARLY_ANNUAL_BILLED"] = "yearly_annual_billed";
|
|
480
|
+
return EnumBillingPeriod22;
|
|
481
|
+
})(EnumBillingPeriod || {});
|
|
472
482
|
var EnumReward = /* @__PURE__ */ ((EnumReward22) => {
|
|
473
483
|
EnumReward22["MYSTERY_JOY_BOX"] = "mystery_joy_box";
|
|
474
484
|
EnumReward22["MYSTERY_SQUEEZE_BOX"] = "mystery_squeeze_box";
|
|
@@ -1711,6 +1721,80 @@ var availableCategories = assignColorToCategories([
|
|
|
1711
1721
|
...petProductsAndAnimalGoods,
|
|
1712
1722
|
...serviceAndExperience
|
|
1713
1723
|
]);
|
|
1724
|
+
var BILLING_CATALOG_KEYS = [
|
|
1725
|
+
"pro_vendor_monthly",
|
|
1726
|
+
"pro_vendor_yearly",
|
|
1727
|
+
"pro_plus_vendor_monthly",
|
|
1728
|
+
"pro_plus_vendor_yearly"
|
|
1729
|
+
];
|
|
1730
|
+
var BILLING_CATALOG_CURRENCY = "nzd";
|
|
1731
|
+
var BILLING_CATALOG_DEFINITIONS = {
|
|
1732
|
+
pro_plus_vendor_monthly: {
|
|
1733
|
+
billingPeriod: "monthly_cancel_anytime",
|
|
1734
|
+
licenceType: "pro_plus_vendor"
|
|
1735
|
+
/* PRO_PLUS_VENDOR */
|
|
1736
|
+
},
|
|
1737
|
+
pro_plus_vendor_yearly: {
|
|
1738
|
+
billingPeriod: "yearly_annual_billed",
|
|
1739
|
+
licenceType: "pro_plus_vendor"
|
|
1740
|
+
/* PRO_PLUS_VENDOR */
|
|
1741
|
+
},
|
|
1742
|
+
pro_vendor_monthly: {
|
|
1743
|
+
billingPeriod: "monthly_cancel_anytime",
|
|
1744
|
+
licenceType: "pro_vendor"
|
|
1745
|
+
/* PRO_VENDOR */
|
|
1746
|
+
},
|
|
1747
|
+
pro_vendor_yearly: {
|
|
1748
|
+
billingPeriod: "yearly_annual_billed",
|
|
1749
|
+
licenceType: "pro_vendor"
|
|
1750
|
+
/* PRO_VENDOR */
|
|
1751
|
+
}
|
|
1752
|
+
};
|
|
1753
|
+
var INITIAL_BILLING_CATALOG = [
|
|
1754
|
+
{
|
|
1755
|
+
active: true,
|
|
1756
|
+
billingPeriod: "monthly_cancel_anytime",
|
|
1757
|
+
currency: BILLING_CATALOG_CURRENCY,
|
|
1758
|
+
key: "pro_vendor_monthly",
|
|
1759
|
+
licenceType: "pro_vendor",
|
|
1760
|
+
taxInclusive: true,
|
|
1761
|
+
unitAmount: 3999
|
|
1762
|
+
},
|
|
1763
|
+
{
|
|
1764
|
+
active: true,
|
|
1765
|
+
billingPeriod: "yearly_annual_billed",
|
|
1766
|
+
currency: BILLING_CATALOG_CURRENCY,
|
|
1767
|
+
key: "pro_vendor_yearly",
|
|
1768
|
+
licenceType: "pro_vendor",
|
|
1769
|
+
taxInclusive: true,
|
|
1770
|
+
unitAmount: 40788
|
|
1771
|
+
},
|
|
1772
|
+
{
|
|
1773
|
+
active: true,
|
|
1774
|
+
billingPeriod: "monthly_cancel_anytime",
|
|
1775
|
+
currency: BILLING_CATALOG_CURRENCY,
|
|
1776
|
+
key: "pro_plus_vendor_monthly",
|
|
1777
|
+
licenceType: "pro_plus_vendor",
|
|
1778
|
+
taxInclusive: true,
|
|
1779
|
+
unitAmount: 6499
|
|
1780
|
+
},
|
|
1781
|
+
{
|
|
1782
|
+
active: true,
|
|
1783
|
+
billingPeriod: "yearly_annual_billed",
|
|
1784
|
+
currency: BILLING_CATALOG_CURRENCY,
|
|
1785
|
+
key: "pro_plus_vendor_yearly",
|
|
1786
|
+
licenceType: "pro_plus_vendor",
|
|
1787
|
+
taxInclusive: true,
|
|
1788
|
+
unitAmount: 62388
|
|
1789
|
+
}
|
|
1790
|
+
];
|
|
1791
|
+
function billingCatalogDefinitionMatches(entry) {
|
|
1792
|
+
const definition = BILLING_CATALOG_DEFINITIONS[entry.key];
|
|
1793
|
+
if (!definition) {
|
|
1794
|
+
return false;
|
|
1795
|
+
}
|
|
1796
|
+
return definition.billingPeriod === entry.billingPeriod && definition.licenceType === entry.licenceType;
|
|
1797
|
+
}
|
|
1714
1798
|
var packagingTypes = [
|
|
1715
1799
|
"Biodegradable",
|
|
1716
1800
|
"Compostable",
|
|
@@ -2155,12 +2239,19 @@ var REDEEMED_REWARD_FIELDS_FRAGMENT = gql`
|
|
|
2155
2239
|
`;
|
|
2156
2240
|
var STRIPE_FIELDS_FRAGMENT = gql`
|
|
2157
2241
|
fragment StripeSubscriptionFields on StripeSubscriptionType {
|
|
2242
|
+
billingPeriod
|
|
2243
|
+
cancelAtPeriodEnd
|
|
2158
2244
|
customerId
|
|
2159
2245
|
subscriptionId
|
|
2160
2246
|
status
|
|
2161
2247
|
currentPlan
|
|
2162
2248
|
startDate
|
|
2163
2249
|
endDate
|
|
2250
|
+
pendingPlan
|
|
2251
|
+
pendingBillingPeriod
|
|
2252
|
+
pendingChangeEffectiveAt
|
|
2253
|
+
priceId
|
|
2254
|
+
scheduleId
|
|
2164
2255
|
}
|
|
2165
2256
|
`;
|
|
2166
2257
|
var USER_FIELDS_FRAGMENT = gql`
|
|
@@ -4194,11 +4285,8 @@ var GET_RESOURCE_ACTIVITY = gql`
|
|
|
4194
4285
|
${RESOURCE_ACTIVITY_FIELDS_FRAGMENT}
|
|
4195
4286
|
`;
|
|
4196
4287
|
var CREATE_CHECKOUT_SESSION_MUTATION = gql`
|
|
4197
|
-
mutation createCheckoutSession(
|
|
4198
|
-
|
|
4199
|
-
$billingPeriod: BillingPeriodEnumType
|
|
4200
|
-
) {
|
|
4201
|
-
createCheckoutSession(planId: $planId, billingPeriod: $billingPeriod) {
|
|
4288
|
+
mutation createCheckoutSession($input: CreateCheckoutSessionInputType!) {
|
|
4289
|
+
createCheckoutSession(input: $input) {
|
|
4202
4290
|
data {
|
|
4203
4291
|
sessionId
|
|
4204
4292
|
checkoutUrl
|
|
@@ -4210,25 +4298,38 @@ var CREATE_CHECKOUT_SESSION_MUTATION = gql`
|
|
|
4210
4298
|
var CANCEL_SUBSCRIPTION_MUTATION = gql`
|
|
4211
4299
|
mutation cancelSubscription {
|
|
4212
4300
|
cancelSubscription {
|
|
4213
|
-
data
|
|
4301
|
+
data {
|
|
4302
|
+
billingPeriod
|
|
4303
|
+
cancelAtPeriodEnd
|
|
4304
|
+
currentPlan
|
|
4305
|
+
endDate
|
|
4306
|
+
pendingBillingPeriod
|
|
4307
|
+
pendingChangeEffectiveAt
|
|
4308
|
+
pendingPlan
|
|
4309
|
+
priceId
|
|
4310
|
+
scheduleId
|
|
4311
|
+
status
|
|
4312
|
+
subscriptionId
|
|
4313
|
+
}
|
|
4214
4314
|
message
|
|
4215
4315
|
}
|
|
4216
4316
|
}
|
|
4217
4317
|
`;
|
|
4218
4318
|
var UPDATE_SUBSCRIPTION_PLAN_MUTATION = gql`
|
|
4219
|
-
mutation updateSubscriptionPlan(
|
|
4220
|
-
|
|
4221
|
-
$billingPeriod: BillingPeriodEnumType
|
|
4222
|
-
) {
|
|
4223
|
-
updateSubscriptionPlan(
|
|
4224
|
-
newPlanId: $newPlanId
|
|
4225
|
-
billingPeriod: $billingPeriod
|
|
4226
|
-
) {
|
|
4319
|
+
mutation updateSubscriptionPlan($input: UpdateSubscriptionPlanInputType!) {
|
|
4320
|
+
updateSubscriptionPlan(input: $input) {
|
|
4227
4321
|
data {
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
priceId
|
|
4322
|
+
billingPeriod
|
|
4323
|
+
cancelAtPeriodEnd
|
|
4231
4324
|
currentPlan
|
|
4325
|
+
endDate
|
|
4326
|
+
pendingBillingPeriod
|
|
4327
|
+
pendingChangeEffectiveAt
|
|
4328
|
+
pendingPlan
|
|
4329
|
+
priceId
|
|
4330
|
+
scheduleId
|
|
4331
|
+
status
|
|
4332
|
+
subscriptionId
|
|
4232
4333
|
}
|
|
4233
4334
|
message
|
|
4234
4335
|
}
|
|
@@ -4244,36 +4345,20 @@ var CREATE_CUSTOMER_PORTAL = gql`
|
|
|
4244
4345
|
}
|
|
4245
4346
|
}
|
|
4246
4347
|
`;
|
|
4247
|
-
var SELECT_PACKAGE_MUTATION = gql`
|
|
4248
|
-
mutation selectPackage(
|
|
4249
|
-
$billingPeriod: BillingPeriodEnumType
|
|
4250
|
-
$selectedLicence: LicencesEnumType!
|
|
4251
|
-
$useStripe: Boolean
|
|
4252
|
-
) {
|
|
4253
|
-
selectPackage(
|
|
4254
|
-
billingPeriod: $billingPeriod
|
|
4255
|
-
selectedLicence: $selectedLicence
|
|
4256
|
-
useStripe: $useStripe
|
|
4257
|
-
) {
|
|
4258
|
-
data {
|
|
4259
|
-
checkoutUrl
|
|
4260
|
-
licences {
|
|
4261
|
-
...LicenceFields
|
|
4262
|
-
}
|
|
4263
|
-
userId
|
|
4264
|
-
}
|
|
4265
|
-
message
|
|
4266
|
-
}
|
|
4267
|
-
}
|
|
4268
|
-
${LICENCE_FIELDS_FRAGMENT}
|
|
4269
|
-
`;
|
|
4270
4348
|
var GET_SUBSCRIPTION_STATUS = gql`
|
|
4271
4349
|
query getSubscriptionStatus {
|
|
4272
4350
|
getSubscriptionStatus {
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
priceId
|
|
4351
|
+
billingPeriod
|
|
4352
|
+
cancelAtPeriodEnd
|
|
4276
4353
|
currentPlan
|
|
4354
|
+
endDate
|
|
4355
|
+
pendingBillingPeriod
|
|
4356
|
+
pendingChangeEffectiveAt
|
|
4357
|
+
pendingPlan
|
|
4358
|
+
priceId
|
|
4359
|
+
scheduleId
|
|
4360
|
+
status
|
|
4361
|
+
subscriptionId
|
|
4277
4362
|
}
|
|
4278
4363
|
}
|
|
4279
4364
|
`;
|
|
@@ -4300,7 +4385,6 @@ var GET_SUBSCRIPTION_PLANS = gql`
|
|
|
4300
4385
|
}
|
|
4301
4386
|
}
|
|
4302
4387
|
isNewUser
|
|
4303
|
-
isTester
|
|
4304
4388
|
appliedDiscountType
|
|
4305
4389
|
}
|
|
4306
4390
|
}
|
|
@@ -4408,6 +4492,57 @@ var GET_APP_SETTINGS = gql`
|
|
|
4408
4492
|
}
|
|
4409
4493
|
${APP_SETTINGS_FIELDS_FRAGMENT}
|
|
4410
4494
|
`;
|
|
4495
|
+
var BILLING_CATALOG_FIELDS_FRAGMENT = gql`
|
|
4496
|
+
fragment BillingCatalogFields on BillingCatalogEntryType {
|
|
4497
|
+
_id
|
|
4498
|
+
active
|
|
4499
|
+
billingPeriod
|
|
4500
|
+
createdAt
|
|
4501
|
+
currency
|
|
4502
|
+
effectiveFrom
|
|
4503
|
+
key
|
|
4504
|
+
licenceType
|
|
4505
|
+
revision
|
|
4506
|
+
stripePriceId
|
|
4507
|
+
stripeProductId
|
|
4508
|
+
taxInclusive
|
|
4509
|
+
unitAmount
|
|
4510
|
+
updatedAt
|
|
4511
|
+
updatedBy
|
|
4512
|
+
}
|
|
4513
|
+
`;
|
|
4514
|
+
var GET_BILLING_CATALOG = gql`
|
|
4515
|
+
query getBillingCatalog {
|
|
4516
|
+
billingCatalog {
|
|
4517
|
+
...BillingCatalogFields
|
|
4518
|
+
}
|
|
4519
|
+
}
|
|
4520
|
+
${BILLING_CATALOG_FIELDS_FRAGMENT}
|
|
4521
|
+
`;
|
|
4522
|
+
var UPDATE_BILLING_CATALOG_PRICE_MUTATION = gql`
|
|
4523
|
+
mutation updateBillingCatalogPrice(
|
|
4524
|
+
$input: UpdateBillingCatalogPriceInputType!
|
|
4525
|
+
) {
|
|
4526
|
+
updateBillingCatalogPrice(input: $input) {
|
|
4527
|
+
data {
|
|
4528
|
+
...BillingCatalogFields
|
|
4529
|
+
}
|
|
4530
|
+
message
|
|
4531
|
+
}
|
|
4532
|
+
}
|
|
4533
|
+
${BILLING_CATALOG_FIELDS_FRAGMENT}
|
|
4534
|
+
`;
|
|
4535
|
+
var SYNC_BILLING_CATALOG_PRICE_MUTATION = gql`
|
|
4536
|
+
mutation syncBillingCatalogPrice($input: SyncBillingCatalogPriceInputType!) {
|
|
4537
|
+
syncBillingCatalogPrice(input: $input) {
|
|
4538
|
+
data {
|
|
4539
|
+
...BillingCatalogFields
|
|
4540
|
+
}
|
|
4541
|
+
message
|
|
4542
|
+
}
|
|
4543
|
+
}
|
|
4544
|
+
${BILLING_CATALOG_FIELDS_FRAGMENT}
|
|
4545
|
+
`;
|
|
4411
4546
|
var GAME_HISTORY_FIELDS_FRAGMENT = gql`
|
|
4412
4547
|
fragment GameHistoryFields on GameHistoryType {
|
|
4413
4548
|
createdAt
|
|
@@ -5246,46 +5381,220 @@ schema.index({
|
|
|
5246
5381
|
start: 1,
|
|
5247
5382
|
status: 1
|
|
5248
5383
|
});
|
|
5384
|
+
schema.index({
|
|
5385
|
+
status: 1,
|
|
5386
|
+
targetRegion: 1,
|
|
5387
|
+
// eslint-disable-next-line sort-keys
|
|
5388
|
+
start: -1
|
|
5389
|
+
});
|
|
5249
5390
|
var AdModel = import_mongoose.default.models.Ad || import_mongoose.default.model("Ad", schema);
|
|
5250
5391
|
|
|
5251
|
-
// src/mongoose/
|
|
5392
|
+
// src/mongoose/BillingCatalog.ts
|
|
5252
5393
|
var import_mongoose2 = __toESM(require("mongoose"));
|
|
5253
5394
|
var MongooseSchema2 = import_mongoose2.default.Schema;
|
|
5254
|
-
var
|
|
5395
|
+
var BILLING_CATALOG_COLLECTION_NAME = "billingCatalog";
|
|
5396
|
+
var paidVendorLicences = [
|
|
5397
|
+
EnumUserLicence.PRO_VENDOR,
|
|
5398
|
+
EnumUserLicence.PRO_PLUS_VENDOR
|
|
5399
|
+
];
|
|
5400
|
+
var supportedBillingPeriods = [
|
|
5401
|
+
EnumBillingPeriod.MONTHLY_CANCEL_ANYTIME,
|
|
5402
|
+
EnumBillingPeriod.YEARLY_ANNUAL_BILLED
|
|
5403
|
+
];
|
|
5404
|
+
var unitAmountField = {
|
|
5405
|
+
min: 1,
|
|
5406
|
+
required: true,
|
|
5407
|
+
type: Number,
|
|
5408
|
+
validate: {
|
|
5409
|
+
message: "Billing catalogue price must be a positive integer.",
|
|
5410
|
+
validator: Number.isInteger
|
|
5411
|
+
}
|
|
5412
|
+
};
|
|
5413
|
+
var currencyField = {
|
|
5414
|
+
default: BILLING_CATALOG_CURRENCY,
|
|
5415
|
+
enum: [BILLING_CATALOG_CURRENCY],
|
|
5416
|
+
immutable: true,
|
|
5417
|
+
lowercase: true,
|
|
5418
|
+
required: true,
|
|
5419
|
+
trim: true,
|
|
5420
|
+
type: String
|
|
5421
|
+
};
|
|
5422
|
+
var stripePriceIdField = {
|
|
5423
|
+
default: null,
|
|
5424
|
+
required: false,
|
|
5425
|
+
trim: true,
|
|
5426
|
+
type: String
|
|
5427
|
+
};
|
|
5428
|
+
var stripeProductIdField = {
|
|
5429
|
+
default: null,
|
|
5430
|
+
required: false,
|
|
5431
|
+
trim: true,
|
|
5432
|
+
type: String
|
|
5433
|
+
};
|
|
5434
|
+
var priceHistorySchema = new MongooseSchema2(
|
|
5435
|
+
{
|
|
5436
|
+
changedAt: { required: true, type: Date },
|
|
5437
|
+
changedBy: {
|
|
5438
|
+
default: null,
|
|
5439
|
+
ref: "User",
|
|
5440
|
+
required: false,
|
|
5441
|
+
type: import_mongoose2.default.Schema.Types.ObjectId
|
|
5442
|
+
},
|
|
5443
|
+
currency: currencyField,
|
|
5444
|
+
effectiveFrom: { required: true, type: Date },
|
|
5445
|
+
effectiveTo: { required: true, type: Date },
|
|
5446
|
+
stripePriceId: stripePriceIdField,
|
|
5447
|
+
stripeProductId: stripeProductIdField,
|
|
5448
|
+
unitAmount: unitAmountField
|
|
5449
|
+
},
|
|
5450
|
+
{ _id: false }
|
|
5451
|
+
);
|
|
5452
|
+
var schema2 = new MongooseSchema2(
|
|
5453
|
+
{
|
|
5454
|
+
active: { default: true, required: true, type: Boolean },
|
|
5455
|
+
billingPeriod: {
|
|
5456
|
+
enum: supportedBillingPeriods,
|
|
5457
|
+
immutable: true,
|
|
5458
|
+
required: true,
|
|
5459
|
+
type: String
|
|
5460
|
+
},
|
|
5461
|
+
currency: currencyField,
|
|
5462
|
+
effectiveFrom: { default: Date.now, required: true, type: Date },
|
|
5463
|
+
key: {
|
|
5464
|
+
enum: BILLING_CATALOG_KEYS,
|
|
5465
|
+
immutable: true,
|
|
5466
|
+
required: true,
|
|
5467
|
+
type: String,
|
|
5468
|
+
unique: true
|
|
5469
|
+
},
|
|
5470
|
+
licenceType: {
|
|
5471
|
+
enum: paidVendorLicences,
|
|
5472
|
+
immutable: true,
|
|
5473
|
+
required: true,
|
|
5474
|
+
type: String
|
|
5475
|
+
},
|
|
5476
|
+
priceHistory: {
|
|
5477
|
+
default: [],
|
|
5478
|
+
required: true,
|
|
5479
|
+
type: [priceHistorySchema]
|
|
5480
|
+
},
|
|
5481
|
+
revision: {
|
|
5482
|
+
default: 1,
|
|
5483
|
+
min: 1,
|
|
5484
|
+
required: true,
|
|
5485
|
+
type: Number,
|
|
5486
|
+
validate: {
|
|
5487
|
+
message: "Billing catalogue revision must be a positive integer.",
|
|
5488
|
+
validator: Number.isInteger
|
|
5489
|
+
}
|
|
5490
|
+
},
|
|
5491
|
+
stripePriceId: stripePriceIdField,
|
|
5492
|
+
stripeProductId: stripeProductIdField,
|
|
5493
|
+
taxInclusive: {
|
|
5494
|
+
default: true,
|
|
5495
|
+
immutable: true,
|
|
5496
|
+
required: true,
|
|
5497
|
+
type: Boolean,
|
|
5498
|
+
validate: {
|
|
5499
|
+
message: "Billing catalogue prices must include GST.",
|
|
5500
|
+
validator: (value) => value === true
|
|
5501
|
+
}
|
|
5502
|
+
},
|
|
5503
|
+
unitAmount: unitAmountField,
|
|
5504
|
+
updatedBy: {
|
|
5505
|
+
default: null,
|
|
5506
|
+
ref: "User",
|
|
5507
|
+
required: false,
|
|
5508
|
+
type: import_mongoose2.default.Schema.Types.ObjectId
|
|
5509
|
+
}
|
|
5510
|
+
},
|
|
5511
|
+
{
|
|
5512
|
+
collection: BILLING_CATALOG_COLLECTION_NAME,
|
|
5513
|
+
strict: true,
|
|
5514
|
+
timestamps: true
|
|
5515
|
+
}
|
|
5516
|
+
);
|
|
5517
|
+
schema2.pre("validate", function validateDefinition() {
|
|
5518
|
+
if (!billingCatalogDefinitionMatches(this)) {
|
|
5519
|
+
this.invalidate(
|
|
5520
|
+
"key",
|
|
5521
|
+
"Billing catalogue key does not match its licence and billing period."
|
|
5522
|
+
);
|
|
5523
|
+
}
|
|
5524
|
+
});
|
|
5525
|
+
schema2.index({ billingPeriod: 1, licenceType: 1 }, { unique: true });
|
|
5526
|
+
schema2.index({ active: 1, licenceType: 1 });
|
|
5527
|
+
schema2.index(
|
|
5528
|
+
{ stripePriceId: 1 },
|
|
5529
|
+
{
|
|
5530
|
+
partialFilterExpression: { stripePriceId: { $type: "string" } },
|
|
5531
|
+
unique: true
|
|
5532
|
+
}
|
|
5533
|
+
);
|
|
5534
|
+
var BillingCatalogModel = import_mongoose2.default.models.BillingCatalogEntry || import_mongoose2.default.model(
|
|
5535
|
+
"BillingCatalogEntry",
|
|
5536
|
+
schema2,
|
|
5537
|
+
BILLING_CATALOG_COLLECTION_NAME
|
|
5538
|
+
);
|
|
5539
|
+
function buildInitialBillingCatalogEntries(now = /* @__PURE__ */ new Date()) {
|
|
5540
|
+
return INITIAL_BILLING_CATALOG.map((entry) => ({
|
|
5541
|
+
active: entry.active,
|
|
5542
|
+
billingPeriod: entry.billingPeriod,
|
|
5543
|
+
currency: entry.currency,
|
|
5544
|
+
effectiveFrom: new Date(now.getTime()),
|
|
5545
|
+
key: entry.key,
|
|
5546
|
+
licenceType: entry.licenceType,
|
|
5547
|
+
priceHistory: [],
|
|
5548
|
+
revision: 1,
|
|
5549
|
+
stripePriceId: null,
|
|
5550
|
+
stripeProductId: null,
|
|
5551
|
+
taxInclusive: entry.taxInclusive,
|
|
5552
|
+
unitAmount: entry.unitAmount,
|
|
5553
|
+
updatedBy: null
|
|
5554
|
+
}));
|
|
5555
|
+
}
|
|
5556
|
+
function getBillingCatalogDefinition(key) {
|
|
5557
|
+
return BILLING_CATALOG_DEFINITIONS[key];
|
|
5558
|
+
}
|
|
5559
|
+
|
|
5560
|
+
// src/mongoose/chat/Chat.ts
|
|
5561
|
+
var import_mongoose3 = __toESM(require("mongoose"));
|
|
5562
|
+
var MongooseSchema3 = import_mongoose3.default.Schema;
|
|
5563
|
+
var MessageReplyPreviewSchema = new MongooseSchema3(
|
|
5255
5564
|
{
|
|
5256
5565
|
contentPreview: { required: true, type: String },
|
|
5257
5566
|
senderId: {
|
|
5258
5567
|
ref: "User",
|
|
5259
5568
|
required: true,
|
|
5260
|
-
type:
|
|
5569
|
+
type: import_mongoose3.default.Schema.Types.ObjectId
|
|
5261
5570
|
},
|
|
5262
5571
|
senderName: { required: true, type: String }
|
|
5263
5572
|
},
|
|
5264
5573
|
{ _id: false }
|
|
5265
5574
|
);
|
|
5266
|
-
var MessageReactionSchema = new
|
|
5575
|
+
var MessageReactionSchema = new MongooseSchema3(
|
|
5267
5576
|
{
|
|
5268
5577
|
createdAt: { required: true, type: Date },
|
|
5269
5578
|
userId: {
|
|
5270
5579
|
ref: "User",
|
|
5271
5580
|
required: true,
|
|
5272
|
-
type:
|
|
5581
|
+
type: import_mongoose3.default.Schema.Types.ObjectId
|
|
5273
5582
|
}
|
|
5274
5583
|
},
|
|
5275
5584
|
{ _id: false }
|
|
5276
5585
|
);
|
|
5277
|
-
var MessageSeenSchema = new
|
|
5586
|
+
var MessageSeenSchema = new MongooseSchema3(
|
|
5278
5587
|
{
|
|
5279
5588
|
seenAt: { required: true, type: Date },
|
|
5280
5589
|
userId: {
|
|
5281
5590
|
ref: "User",
|
|
5282
5591
|
required: true,
|
|
5283
|
-
type:
|
|
5592
|
+
type: import_mongoose3.default.Schema.Types.ObjectId
|
|
5284
5593
|
}
|
|
5285
5594
|
},
|
|
5286
5595
|
{ _id: false }
|
|
5287
5596
|
);
|
|
5288
|
-
var MessageSchema = new
|
|
5597
|
+
var MessageSchema = new MongooseSchema3(
|
|
5289
5598
|
{
|
|
5290
5599
|
content: { required: true, type: String },
|
|
5291
5600
|
likedBy: { default: [], required: false, type: [MessageReactionSchema] },
|
|
@@ -5296,18 +5605,18 @@ var MessageSchema = new MongooseSchema2(
|
|
|
5296
5605
|
replyToMessageId: {
|
|
5297
5606
|
ref: "Chat.messages",
|
|
5298
5607
|
required: false,
|
|
5299
|
-
type:
|
|
5608
|
+
type: import_mongoose3.default.Schema.Types.ObjectId
|
|
5300
5609
|
},
|
|
5301
5610
|
seenBy: { default: [], required: false, type: [MessageSeenSchema] },
|
|
5302
5611
|
senderId: {
|
|
5303
5612
|
ref: "User",
|
|
5304
5613
|
required: true,
|
|
5305
|
-
type:
|
|
5614
|
+
type: import_mongoose3.default.Schema.Types.ObjectId
|
|
5306
5615
|
}
|
|
5307
5616
|
},
|
|
5308
5617
|
{ timestamps: true }
|
|
5309
5618
|
);
|
|
5310
|
-
var ParticipantSchema = new
|
|
5619
|
+
var ParticipantSchema = new MongooseSchema3(
|
|
5311
5620
|
{
|
|
5312
5621
|
active: { default: true, required: true, type: Boolean },
|
|
5313
5622
|
userAvatar: { required: false, type: String },
|
|
@@ -5315,14 +5624,14 @@ var ParticipantSchema = new MongooseSchema2(
|
|
|
5315
5624
|
userId: {
|
|
5316
5625
|
ref: "User",
|
|
5317
5626
|
required: true,
|
|
5318
|
-
type:
|
|
5627
|
+
type: import_mongoose3.default.Schema.Types.ObjectId
|
|
5319
5628
|
},
|
|
5320
5629
|
userName: { required: true, type: String }
|
|
5321
5630
|
},
|
|
5322
5631
|
{ _id: false }
|
|
5323
5632
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
5324
5633
|
);
|
|
5325
|
-
var ChatSchema = new
|
|
5634
|
+
var ChatSchema = new MongooseSchema3(
|
|
5326
5635
|
{
|
|
5327
5636
|
active: { default: true, required: true, type: Boolean },
|
|
5328
5637
|
chatDescription: { required: false, type: String },
|
|
@@ -5346,12 +5655,12 @@ ChatSchema.index({
|
|
|
5346
5655
|
"participants.userId": 1,
|
|
5347
5656
|
updatedAt: -1
|
|
5348
5657
|
});
|
|
5349
|
-
var ChatModel =
|
|
5658
|
+
var ChatModel = import_mongoose3.default.models.Chat || import_mongoose3.default.model("Chat", ChatSchema);
|
|
5350
5659
|
|
|
5351
5660
|
// src/mongoose/chat/ChatReport.ts
|
|
5352
|
-
var
|
|
5353
|
-
var
|
|
5354
|
-
var ReasonSchema = new
|
|
5661
|
+
var import_mongoose4 = __toESM(require("mongoose"));
|
|
5662
|
+
var MongooseSchema4 = import_mongoose4.default.Schema;
|
|
5663
|
+
var ReasonSchema = new MongooseSchema4(
|
|
5355
5664
|
{
|
|
5356
5665
|
details: { default: null, required: false, type: String },
|
|
5357
5666
|
reasonType: {
|
|
@@ -5362,23 +5671,23 @@ var ReasonSchema = new MongooseSchema3(
|
|
|
5362
5671
|
},
|
|
5363
5672
|
{ _id: false }
|
|
5364
5673
|
);
|
|
5365
|
-
var ChatReportSchema = new
|
|
5674
|
+
var ChatReportSchema = new MongooseSchema4(
|
|
5366
5675
|
{
|
|
5367
5676
|
chatId: {
|
|
5368
5677
|
ref: "Chat",
|
|
5369
5678
|
required: true,
|
|
5370
|
-
type:
|
|
5679
|
+
type: import_mongoose4.default.Schema.Types.ObjectId
|
|
5371
5680
|
},
|
|
5372
5681
|
reason: { required: true, type: ReasonSchema },
|
|
5373
5682
|
reportedUserId: {
|
|
5374
5683
|
ref: "User",
|
|
5375
5684
|
required: true,
|
|
5376
|
-
type:
|
|
5685
|
+
type: import_mongoose4.default.Schema.Types.ObjectId
|
|
5377
5686
|
},
|
|
5378
5687
|
reporterUserId: {
|
|
5379
5688
|
ref: "User",
|
|
5380
5689
|
required: true,
|
|
5381
|
-
type:
|
|
5690
|
+
type: import_mongoose4.default.Schema.Types.ObjectId
|
|
5382
5691
|
},
|
|
5383
5692
|
resolved: { default: false, required: true, type: Boolean }
|
|
5384
5693
|
},
|
|
@@ -5386,18 +5695,18 @@ var ChatReportSchema = new MongooseSchema3(
|
|
|
5386
5695
|
);
|
|
5387
5696
|
ChatReportSchema.index({ chatId: 1, reportedUserId: 1 });
|
|
5388
5697
|
ChatReportSchema.index({ createdAt: -1, reporterUserId: 1 });
|
|
5389
|
-
var ChatReportModel =
|
|
5698
|
+
var ChatReportModel = import_mongoose4.default.models.ChatReport || import_mongoose4.default.model("ChatReport", ChatReportSchema);
|
|
5390
5699
|
|
|
5391
5700
|
// src/mongoose/global.ts
|
|
5392
|
-
var
|
|
5701
|
+
var import_mongoose7 = __toESM(require("mongoose"));
|
|
5393
5702
|
|
|
5394
5703
|
// src/mongoose/Relation.ts
|
|
5395
|
-
var
|
|
5704
|
+
var import_mongoose6 = __toESM(require("mongoose"));
|
|
5396
5705
|
|
|
5397
5706
|
// src/mongoose/event/EventInfo.ts
|
|
5398
|
-
var
|
|
5399
|
-
var
|
|
5400
|
-
var StallTypeSchema = new
|
|
5707
|
+
var import_mongoose5 = __toESM(require("mongoose"));
|
|
5708
|
+
var MongooseSchema5 = import_mongoose5.default.Schema;
|
|
5709
|
+
var StallTypeSchema = new MongooseSchema5(
|
|
5401
5710
|
{
|
|
5402
5711
|
label: { required: false, type: String },
|
|
5403
5712
|
price: { required: false, type: Number },
|
|
@@ -5408,7 +5717,7 @@ var StallTypeSchema = new MongooseSchema4(
|
|
|
5408
5717
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
5409
5718
|
}
|
|
5410
5719
|
);
|
|
5411
|
-
var dateTimeSchema = new
|
|
5720
|
+
var dateTimeSchema = new MongooseSchema5(
|
|
5412
5721
|
{
|
|
5413
5722
|
dateStatus: {
|
|
5414
5723
|
enum: Object.values(EnumEventDateStatus),
|
|
@@ -5424,7 +5733,7 @@ var dateTimeSchema = new MongooseSchema4(
|
|
|
5424
5733
|
{ _id: false }
|
|
5425
5734
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
5426
5735
|
);
|
|
5427
|
-
var paymentInfoSchema = new
|
|
5736
|
+
var paymentInfoSchema = new MongooseSchema5(
|
|
5428
5737
|
{
|
|
5429
5738
|
accountHolderName: { required: false, type: String },
|
|
5430
5739
|
accountNumber: { required: false, type: String },
|
|
@@ -5438,7 +5747,7 @@ var paymentInfoSchema = new MongooseSchema4(
|
|
|
5438
5747
|
{ _id: false }
|
|
5439
5748
|
// Prevents Mongoose from creating an additional _id field
|
|
5440
5749
|
);
|
|
5441
|
-
var requirementsSchema = new
|
|
5750
|
+
var requirementsSchema = new MongooseSchema5(
|
|
5442
5751
|
{
|
|
5443
5752
|
category: { required: true, type: String },
|
|
5444
5753
|
label: { required: true, type: String },
|
|
@@ -5449,7 +5758,7 @@ var requirementsSchema = new MongooseSchema4(
|
|
|
5449
5758
|
// Prevents Mongoose from creating an additional _id field for
|
|
5450
5759
|
}
|
|
5451
5760
|
);
|
|
5452
|
-
var refundPolicySchema = new
|
|
5761
|
+
var refundPolicySchema = new MongooseSchema5(
|
|
5453
5762
|
{
|
|
5454
5763
|
category: { required: true, type: String },
|
|
5455
5764
|
label: { required: true, type: String },
|
|
@@ -5457,7 +5766,7 @@ var refundPolicySchema = new MongooseSchema4(
|
|
|
5457
5766
|
},
|
|
5458
5767
|
{ _id: false }
|
|
5459
5768
|
);
|
|
5460
|
-
var
|
|
5769
|
+
var schema3 = new MongooseSchema5(
|
|
5461
5770
|
{
|
|
5462
5771
|
active: { default: true, type: Boolean },
|
|
5463
5772
|
applicationDeadlineHours: { required: true, type: Number },
|
|
@@ -5465,7 +5774,7 @@ var schema2 = new MongooseSchema4(
|
|
|
5465
5774
|
eventId: {
|
|
5466
5775
|
ref: "Event",
|
|
5467
5776
|
required: true,
|
|
5468
|
-
type:
|
|
5777
|
+
type: import_mongoose5.default.Schema.Types.ObjectId
|
|
5469
5778
|
},
|
|
5470
5779
|
packInTime: { required: true, type: Number },
|
|
5471
5780
|
paymentDueHours: { required: true, type: Number },
|
|
@@ -5475,11 +5784,11 @@ var schema2 = new MongooseSchema4(
|
|
|
5475
5784
|
},
|
|
5476
5785
|
{ timestamps: true }
|
|
5477
5786
|
);
|
|
5478
|
-
var EventInfoModel =
|
|
5787
|
+
var EventInfoModel = import_mongoose5.default.models.EventInfo || import_mongoose5.default.model("EventInfo", schema3);
|
|
5479
5788
|
|
|
5480
5789
|
// src/mongoose/Relation.ts
|
|
5481
|
-
var
|
|
5482
|
-
var relationDateTimeSchema = new
|
|
5790
|
+
var MongooseSchema6 = import_mongoose6.default.Schema;
|
|
5791
|
+
var relationDateTimeSchema = new MongooseSchema6(
|
|
5483
5792
|
{
|
|
5484
5793
|
dateStatus: {
|
|
5485
5794
|
enum: Object.values(EnumEventDateStatus),
|
|
@@ -5494,7 +5803,7 @@ var relationDateTimeSchema = new MongooseSchema5(
|
|
|
5494
5803
|
},
|
|
5495
5804
|
{ _id: false }
|
|
5496
5805
|
);
|
|
5497
|
-
var relationDatesSchema = new
|
|
5806
|
+
var relationDatesSchema = new MongooseSchema6(
|
|
5498
5807
|
{
|
|
5499
5808
|
dateTime: {
|
|
5500
5809
|
required: true,
|
|
@@ -5513,19 +5822,19 @@ var relationDatesSchema = new MongooseSchema5(
|
|
|
5513
5822
|
},
|
|
5514
5823
|
{ _id: false }
|
|
5515
5824
|
);
|
|
5516
|
-
var RelationTypeSchema = new
|
|
5825
|
+
var RelationTypeSchema = new MongooseSchema6(
|
|
5517
5826
|
{
|
|
5518
5827
|
active: { default: true, required: true, type: Boolean },
|
|
5519
5828
|
chatId: {
|
|
5520
5829
|
ref: "Chat",
|
|
5521
5830
|
required: true,
|
|
5522
|
-
type:
|
|
5831
|
+
type: import_mongoose6.default.Schema.Types.ObjectId
|
|
5523
5832
|
},
|
|
5524
5833
|
deletedAt: { default: null, required: false, type: Date },
|
|
5525
5834
|
eventId: {
|
|
5526
5835
|
ref: "Event",
|
|
5527
5836
|
required: true,
|
|
5528
|
-
type:
|
|
5837
|
+
type: import_mongoose6.default.Schema.Types.ObjectId
|
|
5529
5838
|
},
|
|
5530
5839
|
lastUpdateBy: {
|
|
5531
5840
|
enum: Object.values(EnumResourceType),
|
|
@@ -5541,7 +5850,7 @@ var RelationTypeSchema = new MongooseSchema5(
|
|
|
5541
5850
|
vendorId: {
|
|
5542
5851
|
ref: "Vendor",
|
|
5543
5852
|
required: true,
|
|
5544
|
-
type:
|
|
5853
|
+
type: import_mongoose6.default.Schema.Types.ObjectId
|
|
5545
5854
|
}
|
|
5546
5855
|
},
|
|
5547
5856
|
{ timestamps: true }
|
|
@@ -5553,23 +5862,23 @@ RelationTypeSchema.index({
|
|
|
5553
5862
|
"relationDates.status": 1,
|
|
5554
5863
|
vendorId: 1
|
|
5555
5864
|
});
|
|
5556
|
-
var RelationModel =
|
|
5865
|
+
var RelationModel = import_mongoose6.default.models.Relation || import_mongoose6.default.model("Relation", RelationTypeSchema);
|
|
5557
5866
|
|
|
5558
5867
|
// src/mongoose/global.ts
|
|
5559
|
-
var
|
|
5560
|
-
var OwnerTypeSchema = new
|
|
5868
|
+
var MongooseSchema7 = import_mongoose7.default.Schema;
|
|
5869
|
+
var OwnerTypeSchema = new MongooseSchema7(
|
|
5561
5870
|
{
|
|
5562
5871
|
email: { required: true, type: String },
|
|
5563
5872
|
userId: {
|
|
5564
5873
|
ref: "User",
|
|
5565
5874
|
required: true,
|
|
5566
|
-
type:
|
|
5875
|
+
type: import_mongoose7.default.Schema.Types.ObjectId
|
|
5567
5876
|
}
|
|
5568
5877
|
},
|
|
5569
5878
|
{ _id: false }
|
|
5570
5879
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
5571
5880
|
);
|
|
5572
|
-
var SocialMediaTypeSchema = new
|
|
5881
|
+
var SocialMediaTypeSchema = new MongooseSchema7(
|
|
5573
5882
|
{
|
|
5574
5883
|
link: { required: true, type: String },
|
|
5575
5884
|
name: { required: true, type: String }
|
|
@@ -5577,7 +5886,7 @@ var SocialMediaTypeSchema = new MongooseSchema6(
|
|
|
5577
5886
|
{ _id: false }
|
|
5578
5887
|
// Prevents Mongoose from creating an additional _id field
|
|
5579
5888
|
);
|
|
5580
|
-
var ResourceImageTypeSchema = new
|
|
5889
|
+
var ResourceImageTypeSchema = new MongooseSchema7(
|
|
5581
5890
|
{
|
|
5582
5891
|
active: { default: true, required: true, type: Boolean },
|
|
5583
5892
|
source: { required: false, type: String },
|
|
@@ -5586,7 +5895,7 @@ var ResourceImageTypeSchema = new MongooseSchema6(
|
|
|
5586
5895
|
{ _id: false }
|
|
5587
5896
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
5588
5897
|
);
|
|
5589
|
-
var SubCategorySchema = new
|
|
5898
|
+
var SubCategorySchema = new MongooseSchema7(
|
|
5590
5899
|
{
|
|
5591
5900
|
id: { required: false, type: String },
|
|
5592
5901
|
items: [
|
|
@@ -5600,7 +5909,7 @@ var SubCategorySchema = new MongooseSchema6(
|
|
|
5600
5909
|
{ _id: false }
|
|
5601
5910
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
5602
5911
|
);
|
|
5603
|
-
var CategorySchema = new
|
|
5912
|
+
var CategorySchema = new MongooseSchema7(
|
|
5604
5913
|
{
|
|
5605
5914
|
id: { required: true, type: String },
|
|
5606
5915
|
name: { required: true, type: String },
|
|
@@ -5609,7 +5918,7 @@ var CategorySchema = new MongooseSchema6(
|
|
|
5609
5918
|
{ _id: false }
|
|
5610
5919
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
5611
5920
|
);
|
|
5612
|
-
var PosterUsageTypeSchema = new
|
|
5921
|
+
var PosterUsageTypeSchema = new MongooseSchema7(
|
|
5613
5922
|
{
|
|
5614
5923
|
count: { default: 0, required: false, type: Number },
|
|
5615
5924
|
month: { required: false, type: String }
|
|
@@ -5617,7 +5926,7 @@ var PosterUsageTypeSchema = new MongooseSchema6(
|
|
|
5617
5926
|
{ _id: false }
|
|
5618
5927
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
5619
5928
|
);
|
|
5620
|
-
var userLicenseSchema = new
|
|
5929
|
+
var userLicenseSchema = new MongooseSchema7(
|
|
5621
5930
|
{
|
|
5622
5931
|
expiryDate: { required: true, type: Date },
|
|
5623
5932
|
issuedDate: { required: true, type: Date },
|
|
@@ -5634,7 +5943,7 @@ var userLicenseSchema = new MongooseSchema6(
|
|
|
5634
5943
|
},
|
|
5635
5944
|
{ _id: false, timestamps: false }
|
|
5636
5945
|
);
|
|
5637
|
-
var ContactDetailsSchema = new
|
|
5946
|
+
var ContactDetailsSchema = new MongooseSchema7(
|
|
5638
5947
|
{
|
|
5639
5948
|
email: { required: false, type: String },
|
|
5640
5949
|
landlinePhone: { required: false, type: String },
|
|
@@ -5643,7 +5952,7 @@ var ContactDetailsSchema = new MongooseSchema6(
|
|
|
5643
5952
|
{ _id: false }
|
|
5644
5953
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
5645
5954
|
);
|
|
5646
|
-
var termsAgreementSchema = new
|
|
5955
|
+
var termsAgreementSchema = new MongooseSchema7(
|
|
5647
5956
|
{
|
|
5648
5957
|
appBuildNumber: { required: true, type: String },
|
|
5649
5958
|
appId: { required: true, type: String },
|
|
@@ -5660,7 +5969,7 @@ var termsAgreementSchema = new MongooseSchema6(
|
|
|
5660
5969
|
},
|
|
5661
5970
|
{ _id: false }
|
|
5662
5971
|
);
|
|
5663
|
-
var resourceRelationsSchema = new
|
|
5972
|
+
var resourceRelationsSchema = new MongooseSchema7(
|
|
5664
5973
|
{
|
|
5665
5974
|
relationDates: {
|
|
5666
5975
|
default: [],
|
|
@@ -5670,12 +5979,12 @@ var resourceRelationsSchema = new MongooseSchema6(
|
|
|
5670
5979
|
relationId: {
|
|
5671
5980
|
ref: "Relation",
|
|
5672
5981
|
required: false,
|
|
5673
|
-
type:
|
|
5982
|
+
type: import_mongoose7.default.Schema.Types.ObjectId
|
|
5674
5983
|
}
|
|
5675
5984
|
},
|
|
5676
5985
|
{ _id: false }
|
|
5677
5986
|
);
|
|
5678
|
-
var dateTimeSchema2 = new
|
|
5987
|
+
var dateTimeSchema2 = new MongooseSchema7(
|
|
5679
5988
|
{
|
|
5680
5989
|
dateStatus: {
|
|
5681
5990
|
enum: Object.values(EnumEventDateStatus),
|
|
@@ -5690,7 +5999,7 @@ var dateTimeSchema2 = new MongooseSchema6(
|
|
|
5690
5999
|
{ _id: false }
|
|
5691
6000
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
5692
6001
|
);
|
|
5693
|
-
var locationGeoSchema = new
|
|
6002
|
+
var locationGeoSchema = new MongooseSchema7(
|
|
5694
6003
|
{
|
|
5695
6004
|
coordinates: { required: true, type: [Number] },
|
|
5696
6005
|
// [longitude, latitude]
|
|
@@ -5699,7 +6008,7 @@ var locationGeoSchema = new MongooseSchema6(
|
|
|
5699
6008
|
{ _id: false }
|
|
5700
6009
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
5701
6010
|
);
|
|
5702
|
-
var locationsSchema = new
|
|
6011
|
+
var locationsSchema = new MongooseSchema7(
|
|
5703
6012
|
{
|
|
5704
6013
|
city: { required: true, type: String },
|
|
5705
6014
|
country: { required: true, type: String },
|
|
@@ -5715,13 +6024,13 @@ var locationsSchema = new MongooseSchema6(
|
|
|
5715
6024
|
{ _id: false }
|
|
5716
6025
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
5717
6026
|
);
|
|
5718
|
-
var relatedPostSchema = new
|
|
6027
|
+
var relatedPostSchema = new MongooseSchema7(
|
|
5719
6028
|
{
|
|
5720
6029
|
postActive: { default: true, required: true, type: Boolean },
|
|
5721
6030
|
postId: {
|
|
5722
6031
|
ref: "Post",
|
|
5723
6032
|
required: true,
|
|
5724
|
-
type:
|
|
6033
|
+
type: import_mongoose7.default.Schema.Types.ObjectId
|
|
5725
6034
|
},
|
|
5726
6035
|
postSlug: { required: true, type: String },
|
|
5727
6036
|
postType: {
|
|
@@ -5733,7 +6042,7 @@ var relatedPostSchema = new MongooseSchema6(
|
|
|
5733
6042
|
{ _id: false }
|
|
5734
6043
|
// Prevents Mongoose from creating an additional _id field for subdocuments
|
|
5735
6044
|
);
|
|
5736
|
-
var socialShareResourceSchema = new
|
|
6045
|
+
var socialShareResourceSchema = new MongooseSchema7(
|
|
5737
6046
|
{
|
|
5738
6047
|
qrCode: { required: true, type: ResourceImageTypeSchema },
|
|
5739
6048
|
socialImage: { required: true, type: ResourceImageTypeSchema }
|
|
@@ -5746,7 +6055,7 @@ var baseResourceFields = {
|
|
|
5746
6055
|
adIds: {
|
|
5747
6056
|
ref: "Ad",
|
|
5748
6057
|
required: false,
|
|
5749
|
-
type: [
|
|
6058
|
+
type: [import_mongoose7.default.Schema.Types.ObjectId]
|
|
5750
6059
|
},
|
|
5751
6060
|
approvedAt: { default: null, required: false, type: Date },
|
|
5752
6061
|
contactDetails: { required: false, type: ContactDetailsSchema },
|
|
@@ -5776,9 +6085,9 @@ var baseResourceFields = {
|
|
|
5776
6085
|
};
|
|
5777
6086
|
|
|
5778
6087
|
// src/mongoose/GoogleImportedMarket.ts
|
|
5779
|
-
var
|
|
5780
|
-
var
|
|
5781
|
-
var addressComponentSchema = new
|
|
6088
|
+
var import_mongoose8 = __toESM(require("mongoose"));
|
|
6089
|
+
var MongooseSchema8 = import_mongoose8.default.Schema;
|
|
6090
|
+
var addressComponentSchema = new MongooseSchema8(
|
|
5782
6091
|
{
|
|
5783
6092
|
longName: { required: false, type: String },
|
|
5784
6093
|
shortName: { required: false, type: String },
|
|
@@ -5786,7 +6095,7 @@ var addressComponentSchema = new MongooseSchema7(
|
|
|
5786
6095
|
},
|
|
5787
6096
|
{ _id: false }
|
|
5788
6097
|
);
|
|
5789
|
-
var
|
|
6098
|
+
var schema4 = new MongooseSchema8(
|
|
5790
6099
|
{
|
|
5791
6100
|
active: { default: false, required: true, type: Boolean },
|
|
5792
6101
|
address: { required: true, type: String },
|
|
@@ -5798,7 +6107,7 @@ var schema3 = new MongooseSchema7(
|
|
|
5798
6107
|
claimedByUserId: {
|
|
5799
6108
|
ref: "User",
|
|
5800
6109
|
required: false,
|
|
5801
|
-
type:
|
|
6110
|
+
type: import_mongoose8.default.Schema.Types.ObjectId
|
|
5802
6111
|
},
|
|
5803
6112
|
cover: {
|
|
5804
6113
|
required: false,
|
|
@@ -5810,7 +6119,7 @@ var schema3 = new MongooseSchema7(
|
|
|
5810
6119
|
eventId: {
|
|
5811
6120
|
ref: "Event",
|
|
5812
6121
|
required: false,
|
|
5813
|
-
type:
|
|
6122
|
+
type: import_mongoose8.default.Schema.Types.ObjectId
|
|
5814
6123
|
},
|
|
5815
6124
|
eventType: {
|
|
5816
6125
|
enum: Object.values(EnumEventType),
|
|
@@ -5849,18 +6158,18 @@ var schema3 = new MongooseSchema7(
|
|
|
5849
6158
|
},
|
|
5850
6159
|
{ timestamps: true }
|
|
5851
6160
|
);
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
5857
|
-
|
|
5858
|
-
var GoogleImportedMarketModel =
|
|
6161
|
+
schema4.index({ "location.geo": "2dsphere" });
|
|
6162
|
+
schema4.index({ name: 1 });
|
|
6163
|
+
schema4.index({ region: 1 });
|
|
6164
|
+
schema4.index({ deletedAt: 1 });
|
|
6165
|
+
schema4.index({ "dateTime.dateStatus": 1 });
|
|
6166
|
+
schema4.index({ slug: 1 });
|
|
6167
|
+
var GoogleImportedMarketModel = import_mongoose8.default.models.GoogleImportedMarket || import_mongoose8.default.model("GoogleImportedMarket", schema4);
|
|
5859
6168
|
|
|
5860
6169
|
// src/mongoose/Notification.ts
|
|
5861
|
-
var
|
|
5862
|
-
var
|
|
5863
|
-
var
|
|
6170
|
+
var import_mongoose9 = __toESM(require("mongoose"));
|
|
6171
|
+
var MongooseSchema9 = import_mongoose9.default.Schema;
|
|
6172
|
+
var schema5 = new MongooseSchema9(
|
|
5864
6173
|
{
|
|
5865
6174
|
data: {
|
|
5866
6175
|
resourceId: { required: true, type: String },
|
|
@@ -5883,16 +6192,16 @@ var schema4 = new MongooseSchema8(
|
|
|
5883
6192
|
userId: {
|
|
5884
6193
|
ref: "User",
|
|
5885
6194
|
required: true,
|
|
5886
|
-
type:
|
|
6195
|
+
type: import_mongoose9.default.Schema.Types.ObjectId
|
|
5887
6196
|
}
|
|
5888
6197
|
},
|
|
5889
6198
|
{ timestamps: true }
|
|
5890
6199
|
);
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
var NotificationModel =
|
|
6200
|
+
schema5.index({ isRead: 1, userId: 1 });
|
|
6201
|
+
schema5.index({ createdAt: -1, userId: 1 });
|
|
6202
|
+
var NotificationModel = import_mongoose9.default.models.Notification || import_mongoose9.default.model("Notification", schema5);
|
|
5894
6203
|
|
|
5895
|
-
// node_modules/@timardex/cluemart-shared/dist/chunk-
|
|
6204
|
+
// node_modules/@timardex/cluemart-shared/dist/chunk-P4NLBWEJ.mjs
|
|
5896
6205
|
var EnumOSPlatform2 = /* @__PURE__ */ ((EnumOSPlatform22) => {
|
|
5897
6206
|
EnumOSPlatform22["ANDROID"] = "android";
|
|
5898
6207
|
EnumOSPlatform22["IOS"] = "ios";
|
|
@@ -5901,9 +6210,9 @@ var EnumOSPlatform2 = /* @__PURE__ */ ((EnumOSPlatform22) => {
|
|
|
5901
6210
|
})(EnumOSPlatform2 || {});
|
|
5902
6211
|
|
|
5903
6212
|
// src/mongoose/PushToken.ts
|
|
5904
|
-
var
|
|
5905
|
-
var
|
|
5906
|
-
var
|
|
6213
|
+
var import_mongoose10 = __toESM(require("mongoose"));
|
|
6214
|
+
var MongooseSchema10 = import_mongoose10.default.Schema;
|
|
6215
|
+
var schema6 = new MongooseSchema10(
|
|
5907
6216
|
{
|
|
5908
6217
|
platform: {
|
|
5909
6218
|
enum: Object.values(EnumOSPlatform2),
|
|
@@ -5914,17 +6223,17 @@ var schema5 = new MongooseSchema9(
|
|
|
5914
6223
|
userId: {
|
|
5915
6224
|
ref: "User",
|
|
5916
6225
|
required: true,
|
|
5917
|
-
type:
|
|
6226
|
+
type: import_mongoose10.default.Schema.Types.ObjectId
|
|
5918
6227
|
}
|
|
5919
6228
|
},
|
|
5920
6229
|
{ timestamps: true }
|
|
5921
6230
|
);
|
|
5922
|
-
var PushTokenModel =
|
|
6231
|
+
var PushTokenModel = import_mongoose10.default.models.PushToken || import_mongoose10.default.model("PushToken", schema6);
|
|
5923
6232
|
|
|
5924
6233
|
// src/mongoose/ResourceActivity.ts
|
|
5925
|
-
var
|
|
5926
|
-
var
|
|
5927
|
-
var ActivitySchema = new
|
|
6234
|
+
var import_mongoose11 = __toESM(require("mongoose"));
|
|
6235
|
+
var MongooseSchema11 = import_mongoose11.default.Schema;
|
|
6236
|
+
var ActivitySchema = new MongooseSchema11(
|
|
5928
6237
|
{
|
|
5929
6238
|
activityType: {
|
|
5930
6239
|
enum: Object.values(EnumActivity),
|
|
@@ -5952,7 +6261,7 @@ var ActivitySchema = new MongooseSchema10(
|
|
|
5952
6261
|
},
|
|
5953
6262
|
{ _id: false }
|
|
5954
6263
|
);
|
|
5955
|
-
var
|
|
6264
|
+
var schema7 = new MongooseSchema11(
|
|
5956
6265
|
{
|
|
5957
6266
|
activity: { default: [], type: [ActivitySchema] },
|
|
5958
6267
|
resourceId: { required: true, type: String },
|
|
@@ -5964,46 +6273,55 @@ var schema6 = new MongooseSchema10(
|
|
|
5964
6273
|
},
|
|
5965
6274
|
{ timestamps: true }
|
|
5966
6275
|
);
|
|
5967
|
-
|
|
5968
|
-
|
|
5969
|
-
var ResourceActivityModel =
|
|
6276
|
+
schema7.index({ resourceId: 1, resourceType: 1 }, { unique: true });
|
|
6277
|
+
schema7.index({ "views.location": "2dsphere" });
|
|
6278
|
+
var ResourceActivityModel = import_mongoose11.default.models.ResourceActivity || import_mongoose11.default.model("ResourceActivity", schema7);
|
|
5970
6279
|
|
|
5971
6280
|
// src/mongoose/User.ts
|
|
5972
|
-
var
|
|
5973
|
-
var
|
|
5974
|
-
var userActivityEventSchema = new
|
|
6281
|
+
var import_mongoose12 = __toESM(require("mongoose"));
|
|
6282
|
+
var MongooseSchema12 = import_mongoose12.default.Schema;
|
|
6283
|
+
var userActivityEventSchema = new MongooseSchema12(
|
|
5975
6284
|
{
|
|
5976
6285
|
dateTime: dateTimeSchema2,
|
|
5977
6286
|
resourceId: {
|
|
5978
6287
|
ref: "Event",
|
|
5979
6288
|
required: false,
|
|
5980
|
-
type:
|
|
6289
|
+
type: import_mongoose12.default.Schema.Types.ObjectId
|
|
5981
6290
|
}
|
|
5982
6291
|
},
|
|
5983
6292
|
{ _id: false }
|
|
5984
6293
|
);
|
|
5985
|
-
var userActivityFavouritesSchema = new
|
|
6294
|
+
var userActivityFavouritesSchema = new MongooseSchema12(
|
|
5986
6295
|
{
|
|
5987
6296
|
events: {
|
|
5988
6297
|
ref: "Event",
|
|
5989
6298
|
required: false,
|
|
5990
|
-
type: [
|
|
6299
|
+
type: [import_mongoose12.default.Schema.Types.ObjectId]
|
|
5991
6300
|
},
|
|
5992
6301
|
partners: {
|
|
5993
6302
|
ref: "Partner",
|
|
5994
6303
|
required: false,
|
|
5995
|
-
type: [
|
|
6304
|
+
type: [import_mongoose12.default.Schema.Types.ObjectId]
|
|
5996
6305
|
},
|
|
5997
6306
|
vendors: {
|
|
5998
6307
|
ref: "Vendor",
|
|
5999
6308
|
required: false,
|
|
6000
|
-
type: [
|
|
6309
|
+
type: [import_mongoose12.default.Schema.Types.ObjectId]
|
|
6001
6310
|
}
|
|
6002
6311
|
},
|
|
6003
6312
|
{ _id: false }
|
|
6004
6313
|
);
|
|
6005
|
-
var stripeSchema = new
|
|
6314
|
+
var stripeSchema = new MongooseSchema12(
|
|
6006
6315
|
{
|
|
6316
|
+
billingPeriod: {
|
|
6317
|
+
enum: Object.values(EnumBillingPeriod),
|
|
6318
|
+
required: false,
|
|
6319
|
+
type: String
|
|
6320
|
+
},
|
|
6321
|
+
cancelAtPeriodEnd: {
|
|
6322
|
+
required: false,
|
|
6323
|
+
type: Boolean
|
|
6324
|
+
},
|
|
6007
6325
|
currentPlan: {
|
|
6008
6326
|
enum: Object.values(EnumUserLicence),
|
|
6009
6327
|
required: false,
|
|
@@ -6017,6 +6335,28 @@ var stripeSchema = new MongooseSchema11(
|
|
|
6017
6335
|
required: false,
|
|
6018
6336
|
type: Date
|
|
6019
6337
|
},
|
|
6338
|
+
pendingBillingPeriod: {
|
|
6339
|
+
enum: Object.values(EnumBillingPeriod),
|
|
6340
|
+
required: false,
|
|
6341
|
+
type: String
|
|
6342
|
+
},
|
|
6343
|
+
pendingChangeEffectiveAt: {
|
|
6344
|
+
required: false,
|
|
6345
|
+
type: Date
|
|
6346
|
+
},
|
|
6347
|
+
pendingPlan: {
|
|
6348
|
+
enum: Object.values(EnumUserLicence),
|
|
6349
|
+
required: false,
|
|
6350
|
+
type: String
|
|
6351
|
+
},
|
|
6352
|
+
priceId: {
|
|
6353
|
+
required: false,
|
|
6354
|
+
type: String
|
|
6355
|
+
},
|
|
6356
|
+
scheduleId: {
|
|
6357
|
+
required: false,
|
|
6358
|
+
type: String
|
|
6359
|
+
},
|
|
6020
6360
|
startDate: {
|
|
6021
6361
|
required: false,
|
|
6022
6362
|
type: Date
|
|
@@ -6029,11 +6369,19 @@ var stripeSchema = new MongooseSchema11(
|
|
|
6029
6369
|
subscriptionId: {
|
|
6030
6370
|
required: false,
|
|
6031
6371
|
type: String
|
|
6372
|
+
},
|
|
6373
|
+
subscriptionMutationLockExpiresAt: {
|
|
6374
|
+
required: false,
|
|
6375
|
+
type: Date
|
|
6376
|
+
},
|
|
6377
|
+
subscriptionMutationLockId: {
|
|
6378
|
+
required: false,
|
|
6379
|
+
type: String
|
|
6032
6380
|
}
|
|
6033
6381
|
},
|
|
6034
6382
|
{ _id: false }
|
|
6035
6383
|
);
|
|
6036
|
-
var redeemedRewardSchema = new
|
|
6384
|
+
var redeemedRewardSchema = new MongooseSchema12(
|
|
6037
6385
|
{
|
|
6038
6386
|
name: {
|
|
6039
6387
|
enum: Object.values(EnumReward),
|
|
@@ -6045,13 +6393,13 @@ var redeemedRewardSchema = new MongooseSchema11(
|
|
|
6045
6393
|
},
|
|
6046
6394
|
{ _id: false }
|
|
6047
6395
|
);
|
|
6048
|
-
var
|
|
6396
|
+
var schema8 = new MongooseSchema12(
|
|
6049
6397
|
{
|
|
6050
6398
|
active: { default: false, required: true, type: Boolean },
|
|
6051
6399
|
affiliate: {
|
|
6052
6400
|
ref: "Affiliate",
|
|
6053
6401
|
required: false,
|
|
6054
|
-
type:
|
|
6402
|
+
type: import_mongoose12.default.Schema.Types.ObjectId
|
|
6055
6403
|
},
|
|
6056
6404
|
avatar: {
|
|
6057
6405
|
required: false,
|
|
@@ -6060,7 +6408,7 @@ var schema7 = new MongooseSchema11(
|
|
|
6060
6408
|
coupon: {
|
|
6061
6409
|
ref: "Coupon",
|
|
6062
6410
|
required: false,
|
|
6063
|
-
type:
|
|
6411
|
+
type: import_mongoose12.default.Schema.Types.ObjectId
|
|
6064
6412
|
},
|
|
6065
6413
|
deletedAt: { default: null, required: false, type: Date },
|
|
6066
6414
|
email: { required: true, type: String },
|
|
@@ -6072,13 +6420,13 @@ var schema7 = new MongooseSchema11(
|
|
|
6072
6420
|
events: {
|
|
6073
6421
|
ref: "Event",
|
|
6074
6422
|
required: false,
|
|
6075
|
-
type: [
|
|
6423
|
+
type: [import_mongoose12.default.Schema.Types.ObjectId]
|
|
6076
6424
|
},
|
|
6077
6425
|
firstName: { required: true, type: String },
|
|
6078
6426
|
game: {
|
|
6079
6427
|
ref: "Game",
|
|
6080
6428
|
required: false,
|
|
6081
|
-
type:
|
|
6429
|
+
type: import_mongoose12.default.Schema.Types.ObjectId
|
|
6082
6430
|
},
|
|
6083
6431
|
interests: {
|
|
6084
6432
|
enum: Object.values(EnumResourceType),
|
|
@@ -6100,7 +6448,7 @@ var schema7 = new MongooseSchema11(
|
|
|
6100
6448
|
partner: {
|
|
6101
6449
|
ref: "Partner",
|
|
6102
6450
|
required: false,
|
|
6103
|
-
type:
|
|
6451
|
+
type: import_mongoose12.default.Schema.Types.ObjectId
|
|
6104
6452
|
},
|
|
6105
6453
|
password: { required: true, type: String },
|
|
6106
6454
|
platform: {
|
|
@@ -6133,7 +6481,7 @@ var schema7 = new MongooseSchema11(
|
|
|
6133
6481
|
school: {
|
|
6134
6482
|
ref: "School",
|
|
6135
6483
|
required: false,
|
|
6136
|
-
type:
|
|
6484
|
+
type: import_mongoose12.default.Schema.Types.ObjectId
|
|
6137
6485
|
},
|
|
6138
6486
|
stripe: {
|
|
6139
6487
|
required: false,
|
|
@@ -6158,19 +6506,19 @@ var schema7 = new MongooseSchema11(
|
|
|
6158
6506
|
vendor: {
|
|
6159
6507
|
ref: "Vendor",
|
|
6160
6508
|
required: false,
|
|
6161
|
-
type:
|
|
6509
|
+
type: import_mongoose12.default.Schema.Types.ObjectId
|
|
6162
6510
|
}
|
|
6163
6511
|
},
|
|
6164
6512
|
{ strict: false, timestamps: true }
|
|
6165
6513
|
);
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
var UserModel =
|
|
6514
|
+
schema8.index({ "licences.expiryDate": 1 });
|
|
6515
|
+
schema8.index({ "licences.licenceType": 1 });
|
|
6516
|
+
var UserModel = import_mongoose12.default.models.User || import_mongoose12.default.model("User", schema8);
|
|
6169
6517
|
|
|
6170
6518
|
// src/mongoose/VerificationToken.ts
|
|
6171
|
-
var
|
|
6172
|
-
var
|
|
6173
|
-
var
|
|
6519
|
+
var import_mongoose13 = __toESM(require("mongoose"));
|
|
6520
|
+
var MongooseSchema13 = import_mongoose13.default.Schema;
|
|
6521
|
+
var schema9 = new MongooseSchema13(
|
|
6174
6522
|
{
|
|
6175
6523
|
createdAt: {
|
|
6176
6524
|
default: Date.now,
|
|
@@ -6185,12 +6533,12 @@ var schema8 = new MongooseSchema12(
|
|
|
6185
6533
|
},
|
|
6186
6534
|
{ timestamps: true }
|
|
6187
6535
|
);
|
|
6188
|
-
var VerificationTokenModel =
|
|
6536
|
+
var VerificationTokenModel = import_mongoose13.default.models.VerificationToken || import_mongoose13.default.model("VerificationToken", schema9);
|
|
6189
6537
|
|
|
6190
6538
|
// src/mongoose/vendor/Vendor.ts
|
|
6191
|
-
var
|
|
6192
|
-
var
|
|
6193
|
-
var vendorProductTypeSchema = new
|
|
6539
|
+
var import_mongoose14 = __toESM(require("mongoose"));
|
|
6540
|
+
var MongooseSchema14 = import_mongoose14.default.Schema;
|
|
6541
|
+
var vendorProductTypeSchema = new MongooseSchema14(
|
|
6194
6542
|
{
|
|
6195
6543
|
description: { required: false, type: String },
|
|
6196
6544
|
name: { required: true, type: String },
|
|
@@ -6201,14 +6549,14 @@ var vendorProductTypeSchema = new MongooseSchema13(
|
|
|
6201
6549
|
},
|
|
6202
6550
|
{ timestamps: true }
|
|
6203
6551
|
);
|
|
6204
|
-
var productWrapperSchema = new
|
|
6552
|
+
var productWrapperSchema = new MongooseSchema14(
|
|
6205
6553
|
{
|
|
6206
6554
|
active: { default: false, required: false, type: Boolean },
|
|
6207
6555
|
productsList: { required: false, type: [vendorProductTypeSchema] }
|
|
6208
6556
|
},
|
|
6209
6557
|
{ _id: false }
|
|
6210
6558
|
);
|
|
6211
|
-
var calendarSchema = new
|
|
6559
|
+
var calendarSchema = new MongooseSchema14(
|
|
6212
6560
|
{
|
|
6213
6561
|
dateTime: {
|
|
6214
6562
|
dateStatus: {
|
|
@@ -6229,14 +6577,14 @@ var calendarSchema = new MongooseSchema13(
|
|
|
6229
6577
|
},
|
|
6230
6578
|
{ _id: false }
|
|
6231
6579
|
);
|
|
6232
|
-
var calendarWrapperSchema = new
|
|
6580
|
+
var calendarWrapperSchema = new MongooseSchema14(
|
|
6233
6581
|
{
|
|
6234
6582
|
active: { default: false, required: true, type: Boolean },
|
|
6235
6583
|
calendarData: { required: false, type: [calendarSchema] }
|
|
6236
6584
|
},
|
|
6237
6585
|
{ _id: false }
|
|
6238
6586
|
);
|
|
6239
|
-
var
|
|
6587
|
+
var schema10 = new MongooseSchema14(
|
|
6240
6588
|
{
|
|
6241
6589
|
...baseResourceFields,
|
|
6242
6590
|
// Importing base resource fields from global.ts
|
|
@@ -6262,12 +6610,12 @@ var schema9 = new MongooseSchema13(
|
|
|
6262
6610
|
unregisteredVendorId: {
|
|
6263
6611
|
ref: "UnregisteredVendor",
|
|
6264
6612
|
required: false,
|
|
6265
|
-
type:
|
|
6613
|
+
type: import_mongoose14.default.Schema.Types.ObjectId
|
|
6266
6614
|
},
|
|
6267
6615
|
vendorInfoId: {
|
|
6268
6616
|
ref: "VendorInfo",
|
|
6269
6617
|
required: false,
|
|
6270
|
-
type:
|
|
6618
|
+
type: import_mongoose14.default.Schema.Types.ObjectId
|
|
6271
6619
|
},
|
|
6272
6620
|
vendorType: {
|
|
6273
6621
|
enum: Object.values(EnumVendorType),
|
|
@@ -6277,24 +6625,24 @@ var schema9 = new MongooseSchema13(
|
|
|
6277
6625
|
},
|
|
6278
6626
|
{ timestamps: true }
|
|
6279
6627
|
);
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
-
|
|
6284
|
-
|
|
6285
|
-
var VendorModel =
|
|
6628
|
+
schema10.index({ name: 1 });
|
|
6629
|
+
schema10.index({ description: 1 });
|
|
6630
|
+
schema10.index({ region: 1 });
|
|
6631
|
+
schema10.index({ "categories.name": 1 });
|
|
6632
|
+
schema10.index({ slug: 1 });
|
|
6633
|
+
var VendorModel = import_mongoose14.default.models.Vendor || import_mongoose14.default.model("Vendor", schema10);
|
|
6286
6634
|
|
|
6287
6635
|
// src/mongoose/vendor/VendorInfo.ts
|
|
6288
|
-
var
|
|
6289
|
-
var
|
|
6290
|
-
var AttributesSchema = new
|
|
6636
|
+
var import_mongoose15 = __toESM(require("mongoose"));
|
|
6637
|
+
var MongooseSchema15 = import_mongoose15.default.Schema;
|
|
6638
|
+
var AttributesSchema = new MongooseSchema15(
|
|
6291
6639
|
{
|
|
6292
6640
|
details: { required: false, type: String },
|
|
6293
6641
|
isRequired: { default: false, required: true, type: Boolean }
|
|
6294
6642
|
},
|
|
6295
6643
|
{ _id: false }
|
|
6296
6644
|
);
|
|
6297
|
-
var
|
|
6645
|
+
var schema11 = new MongooseSchema15(
|
|
6298
6646
|
{
|
|
6299
6647
|
active: { default: true, type: Boolean },
|
|
6300
6648
|
compliance: {
|
|
@@ -6329,28 +6677,28 @@ var schema10 = new MongooseSchema14(
|
|
|
6329
6677
|
vendorId: {
|
|
6330
6678
|
ref: "Vendor",
|
|
6331
6679
|
required: true,
|
|
6332
|
-
type:
|
|
6680
|
+
type: import_mongoose15.default.Schema.Types.ObjectId
|
|
6333
6681
|
}
|
|
6334
6682
|
},
|
|
6335
6683
|
{ timestamps: true }
|
|
6336
6684
|
);
|
|
6337
|
-
var VendorInfoModel =
|
|
6685
|
+
var VendorInfoModel = import_mongoose15.default.models.VendorInfo || import_mongoose15.default.model("VendorInfo", schema11);
|
|
6338
6686
|
|
|
6339
6687
|
// src/mongoose/vendor/UnregisteredVendor.ts
|
|
6340
|
-
var
|
|
6341
|
-
var
|
|
6342
|
-
var invitationSchema = new
|
|
6688
|
+
var import_mongoose16 = __toESM(require("mongoose"));
|
|
6689
|
+
var MongooseSchema16 = import_mongoose16.default.Schema;
|
|
6690
|
+
var invitationSchema = new MongooseSchema16(
|
|
6343
6691
|
{
|
|
6344
6692
|
dateTime: { required: true, type: [dateTimeSchema2] },
|
|
6345
6693
|
inviterId: {
|
|
6346
6694
|
ref: "Event",
|
|
6347
6695
|
required: true,
|
|
6348
|
-
type:
|
|
6696
|
+
type: import_mongoose16.default.Schema.Types.ObjectId
|
|
6349
6697
|
}
|
|
6350
6698
|
},
|
|
6351
6699
|
{ _id: false }
|
|
6352
6700
|
);
|
|
6353
|
-
var
|
|
6701
|
+
var schema12 = new MongooseSchema16(
|
|
6354
6702
|
{
|
|
6355
6703
|
active: { default: true, required: true, type: Boolean },
|
|
6356
6704
|
categoryIds: { required: true, type: [String] },
|
|
@@ -6359,7 +6707,7 @@ var schema11 = new MongooseSchema15(
|
|
|
6359
6707
|
claimedByUserId: {
|
|
6360
6708
|
ref: "User",
|
|
6361
6709
|
required: false,
|
|
6362
|
-
type:
|
|
6710
|
+
type: import_mongoose16.default.Schema.Types.ObjectId
|
|
6363
6711
|
},
|
|
6364
6712
|
claimInitiatedAt: { default: null, required: false, type: Date },
|
|
6365
6713
|
claimToken: { default: null, required: false, type: String },
|
|
@@ -6372,14 +6720,14 @@ var schema11 = new MongooseSchema15(
|
|
|
6372
6720
|
},
|
|
6373
6721
|
{ timestamps: true }
|
|
6374
6722
|
);
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
var UnregisteredVendorModel =
|
|
6723
|
+
schema12.index({ name: 1 });
|
|
6724
|
+
schema12.index({ email: 1 });
|
|
6725
|
+
var UnregisteredVendorModel = import_mongoose16.default.models.UnregisteredVendor || import_mongoose16.default.model("UnregisteredVendor", schema12);
|
|
6378
6726
|
|
|
6379
6727
|
// src/mongoose/event/Event.ts
|
|
6380
|
-
var
|
|
6381
|
-
var
|
|
6382
|
-
var
|
|
6728
|
+
var import_mongoose17 = __toESM(require("mongoose"));
|
|
6729
|
+
var MongooseSchema17 = import_mongoose17.default.Schema;
|
|
6730
|
+
var schema13 = new MongooseSchema17(
|
|
6383
6731
|
{
|
|
6384
6732
|
...baseResourceFields,
|
|
6385
6733
|
// Importing base resource fields from global.ts
|
|
@@ -6388,7 +6736,7 @@ var schema12 = new MongooseSchema16(
|
|
|
6388
6736
|
eventInfoId: {
|
|
6389
6737
|
ref: "EventInfo",
|
|
6390
6738
|
required: false,
|
|
6391
|
-
type:
|
|
6739
|
+
type: import_mongoose17.default.Schema.Types.ObjectId
|
|
6392
6740
|
},
|
|
6393
6741
|
eventType: {
|
|
6394
6742
|
enum: Object.values(EnumEventType),
|
|
@@ -6417,20 +6765,20 @@ var schema12 = new MongooseSchema16(
|
|
|
6417
6765
|
},
|
|
6418
6766
|
{ timestamps: true }
|
|
6419
6767
|
);
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
|
|
6424
|
-
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
|
|
6428
|
-
var EventModel =
|
|
6768
|
+
schema13.index({ name: 1 });
|
|
6769
|
+
schema13.index({ description: 1 });
|
|
6770
|
+
schema13.index({ region: 1 });
|
|
6771
|
+
schema13.index({ "location.geo": "2dsphere" });
|
|
6772
|
+
schema13.index({ tags: 1 });
|
|
6773
|
+
schema13.index({ deletedAt: 1 });
|
|
6774
|
+
schema13.index({ "dateTime.dateStatus": 1 });
|
|
6775
|
+
schema13.index({ slug: 1 });
|
|
6776
|
+
var EventModel = import_mongoose17.default.models.Event || import_mongoose17.default.model("Event", schema13);
|
|
6429
6777
|
|
|
6430
6778
|
// src/mongoose/Partner.ts
|
|
6431
|
-
var
|
|
6432
|
-
var
|
|
6433
|
-
var
|
|
6779
|
+
var import_mongoose18 = __toESM(require("mongoose"));
|
|
6780
|
+
var MongooseSchema18 = import_mongoose18.default.Schema;
|
|
6781
|
+
var schema14 = new MongooseSchema18(
|
|
6434
6782
|
{
|
|
6435
6783
|
...baseResourceFields,
|
|
6436
6784
|
location: {
|
|
@@ -6446,19 +6794,19 @@ var schema13 = new MongooseSchema17(
|
|
|
6446
6794
|
},
|
|
6447
6795
|
{ timestamps: true }
|
|
6448
6796
|
);
|
|
6449
|
-
|
|
6450
|
-
|
|
6451
|
-
|
|
6452
|
-
|
|
6453
|
-
|
|
6454
|
-
var PartnerModel =
|
|
6797
|
+
schema14.index({ name: 1 });
|
|
6798
|
+
schema14.index({ description: 1 });
|
|
6799
|
+
schema14.index({ region: 1 });
|
|
6800
|
+
schema14.index({ "location.geo": "2dsphere" });
|
|
6801
|
+
schema14.index({ slug: 1 });
|
|
6802
|
+
var PartnerModel = import_mongoose18.default.models.Partner || import_mongoose18.default.model("Partner", schema14);
|
|
6455
6803
|
|
|
6456
6804
|
// src/mongoose/Post.ts
|
|
6457
|
-
var
|
|
6458
|
-
var
|
|
6459
|
-
var contentSchema = new
|
|
6805
|
+
var import_mongoose19 = __toESM(require("mongoose"));
|
|
6806
|
+
var MongooseSchema19 = import_mongoose19.default.Schema;
|
|
6807
|
+
var contentSchema = new MongooseSchema19(
|
|
6460
6808
|
{
|
|
6461
|
-
contentData:
|
|
6809
|
+
contentData: import_mongoose19.Schema.Types.Mixed,
|
|
6462
6810
|
contentOrder: { required: true, type: Number },
|
|
6463
6811
|
contentType: {
|
|
6464
6812
|
enum: Object.values(EnumPostContentType),
|
|
@@ -6468,7 +6816,7 @@ var contentSchema = new MongooseSchema18(
|
|
|
6468
6816
|
},
|
|
6469
6817
|
{ _id: false }
|
|
6470
6818
|
);
|
|
6471
|
-
var resourceSchema = new
|
|
6819
|
+
var resourceSchema = new MongooseSchema19(
|
|
6472
6820
|
{
|
|
6473
6821
|
resourceId: { required: true, type: String },
|
|
6474
6822
|
resourceRegion: { required: true, type: String },
|
|
@@ -6481,7 +6829,7 @@ var resourceSchema = new MongooseSchema18(
|
|
|
6481
6829
|
},
|
|
6482
6830
|
{ _id: false }
|
|
6483
6831
|
);
|
|
6484
|
-
var
|
|
6832
|
+
var schema15 = new MongooseSchema19(
|
|
6485
6833
|
{
|
|
6486
6834
|
active: { default: false, required: true, type: Boolean },
|
|
6487
6835
|
approvedAt: { default: null, required: false, type: Date },
|
|
@@ -6512,16 +6860,16 @@ var schema14 = new MongooseSchema18(
|
|
|
6512
6860
|
},
|
|
6513
6861
|
{ timestamps: true }
|
|
6514
6862
|
);
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
var PostModel =
|
|
6863
|
+
schema15.index({ title: 1 });
|
|
6864
|
+
schema15.index({ tags: 1 });
|
|
6865
|
+
schema15.index({ postType: 1, slug: 1 }, { unique: true });
|
|
6866
|
+
var PostModel = import_mongoose19.default.models.Post || import_mongoose19.default.model("Post", schema15);
|
|
6519
6867
|
|
|
6520
6868
|
// src/mongoose/AppSetting.ts
|
|
6521
|
-
var
|
|
6522
|
-
var
|
|
6869
|
+
var import_mongoose20 = __toESM(require("mongoose"));
|
|
6870
|
+
var MongooseSchema20 = import_mongoose20.default.Schema;
|
|
6523
6871
|
var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
|
|
6524
|
-
var AppSettingSchema = new
|
|
6872
|
+
var AppSettingSchema = new MongooseSchema20(
|
|
6525
6873
|
{
|
|
6526
6874
|
activeSchoolsStudentCountTotal: {
|
|
6527
6875
|
default: 0,
|
|
@@ -6552,18 +6900,18 @@ var AppSettingSchema = new MongooseSchema19(
|
|
|
6552
6900
|
},
|
|
6553
6901
|
{ timestamps: true }
|
|
6554
6902
|
);
|
|
6555
|
-
var AppSettingModel =
|
|
6903
|
+
var AppSettingModel = import_mongoose20.default.models.AppSetting || import_mongoose20.default.model("AppSetting", AppSettingSchema);
|
|
6556
6904
|
|
|
6557
6905
|
// src/mongoose/game/Game.ts
|
|
6558
|
-
var
|
|
6906
|
+
var import_mongoose24 = __toESM(require("mongoose"));
|
|
6559
6907
|
|
|
6560
6908
|
// src/mongoose/game/DailyClue.ts
|
|
6561
|
-
var
|
|
6909
|
+
var import_mongoose22 = __toESM(require("mongoose"));
|
|
6562
6910
|
|
|
6563
6911
|
// src/mongoose/game/utils.ts
|
|
6564
|
-
var
|
|
6565
|
-
var
|
|
6566
|
-
var schemaGameDate = new
|
|
6912
|
+
var import_mongoose21 = __toESM(require("mongoose"));
|
|
6913
|
+
var MongooseSchema21 = import_mongoose21.default.Schema;
|
|
6914
|
+
var schemaGameDate = new MongooseSchema21(
|
|
6567
6915
|
{
|
|
6568
6916
|
endDate: { required: true, type: Date },
|
|
6569
6917
|
startDate: { required: true, type: Date }
|
|
@@ -6572,8 +6920,8 @@ var schemaGameDate = new MongooseSchema20(
|
|
|
6572
6920
|
);
|
|
6573
6921
|
|
|
6574
6922
|
// src/mongoose/game/DailyClue.ts
|
|
6575
|
-
var
|
|
6576
|
-
var schemaLetters = new
|
|
6923
|
+
var MongooseSchema22 = import_mongoose22.default.Schema;
|
|
6924
|
+
var schemaLetters = new MongooseSchema22(
|
|
6577
6925
|
{
|
|
6578
6926
|
collected: { required: false, type: [String] },
|
|
6579
6927
|
solutionShuffled: { required: true, type: [String] }
|
|
@@ -6581,14 +6929,14 @@ var schemaLetters = new MongooseSchema21(
|
|
|
6581
6929
|
},
|
|
6582
6930
|
{ _id: false }
|
|
6583
6931
|
);
|
|
6584
|
-
var schemaDailyClueBaseGame = new
|
|
6932
|
+
var schemaDailyClueBaseGame = new MongooseSchema22(
|
|
6585
6933
|
{
|
|
6586
6934
|
gameDate: { required: true, type: schemaGameDate },
|
|
6587
6935
|
gameSolution: { required: true, type: String }
|
|
6588
6936
|
},
|
|
6589
6937
|
{ _id: false }
|
|
6590
6938
|
);
|
|
6591
|
-
var schemaDailyClueGameData = new
|
|
6939
|
+
var schemaDailyClueGameData = new MongooseSchema22(
|
|
6592
6940
|
{
|
|
6593
6941
|
gameFields: { required: true, type: schemaDailyClueBaseGame },
|
|
6594
6942
|
lastFoundDate: { default: null, required: false, type: Date },
|
|
@@ -6603,9 +6951,9 @@ var schemaDailyClueGameData = new MongooseSchema21(
|
|
|
6603
6951
|
);
|
|
6604
6952
|
|
|
6605
6953
|
// src/mongoose/game/PuzzleGame.ts
|
|
6606
|
-
var
|
|
6607
|
-
var
|
|
6608
|
-
var schemaPuzzleAnswer = new
|
|
6954
|
+
var import_mongoose23 = __toESM(require("mongoose"));
|
|
6955
|
+
var MongooseSchema23 = import_mongoose23.default.Schema;
|
|
6956
|
+
var schemaPuzzleAnswer = new MongooseSchema23(
|
|
6609
6957
|
{
|
|
6610
6958
|
answer: { required: true, type: String },
|
|
6611
6959
|
answerId: { required: true, type: String },
|
|
@@ -6613,7 +6961,7 @@ var schemaPuzzleAnswer = new MongooseSchema22(
|
|
|
6613
6961
|
},
|
|
6614
6962
|
{ _id: false }
|
|
6615
6963
|
);
|
|
6616
|
-
var schemaPuzzleQuestion = new
|
|
6964
|
+
var schemaPuzzleQuestion = new MongooseSchema23(
|
|
6617
6965
|
{
|
|
6618
6966
|
answers: { required: true, type: [schemaPuzzleAnswer] },
|
|
6619
6967
|
question: { required: true, type: String },
|
|
@@ -6621,20 +6969,20 @@ var schemaPuzzleQuestion = new MongooseSchema22(
|
|
|
6621
6969
|
},
|
|
6622
6970
|
{ _id: false }
|
|
6623
6971
|
);
|
|
6624
|
-
var schemaPuzzleBaseGame = new
|
|
6972
|
+
var schemaPuzzleBaseGame = new MongooseSchema23(
|
|
6625
6973
|
{
|
|
6626
6974
|
questions: { required: true, type: [schemaPuzzleQuestion] }
|
|
6627
6975
|
},
|
|
6628
6976
|
{ _id: false }
|
|
6629
6977
|
);
|
|
6630
|
-
var schemaPuzzleAnsweredQuestion = new
|
|
6978
|
+
var schemaPuzzleAnsweredQuestion = new MongooseSchema23(
|
|
6631
6979
|
{
|
|
6632
6980
|
questionId: { required: true, type: String },
|
|
6633
6981
|
selectedAnswerId: { required: true, type: String }
|
|
6634
6982
|
},
|
|
6635
6983
|
{ _id: false }
|
|
6636
6984
|
);
|
|
6637
|
-
var schemaPuzzleGameData = new
|
|
6985
|
+
var schemaPuzzleGameData = new MongooseSchema23(
|
|
6638
6986
|
{
|
|
6639
6987
|
answeredQuestions: {
|
|
6640
6988
|
default: null,
|
|
@@ -6649,19 +6997,19 @@ var schemaPuzzleGameData = new MongooseSchema22(
|
|
|
6649
6997
|
);
|
|
6650
6998
|
|
|
6651
6999
|
// src/mongoose/game/Game.ts
|
|
6652
|
-
var
|
|
7000
|
+
var MongooseSchema24 = import_mongoose24.default.Schema;
|
|
6653
7001
|
var gameDataSchemas = {
|
|
6654
7002
|
[EnumGameType.DAILY_CLUE]: schemaDailyClueGameData,
|
|
6655
7003
|
[EnumGameType.MINI_QUIZ]: schemaPuzzleGameData,
|
|
6656
7004
|
[EnumGameType.ODD_ONE_OUT]: schemaPuzzleGameData
|
|
6657
7005
|
};
|
|
6658
7006
|
var gameDataDefinition = Object.fromEntries(
|
|
6659
|
-
Object.entries(gameDataSchemas).map(([key,
|
|
7007
|
+
Object.entries(gameDataSchemas).map(([key, schema20]) => [
|
|
6660
7008
|
key,
|
|
6661
|
-
{ default: null, required: false, type:
|
|
7009
|
+
{ default: null, required: false, type: schema20 }
|
|
6662
7010
|
])
|
|
6663
7011
|
);
|
|
6664
|
-
var gameHistorySchema = new
|
|
7012
|
+
var gameHistorySchema = new MongooseSchema24(
|
|
6665
7013
|
{
|
|
6666
7014
|
createdAt: { required: true, type: Date },
|
|
6667
7015
|
gameDate: { required: true, type: schemaGameDate },
|
|
@@ -6681,7 +7029,7 @@ var gameHistorySchema = new MongooseSchema23(
|
|
|
6681
7029
|
},
|
|
6682
7030
|
{ _id: false }
|
|
6683
7031
|
);
|
|
6684
|
-
var gameTypeSchema = new
|
|
7032
|
+
var gameTypeSchema = new MongooseSchema24(
|
|
6685
7033
|
{
|
|
6686
7034
|
active: { default: true, required: true, type: Boolean },
|
|
6687
7035
|
gameData: gameDataDefinition,
|
|
@@ -6696,7 +7044,7 @@ var gameTypeSchema = new MongooseSchema23(
|
|
|
6696
7044
|
},
|
|
6697
7045
|
{ timestamps: true }
|
|
6698
7046
|
);
|
|
6699
|
-
var
|
|
7047
|
+
var schema16 = new MongooseSchema24(
|
|
6700
7048
|
{
|
|
6701
7049
|
active: { default: false, required: true, type: Boolean },
|
|
6702
7050
|
deletedAt: { default: null, required: false, type: Date },
|
|
@@ -6709,12 +7057,12 @@ var schema15 = new MongooseSchema23(
|
|
|
6709
7057
|
},
|
|
6710
7058
|
{ timestamps: true }
|
|
6711
7059
|
);
|
|
6712
|
-
var GameModel =
|
|
7060
|
+
var GameModel = import_mongoose24.default.models.Game || import_mongoose24.default.model("Game", schema16);
|
|
6713
7061
|
|
|
6714
7062
|
// src/mongoose/School.ts
|
|
6715
|
-
var
|
|
6716
|
-
var
|
|
6717
|
-
var campaignsSchema = new
|
|
7063
|
+
var import_mongoose25 = __toESM(require("mongoose"));
|
|
7064
|
+
var MongooseSchema25 = import_mongoose25.default.Schema;
|
|
7065
|
+
var campaignsSchema = new MongooseSchema25(
|
|
6718
7066
|
{
|
|
6719
7067
|
endDate: { required: true, type: Date },
|
|
6720
7068
|
name: { required: true, type: String },
|
|
@@ -6722,7 +7070,7 @@ var campaignsSchema = new MongooseSchema24(
|
|
|
6722
7070
|
},
|
|
6723
7071
|
{ _id: false }
|
|
6724
7072
|
);
|
|
6725
|
-
var
|
|
7073
|
+
var schema17 = new MongooseSchema25(
|
|
6726
7074
|
{
|
|
6727
7075
|
// New schools are active by default
|
|
6728
7076
|
active: { default: false, required: true, type: Boolean },
|
|
@@ -6749,19 +7097,19 @@ var schema16 = new MongooseSchema24(
|
|
|
6749
7097
|
},
|
|
6750
7098
|
{ timestamps: true }
|
|
6751
7099
|
);
|
|
6752
|
-
|
|
7100
|
+
schema17.index(
|
|
6753
7101
|
{ schoolCode: 1 },
|
|
6754
7102
|
{
|
|
6755
7103
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
6756
7104
|
unique: true
|
|
6757
7105
|
}
|
|
6758
7106
|
);
|
|
6759
|
-
var SchoolModel =
|
|
7107
|
+
var SchoolModel = import_mongoose25.default.models.School || import_mongoose25.default.model("School", schema17);
|
|
6760
7108
|
|
|
6761
7109
|
// src/mongoose/Affiliate.ts
|
|
6762
|
-
var
|
|
6763
|
-
var
|
|
6764
|
-
var affiliateRewardSchema = new
|
|
7110
|
+
var import_mongoose26 = __toESM(require("mongoose"));
|
|
7111
|
+
var MongooseSchema26 = import_mongoose26.default.Schema;
|
|
7112
|
+
var affiliateRewardSchema = new MongooseSchema26(
|
|
6765
7113
|
{
|
|
6766
7114
|
createdAt: { required: true, type: Date },
|
|
6767
7115
|
redeemedAt: { default: null, required: false, type: Date },
|
|
@@ -6775,13 +7123,13 @@ var affiliateRewardSchema = new MongooseSchema25(
|
|
|
6775
7123
|
},
|
|
6776
7124
|
{ _id: false }
|
|
6777
7125
|
);
|
|
6778
|
-
var affiliateResourceSchema = new
|
|
7126
|
+
var affiliateResourceSchema = new MongooseSchema26(
|
|
6779
7127
|
{
|
|
6780
7128
|
resourceActive: { default: true, required: true, type: Boolean },
|
|
6781
7129
|
resourceDeletedAt: { default: null, required: false, type: Date },
|
|
6782
7130
|
resourceId: {
|
|
6783
7131
|
required: true,
|
|
6784
|
-
type:
|
|
7132
|
+
type: import_mongoose26.default.Schema.Types.ObjectId
|
|
6785
7133
|
},
|
|
6786
7134
|
resourceName: { required: true, type: String },
|
|
6787
7135
|
resourceOwner: {
|
|
@@ -6801,20 +7149,20 @@ var affiliateResourceSchema = new MongooseSchema25(
|
|
|
6801
7149
|
},
|
|
6802
7150
|
{ _id: false }
|
|
6803
7151
|
);
|
|
6804
|
-
var affiliateContactDetailsSchema = new
|
|
7152
|
+
var affiliateContactDetailsSchema = new MongooseSchema26(
|
|
6805
7153
|
{
|
|
6806
7154
|
mobilePhone: { required: true, type: String }
|
|
6807
7155
|
},
|
|
6808
7156
|
{ _id: false }
|
|
6809
7157
|
);
|
|
6810
|
-
var affiliateBankAccountDetailsSchema = new
|
|
7158
|
+
var affiliateBankAccountDetailsSchema = new MongooseSchema26(
|
|
6811
7159
|
{
|
|
6812
7160
|
accountHolderName: { required: true, type: String },
|
|
6813
7161
|
accountNumber: { required: true, type: String }
|
|
6814
7162
|
},
|
|
6815
7163
|
{ _id: false }
|
|
6816
7164
|
);
|
|
6817
|
-
var affiliateDetailsSchema = new
|
|
7165
|
+
var affiliateDetailsSchema = new MongooseSchema26(
|
|
6818
7166
|
{
|
|
6819
7167
|
bankAccountDetails: {
|
|
6820
7168
|
required: true,
|
|
@@ -6836,7 +7184,7 @@ var affiliateDetailsSchema = new MongooseSchema25(
|
|
|
6836
7184
|
},
|
|
6837
7185
|
{ _id: false }
|
|
6838
7186
|
);
|
|
6839
|
-
var redeemHistorySchema = new
|
|
7187
|
+
var redeemHistorySchema = new MongooseSchema26(
|
|
6840
7188
|
{
|
|
6841
7189
|
paidAt: { default: null, required: false, type: Date },
|
|
6842
7190
|
redeemedAt: { required: true, type: Date },
|
|
@@ -6844,7 +7192,7 @@ var redeemHistorySchema = new MongooseSchema25(
|
|
|
6844
7192
|
},
|
|
6845
7193
|
{ _id: false }
|
|
6846
7194
|
);
|
|
6847
|
-
var
|
|
7195
|
+
var schema18 = new MongooseSchema26(
|
|
6848
7196
|
{
|
|
6849
7197
|
active: { default: false, required: true, type: Boolean },
|
|
6850
7198
|
affiliateBonusRewards: {
|
|
@@ -6874,19 +7222,19 @@ var schema17 = new MongooseSchema25(
|
|
|
6874
7222
|
},
|
|
6875
7223
|
{ timestamps: true }
|
|
6876
7224
|
);
|
|
6877
|
-
|
|
7225
|
+
schema18.index(
|
|
6878
7226
|
{ affiliateCode: 1 },
|
|
6879
7227
|
{
|
|
6880
7228
|
partialFilterExpression: { active: true, deletedAt: null },
|
|
6881
7229
|
unique: true
|
|
6882
7230
|
}
|
|
6883
7231
|
);
|
|
6884
|
-
var AffiliateModel =
|
|
7232
|
+
var AffiliateModel = import_mongoose26.default.models.Affiliate || import_mongoose26.default.model("Affiliate", schema18);
|
|
6885
7233
|
|
|
6886
7234
|
// src/mongoose/Coupon.ts
|
|
6887
|
-
var
|
|
6888
|
-
var
|
|
6889
|
-
var couponOptionSchema = new
|
|
7235
|
+
var import_mongoose27 = __toESM(require("mongoose"));
|
|
7236
|
+
var MongooseSchema27 = import_mongoose27.default.Schema;
|
|
7237
|
+
var couponOptionSchema = new MongooseSchema27(
|
|
6890
7238
|
{
|
|
6891
7239
|
buy: { required: false, type: Number },
|
|
6892
7240
|
get: { required: false, type: Number },
|
|
@@ -6901,29 +7249,29 @@ var couponOptionSchema = new MongooseSchema26(
|
|
|
6901
7249
|
},
|
|
6902
7250
|
{ _id: false }
|
|
6903
7251
|
);
|
|
6904
|
-
var couponVendorProductSchema = new
|
|
7252
|
+
var couponVendorProductSchema = new MongooseSchema27(
|
|
6905
7253
|
{
|
|
6906
7254
|
couponId: {
|
|
6907
7255
|
required: true,
|
|
6908
|
-
type:
|
|
7256
|
+
type: import_mongoose27.default.Schema.Types.ObjectId
|
|
6909
7257
|
},
|
|
6910
7258
|
productId: {
|
|
6911
7259
|
required: true,
|
|
6912
|
-
type:
|
|
7260
|
+
type: import_mongoose27.default.Schema.Types.ObjectId
|
|
6913
7261
|
},
|
|
6914
7262
|
vendorCouponId: {
|
|
6915
7263
|
required: false,
|
|
6916
|
-
type:
|
|
7264
|
+
type: import_mongoose27.default.Schema.Types.ObjectId
|
|
6917
7265
|
},
|
|
6918
7266
|
vendorId: {
|
|
6919
7267
|
ref: "Vendor",
|
|
6920
7268
|
required: true,
|
|
6921
|
-
type:
|
|
7269
|
+
type: import_mongoose27.default.Schema.Types.ObjectId
|
|
6922
7270
|
}
|
|
6923
7271
|
},
|
|
6924
7272
|
{ _id: false }
|
|
6925
7273
|
);
|
|
6926
|
-
var couponCodeSchema = new
|
|
7274
|
+
var couponCodeSchema = new MongooseSchema27(
|
|
6927
7275
|
{
|
|
6928
7276
|
code: { required: true, type: String },
|
|
6929
7277
|
qrCode: { required: true, type: ResourceImageTypeSchema },
|
|
@@ -6931,7 +7279,7 @@ var couponCodeSchema = new MongooseSchema26(
|
|
|
6931
7279
|
},
|
|
6932
7280
|
{ _id: false }
|
|
6933
7281
|
);
|
|
6934
|
-
var couponParticipantUserSchema = new
|
|
7282
|
+
var couponParticipantUserSchema = new MongooseSchema27(
|
|
6935
7283
|
{
|
|
6936
7284
|
couponCollectedCount: { default: 0, required: true, type: Number },
|
|
6937
7285
|
couponCycleRedeemed: { default: false, required: true, type: Boolean },
|
|
@@ -6940,12 +7288,12 @@ var couponParticipantUserSchema = new MongooseSchema26(
|
|
|
6940
7288
|
userId: {
|
|
6941
7289
|
ref: "User",
|
|
6942
7290
|
required: true,
|
|
6943
|
-
type:
|
|
7291
|
+
type: import_mongoose27.default.Schema.Types.ObjectId
|
|
6944
7292
|
}
|
|
6945
7293
|
},
|
|
6946
7294
|
{ timestamps: true }
|
|
6947
7295
|
);
|
|
6948
|
-
var couponDataSchema = new
|
|
7296
|
+
var couponDataSchema = new MongooseSchema27(
|
|
6949
7297
|
{
|
|
6950
7298
|
active: { default: true, required: true, type: Boolean },
|
|
6951
7299
|
couponCode: { required: false, type: couponCodeSchema },
|
|
@@ -6972,7 +7320,7 @@ var couponDataSchema = new MongooseSchema26(
|
|
|
6972
7320
|
},
|
|
6973
7321
|
{ timestamps: true }
|
|
6974
7322
|
);
|
|
6975
|
-
var
|
|
7323
|
+
var schema19 = new MongooseSchema27(
|
|
6976
7324
|
{
|
|
6977
7325
|
active: { default: true, required: true, type: Boolean },
|
|
6978
7326
|
couponData: { default: [], required: false, type: [couponDataSchema] },
|
|
@@ -6984,13 +7332,15 @@ var schema18 = new MongooseSchema26(
|
|
|
6984
7332
|
},
|
|
6985
7333
|
{ timestamps: true }
|
|
6986
7334
|
);
|
|
6987
|
-
var CouponModel =
|
|
7335
|
+
var CouponModel = import_mongoose27.default.models.Coupon || import_mongoose27.default.model("Coupon", schema19);
|
|
6988
7336
|
// Annotate the CommonJS export names for ESM import in node:
|
|
6989
7337
|
0 && (module.exports = {
|
|
6990
7338
|
APP_SETTINGS_ID,
|
|
6991
7339
|
AdModel,
|
|
6992
7340
|
AffiliateModel,
|
|
6993
7341
|
AppSettingModel,
|
|
7342
|
+
BILLING_CATALOG_COLLECTION_NAME,
|
|
7343
|
+
BillingCatalogModel,
|
|
6994
7344
|
CategorySchema,
|
|
6995
7345
|
ChatModel,
|
|
6996
7346
|
ChatReportModel,
|
|
@@ -7018,7 +7368,9 @@ var CouponModel = import_mongoose26.default.models.Coupon || import_mongoose26.d
|
|
|
7018
7368
|
VendorModel,
|
|
7019
7369
|
VerificationTokenModel,
|
|
7020
7370
|
baseResourceFields,
|
|
7371
|
+
buildInitialBillingCatalogEntries,
|
|
7021
7372
|
dateTimeSchema,
|
|
7373
|
+
getBillingCatalogDefinition,
|
|
7022
7374
|
locationGeoSchema,
|
|
7023
7375
|
locationsSchema,
|
|
7024
7376
|
refundPolicySchema,
|