@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.
@@ -1,9 +1,10 @@
1
1
  import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
2
- import { AdType, ReportChatUser, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, AssociateType, ResourceContactDetailsType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, PosterUsageType, GoogleImportedMarket, RelationType, ResourceActivityType, UserActivityEvent, UserType, VendorType, VendorInfoType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, AppSettingsType, GameType, GameDocType, SchoolType } from '@timardex/cluemart-shared';
2
+ import { AdType, ReportChatUser, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, AssociateType, ResourceContactDetailsType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, PosterUsageType, GoogleImportedMarket, ResourceActivityType, UserActivityEvent, UserType, VendorType, VendorInfoType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, AppSettingsType, GameType, GameDocType, SchoolType } from '@timardex/cluemart-shared';
3
3
  import mongoose from 'mongoose';
4
4
  import { O as ObjectId } from '../Chat-Ctmtatmi.mjs';
5
5
  export { C as ChatModel, N as NotificationModel, a as SchemaChatMessageReactionType, S as SchemaChatMessageReplyPreviewType, b as SchemaChatMessageSeenType, c as SchemaChatMessageType, e as SchemaChatType, f as SchemaCreateBulkNotificationInput, g as SchemaNotificationType, d as SchemaParticipantType } from '../Chat-Ctmtatmi.mjs';
6
6
  import { EnumOSPlatform } from '@timardex/cluemart-shared/enums';
7
+ export { a as RelationModel, R as RelationTypeSchema, S as SchemaRelationType, r as relationDatesSchema } from '../Relation-BQhULTU-.mjs';
7
8
  import '@timardex/cluemart-shared/types';
8
9
  import 'express';
9
10
 
@@ -350,48 +351,6 @@ declare const PushTokenModel: mongoose.Model<SchemaPushTokenType, {}, {}, {}, mo
350
351
  __v: number;
351
352
  }, any>;
352
353
 
