diff --git a/backend/src/dao/InterviewSchedulerDao.ts b/backend/src/dao/InterviewSchedulerDao.ts index 2886c3a9e..f829683b2 100644 --- a/backend/src/dao/InterviewSchedulerDao.ts +++ b/backend/src/dao/InterviewSchedulerDao.ts @@ -3,6 +3,9 @@ import { interviewSchedulerCollection } from '../firebase'; import BaseDao from './BaseDao'; export default class InterviewSchedulerDao extends BaseDao { + /** + * Initializes DAO with the interview scheduler collection. + */ constructor() { super( interviewSchedulerCollection, @@ -11,14 +14,28 @@ export default class InterviewSchedulerDao extends BaseDao { return this.getDocuments(); } + /** + * Gets a specific instance of Interview Scheduler with uuid + * @param uuid the uuid of a Interview Scheduler instance + * @returns a promise resolving to a specific instance if found and null otherwise + */ async getInstance(uuid: string): Promise { return this.getDocument(uuid); } + /** + * Creates an instance of Interview Scheduler with uuid and assigns one if not provided + * @param instance the Interview Scheduler instance to create + * @returns uuid of created instance + */ async createInstance(instance: InterviewScheduler): Promise { const instanceWithUUID = { ...instance, @@ -28,10 +45,19 @@ export default class InterviewSchedulerDao extends BaseDao { return this.updateDocument(instance.uuid, instance); } + /** + * Deletes an instance of Interview Scheduler + * @param uuid the uuid of the instance to delete + */ async deleteInstance(uuid: string): Promise { this.deleteDocument(uuid); }