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

@Entity('agent_sessions')
export class AgentSession {
  @PrimaryGeneratedColumn('uuid')
  id!: string;

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

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

  @Column({ type: 'varchar', length: 20, default: 'active' })
  status!: 'active' | 'completed' | 'cancelled' | 'error';

  @Column({ type: 'text', nullable: true })
  systemPrompt?: string;

  @Column({ type: 'jsonb', default: {} })
  metadata!: Record<string, unknown>;

  @CreateDateColumn({ type: 'timestamptz' })
  createdAt!: Date;

  @UpdateDateColumn({ type: 'timestamptz' })
  updatedAt!: Date;
}
