modulos
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import {
|
||||
Entity,
|
||||
Column,
|
||||
PrimaryGeneratedColumn,
|
||||
OneToMany,
|
||||
ManyToOne,
|
||||
JoinColumn,
|
||||
} from 'typeorm';
|
||||
import { Carrito } from '../../carrito/carrito.entity';
|
||||
import { Institucion } from '../../institucion/institucion.entity';
|
||||
|
||||
@Entity()
|
||||
export class Modulo {
|
||||
@PrimaryGeneratedColumn()
|
||||
id_modulo: number;
|
||||
|
||||
@Column({ type: String, nullable: false, length: 50 })
|
||||
modulo: string;
|
||||
|
||||
@Column({ type: Boolean, nullable: false, default: false })
|
||||
activo: boolean;
|
||||
|
||||
@ManyToOne(() => Institucion, (institucion) => institucion.modulos, {
|
||||
eager: true,
|
||||
})
|
||||
@JoinColumn({ name: 'id_institucion' })
|
||||
institucion: Institucion;
|
||||
|
||||
@OneToMany(() => Carrito, (carrito) => carrito.modulo)
|
||||
carritos: Carrito[];
|
||||
}
|
||||
Reference in New Issue
Block a user