@@ -11,13 +11,14 @@ import {
1111} from "mongodb" ;
1212import { Logger } from "@core/logger/winston.logger" ;
1313import {
14- CompassCalendar ,
15- Schema_CalendarList as Schema_Calendar ,
14+ Schema_CalendarList as Schema_CalList ,
15+ Schema_Calendar ,
1616} from "@core/types/calendar.types" ;
1717import { Schema_Event } from "@core/types/event.types" ;
1818import { Schema_Sync } from "@core/types/sync.types" ;
1919import { Schema_User } from "@core/types/user.types" ;
2020import { Schema_Waitlist } from "@core/types/waitlist/waitlist.types" ;
21+ import { Schema_Watch } from "@core/types/watch.types" ;
2122import { Collections } from "@backend/common/constants/collections" ;
2223import { ENV } from "@backend/common/constants/env.constants" ;
2324import { waitUntilEvent } from "@backend/common/helpers/common.util" ;
@@ -27,12 +28,13 @@ const logger = Logger("app:mongo.service");
2728interface InternalClient {
2829 db : Db ;
2930 client : MongoClient ;
30- calendar : Collection < CompassCalendar > ;
31- calendarList : Collection < Schema_Calendar > ;
31+ calendar : Collection < Schema_Calendar > ;
32+ calendarList : Collection < Schema_CalList > ;
3233 event : Collection < Omit < Schema_Event , "_id" > > ;
3334 sync : Collection < Schema_Sync > ;
3435 user : Collection < Schema_User > ;
3536 waitlist : Collection < Schema_Waitlist > ;
37+ watch : Collection < Omit < Schema_Watch , "_id" > > ;
3638}
3739
3840class MongoService {
@@ -96,6 +98,15 @@ class MongoService {
9698 return this . #accessInternalCollectionProps( "waitlist" ) ;
9799 }
98100
101+ /**
102+ * watch
103+ *
104+ * mongo collection
105+ */
106+ get watch ( ) : InternalClient [ "watch" ] {
107+ return this . #accessInternalCollectionProps( "watch" ) ;
108+ }
109+
99110 private onConnect ( client : MongoClient , useDynamicDb = false ) {
100111 this . #internalClient = this . createInternalClient ( client , useDynamicDb ) ;
101112
@@ -127,12 +138,13 @@ class MongoService {
127138 return {
128139 db,
129140 client,
130- calendar : db . collection < CompassCalendar > ( Collections . CALENDAR ) ,
131- calendarList : db . collection < Schema_Calendar > ( Collections . CALENDARLIST ) ,
141+ calendar : db . collection < Schema_Calendar > ( Collections . CALENDAR ) ,
142+ calendarList : db . collection < Schema_CalList > ( Collections . CALENDARLIST ) ,
132143 event : db . collection < Omit < Schema_Event , "_id" > > ( Collections . EVENT ) ,
133144 sync : db . collection < Schema_Sync > ( Collections . SYNC ) ,
134145 user : db . collection < Schema_User > ( Collections . USER ) ,
135146 waitlist : db . collection < Schema_Waitlist > ( Collections . WAITLIST ) ,
147+ watch : db . collection < Omit < Schema_Watch , "_id" > > ( Collections . WATCH ) ,
136148 } ;
137149 }
138150
0 commit comments