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

@Entity('workflow_aprovacao')
export class WorkflowAprovacao {
  @PrimaryGeneratedColumn('uuid')
  id: string;

  @Column()
  demanda_id: string;

  @Column({ nullable: true })
  proposta_id: string;

  @Column({ type: 'float' })
  valor_total: number;

  @Column({ length: 30, default: 'pendente' })
  status: string;

  @Column({ default: 1 })
  etapa_atual: number;

  @Column({ type: 'simple-json', default: '[]' })
  etapas: any;

  @Column({ default: false })
  emergencial: boolean;

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

  @CreateDateColumn()
  created_at: Date;

  @UpdateDateColumn()
  updated_at: Date;
}
