Skip to content

Commit 2167e5a

Browse files
committed
backend complete
1 parent 242c46f commit 2167e5a

File tree

5 files changed

+34
-0
lines changed

5 files changed

+34
-0
lines changed

server/api.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,6 +1424,15 @@ components:
14241424
maximum: 999
14251425
learningStatus:
14261426
$ref: '#/components/schemas/LearningStatus'
1427+
mentors:
1428+
type: object
1429+
properties:
1430+
technical:
1431+
type: string
1432+
hr:
1433+
type: string
1434+
english:
1435+
type: string
14271436
startDate:
14281437
type: string
14291438
format: date-time

server/scripts/setup/generators/traineeGenerator.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ const generateEducationInfo = (minCohort: number, maxCohort: number): TraineeEdu
100100
currentCohort: cohort,
101101
startCohort: cohort,
102102
startDate: faker.date.future({ refDate: '2016-01-01', years: 10 }),
103+
mentors: {},
103104
learningStatus: randomLearningStatus(),
104105
strikes: [],
105106
assignments: [],

server/src/models/Mentors.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export interface Mentors {
2+
technical?: string;
3+
hr?: string;
4+
english?: string;
5+
}

server/src/models/Trainee.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { InteractionWithReporter } from './Interaction';
33
import { StrikeWithReporter } from './Strike';
44
import { Test } from './Test';
55
import removeAccents from 'remove-accents';
6+
import { Mentors } from './Mentors';
67

78
export enum Gender {
89
Man = 'man',
@@ -142,6 +143,7 @@ export interface TraineeEducationInfo {
142143
startCohort: number;
143144
currentCohort?: number;
144145
learningStatus: LearningStatus;
146+
mentors?: Mentors;
145147
startDate?: Date;
146148
graduationDate?: Date;
147149
quitReason?: QuitReason;

server/src/schemas/TraineeSchema.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { WithMongoID, jsonFormatting } from '../utils/database';
2929

3030
import { Schema } from 'mongoose';
3131
import { genId } from '../utils/random';
32+
import { Mentors } from '../models/Mentors';
3233

3334
const TraineePersonalInfoSchema = new Schema<TraineePersonalInfo>(
3435
{
@@ -64,6 +65,15 @@ const TraineeContactInfoSchema = new Schema<TraineeContactInfo>(
6465
{ _id: false }
6566
);
6667

68+
const MentorsSchema = new Schema<Mentors>(
69+
{
70+
technical: { type: String, required: false, default: null },
71+
hr: { type: String, required: false, default: null },
72+
english: { type: String, required: false, default: null },
73+
},
74+
{ minimize: false }
75+
);
76+
6777
const StrikeSchema = new Schema<StrikeWithReporterID & WithMongoID>({
6878
_id: { type: String, default: genId },
6979
date: { type: Date, required: true },
@@ -109,6 +119,13 @@ const TraineeEducationInfoSchema = new Schema<TraineeEducationInfo>(
109119
enum: Object.values(LearningStatus),
110120
default: LearningStatus.Studying,
111121
},
122+
mentors: {
123+
type: MentorsSchema,
124+
required: false,
125+
default: {},
126+
id: false,
127+
_id: false
128+
},
112129
startDate: { type: Date, required: false, default: null },
113130
graduationDate: { type: Date, required: false, default: null },
114131
quitReason: { type: String, required: false, enum: Object.values(QuitReason), default: null },

0 commit comments

Comments
 (0)