Introduced a new "events" table and corresponding EventDAO for managing event data. Enhanced account handling with device ID and partial card number support. Added a NetworkService method to fetch payments from an API and store them as events.
44 lines
969 B
C
44 lines
969 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;
|
|
|
|
double amount = 0;
|
|
QString phone;
|
|
QString bankName;
|
|
|
|
EventStatus status = EventStatus::Unknown;
|
|
|
|
QDateTime updateTime;
|
|
QDateTime completeTime;
|
|
QDateTime timestamp;
|
|
}; |