Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
node_crisp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
web
node_crisp
Commits
974a53e9
Commit
974a53e9
authored
May 31, 2021
by
Gabriel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Agrega verificacion de que exista el usuario
parent
763d924e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
is.js
endpoints/is.js
+9
-0
handlers.js
handlers.js
+9
-0
No files found.
endpoints/is.js
View file @
974a53e9
...
...
@@ -74,6 +74,15 @@ module.exports =
console
.
log
(
error
);
});
},
existeUsuario
:
async
function
(
tipo_documento
,
numero_documento
,
fecha_nacimiento
,
sexo
){
return
await
axios
.
get
(
`/watson/existe_persona?tipo_documento=
${
tipo_documento
}
&numero_documento=
${
numero_documento
}
&fecha_nacimiento=
${
fecha_nacimiento
}
&sexo=
${
sexo
}
`
)
.
then
(
async
function
(
response
)
{
return
response
.
data
.
existe
;
})
.
catch
(
function
(
error
)
{
console
.
log
(
error
);
});
},
crearTurno
:
async
function
(
tipoDocumento
,
numeroDocumento
,
fechaNacimiento
,
sexo
,
mail
,
telefono
,
idHorario
,
fechaHora
)
{
return
await
axios
.
post
(
'/watson/confirmar_reserva'
,
{
"tipo_documento"
:
tipoDocumento
,
...
...
handlers.js
View file @
974a53e9
...
...
@@ -3,6 +3,8 @@ const utils = require('./utils.js');
const
pasos
=
require
(
'./pasos.js'
);
const
is
=
require
(
'./endpoints/is.js'
)
let
LINK_SOLICITAR_ACCESO_POR_EMAIL
=
'https://www.integrandosalud.com/es-ar/integrando-pacientes-solicitar-acceso-por-email/'
;
let
OPTIONS
=
4
;
let
VER_MAS_PROVINCIAS_ID
=
'99'
;
let
MOSTRANDO_PROVINCIAS_HASTA_KEY
=
'mostrando_provincias_hasta'
...
...
@@ -237,6 +239,13 @@ module.exports =
},
resp_correo
:
async
function
(
message
,
userData
,
website_id
,
session_id
){
userData
[
CORREO
]
=
message
.
content
;
if
(
!
await
is
.
existeUsuario
()
===
true
){
await
crisp
.
sendTextMessage
(
website_id
,
session_id
,
'No se pudieron validar sus datos. Solicite por favor su acceso por email ingresando al siguiente link'
);
await
crisp
.
sendTextMessage
(
website_id
,
session_id
,
LINK_SOLICITAR_ACCESO_POR_EMAIL
);
return
;
}
let
turnoElegido
=
JSON
.
parse
(
userData
[
TURNO_ELEGIDO
]);
let
resp
=
await
is
.
crearTurno
(
userData
[
TIPO_DOCUMENTO
],
userData
[
NUMERO_DOCUMENTO
],
toFechaUsa
(
userData
[
FECHA_NACIMIENTO
]),
userData
[
SEXO
],
userData
[
CORREO
],
0
,
turnoElegido
.
horarioId
,
turnoElegido
.
fechaHora
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment