@timardex/cluemart-server-shared 2.1.4 → 2.1.6

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.
@@ -307,13 +307,22 @@ declare const PostModel: mongoose__default.Model<PostType, {}, {}, {}, mongoose_
307
307
  }, any>;
308
308
 
309
309
  declare const APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
310
- declare const AppSettingModel: mongoose__default.Model<AppSettingsType, {}, {}, {}, mongoose__default.Document<unknown, {}, AppSettingsType, {}, {}> & _timardex_cluemart_shared.AppSettingsFormData & {
310
+ type SchemaAppSettingsType = AppSettingsType & {
311
+ adSettings: {
312
+ displayEnabled: boolean;
313
+ };
314
+ };
315
+ declare const AppSettingModel: mongoose__default.Model<SchemaAppSettingsType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaAppSettingsType, {}, {}> & _timardex_cluemart_shared.AppSettingsFormData & {
311
316
  _id: string;
312
317
  activeSchoolsStudentCountTotal: number;
313
318
  activeSchoolsStudentCountUpdatedAt: Date;
314
319
  createdAt: Date;
315
320
  key: string;
316
321
  updatedAt: Date | null;
322
+ } & {
323
+ adSettings: {
324
+ displayEnabled: boolean;
325
+ };
317
326
  } & Required<{
318
327
  _id: string;
319
328
  }> & {
@@ -360,4 +369,4 @@ declare const CouponModel: mongoose__default.Model<CouponDocument, {}, {}, {}, m
360
369
  __v: number;
361
370
  }, any>;
362
371
 
363
- export { AD_BILLING_CATALOG_COLLECTION_NAME, APP_SETTINGS_ID, AdBillingCatalogModel, AdBookingModel, type AdImpressionEntry, AdImpressionModel, AdModel, AdSettingsModel, AppSettingModel, BILLING_CATALOG_COLLECTION_NAME, BillingCatalogModel, ChatReportModel, type CouponDocument, CouponModel, DEFAULT_AD_SETTINGS, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, PartnerModel, PostModel, PushTokenModel, ResourceActivityModel, type SchemaBillingCatalogEntry, type SchemaBillingCatalogPriceHistoryEntry, type SchemaChatReportType, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, SchemaOwnerType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaUnregisteredVendorInvitationType, type SchemaUnregisteredVendorType, type SchemaVendorInfoType, type SchemaVendorType, SchoolModel, StallTypeSchema, UnregisteredVendorModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, buildInitialBillingCatalogEntries, getBillingCatalogDefinition, refundPolicySchema, schemaAdresource, vendorProductTypeSchema };
372
+ export { AD_BILLING_CATALOG_COLLECTION_NAME, APP_SETTINGS_ID, AdBillingCatalogModel, AdBookingModel, type AdImpressionEntry, AdImpressionModel, AdModel, AdSettingsModel, AppSettingModel, BILLING_CATALOG_COLLECTION_NAME, BillingCatalogModel, ChatReportModel, type CouponDocument, CouponModel, DEFAULT_AD_SETTINGS, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, PartnerModel, PostModel, PushTokenModel, ResourceActivityModel, type SchemaAppSettingsType, type SchemaBillingCatalogEntry, type SchemaBillingCatalogPriceHistoryEntry, type SchemaChatReportType, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, SchemaOwnerType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaUnregisteredVendorInvitationType, type SchemaUnregisteredVendorType, type SchemaVendorInfoType, type SchemaVendorType, SchoolModel, StallTypeSchema, UnregisteredVendorModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, buildInitialBillingCatalogEntries, getBillingCatalogDefinition, refundPolicySchema, schemaAdresource, vendorProductTypeSchema };
@@ -307,13 +307,22 @@ declare const PostModel: mongoose__default.Model<PostType, {}, {}, {}, mongoose_
307
307
  }, any>;
308
308
 
309
309
  declare const APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
