Skip to content

Commit

Permalink
Ft schedule technical interview (#169)
Browse files Browse the repository at this point in the history
* Application cycle process on applicant

* implement Technical Interview invitation

* implement Technical Interview invitation

* Implement Interview inviation

* Pipeline envs (#163)

* fix: remove the rm step

* test: run on PR

* test: test pusher cluster env

* fix: add notification envs

* test: add pusher key

* fix: add the pusher app key

* fix: log container start output

* fix: remove the e flag

* fix: revert changes

* fix: re-add the pusher app key

* fix: add pusher app key value

* fix: typo

* fix: test env file

* fix: syntax

* fix: remove the env from run cmd

* fix: revert changes

* fix: revert changes

* fix: wrap run cmd in an if statement

* Revert "test: test pusher cluster env"

This reverts commit 57b2bbe.

* test: create env file

* test: add error handling

* fix: run on push (#176)

* fix(apply-jobpost): incorporate feedback (#168)

- remove 'submitted' status
- add comments for 'rejected status'

* fix: don't exit on cmd failure (#177)

* fix: don't exit on cmd failure

* fix: re-add values

* fix: add new variables

* test: add container name

* fix: match ports

* fix: add devpulse email

* fix: port

* fix: port

* fix: remove container name

* fix: remove extraneous node env

* fix: add jwt key

* fix: run on push

* #170 An author will be able to update a blog (#171)

* fix (170): an author will be able to update a blog

* fix (170): allow all users to create and update blogs

* Fix to change status in application stage process (#165)

* Ft: Enhance Backend documentation (#164)

* fix: improve on notifications (#175)

* Application cycle process on applicant

* Application cycle process on applicant

* Fixing conflicts and removing unnecessary files

---------

Co-authored-by: Aime-Patrick <[email protected]>
Co-authored-by: Samuel Nishimwe <[email protected]>
Co-authored-by: Joslyn Manzi Karenzi <[email protected]>
Co-authored-by: mutsinziisaac <[email protected]>
Co-authored-by: Emmanuel MUGISHA <[email protected]>
Co-authored-by: ISHIMWE Jean Baptiste <[email protected]>
Co-authored-by: Christian Iradukunda <[email protected]>
  • Loading branch information
8 people authored Dec 9, 2024
1 parent 3b0e5f4 commit eb83c2b
Show file tree
Hide file tree
Showing 21 changed files with 1,350 additions and 340 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
7 changes: 3 additions & 4 deletions src/helpers/bulkyMails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,12 @@ export const sendUserCredentials = async (email: String, password: String) => {
}
};


export const sendEmailTemplate = async (
email: string,
subject: string,
title: string,
body: string,
button?: { url: string, text: string }
button?: { url: string; text: string }
) => {
try {
const logoText = "DevPulse";
Expand Down Expand Up @@ -171,7 +170,7 @@ export const sendEmailTemplate = async (
<div style="margin-top: 80px;">
<p style="color: #555; font-size: 14px;">
If you received this email by mistake, simply ignore it. <br />
For any questions, contact us at <a href="mailto: samuel.nishimwe@andela.com" style="color: ${secondaryColor};">[email protected]</a>.
For any questions, contact us at <a href="mailto: devpulsedev@gmail.com" style="color: ${secondaryColor};">[email protected]</a>.
</p>
<a href="" style="margin: 0 10px; display: inline-flex; align-items: center; text-decoration: none;">
<img
Expand Down Expand Up @@ -252,7 +251,7 @@ export const sendEmailTemplate = async (
${generateLogo(logoText, mainColor)}
${generateTitle(title)}
${generateBody(body)}
${button ? generateButton(button.url, button.text) : ''}
${button ? generateButton(button.url, button.text) : ""}
${generateFooterLogo()}
${generateSocialIcons()}
${generateFooter()}
Expand Down
20 changes: 14 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ import { attendanceResolver } from "./resolvers/attendanceResolver";
import { attendanceSchema } from "./schema/attendanceSchema";
import { performanceResolver } from "./resolvers/performanceResolver";
import { performanceSchema } from "./schema/performanceSchema";
import { applicationStageDefs } from "./schema/applicationStage";
import {
applicationStageDefs,
technicalInterviewDefs,
} from "./schema/applicationStage";
import { applicationStageResolvers } from "./resolvers/applicationStageResolver";
import filterJobResolver from "./resolvers/filterJob";
import filterProgramResolver from "./resolvers/filterPrograms";
Expand Down Expand Up @@ -88,10 +91,12 @@ import { jobApplicationTypeDefs } from "./schema/jobApplicationSchema";
import { jobApplicationResolver } from "./resolvers/jobApplicationResolver";
import { blogRelatedResolvers } from "./resolvers/blogRelatedArticlesResolver";
import { blogRelatedArticlesSchema } from "./schema/blogRelatedArticlesSchema";
import { reactionSchema } from "./schema/reactionSchema";
import { reactionSchema } from "./schema/reactionSchema";
import { reactionResolvers } from "./resolvers/reactionResolvers";
import { DocSchema } from "./schema/doc";
import { docResolver } from "./resolvers/Doc";
import { technicalInterviewResolvers } from "./resolvers/scheduleInterviewResolver";

const PORT = process.env.PORT || 3000;

const resolvers = mergeResolvers([
Expand Down Expand Up @@ -140,7 +145,8 @@ const resolvers = mergeResolvers([
commentReplyResolvers,
blogRelatedResolvers,
docResolver,
reactionResolvers
reactionResolvers,
technicalInterviewResolvers,
]);
const typeDefs = mergeTypeDefs([
applicationCycleTypeDefs,
Expand Down Expand Up @@ -184,7 +190,9 @@ const typeDefs = mergeTypeDefs([
jobApplicationTypeDefs,
blogRelatedArticlesSchema,
DocSchema,
reactionSchema
reactionSchema,
applicationStageDefs,
technicalInterviewDefs,
]);

const server = new ApolloServer({
Expand All @@ -197,7 +205,7 @@ const server = new ApolloServer({
try {
authToken =
req.headers.authorization &&
req.headers.authorization.startsWith("Bearer ")
req.headers.authorization.startsWith("Bearer ")
? req.headers.authorization.split(" ")[1]
: req.headers.authorization;
if (authToken) {
Expand All @@ -216,4 +224,4 @@ const server = new ApolloServer({
connect().then(() => {
console.log("Database connected!");
server.listen(PORT).then(({ url }) => console.info(`App on ${url}`));
});
});
22 changes: 14 additions & 8 deletions src/models/AuthUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ const userSchema = new Schema(
type: String,
default: "",
},
isVerified:{
type:Boolean,
default:false
isVerified: {
type: Boolean,
default: false,
},
role: {
type: Schema.Types.ObjectId,
Expand All @@ -39,7 +39,15 @@ const userSchema = new Schema(
},
applicationPhase: {
type: String,
enum: ["Applied", 'Shortlisted', 'Technical Assessment', 'Interview Assessment', 'Admitted', 'Rejected', "Enrolled"],
enum: [
"Applied",
"Shortlisted",
"Technical Assessment",
"Interview Assessment",
"Admitted",
"Rejected",
"Enrolled",
],
default: "Applied",
},
isActive: {
Expand All @@ -49,17 +57,15 @@ const userSchema = new Schema(
isEmailVerified: {
type: Boolean,
default: false,

},
cohort: {
type: Schema.Types.ObjectId,
ref: "cohortModel",
},
resetToken: String,
resetTokenExpiration:Date

resetTokenExpiration: Date,
},
{ timestamps: true }
);

export const LoggedUserModel = model("LoggedUserModel", userSchema);
export const LoggedUserModel = model("LoggedUserModel", userSchema);
54 changes: 29 additions & 25 deletions src/models/InterviewAssessmentStageSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,36 @@ interface IInterviewAssessment extends Document {
comments?: string;
}

const interviewAssessmentSchema = new Schema<IInterviewAssessment>({
applicantId: {
type: Schema.Types.ObjectId,
ref: "Trainees",
required: true,
const interviewAssessmentSchema = new Schema<IInterviewAssessment>(
{
applicantId: {
type: Schema.Types.ObjectId,
ref: "Trainees",
required: true,
},
status: {
type: String,
enum: ["No action", "Moved", "Rejected", "Admitted"],
default: "No action",
},
interviewScore: {
type: Number,
min: 0,
max: 2,
validate: {
validator: (value: number) =>
value === null || (value >= 0 && value <= 2),
message: "Score must be between 0 and 2.",
},
},
comments: {
type: String,
},
},
status: {
type: String,
enum: ["No action", "Moved", "Rejected", "Admitted"],
default: "No action",
},
interviewScore: {
type: Number,
min: 0,
max: 2,
validate: {
validator: (value : number) => value === null || (value >= 0 && value <= 2),
message: "Score must be between 0 and 2."
}
},
comments: {
type: String,
},
},{
timestamps: true
});
{
timestamps: true,
}
);

const InterviewAssessment = mongoose.model<IInterviewAssessment>(
"InterviewAssessment",
Expand Down
43 changes: 24 additions & 19 deletions src/models/ShortlistedSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,33 @@ import mongoose, { Schema, Document } from "mongoose";

interface IShortlisted extends Document {
applicantId: mongoose.Schema.Types.ObjectId;
status: "No action" | "Invited" | "Moved" | "Rejected" | "Admitted";
status: "No action" | "Moved" | "Rejected" | "Admitted";
comments?: string;
}

const shortlistedSchema = new Schema<IShortlisted>({
applicantId: {
type: Schema.Types.ObjectId,
ref: "Trainees",
required: true,

},
status: {
type: String,
enum: ["No action", "Invited", "Moved", "Rejected", "Admitted"],
default: "No action",
},
comments: {
type: String,
const shortlistedSchema = new Schema<IShortlisted>(
{
applicantId: {
type: Schema.Types.ObjectId,
ref: "Trainees",
required: true,
},
status: {
type: String,
enum: ["No action", "Invited", "Moved", "Rejected", "Admitted"],
default: "No action",
},
comments: {
type: String,
},
},
},{
timestamps: true,
});
{
timestamps: true,
}
);

const Shortlisted = mongoose.model<IShortlisted>("Shortlisted", shortlistedSchema);
const Shortlisted = mongoose.model<IShortlisted>(
"Shortlisted",
shortlistedSchema
);
export default Shortlisted;
4 changes: 1 addition & 3 deletions src/models/admittedStageSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface IAdmitted extends Document {
const admittedSchema = new Schema<IAdmitted>({
applicantId: {
type: Schema.Types.ObjectId,
ref: "Trainees",
ref: "Trainee",
required: true,
},
status: {
Expand All @@ -20,8 +20,6 @@ const admittedSchema = new Schema<IAdmitted>({
comments: {
type: String,
},
},{
timestamps: true
});

const Admitted = mongoose.model<IAdmitted>("Admitted", admittedSchema);
Expand Down
41 changes: 22 additions & 19 deletions src/models/dismissedStageSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,30 @@ interface IDismissed extends Document {
status: "Rejected"; // Added status field
}

const rejectedSchema = new Schema<IDismissed>({
applicantId: {
type: Schema.Types.ObjectId,
ref: "Trainees",
required: true,
const rejectedSchema = new Schema<IDismissed>(
{
applicantId: {
type: Schema.Types.ObjectId,
ref: "Trainees",
required: true,
},
stageDismissedFrom: {
type: String,
required: true,
},
comments: {
type: String,
},
status: {
type: String,
default: "Rejected",
required: true,
},
},
stageDismissedFrom: {
type: String,
required: true,
},
comments: {
type: String,
},
status:{
type: String,
default: "Rejected",
required: true,
{
timestamps: true,
}
},{
timestamps: true
});
);

const Rejected = mongoose.model<IDismissed>("Dismissed", rejectedSchema);
export default Rejected;
28 changes: 22 additions & 6 deletions src/models/stageSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ import mongoose, { Schema, Document } from "mongoose";

interface IStageTracking extends Document {
applicantId: mongoose.Schema.Types.ObjectId;
currentStage: "Applied" | "Shortlisted" | "Technical Assessment" | "Interview Assessment" | "Admitted" | "Rejected";
currentStage:
| "Applied"
| "Shortlisted"
| "Technical Assessment"
| "Interview Assessment"
| "Admitted"
| "Rejected";
history: [
{
stage: string;
Expand All @@ -21,19 +27,29 @@ const stageTrackingSchema = new Schema<IStageTracking>({
},
currentStage: {
type: String,
enum: ["Applied","Shortlisted", "Technical Assessment", "Interview Assessment", "Admitted", "Rejected"],
enum: [
"Applied",
"Shortlisted",
"Technical Assessment",
"Interview Assessment",
"Admitted",
"Rejected",
],
required: true,
default: "Applied",
},
history: [
{
stage: { type: String, required: true },
comments:{type:String,required: true},
comments: { type: String, required: true },
enteredAt: { type: Date, default: Date.now },
exitedAt: { type: Date },
}
]
},
],
});

const StageTracking = mongoose.model<IStageTracking>("StageTracking", stageTrackingSchema);
const StageTracking = mongoose.model<IStageTracking>(
"StageTracking",
stageTrackingSchema
);
export default StageTracking;
Loading

0 comments on commit eb83c2b

Please sign in to comment.