353
- declare const relationDatesSchema: mongoose.Schema<RelationDate, mongoose.Model<RelationDate, any, any, any, mongoose.Document<unknown, any, RelationDate, any, {}> & RelationDate & {
354
- _id: mongoose.Types.ObjectId;
355
- } & {
356
- __v: number;
357
- }, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, RelationDate, mongoose.Document<unknown, {}, mongoose.FlatRecord<RelationDate>, {}, mongoose.ResolveSchemaOptions<mongoose.DefaultSchemaOptions>> & mongoose.FlatRecord<RelationDate> & {
358
- _id: mongoose.Types.ObjectId;
359
- } & {
360
- __v: number;
361
- }>;
362
- type SchemaRelationType = Omit<RelationType, "eventId" | "vendorId" | "chatId"> & {
363
- eventId: ObjectId;
364
- vendorId: ObjectId;
365
- chatId: ObjectId;
366
- };
367
- /**
368
- * This is the schema for the relation type.
369
- * It is used to define the structure of the relation type in the database.
370
- * The schema is used by Mongoose to create a model for the relation type.
371
- */
372
- declare const RelationTypeSchema: mongoose.Schema<SchemaRelationType, mongoose.Model<SchemaRelationType, any, any, any, mongoose.Document<unknown, any, SchemaRelationType, any, {}> & Omit<RelationType, "chatId" | "eventId" | "vendorId"> & {
373
- eventId: ObjectId;
374
- vendorId: ObjectId;
375
- chatId: ObjectId;
376
- } & Required<{
377
- _id: string;
378
- }> & {
379
- __v: number;
380
- }, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, SchemaRelationType, mongoose.Document<unknown, {}, mongoose.FlatRecord<SchemaRelationType>, {}, mongoose.ResolveSchemaOptions<mongoose.DefaultSchemaOptions>> & mongoose.FlatRecord<SchemaRelationType> & Required<{
381
- _id: string;
382
- }> & {
383
- __v: number;
384
- }>;
385
- declare const RelationModel: mongoose.Model<SchemaRelationType, {}, {}, {}, mongoose.Document<unknown, {}, SchemaRelationType, {}, {}> & Omit<RelationType, "chatId" | "eventId" | "vendorId"> & {
386
- eventId: ObjectId;
387
- vendorId: ObjectId;
388
- chatId: ObjectId;
389
- } & Required<{
390
- _id: string;
391
- }> & {
392
- __v: number;
393
- }, any>;
394
-
395
354
  declare const ResourceActivityModel: mongoose.Model<ResourceActivityType, {}, {}, {}, mongoose.Document<unknown, {}, ResourceActivityType, {}, {}> & ResourceActivityType & Required<{
396
355
  _id: string;
397
356
  }> & {
@@ -564,6 +523,8 @@ declare const PostModel: mongoose.Model<PostType, {}, {}, {}, mongoose.Document<
564
523
  declare const APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
565
524
  declare const AppSettingModel: mongoose.Model<AppSettingsType, {}, {}, {}, mongoose.Document<unknown, {}, AppSettingsType, {}, {}> & _timardex_cluemart_shared.AppSettingsFormData & {
566
525
  _id: string;
526
+ activeSchoolsStudentCountTotal: number;
527
+ activeSchoolsStudentCountUpdatedAt: Date;
567
528
  createdAt: Date;
568
529
  key: string;
569
530
  updatedAt: Date | null;
@@ -589,4 +550,4 @@ declare const SchoolModel: mongoose.Model<SchoolDocument, {}, {}, {}, mongoose.D
589
550
  __v: number;
590
551
  }, any>;
591
552
 
592
- export { APP_SETTINGS_ID, AdModel, AppSettingModel, CategorySchema, ChatReportModel, ContactDetailsSchema, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, OwnerTypeSchema, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, type SchemaChatReportType, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, type SchemaOwnerType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelationType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SchoolModel, SocialMediaTypeSchema, StallTypeSchema, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, associatesSchema, baseResourceFields, dateTimeSchema, locationGeoSchema, locationsSchema, refundPolicySchema, relationDatesSchema, resourceRelationsSchema, termsAgreementSchema, userLicenseSchema };
553
+ export { APP_SETTINGS_ID, AdModel, AppSettingModel, CategorySchema, ChatReportModel, ContactDetailsSchema, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, OwnerTypeSchema, PartnerModel, PostModel, PushTokenModel, ResourceActivityModel, ResourceImageTypeSchema, type SchemaChatReportType, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, type SchemaOwnerType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SchoolModel, SocialMediaTypeSchema, StallTypeSchema, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, associatesSchema, baseResourceFields, dateTimeSchema, locationGeoSchema, locationsSchema, refundPolicySchema, resourceRelationsSchema, termsAgreementSchema, userLicenseSchema };
@@ -1,9 +1,10 @@
1
1
  import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
2
- import { AdType, ReportChatUser, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, AssociateType, ResourceContactDetailsType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, PosterUsageType, GoogleImportedMarket, RelationType, ResourceActivityType, UserActivityEvent, UserType, VendorType, VendorInfoType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, AppSettingsType, GameType, GameDocType, SchoolType } from '@timardex/cluemart-shared';
2
+ import { AdType, ReportChatUser, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, AssociateType, ResourceContactDetailsType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, PosterUsageType, GoogleImportedMarket, ResourceActivityType, UserActivityEvent, UserType, VendorType, VendorInfoType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, AppSettingsType, GameType, GameDocType, SchoolType } from '@timardex/cluemart-shared';
3
3
  import mongoose from 'mongoose';
4
4
  import { O as ObjectId } from '../Chat-Ctmtatmi.js';
5
5
  export { C as ChatModel, N as NotificationModel, a as SchemaChatMessageReactionType, S as SchemaChatMessageReplyPreviewType, b as SchemaChatMessageSeenType, c as SchemaChatMessageType, e as SchemaChatType, f as SchemaCreateBulkNotificationInput, g as SchemaNotificationType, d as SchemaParticipantType } from '../Chat-Ctmtatmi.js';
6
6
  import { EnumOSPlatform } from '@timardex/cluemart-shared/enums';
7
+ export { a as RelationModel, R as RelationTypeSchema, S as SchemaRelationType, r as relationDatesSchema } from '../Relation-Dvgd2CFi.js';
7
8
  import '@timardex/cluemart-shared/types';
8
9
  import 'express';
9
10
 
@@ -350,48 +351,6 @@ declare const PushTokenModel: mongoose.Model<SchemaPushTokenType, {}, {}, {}, mo
350
351
  __v: number;
351
352
  }, any>;
