Commit 7e283c8f authored by Gabriel's avatar Gabriel

Agrega pasos para preguntar telefono

parent b5e03f5e
......@@ -16,6 +16,7 @@ const TIPO_DOCUMENTO = 'tipo_documento';
const NUMERO_DOCUMENTO = 'numero_documento';
const FECHA_NACIMIENTO = 'fecha_nacimiento';
const SEXO = 'sexo';
const TELEFONO = 'telefono';
const CORREO = 'correo';
function getChoiceElegida(message){
......@@ -105,6 +106,14 @@ module.exports =
},
resp_sexo: async function(message, userData, website_id, session_id){
userData[SEXO] = getChoiceElegida(message).value;
await this.ask_telefono(message, userData, website_id, session_id);
},
ask_telefono: async function(message, userData, website_id, session_id){
await crisp.setSiguientePaso(website_id, session_id, pasos.RESP_TELEFONO, userData);
await crisp.sendTextMessage(website_id, session_id, 'Ingresá tu teléfono');
},
resp_telefono: async function(message, userData, website_id, session_id){
userData[TELEFONO] = message.content;
await this.ask_correo(message, userData, website_id, session_id);
},
ask_correo: async function(message, userData, website_id, session_id){
......
......@@ -10,6 +10,8 @@ module.exports = Object.freeze({
RESP_FECHA_NACIMIENTO: 'resp_fecha_nacimiento',
ASK_SEXO: 'ask_sexo',
RESP_SEXO: 'resp_sexo',
ASK_TELEFONO: 'ask_telefono',
RESP_TELEFONO: 'resp_telefono',
ASK_CORREO: 'ask_correo',
RESP_CORREO: 'resp_correo'
});
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment