Files
api/src/entity/Prestamo.ts
T

45 lines
784 B
TypeScript
Raw Normal View History

2020-08-18 11:13:12 -05:00
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
}