From b9475190ef4de4474467f20a2be153eb72afdbfc Mon Sep 17 00:00:00 2001 From: Janno Stern Date: Mon, 10 Mar 2025 16:26:07 +0200 Subject: [PATCH] Remove extra criteria --- .../analytics/hbs/merge-arrays.handlebars | 2 +- .../POST/chat-cif-long-waiting-time.sql | 40 ----------------- .../chats/contact-information-fulfilled.yml | 43 ++----------------- GUI/src/i18n/en/common.json | 1 - GUI/src/i18n/et/common.json | 1 - GUI/src/pages/ChatsPage/options.tsx | 1 - 6 files changed, 4 insertions(+), 84 deletions(-) delete mode 100644 DSL/Resql/analytics/POST/chat-cif-long-waiting-time.sql diff --git a/DSL/DMapper/analytics/hbs/merge-arrays.handlebars b/DSL/DMapper/analytics/hbs/merge-arrays.handlebars index b9581352..9339fc4f 100644 --- a/DSL/DMapper/analytics/hbs/merge-arrays.handlebars +++ b/DSL/DMapper/analytics/hbs/merge-arrays.handlebars @@ -1,5 +1,5 @@ [ - {{#each (mergeChatCountArrays arr1 arr2 arr3)}} + {{#each (mergeChatCountArrays arr1 arr2)}} { "time": "{{this.time}}", "chatCount": {{this.chatCount}} diff --git a/DSL/Resql/analytics/POST/chat-cif-long-waiting-time.sql b/DSL/Resql/analytics/POST/chat-cif-long-waiting-time.sql deleted file mode 100644 index cab5ef21..00000000 --- a/DSL/Resql/analytics/POST/chat-cif-long-waiting-time.sql +++ /dev/null @@ -1,40 +0,0 @@ -WITH user_messages AS ( - SELECT - chat_base_id, - created, - LAG(created) OVER (PARTITION BY chat_base_id, author_role ORDER BY created) AS prev_message_time - FROM message - WHERE author_role = 'end-user' -), -waiting_times AS( - SELECT - m.chat_base_id AS chat_base_id, - MIN(m.created) AS created, - EXTRACT(epoch FROM MAX(m.created - prev_message_time))::INT AS waiting_time_seconds - FROM user_messages m - JOIN message ms - ON m.chat_base_id = ms.chat_base_id - AND ms.author_role = 'backoffice-user' - WHERE prev_message_time IS NOT NULL - GROUP BY m.chat_base_id -) -SELECT - DATE_TRUNC(:period, created) AS time, - COUNT(*) AS long_waiting_time -FROM waiting_times w -WHERE created::date BETWEEN :start::date AND :end::date -AND waiting_time_seconds > :threshold_seconds -AND 0 < ( - SELECT 1 - FROM message m - JOIN chat c ON m.chat_base_id = c.base_id - WHERE m.chat_base_id = w.chat_base_id - AND ( - m.event LIKE '%contact-information-fulfilled' OR - (c.end_user_email IS NOT NULL AND c.end_user_email <> '') OR - (c.end_user_phone IS NOT NULL AND c.end_user_phone <> '') - ) - LIMIT 1 -) -GROUP BY time -ORDER BY time diff --git a/DSL/Ruuter/analytics/POST/chats/contact-information-fulfilled.yml b/DSL/Ruuter/analytics/POST/chats/contact-information-fulfilled.yml index 8878fca4..14c82aa3 100644 --- a/DSL/Ruuter/analytics/POST/chats/contact-information-fulfilled.yml +++ b/DSL/Ruuter/analytics/POST/chats/contact-information-fulfilled.yml @@ -52,7 +52,7 @@ check_outside_working_hours: empty_outside_working_hours: assign: outside_working_hours_result: ${[]} - next: check_long_waiting_time + next: check_all_csas_away outside_working_hours: call: http.post @@ -68,31 +68,6 @@ assign_outside_working_hours: assign: outside_working_hours_result: ${results.response.body} -check_long_waiting_time: - switch: - - condition: ${options.includes('long-waiting-time')} - next: long_waiting_time - -empty_long_waiting_time: - assign: - long_waiting_time_result: ${[]} - next: check_all_csas_away - -long_waiting_time: - call: http.post - args: - url: "[#ANALYTICS_RESQL]/chat-cif-long-waiting-time" - body: - period: ${period} - start: ${start} - end: ${end} - threshold_seconds: ${5 * 60} - result: results - -assign_long_waiting_time: - assign: - long_waiting_time_result: ${results.response.body} - check_all_csas_away: switch: - condition: ${options.includes('all-csas-away')} @@ -137,17 +112,6 @@ outside_working_hours_for_total: end: ${end} result: outside_working_hours_for_total_results -long_waiting_time_for_total: - call: http.post - args: - url: "[#ANALYTICS_RESQL]/chat-cif-long-waiting-time" - body: - period: ${period} - start: ${start} - end: ${end} - threshold_seconds: ${5 * 60} - result: long_waiting_time_for_total_results - all_csas_away_for_total: call: http.post args: @@ -166,8 +130,7 @@ get_total: type: 'json' body: arr1: ${outside_working_hours_for_total_results.response.body} - arr2: ${long_waiting_time_for_total_results.response.body} - arr3: ${all_csas_away_for_total_results.response.body} + arr2: ${all_csas_away_for_total_results.response.body} result: merged_total_result assign_total: @@ -175,4 +138,4 @@ assign_total: total_result: ${merged_total_result.response.body} respond: - return: ${[outside_working_hours_result, long_waiting_time_result, all_csas_away_result, total_result]} + return: ${[outside_working_hours_result, all_csas_away_result, total_result]} diff --git a/GUI/src/i18n/en/common.json b/GUI/src/i18n/en/common.json index bf31fd51..5f62b060 100644 --- a/GUI/src/i18n/en/common.json +++ b/GUI/src/i18n/en/common.json @@ -147,7 +147,6 @@ "onlyBYK": "Only Bürokratt involved", "csaInvolved": "CSA involved", "outsideWorkingHours": "Outside working hours", - "longWaitingTime": "Long waiting time", "allCsvAway": "All CSAs away with red status", "medianWaitingTime": "Median (min)", "averageWaitingTime": "Arithmetic (min)" diff --git a/GUI/src/i18n/et/common.json b/GUI/src/i18n/et/common.json index 066ae4b8..f089f559 100644 --- a/GUI/src/i18n/et/common.json +++ b/GUI/src/i18n/et/common.json @@ -147,7 +147,6 @@ "onlyBYK": "Bürokrati vastatud", "csaInvolved": "Nõustaja kaasatud", "outsideWorkingHours": "Tööpäeva väline aeg", - "longWaitingTime": "Pikk ooteaeg", "allCsvAway": "Kõik nõustajad ära / hõivatud", "medianWaitingTime": "Mediaan (min)", "averageWaitingTime": "Aritmeetiline keskmine (min)" diff --git a/GUI/src/pages/ChatsPage/options.tsx b/GUI/src/pages/ChatsPage/options.tsx index 14a46846..b498000a 100644 --- a/GUI/src/pages/ChatsPage/options.tsx +++ b/GUI/src/pages/ChatsPage/options.tsx @@ -17,7 +17,6 @@ export const chatOptions: Option[] = [ labelKey: 'chats.cip', subOptions: [ { id: 'outside-working-hours', labelKey: 'chats.outsideWorkingHours', color: '#fdbf47' }, - { id: 'long-waiting-time', labelKey: 'chats.longWaitingTime', color: '#ed7d32' }, { id: 'all-csas-away', labelKey: 'chats.allCsvAway', color: '#8ab4d5' }, { id: 'total', labelKey: 'chats.totalCount', color: '#008000' }, ],