members-database/entities/communication.ts

39 lines
953 B
TypeScript
Raw Normal View History

import { Column, Entity, ManyToOne, PrimaryColumn } from "typeorm";
import { member } from "./member";
import { CommunicationType } from "../enums/membership_type";
@Entity()
export class communication {
@PrimaryColumn({ generated: "increment", type: "int" })
id: number;
@Column({ type: "enum", enum: CommunicationType, default: CommunicationType.Phone })
type: CommunicationType;
@Column({ type: "boolean", default: false })
preffered: boolean;
@Column({ type: "varchar", length: 255 })
mobile: string;
@Column({ type: "varchar", length: 255 })
email: string;
@Column({ type: "varchar", length: 255 })
city: string;
@Column({ type: "varchar", length: 255 })
street: string;
@Column({ type: "integer" })
streetnumber: number;
@Column({ type: "varchar", length: 255 })
streetnumber_addition: string;
@ManyToOne(() => member, (member) => member.awards, {
onDelete: "RESTRICT",
})
member: member;
}