import {
  Entity,
  PrimaryGeneratedColumn,
  Column,
  OneToMany
} from "typeorm";
import { Student } from "./Student";
import { Course } from "./Course";

@Entity()
export class TypeStudent {
  @PrimaryGeneratedColumn()
  id!: number;

  @Column()
  name!: string;

  @Column("text")
  description!: string;

  @Column({ default: false })
  allSudent: boolean = false;

  @Column({ default: true })
  enable: boolean = true;

  @OneToMany(() => Student, student => student.TypeStudent)
  Students!: Student[];

  @OneToMany(() => Course, course => course.TypeStudent)
  Courses!: Course[];
}
