Skip to content

Commit

Permalink
interview scheduler dao documentation (#871)
Browse files Browse the repository at this point in the history
### Summary 

Added docs to InterviewSchedulerDao
  • Loading branch information
ladriennel authored Mar 3, 2025
1 parent 162fc8a commit b1c7af0
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions backend/src/dao/InterviewSchedulerDao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { interviewSchedulerCollection } from '../firebase';
import BaseDao from './BaseDao';

export default class InterviewSchedulerDao extends BaseDao<InterviewScheduler, InterviewScheduler> {
/**
* Initializes DAO with the interview scheduler collection.
*/
constructor() {
super(
interviewSchedulerCollection,
Expand All @@ -11,14 +14,28 @@ export default class InterviewSchedulerDao extends BaseDao<InterviewScheduler, I
);
}

/**
* Gets all instances of Interview Scheduler
* @returns a promise that resolves to an array of Interview Scheduler objects
*/
async getAllInstances(): Promise<InterviewScheduler[]> {
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<InterviewScheduler | null> {
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<string> {
const instanceWithUUID = {
...instance,
Expand All @@ -28,10 +45,19 @@ export default class InterviewSchedulerDao extends BaseDao<InterviewScheduler, I
return doc.uuid;
}

/**
* Updates an instance of Interview Scheduler
* @param instance the instance to update
* @returns a promise resolving to the updated instance
*/
async updateInstance(instance: InterviewScheduler): Promise<InterviewScheduler> {
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<void> {
this.deleteDocument(uuid);
}
Expand Down

0 comments on commit b1c7af0

Please sign in to comment.