1
0
forked from BRT/arc
arc/models/db/EventInfo.h
slava 4fe6e399bc Refactor scripts and add enhanced error handling
Revised scripts for payments and history retrieval, introducing improved error management with screenshots for debugging. Added a new LoginAndCheckAccountsScript for account validation, streamlined multi-threading, and updated application logic for clarity and reliability.
2025-05-30 22:16:25 +07:00

49 lines
1.1 KiB
C

#pragma once
#include <QString>
#include <QDateTime>
enum class EventStatus {
Wait,
InProgress,
Complete,
Error,
Unknown
};
inline QString eventStatusToString(const EventStatus type) {
switch (type) {
case EventStatus::Wait: return "wait";
case EventStatus::Error: return "error";
case EventStatus::Complete: return "complete";
case EventStatus::InProgress: return "iPprogress";
default: return "unknown";
}
}
inline EventStatus eventStatusFromString(const QString &str) {
if (str == "error") return EventStatus::Error;
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;
QString comment;
EventStatus status = EventStatus::Unknown;
QDateTime updateTime;
QDateTime completeTime;
QDateTime timestamp;
};