Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interview scheduler dao documentation #871

Merged
merged 3 commits into from
Mar 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading