Table couponrule

This table contains rules of what category of ticket to exchange to what new category by use of a coupon.

Column NameTypePropertiesDocu
ruleidseq64Primary-Key Simple counter key.
couponidstring:32Foreign-Key=coupon(couponid)
fromcategoryint32Foreign-Key=pricecategory(pricecategoryid) from what category of ticket...
tocategoryint32Foreign-Key=pricecategory(pricecategoryid) ..to change to what category of ticket.
maxuseint32NULL-able how often this rule can be used in one order or NULL for unlimited
needcategoryint32NULL-able Foreign-Key=pricecategory(pricecategoryid) after the change tickets of this category must exist or NULL if there is no requirement
needticketsint32NULL-able after the change this many tickets of "needcategory" must exist or NULL if there is no requirement; e.g. a Two-for-One rule would change fromcategory="paid" to tocategory="free" if needcategory="paid" still has needtickets="1" ticket