2024-08-23 07:10:40 +00:00
|
|
|
import { Column, Entity, JoinColumn, ManyToOne, OneToMany, OneToOne, PrimaryColumn } from "typeorm";
|
2024-08-19 10:47:10 +00:00
|
|
|
import { Salutation } from "../enums/salutation";
|
|
|
|
import { membership } from "./membership";
|
2024-08-23 07:10:40 +00:00
|
|
|
import { memberAwards } from "./memberAwards";
|
|
|
|
import { memberQualifications } from "./memberQualifications";
|
|
|
|
import { memberExecutivePositions } from "./memberExecutivePositions";
|
2024-08-21 12:13:39 +00:00
|
|
|
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
|
|
|
|
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;
|
|
|
|
|
2024-08-21 12:13:39 +00:00
|
|
|
@Column({ type: "varchar", length: 255, unique: true, nullable: true })
|
2024-08-23 07:10:40 +00:00
|
|
|
sepaMandat?: string;
|
2024-08-19 10:47:10 +00:00
|
|
|
|
2024-08-23 07:10:40 +00:00
|
|
|
@OneToMany(() => communication, (communications) => communications.member)
|
2024-08-21 12:13:39 +00:00
|
|
|
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-23 07:10:40 +00:00
|
|
|
@JoinColumn()
|
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-23 07:10:40 +00:00
|
|
|
@OneToMany(() => memberExecutivePositions, (executivePositions) => executivePositions.member, {
|
2024-08-17 14:38:08 +00:00
|
|
|
onDelete: "CASCADE",
|
|
|
|
})
|
2024-08-23 07:10:40 +00:00
|
|
|
positions: memberExecutivePositions[];
|
2024-08-17 14:38:08 +00:00
|
|
|
|
2024-08-23 07:10:40 +00:00
|
|
|
@OneToMany(() => memberQualifications, (qualifications) => qualifications.member, {
|
2024-08-17 14:38:08 +00:00
|
|
|
onDelete: "CASCADE",
|
|
|
|
})
|
2024-08-23 07:10:40 +00:00
|
|
|
qualifications: memberQualifications[];
|
2024-08-19 10:47:10 +00:00
|
|
|
|
2024-08-23 07:10:40 +00:00
|
|
|
@OneToMany(() => memberAwards, (awards) => awards.member, {
|
2024-08-19 10:47:10 +00:00
|
|
|
onDelete: "CASCADE",
|
|
|
|
})
|
2024-08-23 07:10:40 +00:00
|
|
|
awards: memberAwards[];
|
2024-08-17 14:38:08 +00:00
|
|
|
}
|