2025-02-01 13:11:10 +01:00
|
|
|
import { Column, ColumnType, Entity, ManyToOne, PrimaryColumn } from "typeorm";
|
2024-09-14 11:32:34 +02:00
|
|
|
import { member } from "./member";
|
2025-01-05 14:14:00 +01:00
|
|
|
import { qualification } from "../../settings/qualification";
|
2025-02-01 13:11:10 +01:00
|
|
|
import { getTypeByORM } from "../../../migrations/ormHelper";
|
2024-09-14 11:32:34 +02:00
|
|
|
|
|
|
|
@Entity()
|
|
|
|
export class memberQualifications {
|
|
|
|
@PrimaryColumn({ generated: "increment", type: "int" })
|
|
|
|
id: number;
|
|
|
|
|
|
|
|
@Column({ type: "varchar", length: 255, nullable: true })
|
|
|
|
note?: string;
|
|
|
|
|
2025-02-01 13:11:10 +01:00
|
|
|
@Column({ type: getTypeByORM("date").type as ColumnType })
|
2024-09-14 11:32:34 +02:00
|
|
|
start: Date;
|
|
|
|
|
2025-02-01 13:11:10 +01:00
|
|
|
@Column({ type: getTypeByORM("date").type as ColumnType, nullable: true })
|
2024-09-14 11:32:34 +02:00
|
|
|
end?: Date;
|
|
|
|
|
|
|
|
@Column({ type: "varchar", length: 255, nullable: true })
|
|
|
|
terminationReason?: string;
|
|
|
|
|
2025-01-02 17:08:53 +01:00
|
|
|
@Column()
|
2025-01-29 08:53:49 +01:00
|
|
|
memberId: string;
|
2025-01-02 17:08:53 +01:00
|
|
|
|
|
|
|
@Column()
|
|
|
|
qualificationId: number;
|
|
|
|
|
2024-09-14 11:32:34 +02:00
|
|
|
@ManyToOne(() => member, (member) => member.awards, {
|
|
|
|
nullable: false,
|
|
|
|
onDelete: "CASCADE",
|
|
|
|
onUpdate: "RESTRICT",
|
|
|
|
})
|
|
|
|
member: member;
|
|
|
|
|
|
|
|
@ManyToOne(() => qualification, (qualification) => qualification.members, {
|
|
|
|
nullable: false,
|
|
|
|
onDelete: "RESTRICT",
|
|
|
|
onUpdate: "RESTRICT",
|
2025-01-29 16:49:34 +01:00
|
|
|
cascade: ["insert"],
|
2024-09-14 11:32:34 +02:00
|
|
|
})
|
|
|
|
qualification: qualification;
|
|
|
|
}
|