10 — Tags
What it is: A lightweight, cross-entity labeling system. One tag can be applied to many different entity types — events, packs, tiers, packages, sections, price codes.
Tables
tbl_tags
| Field | Notes |
|---|---|
tagId | PK |
tagName | unique across the system (case-sensitive) |
tagHex | optional hex color (e.g. #FF5733) for badge UI |
tbl_entity_tag_mapping
Generic junction table. One row = one tag applied to one entity.
| Field | Notes |
|---|---|
entityCode | the entity's identifier (eventCode, packId as text, tierId as text, etc.) |
entityType | EVENT, PACK, PACKAGE, PACK_TIER, SECTION_NAME, PRICE_CODE, SUITE, SUITE_TYPE |
tagId | FK to tbl_tags |
Composite PK: (entityCode, entityType, tagId) — prevents duplicate assignments.
⚠️
entityTypeis case-sensitive — store it UPPERCASE. Read-side filters match the literal value (e.g.etm."entityType" = 'EVENT'), but the admin write API doesn't enforce casing (free-form string), so a lowercaseeventsaves fine yet silently never matches on read.
Entity type → entityCode format
| entityType | entityCode value |
|---|---|
EVENT | eventCode (string, used directly) |
PACK | packId cast to text |
PACKAGE | packageId cast to text |
PACK_TIER | tierId cast to text |
SECTION_NAME | section name string |
PRICE_CODE | price code string |
SUITE | suiteId cast to text |
SUITE_TYPE | suiteTypeId cast to text |
Key rules
- Tags are included in the
getCatalogAPI response for all tagged entities - A tag cannot be hard-deleted if it has active mappings (FK ON DELETE NO ACTION)
- Tags are reusable — same tag can appear on events, packs, sections, etc.
- Tags vs Categories: tags are informal/multi-entity; categories (in
09-event.md) are formal and event-only