2024-08-21 12:13:39 +00:00
|
|
|
import { Column, Entity, ManyToOne, OneToMany, OneToOne, PrimaryColumn } from "typeorm";
|
2024-08-19 10:47:10 +00:00
|
|
|
import { Salutation } from "../enums/salutation";
|
|
|
|
import { membership } from "./membership";
|
|
|
|
import { member_awards } from "./member_awards";
|
2024-08-21 12:13:39 +00:00
|
|
|
import { member_qualifications } from "./member_qualifications";
|
|
|
|
import { member_executive_positions } from "./member_executive_positions";
|
|
|
|
import { communication } from "./communication";
|
2024-08-17 14:38:08 +00:00
|
|
|
|
|
|
|
@Entity()
|
|
|
|
export class member {
|
2024-08-21 12:13:39 +00:00
|
|
|
@PrimaryColumn({ generated: "increment", type: "int" })
|
|
|
|
id: number;
|
2024-08-19 10:47:10 +00:00
|
|
|
|
|
|
|
@Column({ type: "varchar", length: 255, unique: true, nullable: true })
|
|
|
|
member_id?: string;
|
|
|
|
|
2024-08-21 12:13:39 +00:00
|
|
|
@Column({ type: "enum", enum: Salutation, default: Salutation.none })
|
|
|
|
salutation: Salutation;
|
2024-08-17 14:38:08 +00:00
|
|
|
|
|
|
|
@Column({ type: "varchar", length: 255 })
|
|
|
|
firstname: string;
|
|
|
|
|
|
|
|
@Column({ type: "varchar", length: 255 })
|
|
|
|
lastname: string;
|
|
|
|
|
|
|
|
@Column({ type: "varchar", length: 255 })
|
2024-08-21 12:13:39 +00:00
|
|
|
nameaffix: string;
|
2024-08-17 14:38:08 +00:00
|
|
|
|
|
|
|
@Column({ type: "date" })
|
|
|
|
birthdate: Date;
|
|
|
|
|
|
|
|
@Column({ type: "date", nullable: true, default: null })
|
2024-08-19 10:47:10 +00:00
|
|
|
deathdate?: Date;
|
2024-08-17 14:38:08 +00:00
|
|
|
|
2024-08-21 12:13:39 +00:00
|
|
|
@Column({ type: "varchar", length: 255, unique: true, nullable: true })
|
|
|
|
sepa_mandat?: string;
|
2024-08-19 10:47:10 +00:00
|
|
|
|
2024-08-21 12:13:39 +00:00
|
|
|
@ManyToOne(() => communication, (member_communications) => member_communications.member)
|
|
|
|
communications: communication;
|
2024-08-19 10:47:10 +00:00
|
|
|
|
2024-08-21 12:13:39 +00:00
|
|
|
@OneToOne(() => communication, {
|
2024-08-19 10:47:10 +00:00
|
|
|
nullable: true,
|
|
|
|
})
|
2024-08-21 12:13:39 +00:00
|
|
|
sendNewsletter: communication;
|
|
|
|
|
|
|
|
@OneToMany(() => membership, (membership) => membership.member)
|
|
|
|
memberships: membership[];
|
2024-08-19 10:47:10 +00:00
|
|
|
|
2024-08-21 12:13:39 +00:00
|
|
|
@OneToMany(() => member_executive_positions, (member_executive_positions) => member_executive_positions.member, {
|
2024-08-17 14:38:08 +00:00
|
|
|
onDelete: "CASCADE",
|
|
|
|
})
|
2024-08-21 12:13:39 +00:00
|
|
|
positions: member_executive_positions[];
|
2024-08-17 14:38:08 +00:00
|
|
|
|
2024-08-21 12:13:39 +00:00
|
|
|
@OneToMany(() => member_qualifications, (qualification) => qualification.member, {
|
2024-08-17 14:38:08 +00:00
|
|
|
onDelete: "CASCADE",
|
|
|
|
})
|
2024-08-21 12:13:39 +00:00
|
|
|
qualifications: member_qualifications[];
|
2024-08-19 10:47:10 +00:00
|
|
|
|
|
|
|
@OneToMany(() => member_awards, (awards) => awards.member, {
|
|
|
|
onDelete: "CASCADE",
|
|
|
|
})
|
|
|
|
awards: member_awards[];
|
2024-08-17 14:38:08 +00:00
|
|
|
}
|