Spaces:
Sleeping
Sleeping
File size: 914 Bytes
f5957a1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | import {
Entity,
PrimaryGeneratedColumn,
Column,
CreateDateColumn,
ManyToOne,
JoinColumn,
} from 'typeorm';
import { User } from '../../auth/entities/user.entity';
@Entity('system_alerts')
export class SystemAlert {
@PrimaryGeneratedColumn({ type: 'bigint', unsigned: true })
id: number;
@Column({ type: 'varchar', length: 200 })
name: string;
@Column({ type: 'text', nullable: true })
description: string;
@Column({ name: 'condition_type', type: 'varchar', length: 100 })
conditionType: string;
@Column({ type: 'float' })
threshold: number;
@Column({ name: 'is_active', type: 'tinyint', default: 1 })
isActive: boolean;
@CreateDateColumn({ name: 'created_at' })
createdAt: Date;
@Column({ name: 'updated_by', type: 'bigint', unsigned: true, nullable: true })
updatedBy: number;
@ManyToOne(() => User)
@JoinColumn({ name: 'updated_by' })
updater: User;
}
|