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

@Entity('metas')
export class Meta {
  @PrimaryGeneratedColumn('uuid')
  id: string;

  @Column({ length: 300 })
  titulo: string;

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

  @Column({ length: 30 })
  tipo: string; // orcamento | operacional | esg

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

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

  @Column({ type: 'float', default: 0 })
  valor_atual: number;

  @Column({ length: 30, nullable: true })
  unidade: string;

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

  @Column({ length: 30, default: 'em_andamento' })
  status: string; // em_andamento | atingida | atrasada

  @CreateDateColumn()
  created_at: Date;
}
