Skip to content

Commit b1c7af0

Browse files
authored
interview scheduler dao documentation (#871)
### Summary Added docs to InterviewSchedulerDao
1 parent 162fc8a commit b1c7af0

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

backend/src/dao/InterviewSchedulerDao.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ import { interviewSchedulerCollection } from '../firebase';
33
import BaseDao from './BaseDao';
44

55
export default class InterviewSchedulerDao extends BaseDao<InterviewScheduler, InterviewScheduler> {
6+
/**
7+
* Initializes DAO with the interview scheduler collection.
8+
*/
69
constructor() {
710
super(
811
interviewSchedulerCollection,
@@ -11,14 +14,28 @@ export default class InterviewSchedulerDao extends BaseDao<InterviewScheduler, I
1114
);
1215
}
1316

17+
/**
18+
* Gets all instances of Interview Scheduler
19+
* @returns a promise that resolves to an array of Interview Scheduler objects
20+
*/
1421
async getAllInstances(): Promise<InterviewScheduler[]> {
1522
return this.getDocuments();
1623
}
1724

25+
/**
26+
* Gets a specific instance of Interview Scheduler with uuid
27+
* @param uuid the uuid of a Interview Scheduler instance
28+
* @returns a promise resolving to a specific instance if found and null otherwise
29+
*/
1830
async getInstance(uuid: string): Promise<InterviewScheduler | null> {
1931
return this.getDocument(uuid);
2032
}
2133

34+
/**
35+
* Creates an instance of Interview Scheduler with uuid and assigns one if not provided
36+
* @param instance the Interview Scheduler instance to create
37+
* @returns uuid of created instance
38+
*/
2239
async createInstance(instance: InterviewScheduler): Promise<string> {
2340
const instanceWithUUID = {
2441
...instance,
@@ -28,10 +45,19 @@ export default class InterviewSchedulerDao extends BaseDao<InterviewScheduler, I
2845
return doc.uuid;
2946
}
3047

48+
/**
49+
* Updates an instance of Interview Scheduler
50+
* @param instance the instance to update
51+
* @returns a promise resolving to the updated instance
52+
*/
3153
async updateInstance(instance: InterviewScheduler): Promise<InterviewScheduler> {
3254
return this.updateDocument(instance.uuid, instance);
3355
}
3456

57+
/**
58+
* Deletes an instance of Interview Scheduler
59+
* @param uuid the uuid of the instance to delete
60+
*/
3561
async deleteInstance(uuid: string): Promise<void> {
3662
this.deleteDocument(uuid);
3763
}

0 commit comments

Comments
 (0)