48 lines
1.3 KiB
TypeScript
48 lines
1.3 KiB
TypeScript
import type { ClientCaptureMeta, ClientRegistrationNatural } from '~/types/brokerage-registration'
|
|
|
|
export function createEmptyClientRegistration(): ClientRegistrationNatural {
|
|
return {
|
|
id: '',
|
|
economicGroupId: '',
|
|
conglomerateId: '',
|
|
personType: 'natural',
|
|
apellidoPaterno: '',
|
|
apellidoMaterno: '',
|
|
primerNombre: '',
|
|
segundoNombre: '',
|
|
fechaNacimiento: '',
|
|
tipoIdentificacion: '',
|
|
cedulaOPasaporte: '',
|
|
telefonoCelular: '',
|
|
correoElectronicoPersonal: '',
|
|
ocupacion: '',
|
|
procedencia: '',
|
|
detalle: '',
|
|
descripcion: ''
|
|
}
|
|
}
|
|
|
|
export function useClientCaptureMeta(): ClientCaptureMeta {
|
|
const now = new Date()
|
|
return {
|
|
operadorId: '32',
|
|
operadorNombre: 'Jordan',
|
|
fechaCaptura: now.toISOString(),
|
|
progresoCapturaPct: 6,
|
|
estado: ''
|
|
}
|
|
}
|
|
|
|
export function toIndividualCustomerBody(r: ClientRegistrationNatural) {
|
|
const last = [r.apellidoPaterno, r.apellidoMaterno].filter(Boolean).join(' ').trim()
|
|
return {
|
|
first_name: [r.primerNombre, r.segundoNombre].filter(Boolean).join(' ').trim() || r.primerNombre,
|
|
last_name: last || '-',
|
|
email: r.correoElectronicoPersonal.trim(),
|
|
phone: r.telefonoCelular.trim(),
|
|
birth_date: r.fechaNacimiento,
|
|
gender: '',
|
|
document_id: r.cedulaOPasaporte.trim()
|
|
}
|
|
}
|