Filament CustomerResource ViewRecord page: Infolist (identity + KPI stat tiles) + RelationManagers (sales orders) + a derived ViewEntry timeline. Everything below aggregates by customer_id — no per-customer table of its own.
| Field | Filament component | Type | Source | FK target |
| Identity | Infolist header (TextEntry ×N) | strings | stored: customers.display_name / company_name / first_name+last_name / email / currency / discount_percent — same row the Customers list shows | customers.id |
| OEM tags | Badge row | enum / flags | stored: customers.category (OEM) + reference_id series (YGMSB) + portal_enabled flag — channel enum scopes this to the OEM view (retail excluded) | — |
| Open SO value | Stat tile | DERIVED money | derived: Σ sales_orders.total WHERE customer_id = this AND delivery_status ≠ delivered | sales_orders |
| Delivered (all-time) | Stat tile | DERIVED money | derived: Σ sales_orders.total WHERE customer_id = this AND delivery_status = delivered | sales_orders |
| Owing | Stat tile | DERIVED money | derived: Σ invoiced − Σ paid across this customer's orders — invoice_status is a flag only (accounting lives in QuickBooks); "owing" is the unpaid-invoiced total | sales_orders |
| Active orders | Stat tile | DERIVED count | derived: COUNT sales_orders WHERE customer_id = this AND delivery_status ≠ delivered | sales_orders |
| Avg cycle time | Stat tile | DERIVED days | derived: mean of the per-order journey (enquiry → delivered) across this customer's delivered orders — same day-elapsed metric as the SO Order journey rail | reads across deals / sales_orders / shipments |
| Live orders | SalesOrdersRelationManager (scoped table) | rows | stored: sales_orders WHERE customer_id = this; Stage = derived production/delivery chip; Days running = today − created_at (or cycle time when delivered) | sales_orders.id |
| Timeline | ViewEntry timeline (read-only feed) | DERIVED child rows | DERIVED — no new table: unions deal_activities + quotes.sent_at/accepted_at + sales_orders.created_at + mos/bmr milestones + shipment_events for every order of this customer, newest first; each row links its source record | reads across deals / quotes / sales_orders / mos / shipments |
Engine notes
- Nothing here is a new table: the page aggregates by customer_id across deals, quotes, sales_orders, shipments and deal_activities — the customer card (the Customers slide-over) stays the write surface; this is the read/analytics surface.
- Owing = Σ unpaid: invoice_status is a QuickBooks-synced flag, so "owing" is the invoiced-but-unpaid total, not an AR ledger inside Gaia.
- Cycle time is reused from the SO Order journey (days elapsed between stamped hops); the customer KPI is the mean over delivered orders.
- Retail is intentionally excluded. customers is one shared table (channel enum oem/retail/both); this OEM view scopes to sales_orders + OEM shipments only — no retail_sales, no retail deliveries.
- The Timeline is read-only and derived — like the deal diary and the R&D status history, it can be rebuilt from the source rows at any time; it is never written to directly.