Add reset(). Changed print-format.
This commit is contained in:
parent
5b8ac6cc59
commit
3311537fee
@ -4,6 +4,7 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QVector>
|
||||||
#include <QDebugStateSaver>
|
#include <QDebugStateSaver>
|
||||||
|
|
||||||
|
|
||||||
@ -15,65 +16,49 @@ struct ATBDailyTicket {
|
|||||||
ATBDailyTicket() = default;
|
ATBDailyTicket() = default;
|
||||||
|
|
||||||
int daily_ticket_payment_option_id;
|
int daily_ticket_payment_option_id;
|
||||||
int daily_ticket_unit_id;
|
int daily_ticket_id;
|
||||||
double daily_ticket_price;
|
int daily_ticket_price_id;
|
||||||
|
|
||||||
ATBTimeBase::TimeBaseType daily_ticket_tbase_type;
|
int daily_ticket_tb_id;
|
||||||
// time base setting for ticket:
|
// time base setting for ticket:
|
||||||
// absolute: using time stamps
|
// absolute: using time stamps
|
||||||
// relative: use offsets from
|
// relative: use offsets from
|
||||||
// some reference time point,
|
// some reference time point,
|
||||||
// typically "start time".
|
// typically "start time".
|
||||||
|
|
||||||
ATBCustomer::CustomerType daily_ticket_clearance_customer_type;
|
QVector<int> daily_ticket_clearance_customer_ids;
|
||||||
// who is allowed to buy the ticket:
|
// who is allowed to buy the ticket:
|
||||||
// list of customer types
|
// list of customer types
|
||||||
|
|
||||||
int daily_ticket_weekday_range; // [mon-sun]
|
QTime daily_ticket_from_min; // absolute time base
|
||||||
int daily_ticket_special_day_range;
|
QTime daily_ticket_to_max;
|
||||||
|
int daily_ticket_from_offset_min; // relative time base
|
||||||
|
int daily_ticket_to_offset_max;
|
||||||
|
|
||||||
|
void reset() {
|
||||||
|
daily_ticket_payment_option_id = 0;
|
||||||
|
daily_ticket_id = 0;
|
||||||
|
daily_ticket_price_id = 0;
|
||||||
|
daily_ticket_tb_id = 0;
|
||||||
|
daily_ticket_clearance_customer_ids.clear();
|
||||||
|
daily_ticket_from_min = QTime();
|
||||||
|
daily_ticket_to_max = QTime();
|
||||||
|
daily_ticket_from_offset_min = 0;
|
||||||
|
daily_ticket_to_offset_max = 0;
|
||||||
|
}
|
||||||
|
|
||||||
friend QDebug operator<<(QDebug debug, ATBDailyTicket const &ticket) {
|
friend QDebug operator<<(QDebug debug, ATBDailyTicket const &ticket) {
|
||||||
QDebugStateSaver saver(debug);
|
QDebugStateSaver saver(debug);
|
||||||
|
|
||||||
debug.nospace()
|
debug.nospace()
|
||||||
<< " daily_ticket_payment_option_id: " << ticket.daily_ticket_payment_option_id << "\n"
|
<< "DAILY TICKET " << "\n"
|
||||||
<< " daily_ticket_unit_id: " << ticket.daily_ticket_unit_id << "\n"
|
<< " daily_ticket_id: " << ticket.daily_ticket_id << "\n"
|
||||||
<< " daily_ticket_price: " << ticket.daily_ticket_price << "\n";
|
<< " daily_ticket_payment_option_id: " << ticket.daily_ticket_payment_option_id << "\n"
|
||||||
|
<< " daily_ticket_tbase_id: " << ticket.daily_ticket_tb_id << "\n"
|
||||||
switch(ticket.daily_ticket_tbase_type) {
|
<< " daily_ticket_price_id: " << ticket.daily_ticket_price_id << "\n"
|
||||||
case ATBTimeBase::TimeBaseType::ABSOLUTE:
|
<< "daily_ticket_clearance_customer_ids: " << ticket.daily_ticket_clearance_customer_ids << "\n"
|
||||||
debug.nospace()
|
<< " daily_ticket_from_min: " << ticket.daily_ticket_from_min.toString(Qt::ISODate) << "\n"
|
||||||
<< " daily_ticket_tbase_type: " << "TimeBaseType::ABSOLUTE" << "\n";
|
<< " daily_ticket_to_min: " << ticket.daily_ticket_to_max.toString(Qt::ISODate) << "\n";
|
||||||
break;
|
|
||||||
case ATBTimeBase::TimeBaseType::RELATIVE:
|
|
||||||
debug.nospace()
|
|
||||||
<< " daily_ticket_tbase_type: " << "TimeBaseType::RELATIVE" << "\n";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch(ticket.daily_ticket_clearance_customer_type) {
|
|
||||||
case ATBCustomer::CustomerType::ADULT:
|
|
||||||
debug.nospace()
|
|
||||||
<< "daily_ticket_clearance_customer_type: " << "CustomerType::ADULT" << "\n";
|
|
||||||
break;
|
|
||||||
case ATBCustomer::CustomerType::CHILD:
|
|
||||||
debug.nospace()
|
|
||||||
<< "daily_ticket_clearance_customer_type: " << "CustomerType::CHILD" << "\n";
|
|
||||||
break;
|
|
||||||
case ATBCustomer::CustomerType::TEEN:
|
|
||||||
debug.nospace()
|
|
||||||
<< "daily_ticket_clearance_customer_type: " << "CustomerType::TEEN" << "\n";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
debug.nospace()
|
|
||||||
<< "daily_ticket_clearance_customer_type: " << "CustomerType::???" << "\n";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
debug.nospace()
|
|
||||||
<< " daily_ticket_weekday_range: " << ticket.daily_ticket_weekday_range << "\n"
|
|
||||||
<< " daily_ticket_special_day_range: " << ticket.daily_ticket_special_day_range << "\n";
|
|
||||||
|
|
||||||
return debug;
|
return debug;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user