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

@Entity({ name: 'avatar_generation_requests' })
export class AvatarGenerationRequestOrmEntity {
  @PrimaryColumn({ type: 'uuid' })
  id!: string;

  @Index()
  @Column({ type: 'text' })
  userId!: string;

  @Column({ type: 'text' })
  facePhotoUrl!: string;

  @Column({ type: 'text' })
  suitColor!: string;

  @Column({ type: 'text' })
  style!: string;

  @Column({ type: 'text' })
  status!: string;

  @Column({ type: 'jsonb' })
  generatedAvatarUrls!: string[];

  @Column({ type: 'integer', nullable: true })
  selectedAvatarIndex!: number | null;

  @Column({ type: 'text', nullable: true })
  errorMessage!: string | null;

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

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