1
- import TraineeApplicant from '../models/traineeApplicant' ;
1
+ import TraineeApplicant from '../models/traineeApplicant' ;
2
2
import { applicationCycle } from '../models/applicationCycle' ;
3
+ import { traineEAttributes } from "../models/traineeAttribute" ;
3
4
4
5
5
6
const seedDeleteTrainee = async ( ) => {
6
7
const cycle = await applicationCycle . findOne ( ) ;
7
-
8
+
8
9
if ( ! cycle ) {
9
- return ;
10
+ return ;
10
11
}
11
12
12
13
const deleteTrainee = [
@@ -15,44 +16,64 @@ const seedDeleteTrainee = async () => {
15
16
firstName : 'Ben' ,
16
17
lastName : 'iraa' ,
17
18
deleted_at : false ,
18
- cycle_id : cycle . _id
19
-
19
+ cycle_id : cycle . _id ,
20
+ coverLetterUrl : "http://example.com/coverLetter.pdf" ,
21
+ idDocumentUrl : "http://example.com/idDocument.pdf" ,
22
+ resumeUrl : "http://example.com/resume.pdf"
23
+
20
24
} ,
21
25
{
22
26
23
27
firstName : 'Test' ,
24
28
lastName : 'user' ,
25
29
deleted_at : false ,
26
- cycle_id : cycle . _id
27
-
30
+ cycle_id : cycle . _id ,
31
+ coverLetterUrl : "http://example.com/coverLetter.pdf" ,
32
+ idDocumentUrl : "http://example.com/idDocument.pdf" ,
33
+ resumeUrl : "http://example.com/resume.pdf"
34
+
35
+
28
36
} ,
29
37
{
30
38
31
39
firstName : 'iradukunda' ,
32
40
lastName : 'benjamin' ,
33
41
deleted_at : false ,
34
- cycle_id : cycle . _id
42
+ cycle_id : cycle . _id ,
43
+ coverLetterUrl : "http://example.com/coverLetter.pdf" ,
44
+ idDocumentUrl : "http://example.com/idDocument.pdf" ,
45
+ resumeUrl : "http://example.com/resume.pdf"
46
+
35
47
36
48
} ,
37
49
{
38
50
39
51
firstName : 'carlos' ,
40
52
lastName : 'Bz' ,
41
53
deleted_at : false ,
42
- cycle_id : cycle . _id
54
+ cycle_id : cycle . _id ,
55
+ coverLetterUrl : "http://example.com/coverLetter.pdf" ,
56
+ idDocumentUrl : "http://example.com/idDocument.pdf" ,
57
+ resumeUrl : "http://example.com/resume.pdf"
58
+
43
59
44
60
} ,
45
61
{
46
62
47
63
firstName : 'blaise' ,
48
64
lastName : 'k' ,
49
65
deleted_at : false ,
50
- cycle_id : cycle . _id
66
+ cycle_id : cycle . _id ,
67
+ coverLetterUrl : "http://example.com/coverLetter.pdf" ,
68
+ idDocumentUrl : "http://example.com/idDocument.pdf" ,
69
+ resumeUrl : "http://example.com/resume.pdf"
70
+
51
71
52
72
} ,
53
73
] ;
54
- await TraineeApplicant . deleteMany ( { deleteTrainee} ) ;
74
+ await TraineeApplicant . deleteMany ( { deleteTrainee } ) ;
55
75
await TraineeApplicant . insertMany ( deleteTrainee ) ;
76
+ await traineEAttributes . deleteMany ( { } ) ;
56
77
return null ;
57
78
}
58
79
export default seedDeleteTrainee ;
0 commit comments