2024-09-14 09:32:34 +00:00
|
|
|
import { Column, Entity, JoinColumn, ManyToOne, OneToMany, OneToOne, PrimaryColumn } from "typeorm";
|
|
|
|
import { Salutation } from "../enums/salutation";
|
|
|
|
import { membership } from "./membership";
|
|
|
|
import { memberAwards } from "./memberAwards";
|
|
|
|
import { memberQualifications } from "./memberQualifications";
|
|
|
|
import { memberExecutivePositions } from "./memberExecutivePositions";
|
|
|
|
import { communication } from "./communication";
|
2024-09-17 14:44:39 +00:00
|
|
|
import { CommunicationViewModel } from "../viewmodel/admin/communication.models";
|
2024-09-14 09:32:34 +00:00
|
|
|
|
|
|
|
@Entity()
|
|
|
|
export class member {
|
|
|
|
@PrimaryColumn({ generated: "increment", type: "int" })
|
|
|
|
id: number;
|
|
|
|
|
2024-09-16 05:24:41 +00:00
|
|
|
@Column({
|
|
|
|
type: "varchar",
|
|
|
|
length: "255",
|
|
|
|
default: Salutation.none.toString(),
|
|
|
|
transformer: {
|
|
|
|
to(value: Salutation) {
|
|
|
|
return value.toString();
|
|
|
|
},
|
|
|
|
from(value: string) {
|
|
|
|
return Salutation[value as keyof typeof Salutation];
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
2024-09-14 09:32:34 +00:00
|
|
|
salutation: Salutation;
|
|
|
|
|
|
|
|
@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;
|
|
|
|
|
|
|
|
@OneToMany(() => communication, (communications) => communications.member)
|
2024-12-23 13:00:50 +00:00
|
|
|
communications: communication[];
|
2024-09-14 09:32:34 +00:00
|
|
|
|
|
|
|
@OneToOne(() => communication, {
|
|
|
|
nullable: true,
|
|
|
|
onDelete: "SET NULL",
|
|
|
|
onUpdate: "RESTRICT",
|
|
|
|
})
|
|
|
|
@JoinColumn()
|
|
|
|
sendNewsletter?: communication;
|
|
|
|
|
|
|
|
@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 13:55:41 +00:00
|
|
|
|
|
|
|
firstMembershipEntry?: membership;
|
|
|
|
lastMembershipEntry?: membership;
|
2024-09-17 14:44:39 +00:00
|
|
|
preferredCommunication?: Array<communication>;
|
2024-11-27 09:07:59 +00:00
|
|
|
smsAlarming?: Array<communication>;
|
2024-09-14 09:32:34 +00:00
|
|
|
}
|