1
0
mirror of https://github.com/malumantovanelli/econocart.git synced 2024-06-26 04:40:16 +00:00
econocart/src/entities/Necessidade.ts

27 lines
768 B
TypeScript
Raw Normal View History

2017-05-21 19:48:08 +00:00
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, OneToMany } from "typeorm";
import { EntidadeAbstrata } from "./_entidadeAbstrata";
2017-05-21 00:16:17 +00:00
import { Produto } from "./Produto";
import { Consulta } from "./Consulta";
import { Planejamento } from "./Planejamento";
2017-05-21 19:48:08 +00:00
@Entity()
2017-05-21 00:16:17 +00:00
export class Necessidade extends EntidadeAbstrata {
2017-05-21 19:48:08 +00:00
@PrimaryGeneratedColumn()
id: number;
2017-05-21 00:16:17 +00:00
@Column('float')
2017-05-21 19:48:08 +00:00
quantidade: number = 0;
2017-05-21 00:16:17 +00:00
@Column()
2017-05-21 19:48:08 +00:00
satisfeita: boolean = false;
2017-05-21 00:16:17 +00:00
2017-05-23 07:01:18 +00:00
@ManyToOne(type => Produto, other => other.necessidades)
produto: Produto = null;
2017-05-21 00:16:17 +00:00
@OneToMany(type => Consulta, other => other.necessidade)
2017-05-21 19:48:08 +00:00
consultas: Consulta[] = [];
2017-05-21 00:16:17 +00:00
@ManyToOne(type => Planejamento, other => other.necessidades)
2017-05-21 19:48:08 +00:00
planejamento: Planejamento = null;
2017-05-21 00:16:17 +00:00
}