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 | import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; import { Document, Schema as MongooseSchema } from 'mongoose'; @Schema({ collection: 'task_dependencies', timestamps: true }) export class TaskDependency extends Document { @Prop({ type: MongooseSchema.Types.ObjectId, required: true, index: true }) tenantId!: MongooseSchema.Types.ObjectId; @Prop({ type: MongooseSchema.Types.ObjectId, required: true }) predecessorTaskId!: MongooseSchema.Types.ObjectId; @Prop({ type: MongooseSchema.Types.ObjectId, required: true }) successorTaskId!: MongooseSchema.Types.ObjectId; @Prop({ required: true, enum: ['FS', 'SS', 'FF', 'SF'] }) type!: string; @Prop({ default: 0 }) lagDays!: number; } export const TaskDependencySchema = SchemaFactory.createForClass(TaskDependency); TaskDependencySchema.index( { tenantId: 1, predecessorTaskId: 1, successorTaskId: 1 }, { unique: true }, ); |