import { Entity } from './entity'; import { Pessoa } from './pessoa'; import { Endereco } from './endereco'; export class Contrato { public dia_vencimento: number; public modulos: Array; public valor: string; constructor(json? :any) { json = json || {} this.dia_vencimento = json.dia_vencimento || 1 this.modulos = json.modulos || new Array() this.valor = json.valor || 0.00 } } export class Empresa extends Pessoa { nome: string; cnpj: string; atual: boolean; crt: string; contrato: Contrato; data_vinculo: string; pessoa: Pessoa; identificador: string = ''; tester?: boolean; constructor(json?: any, generateId?: boolean) { super(json, generateId); json = json || {}; this.cnpj = json.cpf_cnpj || ''; this.nome = json.nome || ''; this.crt = json.crt || ''; this.contrato = json && json.contrato || new Contrato(); this.data_vinculo = json && json.data_vinculo || ''; this.pessoa = json && json.pessoa || new Pessoa(); this.identificador = json && json.identificador || ''; this.tester = json && json.tester || false; } setAtual(isAtual: boolean): Empresa { super.update(); this.atual = isAtual; return this; } }