import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';

@Entity('metric_snapshots')
export class MetricSnapshot {
  @PrimaryGeneratedColumn({ type: 'bigint' })
  id!: number;

  @Column({ type: 'varchar', length: 20 })
  tenantId!: string;

  @Column({ type: 'uuid' })
  serverId!: string;

  @Column({ type: 'varchar', length: 50 })
  metricType!: string;

  @Column({ type: 'double precision' })
  value!: number;

  @Column({ type: 'timestamptz', default: () => 'NOW()' })
  recordedAt!: Date;
}
