42 lines
1.0 KiB
C
42 lines
1.0 KiB
C
#pragma once
|
|
|
|
#include <QDateTime>
|
|
|
|
enum class AccountStatus {
|
|
Active,
|
|
Off
|
|
};
|
|
|
|
inline QString accountStatusToString(const AccountStatus status) {
|
|
switch (status) {
|
|
case AccountStatus::Active: return "active";
|
|
case AccountStatus::Off: return "off";
|
|
default: return "active";
|
|
}
|
|
}
|
|
|
|
inline QString accountStatusToUiString(const AccountStatus status) {
|
|
switch (status) {
|
|
case AccountStatus::Active: return "в работе";
|
|
case AccountStatus::Off: return "выключена";
|
|
default: return "в работе";
|
|
}
|
|
}
|
|
|
|
inline AccountStatus accountStatusFromString(const QString &str) {
|
|
if (str == "active") return AccountStatus::Active;
|
|
if (str == "off") return AccountStatus::Off;
|
|
return AccountStatus::Active;
|
|
}
|
|
|
|
struct AccountInfo {
|
|
int id = -1;
|
|
QString deviceId; // code
|
|
QString appCode;
|
|
QString lastNumbers;
|
|
QString currency;
|
|
QString description;
|
|
double amount = 0.0;
|
|
QDateTime updateTime;
|
|
AccountStatus status = AccountStatus::Active;
|
|
}; |