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 | import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; import { Document, Schema as MongooseSchema } from 'mongoose'; @Schema({ collection: 'salary_component_dependencies', timestamps: true }) export class SalaryComponentDependency extends Document { @Prop({ type: MongooseSchema.Types.ObjectId, required: true }) tenantId!: MongooseSchema.Types.ObjectId; @Prop({ type: MongooseSchema.Types.ObjectId, required: true }) componentId!: MongooseSchema.Types.ObjectId; @Prop({ type: MongooseSchema.Types.ObjectId, required: true }) dependsOnComponentId!: MongooseSchema.Types.ObjectId; @Prop({ default: 'formula', enum: ['formula', 'percentage', 'slab'] }) dependencyType!: string; } export const SalaryComponentDependencySchema = SchemaFactory.createForClass( SalaryComponentDependency, ); SalaryComponentDependencySchema.index({ tenantId: 1, componentId: 1 }); |