From fc3bf73986fe4bf57dc3803b22f758892c1f2758 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Wed, 26 Jul 2023 12:14:47 +0200 Subject: [PATCH] Improved technician config repo #127 --- .../abc/technician_config_repository_abc.py | 26 +++++++++++++++++++ .../technician_config_repository_service.py | 24 +++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/kdb-bot/src/bot_data/abc/technician_config_repository_abc.py b/kdb-bot/src/bot_data/abc/technician_config_repository_abc.py index 377103fb..1751cbe9 100644 --- a/kdb-bot/src/bot_data/abc/technician_config_repository_abc.py +++ b/kdb-bot/src/bot_data/abc/technician_config_repository_abc.py @@ -1,6 +1,8 @@ from abc import ABC, abstractmethod from bot_data.model.technician_config import TechnicianConfig +from bot_data.model.technician_id_config import TechnicianIdConfig +from bot_data.model.technician_ping_url_config import TechnicianPingUrlConfig class TechnicianConfigRepositoryABC(ABC): @@ -23,3 +25,27 @@ class TechnicianConfigRepositoryABC(ABC): @abstractmethod def delete_technician_config(self, technician_config: TechnicianConfig): pass + + @abstractmethod + def add_technician_id_config(self, technician_id: TechnicianIdConfig): + pass + + @abstractmethod + def update_technician_id_config(self, technician_id: TechnicianIdConfig): + pass + + @abstractmethod + def delete_technician_id_config(self, technician_id: TechnicianIdConfig): + pass + + @abstractmethod + def add_technician_ping_url_config(self, technician_ping_url: TechnicianPingUrlConfig): + pass + + @abstractmethod + def update_technician_ping_url_config(self, technician_ping_url: TechnicianPingUrlConfig): + pass + + @abstractmethod + def delete_technician_ping_url_config(self, technician_ping_url: TechnicianPingUrlConfig): + pass diff --git a/kdb-bot/src/bot_data/service/technician_config_repository_service.py b/kdb-bot/src/bot_data/service/technician_config_repository_service.py index de5ea2f2..bd3728d5 100644 --- a/kdb-bot/src/bot_data/service/technician_config_repository_service.py +++ b/kdb-bot/src/bot_data/service/technician_config_repository_service.py @@ -65,3 +65,27 @@ class TechnicianConfigRepositoryService(TechnicianConfigRepositoryABC): def delete_technician_config(self, technician_config: TechnicianConfig): self._logger.trace(__name__, f"Send SQL command: {technician_config.delete_string}") self._context.cursor.execute(technician_config.delete_string) + + def add_technician_id_config(self, technician_id: TechnicianIdConfig): + self._logger.trace(__name__, f"Send SQL command: {technician_id.insert_string}") + self._context.cursor.execute(technician_id.insert_string) + + def update_technician_id_config(self, technician_id: TechnicianIdConfig): + self._logger.trace(__name__, f"Send SQL command: {technician_id.udpate_string}") + self._context.cursor.execute(technician_id.udpate_string) + + def delete_technician_id_config(self, technician_id: TechnicianIdConfig): + self._logger.trace(__name__, f"Send SQL command: {technician_id.delete_string}") + self._context.cursor.execute(technician_id.delete_string) + + def add_technician_ping_url_config(self, technician_ping_url: TechnicianPingUrlConfig): + self._logger.trace(__name__, f"Send SQL command: {technician_ping_url.insert_string}") + self._context.cursor.execute(technician_ping_url.insert_string) + + def update_technician_ping_url_config(self, technician_ping_url: TechnicianPingUrlConfig): + self._logger.trace(__name__, f"Send SQL command: {technician_ping_url.udpate_string}") + self._context.cursor.execute(technician_ping_url.udpate_string) + + def delete_technician_ping_url_config(self, technician_ping_url: TechnicianPingUrlConfig): + self._logger.trace(__name__, f"Send SQL command: {technician_ping_url.delete_string}") + self._context.cursor.execute(technician_ping_url.delete_string)