352
353
 
353
- declare const relationDatesSchema: mongoose.Schema<RelationDate, mongoose.Model<RelationDate, any, any, any, mongoose.Document<unknown, any, RelationDate, any, {}> & RelationDate & {
354
- _id: mongoose.Types.ObjectId;
355
- } & {
356
- __v: number;
357
- }, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, RelationDate, mongoose.Document<unknown, {}, mongoose.FlatRecord<RelationDate>, {}, mongoose.ResolveSchemaOptions<mongoose.DefaultSchemaOptions>> & mongoose.FlatRecord<RelationDate> & {
358
- _id: mongoose.Types.ObjectId;
359
- } & {
360
- __v: number;
361
- }>;
362
- type SchemaRelationType = Omit<RelationType, "eventId" | "vendorId" | "chatId"> & {
363
- eventId: ObjectId;
364
- vendorId: ObjectId;
365
- chatId: ObjectId;
366
- };
367
- /**
368
- * This is the schema for the relation type.
369
- * It is used to define the structure of the relation type in the database.
370
- * The schema is used by Mongoose to create a model for the relation type.
371
- */
372
- declare const RelationTypeSchema: mongoose.Schema<SchemaRelationType, mongoose.Model<SchemaRelationType, any, any, any, mongoose.Document<unknown, any, SchemaRelationType, any, {}> & Omit<RelationType, "chatId" | "eventId" | "vendorId"> & {
373
- eventId: ObjectId;
374
- vendorId: ObjectId;
375
- chatId: ObjectId;
376
- } & Required<{
377
- _id: string;
378
- }> & {
379
- __v: number;
380
- }, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, SchemaRelationType, mongoose.Document<unknown, {}, mongoose.FlatRecord<SchemaRelationType>, {}, mongoose.ResolveSchemaOptions<mongoose.DefaultSchemaOptions>> & mongoose.FlatRecord<SchemaRelationType> & Required<{
381
- _id: string;
382
- }> & {
383
- __v: number;
384
- }>;
385
- declare const RelationModel: mongoose.Model<SchemaRelationType, {}, {}, {}, mongoose.Document<unknown, {}, SchemaRelationType, {}, {}> & Omit<RelationType, "chatId" | "eventId" | "vendorId"> & {
386
- eventId: ObjectId;
387
- vendorId: ObjectId;
388
- chatId: ObjectId;
389
- } & Required<{
390
- _id: string;
391
- }> & {
392
- __v: number;
393
- }, any>;
394
-
395
354
  declare const ResourceActivityModel: mongoose.Model<ResourceActivityType, {}, {}, {}, mongoose.Document<unknown, {}, ResourceActivityType, {}, {}> & ResourceActivityType & Required<{
396
355
  _id: string;
397
356
  }> & {
@@ -564,6 +523,8 @@ declare const PostModel: mongoose.Model<PostType, {}, {}, {}, mongoose.Document<
564
523
  declare const APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
565
524
  declare const AppSettingModel: mongoose.Model<AppSettingsType, {}, {}, {}, mongoose.Document<unknown, {}, AppSettingsType, {}, {}> & _timardex_cluemart_shared.AppSettingsFormData & {
566
525
  _id: string;
526
+ activeSchoolsStudentCountTotal: number;
527
+ activeSchoolsStudentCountUpdatedAt: Date;
567
528
  createdAt: Date;
568
529
  key: string;
569
530
  updatedAt: Date | null;
@@ -589,4 +550,4 @@ declare const SchoolModel: mongoose.Model<SchoolDocument, {}, {}, {}, mongoose.D
589
550
  __v: number;
590
551
  }, any>;
591
552
 
592
- export { APP_SETTINGS_ID, AdModel, AppSettingModel, CategorySchema, ChatReportModel, ContactDetailsSchema, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, OwnerTypeSchema, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, type SchemaChatReportType, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, type SchemaOwnerType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelationType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SchoolModel, SocialMediaTypeSchema, StallTypeSchema, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, associatesSchema, baseResourceFields, dateTimeSchema, locationGeoSchema, locationsSchema, refundPolicySchema, relationDatesSchema, resourceRelationsSchema, termsAgreementSchema, userLicenseSchema };
553
+ export { APP_SETTINGS_ID, AdModel, AppSettingModel, CategorySchema, ChatReportModel, ContactDetailsSchema, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, OwnerTypeSchema, PartnerModel, PostModel, PushTokenModel, ResourceActivityModel, ResourceImageTypeSchema, type SchemaChatReportType, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, type SchemaOwnerType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SchoolModel, SocialMediaTypeSchema, StallTypeSchema, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, associatesSchema, baseResourceFields, dateTimeSchema, locationGeoSchema, locationsSchema, refundPolicySchema, resourceRelationsSchema, termsAgreementSchema, userLicenseSchema };
@@ -36,7 +36,7 @@ import {
36
36
  resourceRelationsSchema,
37
37
  termsAgreementSchema,
38
38
  userLicenseSchema
39
- } from "../chunk-AY3HRVNJ.mjs";
39
+ } from "../chunk-N2SOT77G.mjs";
40
40
  import "../chunk-3QS3WKRC.mjs";
