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

54 lines
1 KiB
TypeScript
Raw Normal View History

2024-10-28 16:02:56 +01:00
import {
Column,
Entity,
ManyToOne,
PrimaryColumn,
PrimaryGeneratedColumn,
CreateDateColumn,
UpdateDateColumn,
2024-11-07 10:49:34 +01:00
AfterUpdate,
BeforeUpdate,
2024-10-28 16:02:56 +01:00
} from "typeorm";
2025-01-05 14:14:00 +01:00
import { calendarType } from "../settings/calendarType";
2024-10-26 15:08:05 +02:00
@Entity()
export class calendar {
2024-10-28 16:02:56 +01:00
@PrimaryGeneratedColumn("uuid")
id: string;
2024-10-26 15:08:05 +02:00
2024-10-28 16:02:56 +01:00
@Column({ type: "datetime", nullable: false })
2024-10-26 15:08:05 +02:00
starttime: Date;
2024-10-28 16:02:56 +01:00
@Column({ type: "datetime", nullable: false })
2024-10-26 15:08:05 +02:00
endtime: Date;
@Column({ type: "varchar", length: 255, nullable: false })
title: string;
@Column({ type: "text", nullable: true })
content: string;
2024-10-28 16:02:56 +01:00
@Column({ type: "text", nullable: true })
location: string;
@Column({ type: "boolean", default: false })
allDay: boolean;
2024-11-07 10:49:34 +01:00
@Column({ type: "int", default: 1 })
sequence: number;
2024-10-28 16:02:56 +01:00
@CreateDateColumn()
createdAt: Date;
@UpdateDateColumn()
updatedAt: Date;
2024-10-26 15:08:05 +02:00
@ManyToOne(() => calendarType, (t) => t.calendar, {
nullable: false,
onDelete: "RESTRICT",
onUpdate: "RESTRICT",
2025-01-29 16:49:34 +01:00
cascade: ["insert"],
2024-10-26 15:08:05 +02:00
})
type: calendarType;
}