/** * NomNotification object * $Id$ * $HeadURL$ * $Author$ * Created by Hanna E. Rathje, ESZS, 2025-06-23 */ #pragma once #include "dds_handler.h" //#include "nom_db.h" #include // Generated #include namespace NotificationManagement { class ObjectNotification final { public: explicit ObjectNotification(const std::shared_ptr &ddsHandler, const std::shared_ptr &db); ~ObjectNotification(); Core::FunctionReplyObject createObject(const NomNotification &data); Core::FunctionReplyObject readReceipt(const ReadReceipt &data, int notificationId); Core::FunctionReplyObject deleteMessage(const DeleteMessage &data, int notificationId); Core::FunctionReplyObject deleteObject(const DeleteMessage &data, int notificationId); Core::FunctionReplyObject removeObject(); Core::FunctionReplyObject setUsed(bool isUsed); qint32 id() const { return m_dataNotificationObject.id(); } NomNotification notification() const { return m_dataNotificationObject; } QString title() const { return QString::fromStdString(m_dataNotificationObject.title()); } bool isValid() const; bool isUsed() const; // convert methods Database::NomNotification toDbData(const NomNotification &ddsData); // dds -> db static NomNotification toDdsData(const Database::NomNotification &dbData); // db -> dds static Database::NomAddress toDbData(const Address &ddsData); // dds -> db static Address toDdsData(const Database::NomAddress &dbData); // db -> dds private: void onPublishData(); QString contentArgsToJson(); static std::vector jsonToContentArgs(const QString &properties); private: std::shared_ptr m_ddsHandler; std::shared_ptr m_db; NomNotification m_dataNotificationObject; NGL::INGLLogger &m_logger; }; } // namespace NotificationManagement