import { Column, Entity, JoinColumn, ManyToOne, PrimaryColumn } from "typeorm"; import { member } from "./member"; import { membership_status } from "./membership_status"; @Entity() export class membership { @PrimaryColumn({ generated: "increment", type: "int" }) id: number; @Column({ type: "date" }) start: Date; @Column({ type: "date", nullable: true, default: null }) end?: Date; @Column({ type: "varchar", length: 255, nullable: true }) termination_reason?: string; @ManyToOne(() => member, (member) => member.memberships) @JoinColumn() member: member; @ManyToOne(() => membership_status, (membership_status) => membership_status.memberships) @JoinColumn() status: membership_status; }