add server components for event_exceptions
This commit is contained in:
52
server/src/entity/event-exception.entity.ts
Normal file
52
server/src/entity/event-exception.entity.ts
Normal 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;
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user