60 lines
1.5 KiB
TypeScript
60 lines
1.5 KiB
TypeScript
import { Column, Entity, ManyToOne, PrimaryColumn } from "typeorm";
|
|
import { member } from "./member";
|
|
import { communicationType } from "../../settings/communicationType";
|
|
|
|
@Entity()
|
|
export class communication {
|
|
@PrimaryColumn({ generated: "increment", type: "int" })
|
|
id: number;
|
|
|
|
@Column({ type: "boolean", default: false })
|
|
preferred: boolean;
|
|
|
|
@Column({ type: "boolean", default: false })
|
|
isSMSAlarming: boolean;
|
|
|
|
@Column({ type: "boolean", default: false })
|
|
isSendNewsletter: boolean;
|
|
|
|
@Column({ type: "varchar", length: 255, nullable: true })
|
|
mobile: string;
|
|
|
|
@Column({ type: "varchar", length: 255, nullable: true })
|
|
email: string;
|
|
|
|
@Column({ type: "varchar", length: 255, nullable: true })
|
|
postalCode: string;
|
|
|
|
@Column({ type: "varchar", length: 255, nullable: true })
|
|
city: string;
|
|
|
|
@Column({ type: "varchar", length: 255, nullable: true })
|
|
street: string;
|
|
|
|
@Column({ type: "integer", nullable: true })
|
|
streetNumber: number;
|
|
|
|
@Column({ type: "varchar", length: 255, nullable: true })
|
|
streetNumberAddition: string;
|
|
|
|
@Column()
|
|
memberId: string;
|
|
|
|
@Column()
|
|
typeId: number;
|
|
|
|
@ManyToOne(() => member, (member) => member.awards, {
|
|
nullable: false,
|
|
onDelete: "CASCADE",
|
|
onUpdate: "RESTRICT",
|
|
})
|
|
member: member;
|
|
|
|
@ManyToOne(() => communicationType, (communicationType) => communicationType.communications, {
|
|
nullable: false,
|
|
onDelete: "RESTRICT",
|
|
onUpdate: "RESTRICT",
|
|
cascade: ["insert"],
|
|
})
|
|
type: communicationType;
|
|
}
|