import { Column, CreateDateColumn, Entity, PrimaryGeneratedColumn } from 'typeorm'; @Entity('users') export class User { @PrimaryGeneratedColumn('uuid') id!: string; @Column({ unique: true }) email!: string; @Column({ type: 'varchar', length: 120, nullable: true }) name!: string | null; @Column() passwordHash!: string; @Column({ type: 'varchar', length: 255, nullable: true }) refreshTokenHash!: string | null; /** * Center-scoped admin flag. At most one user should have this set at a * time; the cli `user set-admin` enforces single-admin by clearing all * other admins before promoting the target user. Guild backends learn * the current admin via `GET /admin-email`. * * Use: triage channels deliver every message to the admin as a silent * observer (wake=false) regardless of on-duty / mention status, so a * single human can audit all triage traffic. */ @Column({ type: 'tinyint', default: 0, name: 'isAdmin' }) isAdmin!: boolean; @CreateDateColumn() createdAt!: Date; }