@@ -3,6 +3,9 @@ import { interviewSchedulerCollection } from '../firebase';
3
3
import BaseDao from './BaseDao' ;
4
4
5
5
export default class InterviewSchedulerDao extends BaseDao < InterviewScheduler , InterviewScheduler > {
6
+ /**
7
+ * Initializes DAO with the interview scheduler collection.
8
+ */
6
9
constructor ( ) {
7
10
super (
8
11
interviewSchedulerCollection ,
@@ -11,14 +14,28 @@ export default class InterviewSchedulerDao extends BaseDao<InterviewScheduler, I
11
14
) ;
12
15
}
13
16
17
+ /**
18
+ * Gets all instances of Interview Scheduler
19
+ * @returns a promise that resolves to an array of Interview Scheduler objects
20
+ */
14
21
async getAllInstances ( ) : Promise < InterviewScheduler [ ] > {
15
22
return this . getDocuments ( ) ;
16
23
}
17
24
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
+ */
18
30
async getInstance ( uuid : string ) : Promise < InterviewScheduler | null > {
19
31
return this . getDocument ( uuid ) ;
20
32
}
21
33
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
+ */
22
39
async createInstance ( instance : InterviewScheduler ) : Promise < string > {
23
40
const instanceWithUUID = {
24
41
...instance ,
@@ -28,10 +45,19 @@ export default class InterviewSchedulerDao extends BaseDao<InterviewScheduler, I
28
45
return doc . uuid ;
29
46
}
30
47
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
+ */
31
53
async updateInstance ( instance : InterviewScheduler ) : Promise < InterviewScheduler > {
32
54
return this . updateDocument ( instance . uuid , instance ) ;
33
55
}
34
56
57
+ /**
58
+ * Deletes an instance of Interview Scheduler
59
+ * @param uuid the uuid of the instance to delete
60
+ */
35
61
async deleteInstance ( uuid : string ) : Promise < void > {
36
62
this . deleteDocument ( uuid ) ;
37
63
}
0 commit comments