#pragma once #include #include class EventDAO { public: [[nodiscard]] static int insertEvent(const EventInfo &event); [[nodiscard]] static bool updateEvent( int id, const EventStatus &status, const QString &comment ); [[nodiscard]] static QList getAllEvents(const EventStatus &status); [[nodiscard]] static EventInfo getFirstWaitEventByDeviceId(const QString &key); [[nodiscard]] static bool existsActiveByExternalId(const QString &externalId); [[nodiscard]] static QList cancelWaitingByType(const QString &deviceId, EventType type, const QString &bankName = {}); [[nodiscard]] static QList cancelWaitingByMaterial(const QString &materialId, EventType type); [[nodiscard]] static QList cancelWaitingByBank(const QString &deviceId, const QString &bankName); [[nodiscard]] static bool updateScreenshot(int id, const QByteArray &screenshot); [[nodiscard]] static QByteArray getScreenshot(int id); [[nodiscard]] static bool updateEventAmount(int id, double amount); [[nodiscard]] static bool markSentToServer(int id); [[nodiscard]] static QList getEvents(int page, int pageSize); [[nodiscard]] static int getTotalCount(); [[nodiscard]] static bool hasPendingEvents(); [[nodiscard]] static QSet getDevicesWithPendingEvents(); [[nodiscard]] static QList getRecentEvents(int hours); };