import { Collection, Entity, ManyToMany, OneToOne, Property } from '@mikro-orm/core'; import { SoftDeletable } from 'mikro-orm-soft-delete'; import Cities from './cities.entity'; import { CommonEntity } from './common-entity.entity'; import DocumentTypes from './document-types.entity'; import FiscalRoles from './fiscal-roles.entity'; import Genres from './genres.entity'; @SoftDeletable(() => Patients, 'deletedAt', () => new Date()) @Entity() export default class Patients extends CommonEntity { @Property({ name: 'first_name', }) firstName: string; @Property({ name: 'last_name', }) lastName: string; @OneToOne({ nullable: true, }) documentType: DocumentTypes @Property({ name: 'document_number', unique: true, }) documentNumber: string; @OneToOne({ nullable: true, }) genre: Genres @Property({ nullable: true, }) birthday: Date; @OneToOne() fiscalRole: FiscalRoles @OneToOne() city: Cities; @Property({ nullable: true, }) street: string; @Property({ name: 'street_extras', nullable: true, }) streetExtras: string; @Property({ name: 'postal_code', nullable: true, }) postalCode: string; @Property({ name: 'phone_number', nullable: true, }) phoneNumber: string; @Property({ nullable: true, }) email: string; @Property({ type: 'text', nullable: true, }) observations: string; }