
import { Column, ForeignKey, HasMany, Model, Table } from 'sequelize-typescript';
import { UnidSaude } from './unid-saude.model';
import { Atendimento } from './atendimento.model';

@Table({tableName: 'paciente'})
export class Paciente extends Model {

  @Column
  nome: string;

  @Column
  cpf: string;

  @Column
  genero: string;

  @Column
  dataNasci: Date;

  @Column
  cidade: string;
  
  @Column
  uf: string;

  @Column
  createdAt: Date;

  @Column
  updatedAt: Date;
  
  @ForeignKey(() => UnidSaude)
  @Column
  unidsaudeid: number;

  @HasMany(() => Atendimento)
  atendimento: Atendimento[];
  
}