2017-04-03 20:33:18 +00:00
|
|
|
import 'rxjs/add/operator/map';
|
2017-05-20 21:55:08 +00:00
|
|
|
import { Entity, Column, PrimaryGeneratedColumn, ManyToOne } from "typeorm";
|
2017-04-30 14:55:15 +00:00
|
|
|
import { Product } from "./Product";
|
|
|
|
import { Unit } from "./Unit";
|
2017-04-03 20:33:18 +00:00
|
|
|
|
2017-05-20 21:55:08 +00:00
|
|
|
@Entity()
|
2017-04-03 20:33:18 +00:00
|
|
|
export class Item {
|
|
|
|
|
2017-05-20 21:55:08 +00:00
|
|
|
@PrimaryGeneratedColumn()
|
|
|
|
id: number;
|
2017-04-03 20:33:18 +00:00
|
|
|
|
2017-05-20 21:55:08 +00:00
|
|
|
@ManyToOne(type => Product, product => product.items)
|
|
|
|
product: Product;
|
2017-04-03 20:33:18 +00:00
|
|
|
|
2017-05-20 21:55:08 +00:00
|
|
|
@ManyToOne(type => Unit, unit => unit.items)
|
|
|
|
unit: Unit;
|
2017-04-03 20:33:18 +00:00
|
|
|
|
2017-05-20 21:55:08 +00:00
|
|
|
@Column("real")
|
|
|
|
amount: number;
|
2017-04-03 20:33:18 +00:00
|
|
|
|
2017-05-20 21:55:08 +00:00
|
|
|
@Column("real")
|
|
|
|
price: number;
|
2017-04-03 20:33:18 +00:00
|
|
|
|
2017-05-20 21:55:08 +00:00
|
|
|
}
|