Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#174 Fix to change status in application stage process #165

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: "Passed" } }
);
await TraineeApplicant.updateOne(
{ _id: applicantId },
{ $set: { applicationPhase: nextStage, status: "Moved" } }
{ $set: { applicationPhase: nextStage, status: "Passed" } }
);
}

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