@timardex/cluemart-server-shared 1.0.160 → 1.0.162

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/index.cjs CHANGED
@@ -1718,6 +1718,7 @@ __export(index_exports, {
1718
1718
  sendPushNotifications: () => sendPushNotifications,
1719
1719
  termsAgreementSchema: () => termsAgreementSchema,
1720
1720
  updateAdStatuses: () => updateAdStatuses,
1721
+ updateRelationDatesToUnavailable: () => updateRelationDatesToUnavailable,
1721
1722
  updateVendorBasedOnUserLicense: () => updateVendorBasedOnUserLicense,
1722
1723
  userLicenseSchema: () => userLicenseSchema
1723
1724
  });
@@ -12430,6 +12431,16 @@ var MongooseSchema18 = import_mongoose18.default.Schema;
12430
12431
  var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
12431
12432
  var AppSettingSchema = new MongooseSchema18(
12432
12433
  {
12434
+ activeSchoolsStudentCountTotal: {
12435
+ default: 0,
12436
+ required: true,
12437
+ type: Number
12438
+ },
12439
+ activeSchoolsStudentCountUpdatedAt: {
12440
+ default: Date.now,
12441
+ required: true,
12442
+ type: Date
12443
+ },
12433
12444
  appVersion: { default: "1.0.1", required: true, type: String },
12434
12445
  isOfflineMode: { default: false, required: true, type: Boolean },
12435
12446
  key: {
@@ -13001,6 +13012,19 @@ async function findEventOrImportedMarketById(resourceId) {
13001
13012
  return eventDoc ?? googleImportedDoc;
13002
13013
  }
13003
13014
 
13015
+ // src/service/relations.ts
13016
+ function updateRelationDatesToUnavailable(relationDates, eventDateTime) {
13017
+ return relationDates.map((relationDate) => {
13018
+ const existsInEvent = eventDateTime?.some(
13019
+ (dt) => dt.startDate === relationDate.dateTime.startDate && dt.startTime === relationDate.dateTime.startTime
13020
+ ) ?? false;
13021
+ return {
13022
+ ...relationDate,
13023
+ status: existsInEvent ? relationDate.status : EnumInviteStatus.UNAVAILABLE
13024
+ };
13025
+ });
13026
+ }
13027
+
13004
13028
  // src/types/index.ts
13005
13029
  var import_express = __toESM(require("express"));
13006
13030
  var import_mongoose31 = __toESM(require("mongoose"));
@@ -13058,6 +13082,7 @@ var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
13058
13082
  sendPushNotifications,
13059
13083
  termsAgreementSchema,
13060
13084
  updateAdStatuses,
13085
+ updateRelationDatesToUnavailable,
13061
13086
  updateVendorBasedOnUserLicense,
13062
13087
  userLicenseSchema
13063
13088
  });