diff --git a/hrm-form-definitions/form-definitions/cl/v1/PrepopulateKeys.json b/hrm-form-definitions/form-definitions/cl/v1/PrepopulateKeys.json index 4f5223c89a..d1b08a865a 100644 --- a/hrm-form-definitions/form-definitions/cl/v1/PrepopulateKeys.json +++ b/hrm-form-definitions/form-definitions/cl/v1/PrepopulateKeys.json @@ -4,7 +4,7 @@ "CallerInformationTab":[] }, "preEngagement":{ - "ChildInformationTab":["age", "gender", "contactIdentifier","friendlyName","province","district"], + "ChildInformationTab":["age", "gender", "contactIdentifier","friendlyName","province","district","ip"], "CallerInformationTab":["age", "gender"], "CaseInformationTab":[] } diff --git a/hrm-form-definitions/form-definitions/cl/v1/profileForms/FlagDurations.json b/hrm-form-definitions/form-definitions/cl/v1/profileForms/FlagDurations.json new file mode 100644 index 0000000000..5e4214500a --- /dev/null +++ b/hrm-form-definitions/form-definitions/cl/v1/profileForms/FlagDurations.json @@ -0,0 +1,17 @@ +[ + { + "flag": "blocked", + "label": "Bloqueo Temporal (24 Horas)", + "durationInHours": "24" + }, + { + "flag": "blocked", + "label": "Bloqueo Contacto Repetido (30 días)", + "durationInHours": "720" + }, + { + "flag": "blocked", + "label": "Bloqueo Largo Plazo (1 Año)", + "durationInHours": "8760" + } +] \ No newline at end of file diff --git a/hrm-form-definitions/form-definitions/cl/v1/profileForms/Sections.json b/hrm-form-definitions/form-definitions/cl/v1/profileForms/Sections.json index 27d3135126..95a152bcec 100644 --- a/hrm-form-definitions/form-definitions/cl/v1/profileForms/Sections.json +++ b/hrm-form-definitions/form-definitions/cl/v1/profileForms/Sections.json @@ -1,11 +1,29 @@ [ { "name": "summary", - "label": "Summary", - "editLabel": "Edit Summary", + "label": "Resumen", + "editLabel": "Editar Resumen", "type": "textarea", "rows": 20, "width": 500, "placeholder": "Ingrese un resumen del cliente" + }, + { + "name": "blockReasons", + "label": "Motivo del Bloqueo", + "editLabel": "Editar motivo del bloqueo", + "type": "textarea", + "rows": 20, + "width": 500, + "placeholder": "Ingrese un motivo del bloqueo" + }, + { + "name": "lastAgreement", + "label": "Último Acuerdo", + "editLabel": "Editar último acuerdo", + "type": "textarea", + "rows": 20, + "width": 500, + "placeholder": "Ingrese un último acuerdo" } ] diff --git a/hrm-form-definitions/form-definitions/cl/v1/tabbedForms/ChildInformationTab.json b/hrm-form-definitions/form-definitions/cl/v1/tabbedForms/ChildInformationTab.json index a0edcad8cc..bb119868bf 100644 --- a/hrm-form-definitions/form-definitions/cl/v1/tabbedForms/ChildInformationTab.json +++ b/hrm-form-definitions/form-definitions/cl/v1/tabbedForms/ChildInformationTab.json @@ -1852,5 +1852,10 @@ "label": "Pertenece a la comunidad LGTBIQA+" } ] + }, + { + "name": "ip", + "label": "IP", + "type": "input" } ] \ No newline at end of file diff --git a/plugin-hrm-form/src/translations/es-CL/flexUI.json b/plugin-hrm-form/src/translations/es-CL/flexUI.json index 6cdf1fce94..6694de3e14 100644 --- a/plugin-hrm-form/src/translations/es-CL/flexUI.json +++ b/plugin-hrm-form/src/translations/es-CL/flexUI.json @@ -636,5 +636,8 @@ "ProfileList-Summary-None": "- Perfil sin resumen -", "ProfileList-Status-None": "- Sin estado -", "ProfileList-ClientName-None": "- Sin nombre -", - "TeamsView-NoSkills": "- Sin habilidades -" -} \ No newline at end of file + "TeamsView-NoSkills": "- Sin habilidades -", + "abusive": "abusivo", + "blocked": "bloqueado", + "repeated contact": "contacto repetido" + } \ No newline at end of file diff --git a/twilio-iac/helplines/cl/common.hcl b/twilio-iac/helplines/cl/common.hcl index 3d4c2e9fe5..b7d5210269 100644 --- a/twilio-iac/helplines/cl/common.hcl +++ b/twilio-iac/helplines/cl/common.hcl @@ -10,8 +10,8 @@ locals { task_language = "es-CL" voice_ivr_language = "es-MX" enable_post_survey = true - enable_external_recordings = true - + enable_external_recordings = true + workflows = { master : { friendly_name : "Master Workflow" @@ -61,9 +61,10 @@ locals { webchat : { channel_type = "web" contact_identity = "" - templatefile = "/app/twilio-iac/helplines/templates/studio-flows/messaging-no-chatbot-operating-hours.tftpl" + templatefile = "/app/twilio-iac/helplines/templates/studio-flows/messaging-no-chatbot-operating-hours-blocking.tftpl" channel_flow_vars = { chat_greeting_message = "Te damos la bienvenida a Línea Libre, tu mensaje fue recibido exitosamente, la conversación será asignada a uno/a de nuestros psicólogos/as en los próximos instantes." + chat_blocked_message = "Hola, estás comunicándote con Línea Libre, un canal que ofrece una primera atención psicológica, y que busca apoyarte y orientarte en lo que sea que estés pasando. Lamentablemente el número del cual llamas se encuentra bloqueado en nuestro sistema. Si necesitas ayuda te recomendamos tomar contacto con Salud Responde al 6003607777. Si crees que tu número ha sido bloqueado por error, nos puedes escribir un mail a: contacto@paralaconfianza.com" widget_from = "Linea Libre" } chatbot_unique_names = [] @@ -71,9 +72,10 @@ locals { voice : { channel_type = "voice" contact_identity = "" - templatefile = "/app/twilio-iac/helplines/templates/studio-flows/voice-no-chatbot-operating-hours.tftpl" + templatefile = "/app/twilio-iac/helplines/templates/studio-flows/voice-no-chatbot-operating-hours-blocking.tftpl" channel_flow_vars = { voice_ivr_greeting_message = "Hola, estás comunicándote con Línea Libre, un canal que ofrece una primera atención psicológica, y que busca apoyarte y orientarte en lo que sea que estés pasando. Antes de conversar, nos gustaría contarte que trabajamos bajo el principio de protección. Si percibimos que tu integridad o la de un tercero puede estar en riesgo, haremos lo necesario para asegurar tu protección y bienestar. Por tu seguridad, esta llamada podría ser grabada." + voice_ivr_blocked_message = "Hola, estás comunicándote con Línea Libre, un canal que ofrece una primera atención psicológica, y que busca apoyarte y orientarte en lo que sea que estés pasando. Lamentablemente el número del cual llamas se encuentra bloqueado en nuestro sistema. Si necesitas ayuda te recomendamos tomar contacto con Salud Responde al 6003607777. Si crees que tu número ha sido bloqueado por error, nos puedes escribir un mail a: contacto@paralaconfianza.com" voice_ivr_language = "es-MX" } chatbot_unique_names = [] diff --git a/twilio-iac/helplines/templates/studio-flows/messaging-no-chatbot-operating-hours-blocking.tftpl b/twilio-iac/helplines/templates/studio-flows/messaging-no-chatbot-operating-hours-blocking.tftpl new file mode 100644 index 0000000000..e1a7121684 --- /dev/null +++ b/twilio-iac/helplines/templates/studio-flows/messaging-no-chatbot-operating-hours-blocking.tftpl @@ -0,0 +1,297 @@ +${ + jsonencode( + { + "description": "Webchat Studio Flow", + "states": [ + { + "name": "Trigger", + "type": "trigger", + "transitions": [ + { + "next": "getProfileFlagsForIdentifier", + "event": "incomingMessage" + }, + { + "event": "incomingCall" + }, + { + "event": "incomingConversationMessage" + }, + { + "event": "incomingRequest" + }, + { + "event": "incomingParent" + } + ], + "properties": { + "offset": { + "x": 0, + "y": -10 + } + } + }, + { + "name": "check_operating_hours", + "type": "run-function", + "transitions": [ + { + "next": "split_status", + "event": "success" + }, + { + "next": "webhook_notify_error", + "event": "fail" + } + ], + "properties": { + "service_sid": serverless_service_sid, + "environment_sid": serverless_environment_sid, + "offset": { + "x": 0, + "y": 600 + }, + "function_sid": flow_vars["operating_hours_function_sid"] + "parameters": [ + { + "value": "webchat", + "key": "channel" + }, + { + "value": "true", + "key": "includeMessageTextInResponse" + }, + { + "value": task_language, + "key": "language" + } + ], + "url": "${serverless_url}/operatingHours" + } + }, + { + "name": "split_status", + "type": "split-based-on", + "transitions": [ + { + "next": "webhook_notify_error", + "event": "noMatch" + }, + { + "next": "send_welcome_message", + "event": "match", + "conditions": [ + { + "friendly_name": "If value equal_to open", + "arguments": [ + "{{widgets.check_operating_hours.parsed.status}}" + ], + "type": "equal_to", + "value": "open" + } + ] + }, + { + "next": "send_closed", + "event": "match", + "conditions": [ + { + "friendly_name": "If value equal_to closed", + "arguments": [ + "{{widgets.check_operating_hours.parsed.status}}" + ], + "type": "equal_to", + "value": "closed" + } + ] + } + ], + "properties": { + "input": "{{widgets.check_operating_hours.parsed.status}}", + "offset": { + "x": 210, + "y": 860 + } + } + }, + { + "name": "webhook_notify_error", + "type": "make-http-request", + "transitions": [ + { + "event": "success" + }, + { + "event": "failed" + } + ], + "properties": { + "offset": { + "x": 80, + "y": 1410 + }, + "method": "POST", + "content_type": "application/json;charset=utf-8", + "body": "{ \"text\": \"Issue detected on ${short_helpline} ${short_environment} Flow SID: {{flow.flow_sid}} Execution SID: {{flow.sid}} \" }", + "url": webhook_url_studio_errors + } + }, + { + "name": "send_welcome_message", + "type": "send-message", + "transitions": [ + { + "next": "attributes", + "event": "sent" + }, + { + "next": "webhook_notify_error", + "event": "failed" + } + ], + "properties": { + "offset": { + "x": 420, + "y": 1110 + }, + "service": "{{trigger.message.InstanceSid}}", + "channel": "{{trigger.message.ChannelSid}}", + "from": channel_flow_vars["widget_from"], + "to": "{{contact.channel.address}}", + "body": channel_flow_vars["chat_greeting_message"] + } + }, + { + "name": "send_closed", + "type": "send-message", + "transitions": [ + { + "event": "sent" + }, + { + "next": "webhook_notify_error", + "event": "failed" + } + ], + "properties": { + "offset": { + "x": 990, + "y": 1150 + }, + "service": "{{trigger.message.InstanceSid}}", + "channel": "{{trigger.message.ChannelSid}}", + "from": "Linea Libre", + "to": "{{contact.channel.address}}", + "body": "{{widgets.check_operating_hours.parsed.message}}" + } + }, + { + "name": "attributes", + "type": "send-to-flex", + "transitions": [ + { + "event": "callComplete" + }, + { + "event": "failedToEnqueue" + }, + { + "event": "callFailure" + } + ], + "properties": { + "offset": { + "x": 580, + "y": 1400 + }, + "workflow": workflow_sids["master"], + "channel": task_channel_sids["chat"], + "attributes": channel_attributes["default"] + } + }, + { + "name": "getProfileFlagsForIdentifier", + "type": "make-http-request", + "transitions": [ + { + "next": "contact_routing", + "event": "success" + }, + { + "next": "check_operating_hours", + "event": "failed" + } + ], + "properties": { + "offset": { + "x": -300, + "y": 150 + }, + "method": "POST", + "content_type": "application/json;charset=utf-8", + "body": "{ \"trigger\": {{trigger | to_json}}}", + "url": "${serverless_url}/getProfileFlagsForIdentifier" + } + }, + { + "name": "send_blocked_message", + "type": "send-message", + "transitions": [ + { + "event": "sent" + }, + { + "event": "failed" + } + ], + "properties": { + "offset": { + "x": -420, + "y": 770 + }, + "service": "{{trigger.message.InstanceSid}}", + "channel": "{{trigger.message.ChannelSid}}", + "from": "Linea Libre", + "to": "{{contact.channel.address}}", + "body": channel_flow_vars["chat_blocked_message"] + } + }, + { + "name": "contact_routing", + "type": "split-based-on", + "transitions": [ + { + "next": "check_operating_hours", + "event": "noMatch" + }, + { + "next": "send_blocked_message", + "event": "match", + "conditions": [ + { + "friendly_name": "If value contains blocked", + "arguments": [ + "{{widgets.getProfileFlagsForIdentifier.parsed.flags}}" + ], + "type": "contains", + "value": "blocked" + } + ] + } + ], + "properties": { + "input": "{{widgets.getProfileFlagsForIdentifier.parsed.flags}}", + "offset": { + "x": -590, + "y": 470 + } + } + } + ], + "initial_state": "Trigger", + "flags": { + "allow_concurrent_calls": true + } +} + ) + } diff --git a/twilio-iac/helplines/templates/studio-flows/voice-no-chatbot-operating-hours-blocking.tftpl b/twilio-iac/helplines/templates/studio-flows/voice-no-chatbot-operating-hours-blocking.tftpl new file mode 100644 index 0000000000..839d68001c --- /dev/null +++ b/twilio-iac/helplines/templates/studio-flows/voice-no-chatbot-operating-hours-blocking.tftpl @@ -0,0 +1,285 @@ +${ + jsonencode( + { + "description": "Voice Studio Flow", + "states": [ + { + "name": "Trigger", + "type": "trigger", + "transitions": [ + { + "event": "incomingMessage" + }, + { + "next": "getProfileFlagsForIdentifier", + "event": "incomingCall" + }, + { + "event": "incomingConversationMessage" + }, + { + "event": "incomingRequest" + }, + { + "event": "incomingParent" + } + ], + "properties": { + "offset": { + "x": 0, + "y": -10 + } + } + }, + { + "name": "SendCallToAgent", + "type": "send-to-flex", + "transitions": [ + { + "event": "callComplete" + }, + { + "next": "webhook_notify_error", + "event": "failedToEnqueue" + }, + { + "next": "webhook_notify_error", + "event": "callFailure" + } + ], + "properties": { + "offset": { + "x": 570, + "y": 1230 + }, + "workflow": workflow_sids["master"], + "channel": task_channel_sids["voice"], + "attributes":channel_attributes["default"] + } + }, + { + "name": "say_welcome_message", + "type": "say-play", + "transitions": [ + { + "next": "SendCallToAgent", + "event": "audioComplete" + } + ], + "properties": { + "voice": "Polly.Mia-Neural", + "offset": { + "x": 450, + "y": 1020 + }, + "loop": 1, + "say": channel_flow_vars["voice_ivr_greeting_message"], + "language": channel_flow_vars["voice_ivr_language"] + } + }, + { + "name": "check_operating_hours", + "type": "run-function", + "transitions": [ + { + "next": "split_status", + "event": "success" + }, + { + "next": "webhook_notify_error", + "event": "fail" + } + ], + "properties": { + "service_sid": serverless_service_sid, + "environment_sid": serverless_environment_sid, + "offset": { + "x": 60, + "y": 590 + }, + "function_sid": flow_vars["operating_hours_function_sid"] + "parameters": [ + { + "value": "voice", + "key": "channel" + }, + { + "value": "true", + "key": "includeMessageTextInResponse" + }, + { + "value": task_language, + "key": "language" + } + ], + "url": "${serverless_url}/operatingHours" + } + }, + { + "name": "split_status", + "type": "split-based-on", + "transitions": [ + { + "next": "webhook_notify_error", + "event": "noMatch" + }, + { + "next": "say_welcome_message", + "event": "match", + "conditions": [ + { + "friendly_name": "If value equal_to open", + "arguments": [ + "{{widgets.check_operating_hours.parsed.status}}" + ], + "type": "equal_to", + "value": "open" + } + ] + }, + { + "next": "say_closed", + "event": "match", + "conditions": [ + { + "friendly_name": "If value equal_to closed", + "arguments": [ + "{{widgets.check_operating_hours.parsed.status}}" + ], + "type": "equal_to", + "value": "closed" + } + ] + } + ], + "properties": { + "input": "{{widgets.check_operating_hours.parsed.status}}", + "offset": { + "x": 230, + "y": 800 + } + } + }, + { + "name": "webhook_notify_error", + "type": "make-http-request", + "transitions": [ + { + "event": "success" + }, + { + "event": "failed" + } + ], + "properties": { + "offset": { + "x": 40, + "y": 1480 + }, + "method": "POST", + "content_type": "application/json;charset=utf-8", + "body": "{ \"text\": \"Issue detected on ${short_helpline} ${short_environment} Flow SID: {{flow.flow_sid}} Execution SID: {{flow.sid}} \" }", + "url": webhook_url_studio_errors + } + }, + { + "name": "say_closed", + "type": "say-play", + "transitions": [ + { + "event": "audioComplete" + } + ], + "properties": { + "voice": "Polly.Mia-Neural", + "offset": { + "x": 880, + "y": 1020 + }, + "loop": 1, + "say": "{{widgets.check_operating_hours.parsed.message}}", + "language": channel_flow_vars["voice_ivr_language"] + } + }, + { + "name": "getProfileFlagsForIdentifier", + "type": "make-http-request", + "transitions": [ + { + "next": "contact_routing", + "event": "success" + }, + { + "next": "check_operating_hours", + "event": "failed" + } + ], + "properties": { + "offset": { + "x": 20, + "y": 180 + }, + "method": "POST", + "content_type": "application/json;charset=utf-8", + "body": "{ \"trigger\": {{trigger | to_json}}}", + "url": "${serverless_url}/getProfileFlagsForIdentifier" + } + }, + { + "name": "contact_routing", + "type": "split-based-on", + "transitions": [ + { + "next": "check_operating_hours", + "event": "noMatch" + }, + { + "next": "say_blocked", + "event": "match", + "conditions": [ + { + "friendly_name": "If value contains blocked", + "arguments": [ + "{{widgets.getProfileFlagsForIdentifier.parsed.flags}}" + ], + "type": "contains", + "value": "blocked" + } + ] + } + ], + "properties": { + "input": "{{widgets.getProfileFlagsForIdentifier.parsed.flags}}", + "offset": { + "x": -350, + "y": 360 + } + } + }, + { + "name": "say_blocked", + "type": "say-play", + "transitions": [ + { + "event": "audioComplete" + } + ], + "properties": { + "voice": "Polly.Mia-Neural", + "offset": { + "x": -310, + "y": 670 + }, + "loop": 1, + "say": channel_flow_vars["voice_ivr_blocked_message"], + "language": "es-MX" + } + } + ], + "initial_state": "Trigger", + "flags": { + "allow_concurrent_calls": true + } +} +) +} diff --git a/twilio-iac/stages/configure/.terraform.lock.hcl b/twilio-iac/stages/configure/.terraform.lock.hcl index d493da40ba..f884c20d3a 100644 --- a/twilio-iac/stages/configure/.terraform.lock.hcl +++ b/twilio-iac/stages/configure/.terraform.lock.hcl @@ -23,6 +23,25 @@ provider "registry.terraform.io/hashicorp/aws" { ] } +provider "registry.terraform.io/hashicorp/null" { + version = "3.2.2" + hashes = [ + "h1:zT1ZbegaAYHwQa+QwIFugArWikRJI9dqohj8xb0GY88=", + "zh:3248aae6a2198f3ec8394218d05bd5e42be59f43a3a7c0b71c66ec0df08b69e7", + "zh:32b1aaa1c3013d33c245493f4a65465eab9436b454d250102729321a44c8ab9a", + "zh:38eff7e470acb48f66380a73a5c7cdd76cc9b9c9ba9a7249c7991488abe22fe3", + "zh:4c2f1faee67af104f5f9e711c4574ff4d298afaa8a420680b0cb55d7bbc65606", + "zh:544b33b757c0b954dbb87db83a5ad921edd61f02f1dc86c6186a5ea86465b546", + "zh:696cf785090e1e8cf1587499516b0494f47413b43cb99877ad97f5d0de3dc539", + "zh:6e301f34757b5d265ae44467d95306d61bef5e41930be1365f5a8dcf80f59452", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:913a929070c819e59e94bb37a2a253c228f83921136ff4a7aa1a178c7cce5422", + "zh:aa9015926cd152425dbf86d1abdbc74bfe0e1ba3d26b3db35051d7b9ca9f72ae", + "zh:bb04798b016e1e1d49bcc76d62c53b56c88c63d6f2dfe38821afef17c416a0e1", + "zh:c23084e1b23577de22603cff752e59128d83cfecc2e6819edadd8cf7a10af11e", + ] +} + provider "registry.terraform.io/twilio/twilio" { version = "0.17.0" constraints = "0.17.0"