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