diff --git a/Category-Icon-System.md b/Category-Icon-System.md index f30a258..a519eed 100644 --- a/Category-Icon-System.md +++ b/Category-Icon-System.md @@ -1,99 +1,69 @@ -# Category Icon System +# Category & Icon System -The Canteen Asset Tracker uses a category-based icon system to visually identify asset types at a glance. +## Active Categories -## Categories +| Category | Icon | Color | Count | Description | +|----------|------|-------|-------|-------------| +| Bev | 🥤 | `#0a7ab5` | 2,115 | Beverage vending (soda, water, juice) | +| Snack | 🍿 | `#c97d0e` | 1,940 | Snack vending machines | +| Coffee | ☕ | `#a16207` | 1,673 | Coffee brewers & espresso machines | +| Markets | 🏪 | `#7c3aed` | 1,100 | Micro market kiosks, AI smart coolers, loss prevention | +| Appliances | 🔌 | `#3b82f6` | 692 | Refrigeration, coolers, freezers, ice machines | +| Equipment | 🔧 | `#2c3e50` | 17 | General equipment (displays, connectivity) | +| Other | 📦 | `#6b7280` | 15 | Uncategorized assets | +| Food | 🍔 | `#e67e22` | 8 | Food vending machines | -| Category | Icon | Color | Assets | -|------------|------|----------|-------| -| Coffee | ☕ | #a16207 | 1,567 | -| Snack | 🍿 | #c97d0e | 1,833 | -| Kiosk | 🏪 | #7c3aed | 1,100 | -| Bev | 🥤 | #0a7ab5 | 2,221 | -| Appliances | 🔌 | #3b82f6 | 692 | -| Equipment | 🔧 | #2c3e50 | 125 | -| Other | 📦 | #6b7280 | 14 | -| Food | 🍔 | #e67e22 | 8 | +**Total assets: 7,560** -## Fallback Logic (`categoryInfo()`) +## Category Changes -- Category in map → uses that entry's icon + color -- Category exists but NOT in map (unmapped) → ❓ with red background (#b91c1c) — visible signal to admin -- Null/missing category → 📦 (generic) +### 2026-05-31 — Markets, Coffee corrections, Equipment cleanup -This means any new category imported from Cantaloupe that isn't in the lookup table will immediately be visible as ❓ on the technician's phone, prompting the admin to add it. +- **Kiosk → Markets** — Renamed to better reflect contents: + - 365 Retail Markets (816) — micro market POS/kiosk fixtures + - Intuitivo (56) — AI-powered smart cooler/kiosk combos (A-POP) + - Panoptyc (220) — AI loss-prevention cameras for retail + - Smart Market (7), Micro-Market-Ave C (1) — micro market systems +- **Bev → Coffee (106 units)** — Coffee brands misclassified as beverage: + - Nespresso (36), Curtis (23), Krea (14), EVERSYS (12) + - Bloomfield (6), Bravilor (4), Segafredo (4) + - Simonelli (2), Starbucks (2), Marco (2), Cafection Digi-cup (1) +- **Equipment → Snack (107 units)** — Crane vending machines: + - CRANE EPROM (98) + Crane 472 (8) + LEKTRO-VEND EPROM (1) +- **Equipment → Other (1 unit)** — CRANE 623/625/627 parts kit -## Admin Server Category Health +### 2026-05-30 — Coffee category created -The `/api/stats` endpoint includes `category_health`: -```json -{ - "unmapped": [{"name": "Snack/Bev", "count": 18}], - "total_categories": 6, - "unmapped_count": 1 -} +- New Coffee (☕) category with `#a16207` color +- Moved 63 De Jong Duke / Impressions from Equipment → Coffee +- Moved ~1,504 Bev coffee machines (Flavia, Keurig, Bunn, Newco, Cafection) → Coffee +- Beverage-only makes (Dixie Narco, Royal, Vendo, Pepsi, Coke, Waterlogic) stay in Bev + +### 2026-05-30 — Kiosk category created + +- New Kiosk (🏪) category with `#7c3aed` color +- 365 Retail Markets → Kiosk (was Other) +- Intuitivo, Panoptyc → Kiosk (was Other) +- Also fixed 207 misclassified assets out of "Other" + +### 2026-05-30 — Original category icons + +Centralized icon system with 9 entries (Bev, Snack, Food, Equipment, Appliances, Kiosk, Coffee, Other + unmapped fallback). + +## Icon Mapping + +Defined in `static/index.html` as `CATEGORY_MAP`: +```javascript +const CATEGORY_MAP = { + 'Bev': { icon: '🥤', color: '#0a7ab5' }, + 'Snack': { icon: '🍿', color: '#c97d0e' }, + 'Food': { icon: '🍔', color: '#e67e22' }, + 'Equipment': { icon: '🔧', color: '#2c3e50' }, + 'Appliances': { icon: '🔌', color: '#3b82f6' }, + 'Markets': { icon: '🏪', color: '#7c3aed' }, + 'Coffee': { icon: '☕', color: '#a16207' }, + 'Other': { icon: '📦', color: '#6b7280' }, +}; ``` -The admin dashboard shows a red **⚠️ Category Health** card when `unmapped_count > 0`, linking to Settings → Categories to fix. - -## DB Schema - -Table `categories`: -- `id` INTEGER PRIMARY KEY -- `name` TEXT UNIQUE NOT NULL -- `icon` TEXT (emoji or image path) - -Seed data (both `server.py` and `admin_server.py`): -```python -("Bev", "🥤"), ("Snack", "🍿"), -("Food", "🍔"), ("Equipment", "🔧"), -("Appliances", "🔌"), ("Kiosk", "🏪"), -("Coffee", "☕"), -("Other", "📦"), -``` - -## Kiosk Category - -Assets from **365 Retail Markets**, **Panoptyc**, **Intuitivo**, **Smart Market**, and **Micro-Market** are categorized as **Kiosk** (🏪, purple `#7c3aed`). These are unattended retail kiosks and micro-markets — distinct from general Equipment. - -## Re-classification from "Other" - -Many assets that were stuck in "Other" were re-classified to proper categories: - -| Make | Count | New Category | Reason | -|-------------------|-------|-------------|--------------------------------| -| CRANE / Crane | 114 | Equipment | Vending machines | -| Vendo | 19 | Bev | Beverage vending | -| Royal | 18 | Bev | Beverage vending | -| DN (Dixie Narco) | 12 | Bev | Beverage vending | -| USI | 2 | Snack | Snack vending | -| Cold Snap etc. | 3 | Appliances | Cooling/refrigeration | -| Cafection etc. | 4 | Bev | Coffee/water | -| De Jong Duke etc. | 11 | Equipment | Vending equipment | - -> **Note:** In a later update (June 2026), De Jong Duke (63) and Impressions (3) were moved to the new **Coffee** (☕) category with `#a16207` amber color, reducing Equipment to 125. - -## Coffee Category - -Coffee vending machines and brewers are categorized as **Coffee** (☕, amber `#a16207`). This includes: - -| Make | Count | Source | -|------|-------|--------| -| Flavia | 879 | Was Bev | -| Newco | 297 | Was Bev | -| Keurig | 202 | Was Bev | -| Cafection | 72 | Was Bev | -| De Jong Duke / DeJong DUKE / de John Duke | 60 | Was Equipment | -| Bunn | 53 | Was Bev | -| Impressions | 3 | Was Equipment | -| Echostream | 1 | Was Bev | - -**Result:** Coffee is now the largest category (1,567 assets). Bev dropped from 3,725 → 2,221 (remaining are water/ice/soda dispensers). Zero unmapped categories. - -## History - -- **2026-06-01 (this update):** Moved 1,504 coffee brewers from Bev to Coffee (Flavia, Newco, Keurig, Bunn, Cafection, Echostream). Coffee → 1,567, Bev → 2,221. -- **2026-06-01 (fff2b6a):** Added Coffee category (☕). Moved 63 De Jong Duke/Impressions coffee vending machines from Equipment to Coffee. -- **2026-06-01 (955e489):** Added Kiosk category (🏪). Re-classified 207 assets from "Other" to proper categories. Category Health now perfectly clean. -- **2026-05-29 (f1a3bb9):** Cleaned CATEGORY_MAP (removed dead entries, fixed duplicates). Added `categoryInfo()` helper with proper unmapped fallback. Added detail view icons. Synced DB categories with real asset data. -- **Admin d58834b:** Added Category Health dashboard widget. +Unmapped categories get ❓ with red `#b91c1c` background.