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.
45 lines
991 B
C
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;
|
|
}; |