Skip to content

Commit eb83c2b

Browse files
bahati10Aime-Patrickceelogrejkarenzimutsinziisaac
authored
Ft schedule technical interview (#169)
* 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]>
1 parent 3b0e5f4 commit eb83c2b

21 files changed

+1350
-340
lines changed

Diff for: .vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib"
3+
}

Diff for: src/helpers/bulkyMails.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,12 @@ export const sendUserCredentials = async (email: String, password: String) => {
111111
}
112112
};
113113

114-
115114
export const sendEmailTemplate = async (
116115
email: string,
117116
subject: string,
118117
title: string,
119118
body: string,
120-
button?: { url: string, text: string }
119+
button?: { url: string; text: string }
121120
) => {
122121
try {
123122
const logoText = "DevPulse";
@@ -171,7 +170,7 @@ export const sendEmailTemplate = async (
171170
<div style="margin-top: 80px;">
172171
<p style="color: #555; font-size: 14px;">
173172
If you received this email by mistake, simply ignore it. <br />
174-
For any questions, contact us at <a href="mailto: samuel.nishimwe@andela.com" style="color: ${secondaryColor};">[email protected]</a>.
173+
For any questions, contact us at <a href="mailto: devpulsedev@gmail.com" style="color: ${secondaryColor};">[email protected]</a>.
175174
</p>
176175
<a href="" style="margin: 0 10px; display: inline-flex; align-items: center; text-decoration: none;">
177176
<img
@@ -252,7 +251,7 @@ export const sendEmailTemplate = async (
252251
${generateLogo(logoText, mainColor)}
253252
${generateTitle(title)}
254253
${generateBody(body)}
255-
${button ? generateButton(button.url, button.text) : ''}
254+
${button ? generateButton(button.url, button.text) : ""}
256255
${generateFooterLogo()}
257256
${generateSocialIcons()}
258257
${generateFooter()}

Diff for: src/index.ts

+14-6
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ import { attendanceResolver } from "./resolvers/attendanceResolver";
5555
import { attendanceSchema } from "./schema/attendanceSchema";
5656
import { performanceResolver } from "./resolvers/performanceResolver";
5757
import { performanceSchema } from "./schema/performanceSchema";
58-
import { applicationStageDefs } from "./schema/applicationStage";
58+
import {
59+
applicationStageDefs,
60+
technicalInterviewDefs,
61+
} from "./schema/applicationStage";
5962
import { applicationStageResolvers } from "./resolvers/applicationStageResolver";
6063
import filterJobResolver from "./resolvers/filterJob";
6164
import filterProgramResolver from "./resolvers/filterPrograms";
@@ -88,10 +91,12 @@ import { jobApplicationTypeDefs } from "./schema/jobApplicationSchema";
8891
import { jobApplicationResolver } from "./resolvers/jobApplicationResolver";
8992
import { blogRelatedResolvers } from "./resolvers/blogRelatedArticlesResolver";
9093
import { blogRelatedArticlesSchema } from "./schema/blogRelatedArticlesSchema";
91-
import { reactionSchema } from "./schema/reactionSchema";
94+
import { reactionSchema } from "./schema/reactionSchema";
9295
import { reactionResolvers } from "./resolvers/reactionResolvers";
9396
import { DocSchema } from "./schema/doc";
9497
import { docResolver } from "./resolvers/Doc";
98+
import { technicalInterviewResolvers } from "./resolvers/scheduleInterviewResolver";
99+
95100
const PORT = process.env.PORT || 3000;
96101

97102
const resolvers = mergeResolvers([
@@ -140,7 +145,8 @@ const resolvers = mergeResolvers([
140145
commentReplyResolvers,
141146
blogRelatedResolvers,
142147
docResolver,
143-
reactionResolvers
148+
reactionResolvers,
149+
technicalInterviewResolvers,
144150
]);
145151
const typeDefs = mergeTypeDefs([
146152
applicationCycleTypeDefs,
@@ -184,7 +190,9 @@ const typeDefs = mergeTypeDefs([
184190
jobApplicationTypeDefs,
185191
blogRelatedArticlesSchema,
186192
DocSchema,
187-
reactionSchema
193+
reactionSchema,
194+
applicationStageDefs,
195+
technicalInterviewDefs,
188196
]);
189197

190198
const server = new ApolloServer({
@@ -197,7 +205,7 @@ const server = new ApolloServer({
197205
try {
198206
authToken =
199207
req.headers.authorization &&
200-
req.headers.authorization.startsWith("Bearer ")
208+
req.headers.authorization.startsWith("Bearer ")
201209
? req.headers.authorization.split(" ")[1]
202210
: req.headers.authorization;
203211
if (authToken) {
@@ -216,4 +224,4 @@ const server = new ApolloServer({
216224
connect().then(() => {
217225
console.log("Database connected!");
218226
server.listen(PORT).then(({ url }) => console.info(`App on ${url}`));
219-
});
227+
});

Diff for: src/models/AuthUser.ts

+14-8
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ const userSchema = new Schema(
1717
type: String,
1818
default: "",
1919
},
20-
isVerified:{
21-
type:Boolean,
22-
default:false
20+
isVerified: {
21+
type: Boolean,
22+
default: false,
2323
},
2424
role: {
2525
type: Schema.Types.ObjectId,
@@ -39,7 +39,15 @@ const userSchema = new Schema(
3939
},
4040
applicationPhase: {
4141
type: String,
42-
enum: ["Applied", 'Shortlisted', 'Technical Assessment', 'Interview Assessment', 'Admitted', 'Rejected', "Enrolled"],
42+
enum: [
43+
"Applied",
44+
"Shortlisted",
45+
"Technical Assessment",
46+
"Interview Assessment",
47+
"Admitted",
48+
"Rejected",
49+
"Enrolled",
50+
],
4351
default: "Applied",
4452
},
4553
isActive: {
@@ -49,17 +57,15 @@ const userSchema = new Schema(
4957
isEmailVerified: {
5058
type: Boolean,
5159
default: false,
52-
5360
},
5461
cohort: {
5562
type: Schema.Types.ObjectId,
5663
ref: "cohortModel",
5764
},
5865
resetToken: String,
59-
resetTokenExpiration:Date
60-
66+
resetTokenExpiration: Date,
6167
},
6268
{ timestamps: true }
6369
);
6470

65-
export const LoggedUserModel = model("LoggedUserModel", userSchema);
71+
export const LoggedUserModel = model("LoggedUserModel", userSchema);

Diff for: src/models/InterviewAssessmentStageSchema.ts

+29-25
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,36 @@ interface IInterviewAssessment extends Document {
77
comments?: string;
88
}
99

10-
const interviewAssessmentSchema = new Schema<IInterviewAssessment>({
11-
applicantId: {
12-
type: Schema.Types.ObjectId,
13-
ref: "Trainees",
14-
required: true,
10+
const interviewAssessmentSchema = new Schema<IInterviewAssessment>(
11+
{
12+
applicantId: {
13+
type: Schema.Types.ObjectId,
14+
ref: "Trainees",
15+
required: true,
16+
},
17+
status: {
18+
type: String,
19+
enum: ["No action", "Moved", "Rejected", "Admitted"],
20+
default: "No action",
21+
},
22+
interviewScore: {
23+
type: Number,
24+
min: 0,
25+
max: 2,
26+
validate: {
27+
validator: (value: number) =>
28+
value === null || (value >= 0 && value <= 2),
29+
message: "Score must be between 0 and 2.",
30+
},
31+
},
32+
comments: {
33+
type: String,
34+
},
1535
},
16-
status: {
17-
type: String,
18-
enum: ["No action", "Moved", "Rejected", "Admitted"],
19-
default: "No action",
20-
},
21-
interviewScore: {
22-
type: Number,
23-
min: 0,
24-
max: 2,
25-
validate: {
26-
validator: (value : number) => value === null || (value >= 0 && value <= 2),
27-
message: "Score must be between 0 and 2."
28-
}
29-
},
30-
comments: {
31-
type: String,
32-
},
33-
},{
34-
timestamps: true
35-
});
36+
{
37+
timestamps: true,
38+
}
39+
);
3640

3741
const InterviewAssessment = mongoose.model<IInterviewAssessment>(
3842
"InterviewAssessment",

Diff for: src/models/ShortlistedSchema.ts

+24-19
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,33 @@ import mongoose, { Schema, Document } from "mongoose";
22

33
interface IShortlisted extends Document {
44
applicantId: mongoose.Schema.Types.ObjectId;
5-
status: "No action" | "Invited" | "Moved" | "Rejected" | "Admitted";
5+
status: "No action" | "Moved" | "Rejected" | "Admitted";
66
comments?: string;
77
}
88

9-
const shortlistedSchema = new Schema<IShortlisted>({
10-
applicantId: {
11-
type: Schema.Types.ObjectId,
12-
ref: "Trainees",
13-
required: true,
14-
15-
},
16-
status: {
17-
type: String,
18-
enum: ["No action", "Invited", "Moved", "Rejected", "Admitted"],
19-
default: "No action",
20-
},
21-
comments: {
22-
type: String,
9+
const shortlistedSchema = new Schema<IShortlisted>(
10+
{
11+
applicantId: {
12+
type: Schema.Types.ObjectId,
13+
ref: "Trainees",
14+
required: true,
15+
},
16+
status: {
17+
type: String,
18+
enum: ["No action", "Invited", "Moved", "Rejected", "Admitted"],
19+
default: "No action",
20+
},
21+
comments: {
22+
type: String,
23+
},
2324
},
24-
},{
25-
timestamps: true,
26-
});
25+
{
26+
timestamps: true,
27+
}
28+
);
2729

28-
const Shortlisted = mongoose.model<IShortlisted>("Shortlisted", shortlistedSchema);
30+
const Shortlisted = mongoose.model<IShortlisted>(
31+
"Shortlisted",
32+
shortlistedSchema
33+
);
2934
export default Shortlisted;

Diff for: src/models/admittedStageSchema.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface IAdmitted extends Document {
1010
const admittedSchema = new Schema<IAdmitted>({
1111
applicantId: {
1212
type: Schema.Types.ObjectId,
13-
ref: "Trainees",
13+
ref: "Trainee",
1414
required: true,
1515
},
1616
status: {
@@ -20,8 +20,6 @@ const admittedSchema = new Schema<IAdmitted>({
2020
comments: {
2121
type: String,
2222
},
23-
},{
24-
timestamps: true
2523
});
2624

2725
const Admitted = mongoose.model<IAdmitted>("Admitted", admittedSchema);

Diff for: src/models/dismissedStageSchema.ts

+22-19
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,30 @@ interface IDismissed extends Document {
77
status: "Rejected"; // Added status field
88
}
99

10-
const rejectedSchema = new Schema<IDismissed>({
11-
applicantId: {
12-
type: Schema.Types.ObjectId,
13-
ref: "Trainees",
14-
required: true,
10+
const rejectedSchema = new Schema<IDismissed>(
11+
{
12+
applicantId: {
13+
type: Schema.Types.ObjectId,
14+
ref: "Trainees",
15+
required: true,
16+
},
17+
stageDismissedFrom: {
18+
type: String,
19+
required: true,
20+
},
21+
comments: {
22+
type: String,
23+
},
24+
status: {
25+
type: String,
26+
default: "Rejected",
27+
required: true,
28+
},
1529
},
16-
stageDismissedFrom: {
17-
type: String,
18-
required: true,
19-
},
20-
comments: {
21-
type: String,
22-
},
23-
status:{
24-
type: String,
25-
default: "Rejected",
26-
required: true,
30+
{
31+
timestamps: true,
2732
}
28-
},{
29-
timestamps: true
30-
});
33+
);
3134

3235
const Rejected = mongoose.model<IDismissed>("Dismissed", rejectedSchema);
3336
export default Rejected;

Diff for: src/models/stageSchema.ts

+22-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@ import mongoose, { Schema, Document } from "mongoose";
22

33
interface IStageTracking extends Document {
44
applicantId: mongoose.Schema.Types.ObjectId;
5-
currentStage: "Applied" | "Shortlisted" | "Technical Assessment" | "Interview Assessment" | "Admitted" | "Rejected";
5+
currentStage:
6+
| "Applied"
7+
| "Shortlisted"
8+
| "Technical Assessment"
9+
| "Interview Assessment"
10+
| "Admitted"
11+
| "Rejected";
612
history: [
713
{
814
stage: string;
@@ -21,19 +27,29 @@ const stageTrackingSchema = new Schema<IStageTracking>({
2127
},
2228
currentStage: {
2329
type: String,
24-
enum: ["Applied","Shortlisted", "Technical Assessment", "Interview Assessment", "Admitted", "Rejected"],
30+
enum: [
31+
"Applied",
32+
"Shortlisted",
33+
"Technical Assessment",
34+
"Interview Assessment",
35+
"Admitted",
36+
"Rejected",
37+
],
2538
required: true,
2639
default: "Applied",
2740
},
2841
history: [
2942
{
3043
stage: { type: String, required: true },
31-
comments:{type:String,required: true},
44+
comments: { type: String, required: true },
3245
enteredAt: { type: Date, default: Date.now },
3346
exitedAt: { type: Date },
34-
}
35-
]
47+
},
48+
],
3649
});
3750

38-
const StageTracking = mongoose.model<IStageTracking>("StageTracking", stageTrackingSchema);
51+
const StageTracking = mongoose.model<IStageTracking>(
52+
"StageTracking",
53+
stageTrackingSchema
54+
);
3955
export default StageTracking;

0 commit comments

Comments
 (0)