45 lines
784 B
TypeScript
45 lines
784 B
TypeScript
|
|
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne } from 'typeorm'
|
||
|
|
import { Usuario } from './Usuario'
|
||
|
|
import { Reporte } from './Reporte'
|
||
|
|
import { Equipo } from './Equipo'
|
||
|
|
import { Mesa } from './Mesa'
|
||
|
|
|
||
|
|
@Entity()
|
||
|
|
export class Prestamo {
|
||
|
|
@PrimaryGeneratedColumn()
|
||
|
|
id: number
|
||
|
|
|
||
|
|
@Column()
|
||
|
|
activo: boolean
|
||
|
|
|
||
|
|
@Column({ type: 'date' })
|
||
|
|
fechaInicio: string
|
||
|
|
|
||
|
|
@Column({ type: 'date' })
|
||
|
|
fechaFin: string
|
||
|
|
|
||
|
|
@ManyToOne(
|
||
|
|
(type) => Usuario,
|
||
|
|
(usuario) => usuario.prestamos
|
||
|
|
)
|
||
|
|
usuario: Usuario
|
||
|
|
|
||
|
|
@ManyToOne(
|
||
|
|
(type) => Mesa,
|
||
|
|
(mesa) => mesa.prestamos
|
||
|
|
)
|
||
|
|
mesa: Mesa
|
||
|
|
|
||
|
|
@ManyToOne(
|
||
|
|
(type) => Reporte,
|
||
|
|
(reporte) => reporte.prestamos
|
||
|
|
)
|
||
|
|
reporte: Reporte
|
||
|
|
|
||
|
|
@ManyToOne(
|
||
|
|
(type) => Equipo,
|
||
|
|
(equipo) => equipo.prestamos
|
||
|
|
)
|
||
|
|
equipo: Equipo
|
||
|
|
}
|