All files / learning/schemas configuration.schema.ts

100% Statements 39/39
80% Branches 8/10
100% Functions 0/0
100% Lines 37/37

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 1051x 1x     1x   1x     1x     1x     1x     1x     1x     1x     1x     1x     1x     1x     1x     1x     1x     1x     1x     1x     1x     1x     1x     1x     1x     1x     1x     1x     1x     1x     1x     1x     1x     1x     1x     1x 1x  
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { Document, Schema as MongooseSchema } from 'mongoose';
 
@Schema({ timestamps: true, collection: 'learning_configurations' })
export class LearningConfiguration extends Document {
  @Prop({ type: MongooseSchema.Types.ObjectId, required: true, index: true })
  tenantId: MongooseSchema.Types.ObjectId;
 
  @Prop({ default: true })
  learningEnabled: boolean;
 
  @Prop({ default: true })
  selfEnrollmentEnabled: boolean;
 
  @Prop({ default: false })
  managerApprovalRequired: boolean;
 
  @Prop({ default: false })
  trainingRequestApprovalRequired: boolean;
 
  @Prop({ default: true })
  externalTrainingEnabled: boolean;
 
  @Prop({ default: true })
  classroomTrainingEnabled: boolean;
 
  @Prop({ default: true })
  virtualTrainingEnabled: boolean;
 
  @Prop({ default: true })
  selfPacedLearningEnabled: boolean;
 
  @Prop({ default: true })
  blendedLearningEnabled: boolean;
 
  @Prop({ default: true })
  assessmentEnabled: boolean;
 
  @Prop({ default: true })
  certificationEnabled: boolean;
 
  @Prop({ default: true })
  complianceTrainingEnabled: boolean;
 
  @Prop({ default: true })
  mandatoryTrainingEnabled: boolean;
 
  @Prop({ default: true })
  courseVersioningEnabled: boolean;
 
  @Prop({ default: false })
  contentApprovalRequired: boolean;
 
  @Prop({ default: false })
  instructorApprovalRequired: boolean;
 
  @Prop({ default: true })
  aiRecommendationsEnabled: boolean;
 
  @Prop({ default: true })
  skillBasedRecommendationsEnabled: boolean;
 
  @Prop({ default: false })
  offlineLearningEnabled: boolean;
 
  @Prop({ default: true })
  courseDiscussionEnabled: boolean;
 
  @Prop({ default: true })
  courseFeedbackEnabled: boolean;
 
  @Prop({ default: true })
  gamificationEnabled: boolean;
 
  @Prop({ default: true })
  certificateExpiryAlertsEnabled: boolean;
 
  @Prop({ default: true })
  recertificationEnabled: boolean;
 
  @Prop({ default: 80 })
  defaultPassingPercentage: number;
 
  @Prop({ default: 3 })
  defaultAttemptLimit: number;
 
  @Prop({ default: 'completed_all_lessons' })
  defaultCompletionRule: string;
 
  @Prop({ type: MongooseSchema.Types.ObjectId })
  defaultCertificateTemplateId: MongooseSchema.Types.ObjectId;
 
  @Prop({ default: 'UTC' })
  defaultTimezone: string;
 
  @Prop({ default: 'en' })
  defaultLocale: string;
 
  @Prop({ default: 365 })
  learningRecordRetentionDays: number;
}
 
export const LearningConfigurationSchema = SchemaFactory.createForClass(LearningConfiguration);
LearningConfigurationSchema.index({ tenantId: 1 });