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

@Entity('ordens_servico')
export class OrdemServico {
  @PrimaryGeneratedColumn('uuid')
  id: string;

  @Column({ type: 'integer', unique: true, nullable: true })
  numero: number;

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

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

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

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

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

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

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

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

  @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;

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

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

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

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

  @CreateDateColumn()
  created_at: Date;

  @UpdateDateColumn()
  updated_at: Date;
}
