65 lines
1.4 KiB
TypeScript
65 lines
1.4 KiB
TypeScript
import { Entity, PrimaryGeneratedColumn, Column, Unique } from 'typeorm';
|
|
import { Rol, Autorizacion } from '../../../common/enums/rol.enum.js';
|
|
import { EstadoGeneral } from '../../../common/enums/estados.enum.js';
|
|
|
|
@Entity('persona')
|
|
@Unique(['codPais', 'whatsapp'])
|
|
export class Persona {
|
|
@PrimaryGeneratedColumn('uuid')
|
|
idPersona: string;
|
|
|
|
@Column()
|
|
nombres: string;
|
|
|
|
@Column()
|
|
apellidos: string;
|
|
|
|
@Column({ default: '591' })
|
|
codPais: string;
|
|
|
|
@Column()
|
|
whatsapp: string;
|
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
photoUrl?: string | null;
|
|
|
|
@Column({
|
|
type: 'varchar',
|
|
})
|
|
rol: Rol;
|
|
|
|
@Column({
|
|
type: 'varchar',
|
|
default: Autorizacion.Usuario,
|
|
})
|
|
autorizacion: Autorizacion;
|
|
|
|
@Column({ type: 'date', nullable: true })
|
|
fecNac?: string | null;
|
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
ci?: string | null;
|
|
|
|
@Column({ type: 'varchar', nullable: true })
|
|
complemento?: string | null;
|
|
|
|
@Column({ default: false })
|
|
verificado: boolean;
|
|
|
|
@Column({ type: 'timestamptz', nullable: true })
|
|
ultConexion?: Date | null;
|
|
|
|
/**
|
|
* Última plataforma desde la que inició sesión la persona
|
|
* (`Android` | `iOS` | `Web` | `Otro`; tanda presencia 2026-11-01).
|
|
* La manda la app en `POST /auth/login`.
|
|
*/
|
|
@Column({ type: 'varchar', nullable: true })
|
|
platform?: string | null;
|
|
|
|
@Column({
|
|
type: 'varchar',
|
|
default: EstadoGeneral.Activo,
|
|
})
|
|
estado: EstadoGeneral;
|
|
}
|