41
41
  export {
42
42
  APP_SETTINGS_ID,
@@ -1679,6 +1679,7 @@ __export(service_exports, {
1679
1679
  saveNotificationsInDb: () => saveNotificationsInDb,
1680
1680
  sendPushNotifications: () => sendPushNotifications,
1681
1681
  updateAdStatuses: () => updateAdStatuses,
1682
+ updateRelationDatesToUnavailable: () => updateRelationDatesToUnavailable,
1682
1683
  updateVendorBasedOnUserLicense: () => updateVendorBasedOnUserLicense
1683
1684
  });
1684
1685
  module.exports = __toCommonJS(service_exports);
@@ -12549,6 +12550,16 @@ var MongooseSchema18 = import_mongoose19.default.Schema;
12549
12550
  var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
12550
12551
  var AppSettingSchema = new MongooseSchema18(
12551
12552
  {
12553
+ activeSchoolsStudentCountTotal: {
12554
+ default: 0,
12555
+ required: true,
12556
+ type: Number
12557
+ },
12558
+ activeSchoolsStudentCountUpdatedAt: {
12559
+ default: Date.now,
12560
+ required: true,
12561
+ type: Date
12562
+ },
12552
12563
  appVersion: { default: "1.0.1", required: true, type: String },
12553
12564
  isOfflineMode: { default: false, required: true, type: Boolean },
12554
12565
  key: {
@@ -12962,6 +12973,19 @@ async function findEventOrImportedMarketById(resourceId) {
12962
12973
  ]);
12963
12974
  return eventDoc ?? googleImportedDoc;
12964
12975
  }
12976
+
12977
+ // src/service/relations.ts
12978
+ function updateRelationDatesToUnavailable(relationDates, eventDateTime) {
12979
+ return relationDates.map((relationDate) => {
12980
+ const existsInEvent = eventDateTime?.some(
12981
+ (dt) => dt.startDate === relationDate.dateTime.startDate && dt.startTime === relationDate.dateTime.startTime
12982
+ ) ?? false;
12983
+ return {
12984
+ ...relationDate,
12985
+ status: existsInEvent ? relationDate.status : EnumInviteStatus.UNAVAILABLE
12986
+ };
12987
+ });
12988
+ }
12965
12989
  // Annotate the CommonJS export names for ESM import in node:
12966
12990
  0 && (module.exports = {
12967
12991
  connectToDatabase,
@@ -12970,6 +12994,7 @@ async function findEventOrImportedMarketById(resourceId) {
12970
12994
  saveNotificationsInDb,
12971
12995
  sendPushNotifications,
12972
12996
  updateAdStatuses,
12997
+ updateRelationDatesToUnavailable,
12973
12998
  updateVendorBasedOnUserLicense
12974
12999
  });
12975
13000
  /*! Bundled license information: