1
0
forked from BRT/arc
arc/models/db/EventInfo.h
slava 5cb32ec4f1 Refactor and enhance device and event handling logic
Refactored `DeviceScreener`, `NetworkService`, and event-related logic for improved maintainability and flexibility. Introduced `EventHandler` for thread management and made changes to include configurable URLs via `config.ini`. Modified database schema to support device-level event linking.
2025-05-22 21:33:25 +07:00

45 lines
991 B
C

#pragma once
#include <QString>
#include <QDateTime>
enum class EventStatus {
Wait,
InProgress,
Complete,
Unknown
};
inline QString eventStatusToString(const EventStatus type) {
switch (type) {
case EventStatus::Wait: return "wait";
case EventStatus::Complete: return "complete";
case EventStatus::InProgress: return "iPprogress";
default: return "unknown";
}
}
inline EventStatus eventStatusFromString(const QString &str) {
if (str == "wait") return EventStatus::Wait;
if (str == "complete") return EventStatus::Complete;
if (str == "iPprogress") return EventStatus::InProgress;
return EventStatus::Unknown;
}
struct EventInfo {
int id = -1;
int externalId = -1;
int accountId = -1;
QString deviceId;
double amount = 0;
QString phone;
QString bankName;
EventStatus status = EventStatus::Unknown;
QDateTime updateTime;
QDateTime completeTime;
QDateTime timestamp;
};