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