Skip to content

Commit

Permalink
Fix to change status in application stage process
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugisha146 committed Dec 2, 2024
1 parent 02e8d44 commit 1e5c600
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 69 deletions.
2 changes: 1 addition & 1 deletion src/models/technicalAssessmentStage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const technicalAssessmentSchema = new Schema<ITechnicalAssessment>({
},
status: {
type: String,
enum: ["No action", "Invited", "Moved", "Rejected", "Admitted"],
enum: ["No action", "Invited", "Moved","Passed", "Rejected", "Admitted"],
default: "No action",
},
score: {
Expand Down
10 changes: 5 additions & 5 deletions src/resolvers/applicationStageResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,11 @@ export const applicationStageResolvers: any = {
if (stageTracking) {
await Shortlisted.updateOne(
{ applicantId, status: "No action" },
{ $set: { status: "Moved" } }
{ $set: { status: "Selected" } }
);
await TraineeApplicant.updateOne(
{ _id: applicantId },
{ $set: { applicationPhase: nextStage, status: "Moved" } }
{ $set: { applicationPhase: nextStage, status: "Selected" } }
);
}

Expand Down Expand Up @@ -339,11 +339,11 @@ export const applicationStageResolvers: any = {
if (stageTracking) {
await TechnicalAssessment.updateOne(
{ applicantId, status: "No action" },
{ $set: { status: "Moved" } }
{ $set: { status: "Passed" } }
);
await TraineeApplicant.updateOne(
{ _id: applicantId },
{ $set: { applicationPhase: nextStage, status: "Moved" } }
{ $set: { applicationPhase: nextStage, status: "Passed" } }
);
}
await InterviewAssessment.create({
Expand Down Expand Up @@ -389,7 +389,7 @@ export const applicationStageResolvers: any = {
if (stageTracking) {
await InterviewAssessment.updateOne(
{ applicantId, status: "No action" },
{ $set: { status: "Moved" } }
{ $set: { status: "Passed" } }
);
}

Expand Down
64 changes: 1 addition & 63 deletions src/seeders/DelTrainee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,69 +10,7 @@ const seedDeleteTrainee = async () => {
return;
}

const deleteTrainee = [
{
email: '[email protected]',
firstName: 'Ben',
lastName: 'iraa',
deleted_at: false,
cycle_id: cycle._id,
coverLetterUrl: "http://example.com/coverLetter.pdf",
idDocumentUrl: "http://example.com/idDocument.pdf",
resumeUrl: "http://example.com/resume.pdf"

},
{
email: '[email protected]',
firstName: 'Test',
lastName: 'user',
deleted_at: false,
cycle_id: cycle._id,
coverLetterUrl: "http://example.com/coverLetter.pdf",
idDocumentUrl: "http://example.com/idDocument.pdf",
resumeUrl: "http://example.com/resume.pdf"


},
{
email: '[email protected]',
firstName: 'iradukunda',
lastName: 'benjamin',
deleted_at: false,
cycle_id: cycle._id,
coverLetterUrl: "http://example.com/coverLetter.pdf",
idDocumentUrl: "http://example.com/idDocument.pdf",
resumeUrl: "http://example.com/resume.pdf"


},
{
email: '[email protected]',
firstName: 'carlos',
lastName: 'Bz',
deleted_at: false,
cycle_id: cycle._id,
coverLetterUrl: "http://example.com/coverLetter.pdf",
idDocumentUrl: "http://example.com/idDocument.pdf",
resumeUrl: "http://example.com/resume.pdf"


},
{
email: '[email protected]',
firstName: 'blaise',
lastName: 'k',
deleted_at: false,
cycle_id: cycle._id,
coverLetterUrl: "http://example.com/coverLetter.pdf",
idDocumentUrl: "http://example.com/idDocument.pdf",
resumeUrl: "http://example.com/resume.pdf"


},
];
await TraineeApplicant.deleteMany({ deleteTrainee });
await TraineeApplicant.insertMany(deleteTrainee);
await TraineeApplicant.deleteMany({});
await traineEAttributes.deleteMany({});
return null;
}
Expand Down

0 comments on commit 1e5c600

Please sign in to comment.