MagicSmoke  $VERSION$
MOCartTicket Class Reference

Encapsulates tickets for a specific event in a specific price category as they are stored in the cart. One instance of CartTicket can contain several tickets. This class is used by the client to tell the server about new orders and by the Web UI to actually store its cart. More...

#include <srcMOCartTicket.h>

Inheritance diagram for MOCartTicket:

Public Types

enum  TicketValidationState {
  Ok =0, EventOver =1, TooLate =2, Exhausted =3,
  Invalid =4
}
 Used when checking orders: tells us whether a ticket can be sold or not. More...
 

Public Member Functions

 MOCartTicket ()
 default constructor: constructs an invalid instance of MOCartTicket More...
 
 MOCartTicket (const MOCartTicket &)
 copy constructor: creates a (deep) copy of the object More...
 
 MOCartTicket (const QDomElement &)
 special constructor: create from the XML representation, deserializing the object More...
 
virtual ~MOCartTicket ()
 destructor: deletes this copy of the object More...
 
virtual Nullable< qint64 > amount () const
 
virtual Nullable< QString > cartid () const
 The cartID as used by the web user interface, this property must not be interpreted while the server attempts to create an order from this cart, the server must preserve it unchanged. More...
 
virtual Nullable< qint64 > cartlineid () const
 optional property that can be used by the calling process to distinguish lines in the cart, the server must preserve it unchanged More...
 
virtual Nullable< MOEventevent () const
 Used in the Web UI only to provide access to event properties. More...
 
virtual Nullable< qint64 > eventid () const
 
virtual Nullable< MOEventPriceeventprice () const
 Used in the Web UI only to provide access to price properties. More...
 
virtual Nullable< qint64 > maxamount () const
 
MOCartTicketoperator= (const MOCartTicket &)
 copy assignment: creates a (deep) copy of the object More...
 
virtual Nullable< MOEventPriceorigeventprice () const
 Used in the Web UI only to provide access to price properties. More...
 
virtual Nullable< qint64 > origpricecategoryid () const
 Price category originally assigned before the coupon changed it. More...
 
virtual Nullable< qint64 > price () const
 
virtual Nullable< qint64 > pricecategoryid () const
 Price category to be used for this ticket. More...
 
 Q_ENUMS (TicketValidationState)
 
virtual void setamount (Nullable< qint64 > s)
 
virtual void setcartid (Nullable< QString > s)
 The cartID as used by the web user interface, this property must not be interpreted while the server attempts to create an order from this cart, the server must preserve it unchanged. More...
 
virtual void setcartlineid (Nullable< qint64 > s)
 optional property that can be used by the calling process to distinguish lines in the cart, the server must preserve it unchanged More...
 
virtual void setevent (Nullable< MOEvent > s)
 Used in the Web UI only to provide access to event properties. More...
 
virtual void seteventid (Nullable< qint64 > s)
 
virtual void seteventprice (Nullable< MOEventPrice > s)
 Used in the Web UI only to provide access to price properties. More...
 
virtual void setmaxamount (Nullable< qint64 > s)
 
virtual void setorigeventprice (Nullable< MOEventPrice > s)
 Used in the Web UI only to provide access to price properties. More...
 
virtual void setorigpricecategoryid (Nullable< qint64 > s)
 Price category originally assigned before the coupon changed it. More...
 
virtual void setprice (Nullable< qint64 > s)
 
virtual void setpricecategoryid (Nullable< qint64 > s)
 Price category to be used for this ticket. More...
 
virtual void setstatus (Nullable< TicketValidationState > s)
 
virtual void setstatustext (Nullable< QString > s)
 
virtual Nullable
< TicketValidationState
status () const
 
virtual Nullable< QString > statustext () const
 
QString toString ()
 Serializes the object to XML and returns the string representation of that XML. More...
 
QDomElement toXml (QDomDocument &doc, QString name="CartTicket")
 Transforms the object into its XML representation, the element node returned is not appended to the document - you have to do that yourself. More...
 
void toXml (QDomDocument &, QDomElement &)
 Serializes the object into the given element. More...
 

Static Public Member Functions

static MOCartTicket fromString (const QString &)
 create MOCartTicket from XML formatted string (inverse of toString) More...
 
