Skip to content

Commit 6ce8a5d

Browse files
authored
Fix to change status in application stage process (#165)
1 parent 183d2a9 commit 6ce8a5d

File tree

3 files changed

+7
-69
lines changed

3 files changed

+7
-69
lines changed

Diff for: src/models/technicalAssessmentStage.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const technicalAssessmentSchema = new Schema<ITechnicalAssessment>({
1717
},
1818
status: {
1919
type: String,
20-
enum: ["No action", "Invited", "Moved", "Rejected", "Admitted"],
20+
enum: ["No action", "Invited", "Moved","Passed", "Rejected", "Admitted"],
2121
default: "No action",
2222
},
2323
score: {

Diff for: src/resolvers/applicationStageResolver.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,11 @@ export const applicationStageResolvers: any = {
287287
if (stageTracking) {
288288
await Shortlisted.updateOne(
289289
{ applicantId, status: "No action" },
290-
{ $set: { status: "Moved" } }
290+
{ $set: { status: "Passed" } }
291291
);
292292
await TraineeApplicant.updateOne(
293293
{ _id: applicantId },
294-
{ $set: { applicationPhase: nextStage, status: "Moved" } }
294+
{ $set: { applicationPhase: nextStage, status: "Passed" } }
295295
);
296296
}
297297

@@ -339,11 +339,11 @@ export const applicationStageResolvers: any = {
339339
if (stageTracking) {
340340
await TechnicalAssessment.updateOne(
341341
{ applicantId, status: "No action" },
342-
{ $set: { status: "Moved" } }
342+
{ $set: { status: "Passed" } }
343343
);
344344
await TraineeApplicant.updateOne(
345345
{ _id: applicantId },
346-
{ $set: { applicationPhase: nextStage, status: "Moved" } }
346+
{ $set: { applicationPhase: nextStage, status: "Passed" } }
347347
);
348348
}
349349
await InterviewAssessment.create({
@@ -389,7 +389,7 @@ export const applicationStageResolvers: any = {
389389
if (stageTracking) {
390390
await InterviewAssessment.updateOne(
391391
{ applicantId, status: "No action" },
392-
{ $set: { status: "Moved" } }
392+
{ $set: { status: "Passed" } }
393393
);
394394
}
395395

Diff for: src/seeders/DelTrainee.ts

+1-63
Original file line numberDiff line numberDiff line change
@@ -10,69 +10,7 @@ const seedDeleteTrainee = async () => {
1010
return;
1111
}
1212

13-
const deleteTrainee = [
14-
{
15-
16-
firstName: 'Ben',
17-
lastName: 'iraa',
18-
deleted_at: false,
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-
24-
},
25-
{
26-
27-
firstName: 'Test',
28-
lastName: 'user',
29-
deleted_at: false,
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-
36-
},
37-
{
38-
39-
firstName: 'iradukunda',
40-
lastName: 'benjamin',
41-
deleted_at: false,
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-
47-
48-
},
49-
{
50-
51-
firstName: 'carlos',
52-
lastName: 'Bz',
53-
deleted_at: false,
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-
59-
60-
},
61-
{
62-
63-
firstName: 'blaise',
64-
lastName: 'k',
65-
deleted_at: false,
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-
71-
72-
},
73-
];
74-
await TraineeApplicant.deleteMany({ deleteTrainee });
75-
await TraineeApplicant.insertMany(deleteTrainee);
13+
await TraineeApplicant.deleteMany({});
7614
await traineEAttributes.deleteMany({});
7715
return null;
7816
}

0 commit comments

Comments
 (0)