From 1cf89f4e8aad6624be904cf39ea7ee5c3446e5e8 Mon Sep 17 00:00:00 2001 From: Mihhail Kohhantsuk Date: Fri, 18 Oct 2024 14:01:51 +0300 Subject: [PATCH] Show analytics only for ended conversations --- DSL/Resql/chat-count-only-chatbot.sql | 2 +- DSL/Resql/chat-count-with-csa-and-chatbot.sql | 4 ++-- DSL/Resql/chat-count-with-csa.sql | 2 +- README.md | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/DSL/Resql/chat-count-only-chatbot.sql b/DSL/Resql/chat-count-only-chatbot.sql index fdd677b1..0b415993 100644 --- a/DSL/Resql/chat-count-only-chatbot.sql +++ b/DSL/Resql/chat-count-only-chatbot.sql @@ -2,7 +2,7 @@ SELECT DATE_TRUNC(:period, created) AS time, COUNT(DISTINCT base_id) AS count FROM chat -WHERE created::date BETWEEN :start::date AND :end::date +WHERE created::date BETWEEN :start::date AND :end::date AND status = 'ENDED' AND NOT EXISTS ( SELECT 1 FROM message diff --git a/DSL/Resql/chat-count-with-csa-and-chatbot.sql b/DSL/Resql/chat-count-with-csa-and-chatbot.sql index 72bfe151..3d8b059e 100644 --- a/DSL/Resql/chat-count-with-csa-and-chatbot.sql +++ b/DSL/Resql/chat-count-with-csa-and-chatbot.sql @@ -3,7 +3,7 @@ WITH chatbot_chats AS ( DATE_TRUNC(:period, created) AS time, COUNT(DISTINCT base_id) AS count FROM chat - WHERE created::date BETWEEN :start::date AND :end::date + WHERE created::date BETWEEN :start::date AND :end::date AND status = 'ENDED' AND NOT EXISTS ( SELECT 1 FROM message @@ -17,7 +17,7 @@ csa_chats AS ( DATE_TRUNC(:period, created) AS time, COUNT(DISTINCT base_id) AS count FROM chat - WHERE created::date BETWEEN :start::date AND :end::date + WHERE created::date BETWEEN :start::date AND :end::date AND status = 'ENDED' AND EXISTS ( SELECT 1 FROM message diff --git a/DSL/Resql/chat-count-with-csa.sql b/DSL/Resql/chat-count-with-csa.sql index ace73bb9..e89391f3 100644 --- a/DSL/Resql/chat-count-with-csa.sql +++ b/DSL/Resql/chat-count-with-csa.sql @@ -2,7 +2,7 @@ SELECT DATE_TRUNC(:period, created) AS time, COUNT(DISTINCT base_id) AS count FROM chat -WHERE created::date BETWEEN :start::date AND :end::date +WHERE created::date BETWEEN :start::date AND :end::date AND status = 'ENDED' AND EXISTS ( SELECT 1 FROM message diff --git a/README.md b/README.md index 64a47e4d..40d8f6f1 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ Currently, Header and Main Navigation used as external components, they are defi ``` curl -X POST -H "Content-Type: application/json" -d '{ "login": "EE30303039914", - "password": "" + "password": "OK" }' http://localhost:8080/auth/login ```