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

@Entity('documento_versoes')
export class DocumentoVersao {
  @PrimaryGeneratedColumn('uuid')
  id: string;

  @Column()
  ordem_servico_id: string;

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

  @Column({ length: 500 })
  nome_arquivo: string;

  @Column({ length: 1000 })
  caminho: string;

  @Column({ type: 'integer', default: 0 })
  tamanho: number;

  @Column({ type: 'integer', default: 1 })
  versao: number;

  @Column({ type: 'float', nullable: true })
  valor_bruto: number;

  @Column({ type: 'float', nullable: true })
  valor_liquido: number;

  @Column({ type: 'float', nullable: true })
  iss: number;

  @Column({ type: 'float', nullable: true })
  inss: number;

  @Column({ type: 'float', nullable: true })
  pcc: number;

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

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

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

  @CreateDateColumn()
  created_at: Date;
}
