django_program.registration.services.checkin

Check-in and product redemption business logic services.

Provides CheckInService for attendee check-in operations (lookup, check-in, badge data, door checks) and RedemptionService for tracking product redemption (tutorials, meals, events) against purchased order line items.

Classes

CheckInService

Service for attendee check-in operations at the conference venue.

RedemptionService

Service for product redemption (tutorials, meals, events).

class django_program.registration.services.checkin.CheckInService[source]

Bases: object

Service for attendee check-in operations at the conference venue.

ACTIVE_ORDER_STATUSES = {Order.Status.PAID, Order.Status.PARTIALLY_REFUNDED}
static validate_order_status(attendee)[source]

Check if the attendee has a valid order for check-in.

Returns None if valid, or an error message string if not.

Parameters:

attendee (Attendee)

Return type:

str | None

static lookup_attendee(*, conference, access_code)[source]

Look up an attendee by access code within a conference.

Parameters:
  • conference (Conference) – The conference to search within.

  • access_code (str) – The attendee’s unique access code (from badge QR/barcode).

Return type:

Attendee

Returns:

The matched Attendee instance with user and order pre-loaded.

Raises:

Attendee.DoesNotExist – If no attendee matches the given code within the specified conference.

static get_badge_data(attendee)[source]

Return badge display data for a checked-in attendee.

Parameters:

attendee (Attendee) – The attendee to get badge data for.

Returns:

name, email, access_code, ticket_type, checked_in, first_check_in_at, check_in_count, products.

Return type:

Dict with keys

static record_door_check(*, attendee, ticket_type=None, addon=None, checked_by=None, station='')[source]

Record a door check for per-product admission.

Validates that exactly one of ticket_type or addon is provided, then creates a DoorCheck record for the sub-event admission.

Parameters:
  • attendee (Attendee) – The attendee being checked.

  • ticket_type (TicketType | None) – The ticket type being checked (mutually exclusive with addon).

  • addon (AddOn | None) – The add-on being checked (mutually exclusive with ticket_type).

  • checked_by (AbstractUser | None) – Staff member performing the check.

  • station (str) – Identifier for the check station (e.g. “Tutorial Room 1”).

Return type:

DoorCheck

Returns:

The created DoorCheck record.

Raises:

ValueError – If neither or both ticket_type and addon are provided.

class django_program.registration.services.checkin.RedemptionService[source]

Bases: object

Service for product redemption (tutorials, meals, events).

Tracks which purchased order line items have been redeemed by an attendee, preventing double-use of single-use products. Each line item can be redeemed up to its purchased quantity.

static get_redeemable_products(attendee)[source]

List products the attendee can redeem.

Examines the attendee’s order line items and checks which have not yet been fully redeemed based on the ProductRedemption records.

Parameters:

attendee (Attendee) – The attendee to check.

Returns:

line_item_id, description, quantity, redeemed_count, remaining, ticket_type_id, addon_id.

Return type:

List of dicts with keys

static redeem_product(*, attendee, order_line_item, redeemed_by=None)[source]

Redeem a purchased product for an attendee.

Validates that the line item belongs to the attendee’s order and has not already been fully redeemed before creating the redemption record.

Parameters:
  • attendee (Attendee) – The attendee redeeming.

  • order_line_item (OrderLineItem) – The line item being redeemed.

  • redeemed_by (AbstractUser | None) – Staff member performing the redemption.

Return type:

ProductRedemption

Returns:

The created ProductRedemption record.

Raises:
  • ValueError – If the line item does not belong to the attendee’s order.

  • ValueError – If the product has already been fully redeemed (redeemed count >= quantity).