Skip to main content

Pricing Rules — Reference

Lookup tables for the pricing-rule system. For the concept and worked examples, read Pricing Rules — one big filter.

Verified against flex-v3-backend / cortex-backend code, 2026-06-10.

Where things live

ConcernRepo & location
Rule resolution (which rule a fan gets)flex-v3-backendsrc/modules/pricing-rules/ (PricingRuleResolverService)
Rule CRUD (create/edit rules)cortex-backendsrc/modules/flex-product/pricing-rules/
Per-mode inventory queriesflex-v3-backendsrc/modules/inventory/ (service + repository)

tbl_pricing_rules

ColumnMeaning
ruleIdPK
programIdthe Flex program the rule belongs to
ruleName, ruleDescriptionadmin-facing
statusonly published rules load at runtime — draft rules are invisible to fans
isActivemust also be true to load at runtime (runtime filters on status = published and isActive = true)
priorityresolution order: sorted ASC NULLS LAST, lower number wins
pricingModeevent_level · suite_level · suite_tier_level — selects which price table applies
showAllAvailableno filtering (rare — team supplies only desired pricing)
discountPercentage⚠️ defined and documented, but never applied anywhere in code

tbl_pricing_rule_conditions — who qualifies

ColumnCondition
accountGroupIdfan's account group (varchar, no FK — orphan risk if groups are deleted)
packageIdfan selected this preset package
packIdfan selected this game pack
minEventCountfan selected at least N events

Semantics: fields within one row are AND-combined; multiple rows on one rule are OR-combined. A fan qualifies for exactly one rule: rules are checked in priority order and the first match wins.

Price tables (per pricingMode)

ModeTableKey columns
event_leveltbl_pricing_rule_pricesruleId, eventCode, priceCode, ticketTypeCode
suite_leveltbl_pricing_rule_suite_prices+ suiteId (composite PK) — per-suite ticket type codes
suite_tier_leveltbl_suite_pricing_tiers + tbl_pricing_rule_tier_mapping + tbl_pricing_rules_suite_tier_pricessuites grouped into tiers, priced per tier

Resolution algorithm (get-inventory flow)

  1. Load the program's published, isActive rules, ordered by priority ASC NULLS LAST.
  2. For each rule in order: if any condition row matches the fan's context (account group, selected pack/package, event count) → that rule wins. Stop.
  3. Join seats with all vendor pricing, then filter to the winning rule's price combos. Pricing is filtering — nothing more.

Rules of thumb

  • One seat should resolve to one price code → one ticket type code per rule. (Same price code → two ticket type codes is the "multiple ticket-type-code" future feature.)
  • Suite price = sum of its seats' prices, not price × seat count.
  • Game packs have no direct link to a ticket type code: the packId is a condition; the matched rule's price rows carry the actual codes.