ER · Canifa AI Chatbot

# Database schema · 21 tables, 6 entity groups

Product is the aggregate root — every search, outfit match, and description traces back to it via `internal_ref_code`. `#` marks primary keys, `→` marks foreign keys.

AGGREGATE ROOT

### Product is the center

2,540 products with 44 columns. Every outfit match, description, and search query traces back to `internal_ref_code`. Contains BITMAP fields for style/fitting/season filtering.

### 3-table search architecture

- Outfit Matches (124K) — score + ai_reason per pair
- Ultra Descriptions (1.9K) — AI-generated product copy
- Fashion Rules (698) — occasion-based pairing logic

### suggest_items is deprecated

The `suggest_items` column in Product is unreliable. Use `similar_items` for self-join, and Outfit Matches for curated outfit pairing with AI reasoning.