Inventory Management

Registrasion uses an inventory model to keep track of tickets, and the other various products that attendees of your conference might want to have, such as t-shirts and dinner tickets.

All of the classes described herein are available through the Django Admin interface.

Overview

The inventory model is split up into Categories and Products. Categories are used to group Products.

Registrasion uses conditionals to build up complex tickets, or enable/disable specific items to specific users:

Often, you will want to offer free items, such as t-shirts or dinner tickets to your attendees. Registrasion has a Discounts facility that lets you automatically offer free items to your attendees as part of their tickets. You can also automatically offer promotional discounts, such as Early Bird discounts.

Sometimes, you may want to restrict parts of the conference to specific attendees, for example, you might have a Speakers Dinner to only speakers. Or you might want to restrict certain Products to attendees who have purchased other items, for example, you might want to sell Comfy Chairs to people who’ve bought VIP tickets. You can control showing and hiding specific products using Flags.

Categories

Categories are logical groups of Products. Generally, you should keep like products in the same category, and use as many categories as you need.

You will need at least one Category to be able to sell tickets to your attendees.

Each category has the following attributes:

class registrasion.models.inventory.Category(*args, **kwargs)

Registration product categories, used as logical groupings for Products in registration forms.

name

str

The display name for the category.

description

str

Some explanatory text for the category. This is displayed alongside the forms where your attendees choose their items.

required

bool

Requires a user to select an item from this category during initial registration. You can use this, e.g., for making sure that the user has a ticket before they select whether they want a t-shirt.

render_type

int

This is used to determine what sort of form the attendee will be presented with when choosing Products from this category. These may be either of the following:

RENDER_TYPE_RADIO presents the Products in the Category as a list of radio buttons. At most one item can be chosen at a time. This works well when setting limit_per_user to 1.

RENDER_TYPE_QUANTITY shows each Product next to an input field, where the user can specify a quantity of each Product type. This is useful for additional extras, like Dinner Tickets.

limit_per_user

Optional[int]

This restricts the number of items from this Category that each attendee may claim. This extends across multiple Invoices.

display_order

int

An ascending order for displaying the Categories available. By convention, your Category for ticket types should have the lowest display order.

Products

Products represent the different items that comprise a user’s conference ticket.

Each product has the following attributes:

class registrasion.models.inventory.Product(*args, **kwargs)

Products make up the conference inventory.

name

str

The display name for the product.

description

str

Some descriptive text that will help the user to understand the product when they’re at the registration form.

category

Category

The Category that this product will be grouped under.

price

Decimal

The price that 1 unit of this product will sell for. Note that this should be the full price, before any discounts are applied.

limit_per_user

Optional[int]

This restricts the number of this Product that each attendee may claim. This extends across multiple Invoices.

reservation_duration

datetime

When a Product is added to the user’s tentative registration, it is marked as unavailable for a period of time. This allows the user to build up their registration and then pay for it. This reservation duration determines how long an item should be allowed to be reserved whilst being unpaid.

display_order

int

An ascending order for displaying the Products within each Category.

Vouchers

Vouchers are used to enable Discounts or Flags for people who enter a voucher code.

class registrasion.models.inventory.Voucher(*args, **kwargs)

Vouchers are used to enable Discounts or Flags for the people who hold the voucher code.

recipient

str

A display string used to identify the holder of the voucher on the admin page.

code

str

The string that is used to prove that the attendee holds this voucher.

limit

int

The number of attendees who are permitted to hold this voucher.

If an attendee enters a voucher code, they have at least an hour to finalise their registration before the voucher becomes unreserved. Only as many people as allowed by limit are allowed to have a voucher reserved.

Discounts

Discounts serve multiple purposes: they can be used to build up complex tickets by automatically waiving the costs for sub-products; they can be used to offer freebie tickets to specific people, or people who hold voucher codes; or they can be used to enable short-term promotional discounts.

Registrasion has several types of discounts, which enable themselves under specific conditions. We’ll explain how these work later on, but first:

Common features

Each discount type has the following common attributes:

class registrasion.models.conditions.DiscountBase(*args, **kwargs)

Base class for discounts. This class is subclassed with special attributes which are used to determine whether or not the given discount is available to be added to the current cart.

description

str

Display text that appears on the attendee’s Invoice when the discount is applied to a Product on that invoice.

You can apply a discount to individual products, or to whole categories, or both. All of the products and categories affected by the discount are displayed on the discount’s admin page.

If you choose to specify individual products, you have these options:

class registrasion.models.conditions.DiscountForProduct(*args, **kwargs)

Represents a discount on an individual product. Each Discount can contain multiple products and categories. Discounts can either be a percentage or a fixed amount, but not both.

product

inventory.Product

The product that this discount line will apply to.

percentage

Decimal

The percentage discount that will be taken off this product if this discount applies.

price

Decimal

The currency value that will be taken off this product if this discount applies.

quantity

int

The number of times that each user may apply this discount line. This applies across every valid Invoice that the user has.

If you choose to specify whole categories, you have these options:

class registrasion.models.conditions.DiscountForCategory(*args, **kwargs)

Represents a discount for a category of products. Each discount can contain multiple products. Category discounts can only be a percentage.

category

inventory.Category

The category whose products that this discount line will apply to.

percentage

Decimal

