1
0
forked from BRT/arc
arc/database/dao/EventDAO.h

42 lines
1.2 KiB
C++

#pragma once
#include <QSet>
#include <db/EventInfo.h>
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<EventInfo> getAllEvents(const EventStatus &status);
[[nodiscard]] static EventInfo getFirstWaitEventByDeviceId(const QString &key);
[[nodiscard]] static bool existsActiveByExternalId(const QString &externalId);
[[nodiscard]] static bool cancelWaitingByType(const QString &deviceId, EventType type);
[[nodiscard]] static QList<EventInfo> 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<EventInfo> getEvents(int page, int pageSize);
[[nodiscard]] static int getTotalCount();
[[nodiscard]] static bool hasPendingEvents();
[[nodiscard]] static QSet<QString> getDevicesWithPendingEvents();
};