static MOCartTicket fromXml (const QDomElement &)
 create MOCartTicket from XML (inverse of toXml) More...
 
static TicketValidationState locstr2TicketValidationState (QString, bool *ok=0)
 Converts a localized string into the corresponding enum TicketValidationState value. More...
 
static TicketValidationState str2TicketValidationState (QString, bool *ok=0)
 Converts string into the corresponding enum TicketValidationState value. More...
 
static QString TicketValidationState2locstr (TicketValidationState)
 Converts enum TicketValidationState value into the corresponding localized string. More...
 
static QString TicketValidationState2str (TicketValidationState)
 Converts enum TicketValidationState value into the corresponding string. More...
 

Protected Attributes

Nullable< qint64 > mp_amount
 
Nullable< QString > mp_cartid
 
Nullable< qint64 > mp_cartlineid
 
Nullable< MOEventmp_event
 
Nullable< qint64 > mp_eventid
 
Nullable< MOEventPricemp_eventprice
 
Nullable< qint64 > mp_maxamount
 
Nullable< MOEventPricemp_origeventprice
 
Nullable< qint64 > mp_origpricecategoryid
 
Nullable< qint64 > mp_price
 
Nullable< qint64 > mp_pricecategoryid
 
Nullable< TicketValidationStatemp_status
 
Nullable< QString > mp_statustext
 

Properties

Nullable< qint64 > amount
 
Nullable< QString > cartid
 The cartID as used by the web user interface, this property must not be interpreted while the server attempts to create an order from this cart, the server must preserve it unchanged. More...
 
Nullable< qint64 > cartlineid
 optional property that can be used by the calling process to distinguish lines in the cart, the server must preserve it unchanged More...
 
Nullable< MOEventevent
 Used in the Web UI only to provide access to event properties. More...
 
Nullable< qint64 > eventid
 
Nullable< MOEventPriceeventprice
 Used in the Web UI only to provide access to price properties. More...
 
Nullable< qint64 > maxamount
 
Nullable< MOEventPriceorigeventprice
 Used in the Web UI only to provide access to price properties. More...
 
Nullable< qint64 > origpricecategoryid
 Price category originally assigned before the coupon changed it. More...
 
Nullable< qint64 > price
 
Nullable< qint64 > pricecategoryid
 Price category to be used for this ticket. More...
 
Nullable< TicketValidationStatestatus
 
Nullable< QString > statustext
 

Detailed Description

Encapsulates tickets for a specific event in a specific price category as they are stored in the cart. One instance of CartTicket can contain several tickets. This class is used by the client to tell the server about new orders and by the Web UI to actually store its cart.

Member Enumeration Documentation

Used when checking orders: tells us whether a ticket can be sold or not.

Enumerator
Ok 

The tickets can be sold.

EventOver 

The event is already over.

TooLate 

The event is not yet over, but normal sale is no longer possible, you need the CreateOrder:LateSale privilege.

Exhausted 

There are not enough tickets for this event.

Invalid 

There is an inherent mismatch in the ticket (eg. non-existent event or price category), it can't possibly be sold.

Constructor & Destructor Documentation

MOCartTicket::MOCartTicket ( )
inline

default constructor: constructs an invalid instance of MOCartTicket

Referenced by fromString(), and fromXml().

MOCartTicket::MOCartTicket ( const MOCartTicket o)
MOCartTicket::MOCartTicket ( const QDomElement &  root)
explicit
virtual MOCartTicket::~MOCartTicket ( )
inlinevirtual

destructor: deletes this copy of the object

Member Function Documentation

virtual Nullable<qint64> MOCartTicket::amount ( ) const
inlinevirtual
virtual Nullable<QString> MOCartTicket::cartid ( ) const
inlinevirtual

The cartID as used by the web user interface, this property must not be interpreted while the server attempts to create an order from this cart, the server must preserve it unchanged.

virtual Nullable<qint64> MOCartTicket::cartlineid ( ) const
inlinevirtual

optional property that can be used by the calling process to distinguish lines in the cart, the server must preserve it unchanged

virtual Nullable<MOEvent> MOCartTicket::event ( ) const
inlinevirtual

Used in the Web UI only to provide access to event properties.

