ATBTariffCalculator/Utilities/tariff_json_template.h

278 lines
8.0 KiB
C
Raw Normal View History

2024-03-01 13:38:12 +01:00
#ifndef TARIFF_JSON_TEMPLATE_H_INCLUDED
#define TARIFF_JSON_TEMPLATE_H_INCLUDED
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonParseError>
#include <QJsonValue>
2024-03-03 11:20:35 +01:00
struct TariffTemplate : public QJsonObject {
2024-03-01 13:38:12 +01:00
QJsonValue m_project;
QJsonValue m_version;
QJsonValue m_date;
QJsonValue m_committer;
QJsonValue m_info;
struct TariffProduct : public QJsonObject {
QJsonValue m_tariff_product_id;
QJsonValue m_tariff_product_price_id;
QJsonValue m_tariff_product_name;
QJsonArray m_tariff_product_time_ranges;
} m_tariff_product;
QJsonArray m_tariff_product_setting;
struct TariffProduct : public QJsonObject {
QJsonValue m_tariff_accuracy_id;
QJsonValue m_tariff_accuracy_label;
QJsonValue m_tariff_accuracy_value;
QJsonArray m_comment;
} m_tariff_accuracy;
QJsonArray m_tariff_accuracy_setting;
struct TariffType : public QJsonObject {
QJsonValue m_tariff_type_id;
QJsonValue m_tariff_type_label;
QJsonValue m_comment;
} m_tariff_type;
QJsonArray m_tariff_type_setting;
struct TariffTimeBase : public QJsonObject {
QJsonValue m_tariff_timebase_id;
QJsonValue m_tariff_timebase_label;
QJsonValue m_comment;
} m_tariff_timebase;
QJsonArray m_tariff_timebase_setting;
struct TariffPriceCustomer : public QJsonObject {
QJsonValue m_tariff_price_customer_id;
QJsonValue m_tariff_price_customer_label;
QJsonValue m_editable;
QJsonValue m_comment;
};
struct TariffConfig : public QJsonObject {
QJsonValue m_tariff_config_id;
QJsonValue m_tariff_config_label;
QJsonValue m_tariff_config_accuracy;
QJsonValue m_tariff_config_type;
struct TariffMinimalTime : public QJsonObject {
QJsonValue m_value;
QJsonValue m_editable;
QJsonValue m_comment;
} m_tariff_minimal_time;
struct TariffMaximalTime : public QJsonObject {
QJsonValue m_value;
QJsonValue m_editable;
QJsonValue m_comment;
} m_tariff_maximal_time;
struct TariffMinimalPrice : public QJsonObject {
QJsonValue m_value;
QJsonValue m_editable;
QJsonValue m_comment;
} m_minimal_price;
struct TariffMaximalPrice : public QJsonObject {
QJsonValue m_value;
QJsonValue m_editable;
QJsonValue m_comment;
} m_maximal_price;
QJsonValue m_tariff_config_time_base;
QJsonValue m_tariff_config_carry_over;
QJsonValue m_tariff_config_prepaid;
};
struct TariffTimeRange : public QJsonObject {
QJsonValue m_time_range_id;
QJsonValue m_time_range_start;
QJsonValue m_time_range_end;
QJsonValue m_time_range_start_minute;
QJsonValue m_time_range_end_minute;
QJsonValue m_time_range_price_id;
QJsonValue m_comment;
} m_tariff_time_range;
QJsonArray m_tariff_time_range_setting;
struct TariffDateRange : public QJsonObject {
QJsonValue m_date_range_id;
QJsonValue m_date_range_label;
QJsonValue m_date_range_from;
};
QJsonArray m_tariff_time_range_setting;
struct TariffDayConfiguration : public QJsonObject {
QJsonValue m_day_config_id;
QJsonValue m_day_config_date_range;
QJsonValue m_day_consfig_comment_date_range;
QJsonArray m_day_config_product_ids;
QJsonValue m_day_config_comment_product_ids;
struct : QJsonArray {
struct : public QJsonObject {
QJsonArray m_data;
} m_day_time_ranges_short_time_parking;
struct : public QJsonObject {
QJsonArray m_data;
} m_day_time_ranges_day_ticket;
} m_day_config_day_time_ranges;
};
struct TariffWeekDay : public QJsonObject {
QJsonValue m_day_id;
QJsonValue m_day_label;
QJsonValue m_day_config_id;
};
struct TariffHolidayDay : public QJsonObject {
QJsonValue m_day_id;
QJsonValue m_day_label;
QJsonValue m_day_config_id;
QJsonValue m_day_moveable;
};
QJsonArray m_tariff_days_setting;
};
#if 0
namespace ISMAS {
struct TransferData : public QJsonObject {
struct : public QJsonObject {
QJsonValue tariffId;
QJsonValue group;
QJsonValue zone;
} device;
struct : public QJsonObject {
QJsonValue state;
QJsonValue uid;
QJsonValue seq_tick_number;
QJsonValue timestamp;
QJsonValue userText;
QJsonValue userTextType;
} transaction;
struct : public QJsonObject {
// TODO: check what is really used at the moment
QJsonValue id; // unique article id
QJsonValue name; // name
QJsonValue price; // price in cent
QJsonValue currency; //
QJsonValue startTime; // start time
QJsonValue endTime; // end time
QJsonValue userText; // additional info
QJsonValue parkingTime;
QJsonValue printText;
// QJsonValue discount;
} item;
struct : public QJsonObject {
struct : public QJsonObject {
QJsonValue coins; // total amount of coins value
// QJsonValue notes; // total amount of notes value
QJsonValue overpaid; // in cent
QJsonValue currency;
QJsonValue change;
} cash;
struct : public QJsonObject {
QJsonValue cardNumber;
QJsonValue value; // buchungsbetrag
QJsonValue cardType;
QJsonValue currency;
QJsonValue tid;
QJsonValue tresult;
} card;
struct : public QJsonObject {
QJsonValue cardNumber;
QJsonValue cardType;
QJsonValue value;
QJsonValue valueOld;
QJsonValue valueNew;
QJsonValue time;
QJsonValue timeOld;
QJsonValue timeNew;
} prePaidCard;
} payment;
struct : public QJsonObject {
QJsonValue delivery; // PRINT, OnlineTicket
QJsonValue result; // SUCCESS, ERROR
QJsonValue errorCode; // 0=OK, 1=...
QJsonValue errorMsg;
} result;
};
struct AccountData : public QJsonObject {
struct : public QJsonObject {
QJsonValue UID;
QJsonValue ChangeNumber;
QJsonValue Process; // Vorgang
QJsonValue startDateTime;
QJsonValue endDateTime;
QJsonValue startHash;
QJsonValue endHash;
struct : public QJsonObject {
QJsonValue value; // coin value
QJsonValue numberOfCoins; // number of coins
QJsonValue currency;
} coin;
} coinBox; // Münzkasse
};
struct EventData : public QJsonObject {
struct : public QJsonObject {
QJsonValue eventID;
QJsonValue deviceName;
QJsonValue reason;
QJsonValue event;
QJsonValue eventState;
QJsonValue timeStamp;
QJsonValue parameter;
QJsonValue secondLevelInfo;
} machineEvent; //
};
struct StateData : public QJsonObject {
QJsonValue Timestamp;
QJsonArray HW_States;
struct : public QJsonObject {
QJsonValue name;
QJsonValue value;
QJsonValue unit;
} machineState; //
};
enum class REQUEST : quint8 {
NO_REQUEST,
START,
STOP,
PING,
SELF,
PARAMETER
};
}
#endif
#endif // TARIFF_JSON_TEMPLATE_H_INCLUDED