MOBILISIS-Calculator/library/include/mobilisis/tariff_customer.h

48 lines
1.4 KiB
C
Raw Normal View History

2023-12-12 12:14:14 +01:00
#ifndef TARIFF_CUSTOMER_H_INCLUDED
#define TARIFF_CUSTOMER_H_INCLUDED
2023-12-12 11:59:35 +01:00
#include <QString>
2023-12-15 13:28:04 +01:00
#include <QDebug>
#include <QDebugStateSaver>
2023-12-12 11:59:35 +01:00
2023-12-12 17:55:44 +01:00
struct ATBCustomer {
enum class CustomerType {ADULT=1000, CHILD, TEEN};
2023-12-12 11:59:35 +01:00
2023-12-12 17:55:44 +01:00
ATBCustomer() = default;
2023-12-12 11:59:35 +01:00
2024-01-30 10:15:39 +01:00
int cust_id;
2023-12-12 12:14:14 +01:00
CustomerType cust_type;
2023-12-12 12:10:55 +01:00
QString cust_label;
2023-12-15 13:28:04 +01:00
friend QDebug operator<<(QDebug debug, ATBCustomer const &customer) {
QDebugStateSaver saver(debug);
2024-01-30 10:15:39 +01:00
debug.nospace() << "CUSTOMER" << "\n";
2023-12-15 13:28:04 +01:00
switch(customer.cust_type) {
case ATBCustomer::CustomerType::ADULT:
debug.nospace()
2024-01-30 10:15:39 +01:00
<< " cust_id: " << customer.cust_id << "\n"
2023-12-15 13:28:04 +01:00
<< " cust_type: " << "CustomerType::ADULT" << "\n"
<< "cust_label: " << customer.cust_label << "\n";
break;
case ATBCustomer::CustomerType::CHILD:
debug.nospace()
2024-01-30 10:15:39 +01:00
<< " cust_id: " << customer.cust_id << "\n"
2023-12-15 13:28:04 +01:00
<< " cust_type: " << "CustomerType::CHILD" << "\n"
<< "cust_label: " << customer.cust_label << "\n";
break;
case ATBCustomer::CustomerType::TEEN:
debug.nospace()
2024-01-30 10:15:39 +01:00
<< " cust_id: " << customer.cust_id << "\n"
2023-12-15 13:28:04 +01:00
<< " cust_type: " << "CustomerType::TEEN" << "\n"
<< "cust_label: " << customer.cust_label << "\n";
break;
}
return debug;
}
2023-12-12 11:59:35 +01:00
};
#endif // TARIFF_CUSTOMER_H_INCLUDED