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

60 lines
1.5 KiB
TypeScript
Raw Normal View History

2025-01-03 19:26:33 +01:00
import { Column, 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 { communicationType } from "../../settings/communicationType";
2024-09-04 11:36:52 +02:00
@Entity()
export class communication {
@PrimaryColumn({ generated: "increment", type: "int" })
id: number;
@Column({ type: "boolean", default: false })
2024-09-16 07:24:41 +02:00
preferred: boolean;
2024-09-04 11:36:52 +02:00
2024-11-27 10:07:59 +01:00
@Column({ type: "boolean", default: false })
isSMSAlarming: boolean;
@Column({ type: "boolean", default: false })
isSendNewsletter: boolean;
2024-09-27 14:55:34 +02:00
@Column({ type: "varchar", length: 255, nullable: true })
2024-09-04 11:36:52 +02:00
mobile: string;
2024-09-27 14:55:34 +02:00
@Column({ type: "varchar", length: 255, nullable: true })
2024-09-04 11:36:52 +02:00
email: string;
2025-01-03 19:26:33 +01:00
@Column({ type: "varchar", length: 255, nullable: true })
postalCode: string;
2024-09-27 14:55:34 +02:00
@Column({ type: "varchar", length: 255, nullable: true })
2024-09-04 11:36:52 +02:00
city: string;
2024-09-27 14:55:34 +02:00
@Column({ type: "varchar", length: 255, nullable: true })
2024-09-04 11:36:52 +02:00
street: string;
2024-09-27 14:55:34 +02:00
@Column({ type: "integer", nullable: true })
2024-09-04 11:36:52 +02:00
streetNumber: number;
2024-09-27 14:55:34 +02:00
@Column({ type: "varchar", length: 255, nullable: true })
2024-09-04 11:36:52 +02:00
streetNumberAddition: string;
2025-01-03 19:26:33 +01:00
@Column()
memberId: number;
@Column()
typeId: number;
2025-01-13 11:16:35 +01:00
@ManyToOne(() => member, (member) => member.awards, {
2024-09-04 11:36:52 +02:00
nullable: false,
2025-01-13 11:16:35 +01:00
onDelete: "CASCADE",
onUpdate: "RESTRICT",
2024-09-04 11:36:52 +02:00
})
2025-01-13 11:16:35 +01:00
member: member;
2024-09-04 11:36:52 +02:00
2025-01-13 11:16:35 +01:00
@ManyToOne(() => communicationType, (communicationType) => communicationType.communications, {
2024-09-14 11:32:34 +02:00
nullable: false,
2025-01-13 11:16:35 +01:00
onDelete: "RESTRICT",
2024-09-14 11:32:34 +02:00
onUpdate: "RESTRICT",
})
2025-01-13 11:16:35 +01:00
type: communicationType;
2024-09-04 11:36:52 +02:00
}