add server components for event_exceptions

This commit is contained in:
Roland Schneider
2025-11-20 16:01:22 +01:00
parent 4699f16b71
commit c28431e80c
10 changed files with 301 additions and 10 deletions

View File

@@ -0,0 +1,52 @@
// 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: 'event_exceptions' })
export class EventException {
@PrimaryGeneratedColumn()
id: number;
@Column()
@IsNumber()
event_id: number;
@Column()
@IsDate()
original_start_time: Date;
@Column({ default: false })
@IsBoolean()
is_cancelled: boolean = false;
@Column({ type: 'timestamp with time zone', nullable: true })
@IsOptional()
@IsDate()
new_start_time: Date | null;
@Column({ type: 'timestamp with time zone', nullable: true })
@IsOptional()
@IsDate()
new_end_time: Date | null;
@Column({ type: 'character varying', nullable: true })
@IsOptional()
@IsString()
title: string | null;
@Column({ type: 'text', nullable: true })
@IsOptional()
@IsString()
description: string | null;
@Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
@IsDate()
created_at: Date;
}

View File

@@ -1,11 +1,13 @@
// dvbooking-cli/src/templates/nestjs/entity.ts.tpl
import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';
import { IsString, IsNumber, IsBoolean, IsDate, IsOptional } from 'class-validator';
import {
IsString,
IsOptional,
} from 'class-validator';
@Entity({ name: 'event_type' })
export class EventType {
@PrimaryGeneratedColumn()
id: number;
@@ -22,5 +24,4 @@ export class EventType {
@IsOptional()
@IsString()
color: string | null;
}
}

View File

@@ -1,11 +1,10 @@
// dvbooking-cli/src/templates/nestjs/entity.ts.tpl
import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';
import { IsString, IsNumber, IsBoolean, IsDate, IsOptional } from 'class-validator';
import { IsString, IsNumber, IsBoolean, IsOptional } from 'class-validator';
@Entity({ name: 'products' })
export class Product {
@PrimaryGeneratedColumn()
id: number;
@@ -22,5 +21,4 @@ export class Product {
@IsOptional()
@IsBoolean()
is_available: boolean | null = true;
}
}