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

@Entity('locais')
export class Local {
  @PrimaryGeneratedColumn('uuid')
  id: string;

  @Column({ length: 200 })
  nome: string;

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

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

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

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

  @Column({ length: 20, nullable: true })
  classificacao_impacto_ambiental: string;

  @Column({ type: 'simple-json', nullable: true })
  praticas_sustentaveis: string[];

  @Column({ default: true })
  ativo: boolean;

  @CreateDateColumn()
  created_at: Date;

  @UpdateDateColumn()
  updated_at: Date;
}