310
- declare const AppSettingModel: mongoose__default.Model<AppSettingsType, {}, {}, {}, mongoose__default.Document<unknown, {}, AppSettingsType, {}, {}> & _timardex_cluemart_shared.AppSettingsFormData & {
310
+ type SchemaAppSettingsType = AppSettingsType & {
311
+ adSettings: {
312
+ displayEnabled: boolean;
313
+ };
314
+ };
315
+ declare const AppSettingModel: mongoose__default.Model<SchemaAppSettingsType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaAppSettingsType, {}, {}> & _timardex_cluemart_shared.AppSettingsFormData & {
311
316
  _id: string;
312
317
  activeSchoolsStudentCountTotal: number;
313
318
  activeSchoolsStudentCountUpdatedAt: Date;
314
319
  createdAt: Date;
315
320
  key: string;
316
321
  updatedAt: Date | null;
322
+ } & {
323
+ adSettings: {
324
+ displayEnabled: boolean;
325
+ };
317
326
  } & Required<{
318
327
  _id: string;
319
328
  }> & {
@@ -360,4 +369,4 @@ declare const CouponModel: mongoose__default.Model<CouponDocument, {}, {}, {}, m
360
369
  __v: number;
361
370
  }, any>;
362
371
 
363
- export { AD_BILLING_CATALOG_COLLECTION_NAME, APP_SETTINGS_ID, AdBillingCatalogModel, AdBookingModel, type AdImpressionEntry, AdImpressionModel, AdModel, AdSettingsModel, AppSettingModel, BILLING_CATALOG_COLLECTION_NAME, BillingCatalogModel, ChatReportModel, type CouponDocument, CouponModel, DEFAULT_AD_SETTINGS, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, PartnerModel, PostModel, PushTokenModel, ResourceActivityModel, type SchemaBillingCatalogEntry, type SchemaBillingCatalogPriceHistoryEntry, type SchemaChatReportType, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, SchemaOwnerType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaUnregisteredVendorInvitationType, type SchemaUnregisteredVendorType, type SchemaVendorInfoType, type SchemaVendorType, SchoolModel, StallTypeSchema, UnregisteredVendorModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, buildInitialBillingCatalogEntries, getBillingCatalogDefinition, refundPolicySchema, schemaAdresource, vendorProductTypeSchema };
372
+ export { AD_BILLING_CATALOG_COLLECTION_NAME, APP_SETTINGS_ID, AdBillingCatalogModel, AdBookingModel, type AdImpressionEntry, AdImpressionModel, AdModel, AdSettingsModel, AppSettingModel, BILLING_CATALOG_COLLECTION_NAME, BillingCatalogModel, ChatReportModel, type CouponDocument, CouponModel, DEFAULT_AD_SETTINGS, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, PartnerModel, PostModel, PushTokenModel, ResourceActivityModel, type SchemaAppSettingsType, type SchemaBillingCatalogEntry, type SchemaBillingCatalogPriceHistoryEntry, type SchemaChatReportType, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, SchemaOwnerType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaUnregisteredVendorInvitationType, type SchemaUnregisteredVendorType, type SchemaVendorInfoType, type SchemaVendorType, SchoolModel, StallTypeSchema, UnregisteredVendorModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, buildInitialBillingCatalogEntries, getBillingCatalogDefinition, refundPolicySchema, schemaAdresource, vendorProductTypeSchema };
@@ -52,7 +52,7 @@ import {
52
52
  termsAgreementSchema,
53
53
  userLicenseSchema,
54
54
  vendorProductTypeSchema
55
- } from "../chunk-MEEBCSMJ.mjs";
55
+ } from "../chunk-2MNX373V.mjs";
56
56
  export {
57
57
  AD_BILLING_CATALOG_COLLECTION_NAME,
58
58
  APP_SETTINGS_ID,
@@ -94,7 +94,7 @@ __export(service_exports, {
94
94
  });
95
95
  module.exports = __toCommonJS(service_exports);
96
96
 
97
- // src/mongoose/Ad.ts
97
+ // src/mongoose/ad/Ad.ts
98
98
  var import_cluemart_shared = require("@timardex/cluemart-shared");
99
99
  var import_mongoose = __toESM(require("mongoose"));
100
100
  var MongooseSchema = import_mongoose.default.Schema;
@@ -191,7 +191,7 @@ schema.index(
191
191
  );
192
192
  var AdModel = import_mongoose.default.models.Ad || import_mongoose.default.model("Ad", schema);
193
193
 
194
- // src/mongoose/AdBillingCatalog.ts
194
+ // src/mongoose/ad/AdBillingCatalog.ts
195
195
  var import_mongoose2 = __toESM(require("mongoose"));
196
196
  var AD_BILLING_CATALOG_COLLECTION_NAME = "adBillingCatalog";
197
197
  var schema2 = new import_mongoose2.default.Schema(
@@ -230,7 +230,7 @@ var AdBillingCatalogModel = import_mongoose2.default.models.AdBillingCatalog ||
230
230
  AD_BILLING_CATALOG_COLLECTION_NAME
231
231
  );
232
232
 
233
- // src/mongoose/AdBooking.ts
233
+ // src/mongoose/ad/AdBooking.ts
234
234
  var import_cluemart_shared2 = require("@timardex/cluemart-shared");
235
235
  var import_mongoose3 = __toESM(require("mongoose"));
236
236
  var liveStates = [
@@ -371,7 +371,7 @@ schema3.index(
371
371
  );
372
372
  var AdBookingModel = import_mongoose3.default.models.AdBooking || import_mongoose3.default.model("AdBooking", schema3);
373
373
 
374
- // src/mongoose/AdImpression.ts
374
+ // src/mongoose/ad/AdImpression.ts
375
375
  var import_cluemart_shared3 = require("@timardex/cluemart-shared");
376
376
  var import_mongoose4 = __toESM(require("mongoose"));
377
377
  var schema4 = new import_mongoose4.default.Schema(
@@ -395,7 +395,7 @@ schema4.index({ recordedAt: 1 }, { expireAfterSeconds: 7 * 24 * 60 * 60 });
395
395
  schema4.index({ dayKey: 1, placement: 1, adId: 1 });
396
396
  var AdImpressionModel = import_mongoose4.default.models.AdImpression || import_mongoose4.default.model("AdImpression", schema4, "adImpressions");
397
397
 
398
- // src/mongoose/AdSettings.ts
398
+ // src/mongoose/ad/AdSettings.ts
399
399
  var import_mongoose5 = __toESM(require("mongoose"));
400
400
  var schema5 = new import_mongoose5.default.Schema(
401
401
  {
@@ -1656,6 +1656,7 @@ var schema12 = new MongooseSchema12(
1656
1656
  schema12.index({ "licences.expiryDate": 1 });
1657
1657
  schema12.index({ "licences.licenceType": 1 });
1658
1658
  schema12.index({ promoCodes: 1, active: 1, deletedAt: 1 });
1659
+ schema12.index({ email: "text", firstName: "text", lastName: "text" });
1659
1660
  var UserModel = import_mongoose16.default.models.User || import_mongoose16.default.model("User", schema12);
1660
1661
 
1661
1662
  // src/mongoose/VerificationToken.ts
@@ -2057,6 +2058,9 @@ var AppSettingSchema = new MongooseSchema20(
2057
2058
  required: true,
2058
2059
  type: Date
2059
2060
  },
2061
+ adSettings: {
2062
+ displayEnabled: { default: false, required: true, type: Boolean }
2063
+ },
2060
2064
  appVersion: { default: "1.0.1", required: true, type: String },
2061
2065
  isOfflineMode: { default: false, required: true, type: Boolean },
2062
2066
  key: {
@@ -3928,8 +3932,8 @@ async function handleVendorLicenceCompliance(user, now) {
3928
3932
  resourceName: vendor.name,
3929
3933
  resourceType: import_cluemart_shared30.EnumNotificationResourceType.DOWNGRADED_VENDOR
3930
3934
  },
3931
- message: `Your Vendor license has been downgraded due to licence expiration.`,
3932
- title: `Vendor License Downgraded`,
3935
+ message: `Your Vendor licence has been downgraded due to licence expiration.`,
3936
+ title: `Vendor Licence Downgraded`,
3933
3937
  type: import_cluemart_shared30.EnumNotificationType.SYSTEM,
3934
3938
  userIds: [user._id]
3935
3939
  };
@@ -4263,7 +4267,7 @@ async function sendLicenseReminder(user, licence) {
4263
4267
  resourceType: resourceInfo.resourceType
4264
4268
  },
4265
4269
  message: isExtension ? `Your ${licenceName} will be automatically extended for another year on ${(0, import_utils8.formatDate)(expiryDate, "date")}.` : `Your ${licenceName} expires in 7 days (${(0, import_utils8.formatDate)(expiryDate, "date")}). Renew now to avoid deactivation.`,
4266
- title: isExtension ? "License Extension Reminder" : "License Expiring Soon",
4270
+ title: isExtension ? "Licence Extension Reminder" : "Licence Expiring Soon",
4267
4271
  type: resourceInfo.notificationType,
4268
4272
  userIds: [user._id]
4269
4273
  };