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

@Entity('escalation_policies')
export class EscalationPolicy {
  @PrimaryGeneratedColumn('uuid')
  id!: string;

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

  @Column({ type: 'varchar', length: 100 })
  name!: string;

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

  @Column({ type: 'jsonb' })
  steps!: Array<{
    delaySeconds: number;
    channel: string;
    contactIds?: string[];
  }>;

  @Column({ type: 'boolean', default: false })
  isDefault!: boolean;
}