The percentage discount that will be taken off a product if this discount applies.

quantity

int

The number of times that each user may apply this discount line. This applies across every valid Invoice that the user has.

Note that you cannot have a discount apply to both a category, and a product within that category.

Product Inclusions

Product inclusion discounts allow you to enable a discount when an attendee has selected a specific enabling Product.

For example, if you want to give everyone with a ticket a free t-shirt, you can use a product inclusion to offer a 100% discount on the t-shirt category, if the attendee has selected one of your ticket Products.

Once a discount has been enabled in one Invoice, it is available until the quantities are exhausted for that attendee.

class registrasion.models.conditions.IncludedProductDiscount(*args, **kwargs)

Discounts that are enabled because another product has been purchased. e.g. A conference ticket includes a free t-shirt.

enabling_products

[inventory.Product, ...]

The products that enable the discount.

Time/stock limit discounts

These discounts allow you to offer a limited promotion that is automatically offered to all attendees. You can specify a time range for when the discount should be enabled, you can also specify a stock limit.

class registrasion.models.conditions.TimeOrStockLimitDiscount(*args, **kwargs)

Discounts that are generally available, but are limited by timespan or usage count. This is for e.g. Early Bird discounts.

start_time

Optional[datetime]

When the discount should start being offered.

end_time

Optional[datetime]

When the discount should stop being offered.

limit

Optional[int]

How many times the discount is allowed to be applied – to all users.

Voucher discounts

Vouchers can be used to enable discounts.

class registrasion.models.conditions.VoucherDiscount(*args, **kwargs)

Discounts that are enabled when a voucher code is in the current cart. These are normally configured in the Admin page at the same time as creating a Voucher object.

voucher

inventory.Voucher

The voucher that enables this discount.

How discounts get applied

It’s possible for multiple discounts to be available on any given Product. This means there need to be rules for how discounts get applied. It works like so:

  1. Take all of the Products that the user currently has selected, and sort them so that the most expensive comes first.
  2. Apply the highest-value discount line for the first Product, until either all such products have a discount applied, or the discount’s Quantity has been exhausted for that user for that Product.
  3. Repeat until all products have been processed.

In summary, the system greedily applies the highest-value discounts for each product. This may not provide a global optimum, but it’ll do.

As an example: say a user has a voucher available for a 100% discount of tickets, and there’s a promotional discount for 15% off tickets. In this case, the 100% discount will apply, and the 15% discount will not be disturbed.

Flags

Flags are conditions that can be used to enable or disable Products or Categories, depending on whether conditions are met. They can be used to restrict specific products to specific people, or to place time limits on availability for products.

Common Features

class registrasion.models.conditions.FlagBase(*args, **kwargs)

This defines a condition which allows products or categories to be made visible, or be prevented from being visible.

description

str

A human-readable description that is used to identify the flag to staff in the admin interface. It’s not seen anywhere else in Registrasion.

condition

int

This determines the effect of this flag’s condition being met. There are two types of condition:

ENABLE_IF_TRUE conditions switch on the products and categories included under this flag if any such condition is met.

DISABLE_IF_FALSE conditions switch off the products and categories included under this flag is any such condition is not met.

If you have both types of conditions attached to a Product, every DISABLE_IF_FALSE condition must be met, along with one ENABLE_IF_TRUE condition.

products

[inventory.Product, ...]

The Products affected by this flag.

categories

[inventory.Category, ...]

The Categories whose Products are affected by this flag.

Dependencies on products from category

Category Dependency flags have their condition met if a product from the enabling category has been selected by the attendee. For example, if there is an Accommodation Category, this flag could be used to enable an Accommodation Breakfast category, allowing only attendees with accommodation to purchase breakfast.

class registrasion.models.conditions.CategoryFlag(*args, **kwargs)

The condition is met because a product in a particular product is purchased.

enabling_category

inventory.Category

The category that causes this condition to be met.

Dependencies on products

Product dependency flags have their condition met if one of the enabling products have been selected by the attendee.

class registrasion.models.conditions.ProductFlag(*args, **kwargs)

The condition is met because a specific product is purchased.

enabling_products

[inventory.Product, ...]

The products that cause this condition to be met.

Time/stock limit flags

These flags allow the products that they cover to be made available for a limited time, or to set a global ceiling on the products covered.

These can be used to remove items from sale once a sales deadline has been met, or if a venue for a specific event has reached capacity. If there are items that fall under multiple such groupings, it makes sense to set all of these flags to be DISABLE_IF_FALSE.

class registrasion.models.conditions.TimeOrStockLimitFlag(*args, **kwargs)

Product groupings that can be used to enable a product during a specific date range, or when fewer than a limit of products have been sold.

start_time

Optional[datetime]

This condition is only met after this time.

end_time

Optional[datetime]

This condition is only met before this time.

limit

Optional[int]

The number of products that all users can purchase under this limit, regardless of their per-user limits.

If any of the attributes are omitted, then only the remaining attributes affect the availablility of the products covered. If there’s no attributes set at all, then the grouping has no effect, but it can be used to group products for reporting purposes.

Voucher flags

Vouchers can be used to enable flags.

class registrasion.models.conditions.VoucherFlag(*args, **kwargs)

The condition is met because a Voucher is present. This is for e.g. enabling sponsor tickets.