ff-admin-server/src/entity/memberQualifications.ts

36 lines
886 B
TypeScript
Raw Normal View History

2024-09-14 11:32:34 +02:00
import { Column, Entity, ManyToOne, PrimaryColumn } from "typeorm";
import { member } from "./member";
import { qualification } from "./qualification";
@Entity()
export class memberQualifications {
@PrimaryColumn({ generated: "increment", type: "int" })
id: number;
@Column({ type: "varchar", length: 255, nullable: true })
note?: string;
@Column({ type: "date" })
start: Date;
@Column({ type: "date", nullable: true })
end?: Date;
@Column({ type: "varchar", length: 255, nullable: true })
terminationReason?: string;
@ManyToOne(() => member, (member) => member.awards, {
nullable: false,
onDelete: "CASCADE",
onUpdate: "RESTRICT",
})
member: member;
@ManyToOne(() => qualification, (qualification) => qualification.members, {
nullable: false,
onDelete: "RESTRICT",
onUpdate: "RESTRICT",
})
qualification: qualification;
}