ff-admin-server/src/entity/club/member/member.ts

63 lines
1.9 KiB
TypeScript
Raw Normal View History

2024-09-14 11:32:34 +02:00
import { Column, Entity, JoinColumn, ManyToOne, OneToMany, OneToOne, PrimaryColumn } from "typeorm";
import { membership } from "./membership";
import { memberAwards } from "./memberAwards";
import { memberQualifications } from "./memberQualifications";
import { memberExecutivePositions } from "./memberExecutivePositions";
import { communication } from "./communication";
2025-01-25 10:20:57 +01:00
import { salutation } from "../../settings/salutation";
2024-09-14 11:32:34 +02:00
@Entity()
export class member {
@PrimaryColumn({ generated: "increment", type: "int" })
id: number;
@Column({ type: "varchar", length: 255 })
firstname: string;
@Column({ type: "varchar", length: 255 })
lastname: string;
@Column({ type: "varchar", length: 255 })
nameaffix: string;
@Column({ type: "date" })
birthdate: Date;
2025-01-02 17:08:53 +01:00
@Column({ type: "varchar", length: 255, unique: true, nullable: true })
internalId?: string;
2025-01-25 10:20:57 +01:00
@Column()
salutationId: number;
2024-09-14 11:32:34 +02:00
@OneToMany(() => communication, (communications) => communications.member)
2024-12-23 14:00:50 +01:00
communications: communication[];
2024-09-14 11:32:34 +02:00
@OneToOne(() => communication, {
nullable: true,
onDelete: "SET NULL",
onUpdate: "RESTRICT",
})
@JoinColumn()
sendNewsletter?: communication;
2025-01-25 10:20:57 +01:00
@ManyToOne(() => salutation, (salutation) => salutation.members)
salutation: salutation;
2024-09-14 11:32:34 +02:00
@OneToMany(() => membership, (membership) => membership.member)
memberships: membership[];
@OneToMany(() => memberAwards, (awards) => awards.member)
awards: memberAwards[];
@OneToMany(() => memberExecutivePositions, (executivePositions) => executivePositions.member)
positions: memberExecutivePositions[];
@OneToMany(() => memberQualifications, (qualifications) => qualifications.member)
qualifications: memberQualifications[];
2024-09-16 15:55:41 +02:00
firstMembershipEntry?: membership;
lastMembershipEntry?: membership;
2024-09-17 16:44:39 +02:00
preferredCommunication?: Array<communication>;
2024-11-27 10:07:59 +01:00
smsAlarming?: Array<communication>;
2024-09-14 11:32:34 +02:00
}