add event object

This commit is contained in:
Roland Schneider
2025-11-20 15:08:32 +01:00
parent d635ba0986
commit 635975207f
27 changed files with 1224 additions and 92 deletions

View File

@@ -0,0 +1,54 @@
// dvbooking-cli/src/templates/nestjs/entity.ts.tpl
import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';
import {
IsString,
IsNumber,
IsBoolean,
IsDate,
IsOptional,
} from 'class-validator';
@Entity({ name: 'events' })
export class Event {
@PrimaryGeneratedColumn()
id: number;
@Column({ type: 'bigint', nullable: true })
@IsOptional()
@IsNumber()
event_type_id: number | null;
@Column()
@IsString()
title: string;
@Column({ type: 'text', nullable: true })
@IsOptional()
@IsString()
description: string | null;
@Column()
@IsDate()
start_time: Date;
@Column()
@IsDate()
end_time: Date;
@Column()
@IsString()
timezone: string;
@Column({ default: false })
@IsBoolean()
is_recurring: boolean = false;
@Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
@IsDate()
created_at: Date;
@Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
@IsDate()
updated_at: Date;
}