virtual Nullable<qint64> MOCartTicket::eventid ( ) const
inlinevirtual
virtual Nullable<MOEventPrice> MOCartTicket::eventprice ( ) const
inlinevirtual

Used in the Web UI only to provide access to price properties.

MOCartTicket MOCartTicket::fromString ( const QString &  txt)
static

create MOCartTicket from XML formatted string (inverse of toString)

References MOCartTicket().

MOCartTicket MOCartTicket::fromXml ( const QDomElement &  root)
static

create MOCartTicket from XML (inverse of toXml)

References MOCartTicket().

MOCartTicket::TicketValidationState MOCartTicket::locstr2TicketValidationState ( QString  s,
bool *  ok = 0 
)
static

Converts a localized string into the corresponding enum TicketValidationState value.

References EventOver, Exhausted, Invalid, Ok, and TooLate.

virtual Nullable<qint64> MOCartTicket::maxamount ( ) const
inlinevirtual
MOCartTicket & MOCartTicket::operator= ( const MOCartTicket o)
virtual Nullable<MOEventPrice> MOCartTicket::origeventprice ( ) const
inlinevirtual

Used in the Web UI only to provide access to price properties.

virtual Nullable<qint64> MOCartTicket::origpricecategoryid ( ) const
inlinevirtual

Price category originally assigned before the coupon changed it.

virtual Nullable<qint64> MOCartTicket::price ( ) const
inlinevirtual
virtual Nullable<qint64> MOCartTicket::pricecategoryid ( ) const
inlinevirtual

Price category to be used for this ticket.

MOCartTicket::Q_ENUMS ( TicketValidationState  )
virtual void MOCartTicket::setamount ( Nullable< qint64 >  s)
inlinevirtual

Referenced by MOCartTicket().

virtual void MOCartTicket::setcartid ( Nullable< QString >  s)
inlinevirtual

The cartID as used by the web user interface, this property must not be interpreted while the server attempts to create an order from this cart, the server must preserve it unchanged.

Referenced by MOCartTicket().

virtual void MOCartTicket::setcartlineid ( Nullable< qint64 >  s)
inlinevirtual

optional property that can be used by the calling process to distinguish lines in the cart, the server must preserve it unchanged

Referenced by MOCartTicket().

virtual void MOCartTicket::setevent ( Nullable< MOEvent s)
inlinevirtual

Used in the Web UI only to provide access to event properties.

Referenced by MOCartTicket().

virtual void MOCartTicket::seteventid ( Nullable< qint64 >  s)
inlinevirtual

Referenced by MOCartTicket().

virtual void MOCartTicket::seteventprice ( Nullable< MOEventPrice s)
inlinevirtual

Used in the Web UI only to provide access to price properties.

Referenced by MOCartTicket().

virtual void MOCartTicket::setmaxamount ( Nullable< qint64 >  s)
inlinevirtual

Referenced by MOCartTicket().

virtual void MOCartTicket::setorigeventprice ( Nullable< MOEventPrice s)
inlinevirtual

Used in the Web UI only to provide access to price properties.

Referenced by MOCartTicket().

virtual void MOCartTicket::setorigpricecategoryid ( Nullable< qint64 >  s)
inlinevirtual

Price category originally assigned before the coupon changed it.

Referenced by MOCartTicket().

virtual void MOCartTicket::setprice ( Nullable< qint64 >  s)
inlinevirtual

Referenced by MOCartTicket().

virtual void MOCartTicket::setpricecategoryid ( Nullable< qint64 >  s)
inlinevirtual

Price category to be used for this ticket.

Referenced by MOCartTicket().

virtual void MOCartTicket::setstatus ( Nullable< TicketValidationState s)
inlinevirtual

Referenced by MOCartTicket().

virtual void MOCartTicket::setstatustext ( Nullable< QString >  s)
inlinevirtual

Referenced by MOCartTicket().

virtual Nullable<TicketValidationState> MOCartTicket::status ( ) const
inlinevirtual
virtual Nullable<QString> MOCartTicket::statustext ( ) const
inlinevirtual
MOCartTicket::TicketValidationState MOCartTicket::str2TicketValidationState ( QString  s,
bool *  ok = 0 
)
static

Converts string into the corresponding enum TicketValidationState value.

