Contract.ts 632 Bytes
import {
  Entity,
  CreateDateColumn,
  PrimaryGeneratedColumn,
  Column,
  ManyToMany,
  ManyToOne,
  EntityOptions,
  OneToMany,
  OneToOne
} from "typeorm";

import User from "./User";
import Drone from "./Drone";
import Org from "./Org";

@Entity("contracts")
export default class Contract {
  @PrimaryGeneratedColumn() id: string;
  @Column() reason: string;
  @Column() date: string;
  @Column() area: string;
  @Column() address: string;
  @Column() status: string;
  @Column() review: string;

  @ManyToOne(type => User)
  writer: User;

  @ManyToOne(type => Drone)
  drone: Drone;

  @ManyToOne(type => Org)
  org: Org;
}