File indexing completed on 2024-12-29 04:49:57

0001 /*
0002     SPDX-FileCopyrightText: 2018 Volker Krause <vkrause@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "ticket.h"
0008 #include "datatypes_p.h"
0009 
0010 #include <QByteArray>
0011 
0012 #include <cmath>
0013 
0014 using namespace KItinerary;
0015 
0016 namespace KItinerary {
0017 
0018 class SeatPrivate : public QSharedData
0019 {
0020 public:
0021     QString seatNumber;
0022     QString seatRow;
0023     QString seatSection;
0024     QString seatingType;
0025     QString identifier;
0026 };
0027 
0028 KITINERARY_MAKE_CLASS(Seat)
0029 KITINERARY_MAKE_PROPERTY(Seat, QString, seatNumber, setSeatNumber)
0030 KITINERARY_MAKE_PROPERTY(Seat, QString, seatRow, setSeatRow)
0031 KITINERARY_MAKE_PROPERTY(Seat, QString, seatSection, setSeatSection)
0032 KITINERARY_MAKE_PROPERTY(Seat, QString, seatingType, setSeatingType)
0033 KITINERARY_MAKE_PROPERTY(Seat, QString, identifier, setIdentifier)
0034 KITINERARY_MAKE_OPERATOR(Seat)
0035 
0036 class TicketPrivate : public QSharedData
0037 {
0038 public:
0039     QString name;
0040     Organization issuedBy;
0041     QString ticketNumber;
0042     Seat ticketedSeat;
0043     QString ticketToken;
0044     Person underName;
0045     QVariantList subjectOf;
0046     QDateTime validFrom;
0047     QDateTime validUntil;
0048     double totalPrice = NAN;
0049     QString priceCurrency;
0050     QString identifier;
0051 };
0052 
0053 KITINERARY_MAKE_CLASS(Ticket)
0054 KITINERARY_MAKE_PROPERTY(Ticket, QString, name, setName)
0055 KITINERARY_MAKE_PROPERTY(Ticket, Organization, issuedBy, setIssuedBy)
0056 KITINERARY_MAKE_PROPERTY(Ticket, QString, ticketNumber, setTicketNumber)
0057 KITINERARY_MAKE_PROPERTY(Ticket, Seat, ticketedSeat, setTicketedSeat)
0058 KITINERARY_MAKE_PROPERTY(Ticket, QString, ticketToken, setTicketToken)
0059 KITINERARY_MAKE_PROPERTY(Ticket, Person, underName, setUnderName)
0060 KITINERARY_MAKE_PROPERTY(Ticket, QVariantList, subjectOf, setSubjectOf)
0061 KITINERARY_MAKE_PROPERTY(Ticket, QDateTime, validFrom, setValidFrom)
0062 KITINERARY_MAKE_PROPERTY(Ticket, QDateTime, validUntil, setValidUntil)
0063 KITINERARY_MAKE_PROPERTY(Ticket, double, totalPrice, setTotalPrice)
0064 KITINERARY_MAKE_PROPERTY(Ticket, QString, priceCurrency, setPriceCurrency)
0065 KITINERARY_MAKE_PROPERTY(Ticket, QString, identifier, setIdentifier)
0066 KITINERARY_MAKE_OPERATOR(Ticket)
0067 
0068 Token::TokenType Ticket::ticketTokenType() const
0069 {
0070     return Token::tokenType(d->ticketToken);
0071 }
0072 
0073 QVariant Ticket::ticketTokenData() const
0074 {
0075     return Token::tokenData(d->ticketToken);
0076 }
0077 
0078 }
0079 
0080 #include "moc_ticket.cpp"