ff-admin-server/src/entity/club/protocol/protocol.ts

44 lines
1.5 KiB
TypeScript
Raw Normal View History

import { Column, ColumnType, Entity, OneToMany, PrimaryColumn } from "typeorm";
2025-01-29 16:49:34 +01:00
import { protocolAgenda } from "./protocolAgenda";
import { protocolDecision } from "./protocolDecision";
import { protocolPresence } from "./protocolPresence";
import { protocolPrintout } from "./protocolPrintout";
import { protocolVoting } from "./protocolVoting";
import { getTypeByORM } from "../../../migrations/ormHelper";
2024-10-03 13:31:05 +02:00
@Entity()
export class protocol {
@PrimaryColumn({ generated: "increment", type: "int" })
id: number;
2025-01-28 11:09:42 +01:00
@Column({ type: "varchar", length: 255, unique: true })
2024-10-03 13:31:05 +02:00
title: string;
@Column({ type: getTypeByORM("date").type as ColumnType })
2024-10-03 13:31:05 +02:00
date: Date;
2024-10-04 12:47:13 +02:00
@Column({ type: getTypeByORM("time").type as ColumnType, nullable: true })
2024-10-04 12:47:13 +02:00
starttime: Date;
@Column({ type: getTypeByORM("time").type as ColumnType, nullable: true })
2024-10-04 12:47:13 +02:00
endtime: Date;
2024-10-14 17:03:33 +02:00
@Column({ type: "text", nullable: true })
2024-10-04 12:47:13 +02:00
summary: string;
2025-01-29 16:49:34 +01:00
@OneToMany(() => protocolAgenda, (agenda) => agenda.protocol, { cascade: ["insert"] })
agendas: protocolAgenda[];
@OneToMany(() => protocolDecision, (decision) => decision.protocol, { cascade: ["insert"] })
decisions: protocolDecision[];
@OneToMany(() => protocolPresence, (presence) => presence.protocol, { cascade: ["insert"] })
presences: protocolPresence[];
@OneToMany(() => protocolPrintout, (printout) => printout.protocol, { cascade: ["insert"] })
printouts: protocolPrintout[];
@OneToMany(() => protocolVoting, (voting) => voting.protocol, { cascade: ["insert"] })
votings: protocolVoting[];
2024-10-03 13:31:05 +02:00
}