import { Entity, Column } from "typeorm";
import { EntityBase } from "./base/Base";

@Entity("educationLevel")
export class EducationLevel extends EntityBase {
  @Column({
    nullable: true,
    comment: "ระดับการศึกษา",
    length: 255,
    default: null,
  })
  name: string;

  @Column({
    nullable: true,
    comment: "ระดับที่",
    default: null,
  })
  rank: number;

  @Column({
    nullable: true,
    comment: "ขีดจำกัดวุฒิการศึกษา",
    length: 50,
    default: null,
  })
  educationLevel?: string;

  @Column({
    nullable: true,
    comment: "วุฒิการศึกษาสูงสุด",
    default: null,
  })
  isHigh?: boolean;
}

export class CreateEducationLevel {
  @Column()
  name: string;

  @Column()
  rank: number;

  @Column()
  educationLevel?: string;

  @Column()
  isHigh?: boolean;
}

export type UpdateEducationLevel = Partial<CreateEducationLevel>;
