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; }