@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/Relation-BQhULTU-.d.mts +47 -0
- package/dist/Relation-Dvgd2CFi.d.ts +47 -0
- package/dist/{chunk-AY3HRVNJ.mjs → chunk-N2SOT77G.mjs} +12 -1
- package/dist/{chunk-AY3HRVNJ.mjs.map → chunk-N2SOT77G.mjs.map} +1 -1
- package/dist/index.cjs +25 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +10 -2
- package/dist/index.d.ts +10 -2
- package/dist/index.mjs +24 -0
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +10 -0
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +5 -44
- package/dist/mongoose/index.d.ts +5 -44
- package/dist/mongoose/index.mjs +1 -1
- package/dist/service/index.cjs +25 -0
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.d.mts +9 -2
- package/dist/service/index.d.ts +9 -2
- package/dist/service/index.mjs +16 -1
- package/dist/service/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
|
|
2
|
-
import { AdType, CreateBulkNotificationInput, NotificationType, EnumUserRole, ChatMessageType, ParticipantType, ChatType, 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, EnumUserLicence } from '@timardex/cluemart-shared';
|
|
2
|
+
import { AdType, CreateBulkNotificationInput, NotificationType, EnumUserRole, ChatMessageType, ParticipantType, ChatType, 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, EnumUserLicence, DateTimeWithPriceType } from '@timardex/cluemart-shared';
|
|
3
3
|
import mongoose from 'mongoose';
|
|
4
4
|
export { default as mongoose } from 'mongoose';
|
|
5
5
|
import { NotificationCount } from '@timardex/cluemart-shared/types';
|
|
@@ -644,6 +644,8 @@ declare const PostModel: mongoose.Model<PostType, {}, {}, {}, mongoose.Document<
|
|
|
644
644
|
declare const APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
|
|
645
645
|
declare const AppSettingModel: mongoose.Model<AppSettingsType, {}, {}, {}, mongoose.Document<unknown, {}, AppSettingsType, {}, {}> & _timardex_cluemart_shared.AppSettingsFormData & {
|
|
646
646
|
_id: string;
|
|
647
|
+
activeSchoolsStudentCountTotal: number;
|
|
648
|
+
activeSchoolsStudentCountUpdatedAt: Date;
|
|
647
649
|
createdAt: Date;
|
|
648
650
|
key: string;
|
|
649
651
|
updatedAt: Date | null;
|
|
@@ -716,4 +718,10 @@ type EventOrMarket = {
|
|
|
716
718
|
*/
|
|
717
719
|
declare function findEventOrImportedMarketById(resourceId: ObjectId | string | null | undefined): Promise<EventOrMarket>;
|
|
718
720
|
|
|
719
|
-
|
|
721
|
+
/**
|
|
722
|
+
* Helper: Update relationDates based on event's dateTime
|
|
723
|
+
* Marks dates as UNAVAILABLE if they no longer exist in the event's dateTime.
|
|
724
|
+
*/
|
|
725
|
+
declare function updateRelationDatesToUnavailable(relationDates: SchemaRelationType["relationDates"], eventDateTime: DateTimeWithPriceType[] | undefined): SchemaRelationType["relationDates"];
|
|
726
|
+
|
|
727
|
+
export { APP_SETTINGS_ID, AdModel, AppSettingModel, type AuthUser, CategorySchema, ChatModel, ChatReportModel, ContactDetailsSchema, EnumPubSubEvents, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, type GraphQLContext, NotificationModel, type ObjectId, OwnerTypeSchema, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, type SchemaChatMessageReactionType, type SchemaChatMessageReplyPreviewType, type SchemaChatMessageSeenType, type SchemaChatMessageType, type SchemaChatReportType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelationType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SchoolModel, SocialMediaTypeSchema, StallTypeSchema, type SubscriptionPayload, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, associatesSchema, baseResourceFields, connectToDatabase, convertObjectIdsToStrings, dateTimeSchema, findEventOrImportedMarketById, locationGeoSchema, locationsSchema, refundPolicySchema, relationDatesSchema, resourceRelationsSchema, saveNotificationsInDb, sendPushNotifications, termsAgreementSchema, updateAdStatuses, updateRelationDatesToUnavailable, updateVendorBasedOnUserLicense, userLicenseSchema };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
|
|
2
|
-
import { AdType, CreateBulkNotificationInput, NotificationType, EnumUserRole, ChatMessageType, ParticipantType, ChatType, 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, EnumUserLicence } from '@timardex/cluemart-shared';
|
|
2
|
+
import { AdType, CreateBulkNotificationInput, NotificationType, EnumUserRole, ChatMessageType, ParticipantType, ChatType, 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, EnumUserLicence, DateTimeWithPriceType } from '@timardex/cluemart-shared';
|
|
3
3
|
import mongoose from 'mongoose';
|
|
4
4
|
export { default as mongoose } from 'mongoose';
|
|
5
5
|
import { NotificationCount } from '@timardex/cluemart-shared/types';
|
|
@@ -644,6 +644,8 @@ declare const PostModel: mongoose.Model<PostType, {}, {}, {}, mongoose.Document<
|
|
|
644
644
|
declare const APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
|
|
645
645
|
declare const AppSettingModel: mongoose.Model<AppSettingsType, {}, {}, {}, mongoose.Document<unknown, {}, AppSettingsType, {}, {}> & _timardex_cluemart_shared.AppSettingsFormData & {
|
|
646
646
|
_id: string;
|
|
647
|
+
activeSchoolsStudentCountTotal: number;
|
|
648
|
+
activeSchoolsStudentCountUpdatedAt: Date;
|
|
647
649
|
createdAt: Date;
|
|
648
650
|
key: string;
|
|
649
651
|
updatedAt: Date | null;
|
|
@@ -716,4 +718,10 @@ type EventOrMarket = {
|
|
|
716
718
|
*/
|
|
717
719
|
declare function findEventOrImportedMarketById(resourceId: ObjectId | string | null | undefined): Promise<EventOrMarket>;
|
|
718
720
|
|
|
719
|
-
|
|
721
|
+
/**
|
|
722
|
+
* Helper: Update relationDates based on event's dateTime
|
|
723
|
+
* Marks dates as UNAVAILABLE if they no longer exist in the event's dateTime.
|
|
724
|
+
*/
|
|
725
|
+
declare function updateRelationDatesToUnavailable(relationDates: SchemaRelationType["relationDates"], eventDateTime: DateTimeWithPriceType[] | undefined): SchemaRelationType["relationDates"];
|
|
726
|
+
|
|
727
|
+
export { APP_SETTINGS_ID, AdModel, AppSettingModel, type AuthUser, CategorySchema, ChatModel, ChatReportModel, ContactDetailsSchema, EnumPubSubEvents, EventInfoModel, EventModel, GameModel, GoogleImportedMarketModel, type GraphQLContext, NotificationModel, type ObjectId, OwnerTypeSchema, PartnerModel, PostModel, PushTokenModel, RelationModel, RelationTypeSchema, ResourceActivityModel, ResourceImageTypeSchema, type SchemaChatMessageReactionType, type SchemaChatMessageReplyPreviewType, type SchemaChatMessageSeenType, type SchemaChatMessageType, type SchemaChatReportType, type SchemaChatType, type SchemaCreateBulkNotificationInput, type SchemaEventInfoType, type SchemaEventType, type SchemaGameType, type SchemaGoogleImportedMarket, type SchemaNotificationType, type SchemaOwnerType, type SchemaParticipantType, type SchemaPartnerType, type SchemaPostType, type SchemaPushTokenType, type SchemaRelationType, type SchemaUserActivityEvent, type SchemaUserType, type SchemaVendorInfoType, type SchemaVendorType, SchoolModel, SocialMediaTypeSchema, StallTypeSchema, type SubscriptionPayload, UserModel, VendorInfoModel, VendorModel, VerificationTokenModel, type VerificationTokenType, associatesSchema, baseResourceFields, connectToDatabase, convertObjectIdsToStrings, dateTimeSchema, findEventOrImportedMarketById, locationGeoSchema, locationsSchema, refundPolicySchema, relationDatesSchema, resourceRelationsSchema, saveNotificationsInDb, sendPushNotifications, termsAgreementSchema, updateAdStatuses, updateRelationDatesToUnavailable, updateVendorBasedOnUserLicense, userLicenseSchema };
|
package/dist/index.mjs
CHANGED
|
@@ -12371,6 +12371,16 @@ var MongooseSchema18 = mongoose18.Schema;
|
|
|
12371
12371
|
var APP_SETTINGS_ID = "APP_SETTINGS_DOCUMENT_ID";
|
|
12372
12372
|
var AppSettingSchema = new MongooseSchema18(
|
|
12373
12373
|
{
|
|
12374
|
+
activeSchoolsStudentCountTotal: {
|
|
12375
|
+
default: 0,
|
|
12376
|
+
required: true,
|
|
12377
|
+
type: Number
|
|
12378
|
+
},
|
|
12379
|
+
activeSchoolsStudentCountUpdatedAt: {
|
|
12380
|
+
default: Date.now,
|
|
12381
|
+
required: true,
|
|
12382
|
+
type: Date
|
|
12383
|
+
},
|
|
12374
12384
|
appVersion: { default: "1.0.1", required: true, type: String },
|
|
12375
12385
|
isOfflineMode: { default: false, required: true, type: Boolean },
|
|
12376
12386
|
key: {
|
|
@@ -12942,6 +12952,19 @@ async function findEventOrImportedMarketById(resourceId) {
|
|
|
12942
12952
|
return eventDoc ?? googleImportedDoc;
|
|
12943
12953
|
}
|
|
12944
12954
|
|
|
12955
|
+
// src/service/relations.ts
|
|
12956
|
+
function updateRelationDatesToUnavailable(relationDates, eventDateTime) {
|
|
12957
|
+
return relationDates.map((relationDate) => {
|
|
12958
|
+
const existsInEvent = eventDateTime?.some(
|
|
12959
|
+
(dt) => dt.startDate === relationDate.dateTime.startDate && dt.startTime === relationDate.dateTime.startTime
|
|
12960
|
+
) ?? false;
|
|
12961
|
+
return {
|
|
12962
|
+
...relationDate,
|
|
12963
|
+
status: existsInEvent ? relationDate.status : EnumInviteStatus.UNAVAILABLE
|
|
12964
|
+
};
|
|
12965
|
+
});
|
|
12966
|
+
}
|
|
12967
|
+
|
|
12945
12968
|
// src/types/index.ts
|
|
12946
12969
|
import express from "express";
|
|
12947
12970
|
import mongoose27 from "mongoose";
|
|
@@ -12998,6 +13021,7 @@ export {
|
|
|
12998
13021
|
sendPushNotifications,
|
|
12999
13022
|
termsAgreementSchema,
|
|
13000
13023
|
updateAdStatuses,
|
|
13024
|
+
updateRelationDatesToUnavailable,
|
|
13001
13025
|
updateVendorBasedOnUserLicense,
|
|
13002
13026
|
userLicenseSchema
|
|
13003
13027
|
};
|