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
| Concern | Repo & location |
|---|
| Rule resolution (which rule a fan gets) | flex-v3-backend — src/modules/pricing-rules/ (PricingRuleResolverService) |
| Rule CRUD (create/edit rules) | cortex-backend — src/modules/flex-product/pricing-rules/ |
| Per-mode inventory queries | flex-v3-backend — src/modules/inventory/ (service + repository) |
tbl_pricing_rules
| Column | Meaning |
|---|
ruleId | PK |
programId | the Flex program the rule belongs to |
ruleName, ruleDescription | admin-facing |
status | only published rules load at runtime — draft rules are invisible to fans |
isActive | must also be true to load at runtime (runtime filters on status = published and isActive = true) |
priority | resolution order: sorted ASC NULLS LAST, lower number wins |
pricingMode | event_level · suite_level · suite_tier_level — selects which price table applies |
showAllAvailable | no filtering (rare — team supplies only desired pricing) |
discountPercentage | ⚠️ defined and documented, but never applied anywhere in code |
tbl_pricing_rule_conditions — who qualifies
| Column | Condition |
|---|
accountGroupId | fan's account group (varchar, no FK — orphan risk if groups are deleted) |
packageId | fan selected this preset package |
packId | fan selected this game pack |
minEventCount | fan 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)
| Mode | Table | Key columns |
|---|
event_level | tbl_pricing_rule_prices | ruleId, eventCode, priceCode, ticketTypeCode |
suite_level | tbl_pricing_rule_suite_prices | + suiteId (composite PK) — per-suite ticket type codes |
suite_tier_level | tbl_suite_pricing_tiers + tbl_pricing_rule_tier_mapping + tbl_pricing_rules_suite_tier_prices | suites grouped into tiers, priced per tier |
Resolution algorithm (get-inventory flow)
- Load the program's
published, isActive rules, ordered by priority ASC NULLS LAST.
- 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.
- 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.