References EventOver, Exhausted, Invalid, Ok, and TooLate.

Referenced by MOCartTicket().

QString MOCartTicket::TicketValidationState2locstr ( TicketValidationState  e)
static

Converts enum TicketValidationState value into the corresponding localized string.

References EventOver, Exhausted, Invalid, Ok, and TooLate.

QString MOCartTicket::TicketValidationState2str ( TicketValidationState  e)
static

Converts enum TicketValidationState value into the corresponding string.

References EventOver, Exhausted, Invalid, Ok, and TooLate.

QString MOCartTicket::toString ( )

Serializes the object to XML and returns the string representation of that XML.

References toXml().

QDomElement MOCartTicket::toXml ( QDomDocument &  doc,
QString  name = "CartTicket" 
)

Transforms the object into its XML representation, the element node returned is not appended to the document - you have to do that yourself.

Parameters
docthe DOM document node for which to generate the element
namethe name to give the generated element, per default "MOCartTicket" is used

Referenced by toString().

void MOCartTicket::toXml ( QDomDocument &  doc,
QDomElement &  r 
)

Member Data Documentation

Nullable<qint64> MOCartTicket::mp_amount
protected

Referenced by MOCartTicket(), operator=(), and toXml().

Nullable<QString> MOCartTicket::mp_cartid
protected

Referenced by MOCartTicket(), operator=(), and toXml().

Nullable<qint64> MOCartTicket::mp_cartlineid
protected

Referenced by MOCartTicket(), operator=(), and toXml().

Nullable<MOEvent> MOCartTicket::mp_event
protected

Referenced by MOCartTicket(), operator=(), and toXml().

Nullable<qint64> MOCartTicket::mp_eventid
protected

Referenced by MOCartTicket(), operator=(), and toXml().

Nullable<MOEventPrice> MOCartTicket::mp_eventprice
protected

Referenced by MOCartTicket(), operator=(), and toXml().

Nullable<qint64> MOCartTicket::mp_maxamount
protected

Referenced by MOCartTicket(), operator=(), and toXml().

Nullable<MOEventPrice> MOCartTicket::mp_origeventprice
protected

Referenced by MOCartTicket(), operator=(), and toXml().

Nullable<qint64> MOCartTicket::mp_origpricecategoryid
protected

Referenced by MOCartTicket(), operator=(), and toXml().

Nullable<qint64> MOCartTicket::mp_price
protected

Referenced by MOCartTicket(), operator=(), and toXml().

Nullable<qint64> MOCartTicket::mp_pricecategoryid
protected

Referenced by MOCartTicket(), operator=(), and toXml().

Nullable<TicketValidationState> MOCartTicket::mp_status
protected

Referenced by MOCartTicket(), operator=(), and toXml().

Nullable<QString> MOCartTicket::mp_statustext
protected

Referenced by MOCartTicket(), operator=(), and toXml().

Property Documentation

Nullable<qint64> MOCartTicket::amount
readwrite
Nullable<QString> MOCartTicket::cartid
readwrite

The cartID as used by the web user interface, this property must not be interpreted while the server attempts to create an order from this cart, the server must preserve it unchanged.

Nullable<qint64> MOCartTicket::cartlineid
readwrite

optional property that can be used by the calling process to distinguish lines in the cart, the server must preserve it unchanged

Nullable<MOEvent> MOCartTicket::event
readwrite

Used in the Web UI only to provide access to event properties.

Nullable<qint64> MOCartTicket::eventid
readwrite
Nullable<MOEventPrice> MOCartTicket::eventprice
readwrite

Used in the Web UI only to provide access to price properties.

Nullable<qint64> MOCartTicket::maxamount
readwrite
Nullable<MOEventPrice> MOCartTicket::origeventprice
readwrite

Used in the Web UI only to provide access to price properties.

Nullable<qint64> MOCartTicket::origpricecategoryid
readwrite

Price category originally assigned before the coupon changed it.

Nullable<qint64> MOCartTicket::price
readwrite
Nullable<qint64> MOCartTicket::pricecategoryid
readwrite

Price category to be used for this ticket.

Nullable<TicketValidationState> MOCartTicket::status
readwrite
Nullable<QString> MOCartTicket::statustext
readwrite

The documentation for this class was generated from the following files: