Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; import { Document, Schema as MongooseSchema } from 'mongoose'; @Schema({ timestamps: true, collection: 'assessment_definitions' }) export class AssessmentDefinition extends Document { @Prop({ required: true, index: true }) tenantId: string; @Prop({ required: true }) title: string; @Prop({ required: true, enum: ['Technical', 'Aptitude', 'Language', 'Coding', 'CaseStudy', 'Situational', 'Custom'] }) type: string; @Prop({ default: 60 }) // minutes durationMinutes: number; @Prop({ default: 50 }) // passing percentage score passingScore: number; } export const AssessmentDefinitionSchema = SchemaFactory.createForClass(AssessmentDefinition); @Schema({ timestamps: true, collection: 'assessment_assignments' }) export class AssessmentAssignment extends Document { @Prop({ required: true, index: true }) tenantId: string; @Prop({ required: true, type: MongooseSchema.Types.ObjectId, ref: 'AssessmentDefinition' }) assessmentId: string; @Prop({ required: true, type: MongooseSchema.Types.ObjectId, ref: 'Candidate' }) candidateId: string; @Prop() assignedAt: Date; @Prop() expiresAt?: Date; @Prop({ default: 'assigned', enum: ['assigned', 'started', 'completed', 'expired'] }) status: string; @Prop({ default: 0 }) obtainedScore: number; } export const AssessmentAssignmentSchema = SchemaFactory.createForClass(AssessmentAssignment); @Schema({ timestamps: true, collection: 'interview_plans' }) export class InterviewPlan extends Document { @Prop({ required: true, index: true }) tenantId: string; @Prop({ required: true, type: MongooseSchema.Types.ObjectId, ref: 'JobPosting' }) jobPostingId: string; @Prop({ required: true }) planName: string; } export const InterviewPlanSchema = SchemaFactory.createForClass(InterviewPlan); @Schema({ timestamps: true, collection: 'interview_rounds' }) export class InterviewRound extends Document { @Prop({ required: true, index: true }) tenantId: string; @Prop({ required: true, type: MongooseSchema.Types.ObjectId, ref: 'InterviewPlan' }) planId: string; @Prop({ required: true }) roundName: string; @Prop({ required: true }) sequence: number; } export const InterviewRoundSchema = SchemaFactory.createForClass(InterviewRound); @Schema({ timestamps: true, collection: 'interview_schedules' }) export class InterviewSchedule extends Document { @Prop({ required: true, index: true }) tenantId: string; @Prop({ required: true, type: MongooseSchema.Types.ObjectId, ref: 'JobApplication' }) applicationId: string; @Prop({ required: true, type: MongooseSchema.Types.ObjectId, ref: 'InterviewRound' }) roundId: string; @Prop({ required: true }) startAt: Date; @Prop({ required: true }) endAt: Date; @Prop({ type: [String], default: [] }) panelMembers: string[]; // employeeIds @Prop({ default: 'scheduled', enum: ['scheduled', 'completed', 'cancelled', 'no_show', 'rescheduled'] }) status: string; @Prop() calendarEventId?: string; // Links back to Enterprise Calendar platform eventId @Prop({ default: false }) feedbackLocked: boolean; // Locks feedback after deadline } export const InterviewScheduleSchema = SchemaFactory.createForClass(InterviewSchedule); @Schema({ timestamps: true, collection: 'interview_feedbacks' }) export class InterviewFeedback extends Document { @Prop({ required: true, index: true }) tenantId: string; @Prop({ required: true, type: MongooseSchema.Types.ObjectId, ref: 'InterviewSchedule' }) scheduleId: string; @Prop({ required: true }) interviewerId: string; // employeeId @Prop({ default: 0 }) rating: number; // Score card 1-5 @Prop() notes?: string; @Prop({ default: 'hire', enum: ['hire', 'strong_hire', 'no_hire', 'hold'] }) recommendation: string; } export const InterviewFeedbackSchema = SchemaFactory.createForClass(InterviewFeedback); InterviewFeedbackSchema.index({ tenantId: 1, scheduleId: 1, interviewerId: 1 }, { unique: true }); @Schema({ timestamps: true, collection: 'background_check_requests' }) export class BackgroundCheckRequest extends Document { @Prop({ required: true, index: true }) tenantId: string; @Prop({ required: true, type: MongooseSchema.Types.ObjectId, ref: 'Candidate' }) candidateId: string; @Prop({ default: false }) candidateConsentObtained: boolean; @Prop({ required: true, enum: ['Identity', 'Address', 'Employment', 'Education', 'Reference', 'Criminal', 'Credit', 'Drug'] }) checkType: string; @Prop({ default: 'pending', enum: ['pending', 'in_progress', 'passed', 'failed', 'exceptions'] }) status: string; @Prop() reportFileId?: string; @Prop() verifiedAt?: Date; } export const BackgroundCheckRequestSchema = SchemaFactory.createForClass(BackgroundCheckRequest); @Schema({ timestamps: true, collection: 'reference_checks' }) export class ReferenceCheck extends Document { @Prop({ required: true, index: true }) tenantId: string; @Prop({ required: true, type: MongooseSchema.Types.ObjectId, ref: 'Candidate' }) candidateId: string; @Prop({ required: true }) refereeName: string; @Prop({ required: true }) refereeEmail: string; @Prop() refereePhone?: string; @Prop({ type: MongooseSchema.Types.Mixed, default: {} }) questionnaireResponse: any; @Prop({ default: 'pending', enum: ['pending', 'responded', 'failed'] }) status: string; } export const ReferenceCheckSchema = SchemaFactory.createForClass(ReferenceCheck); |