Channel module
The Channel tab — the brand's view of its own dealer channel. Four read-only views of how one manufacturer's product moves through this shop. It SHOWS, it does not transact — no writes, no money surface, no mutation anywhere in api.ts.
The first sliver of the B2B Interface from the Norco Opportunity. Named "Channel", not "Norco", because the brand is a parameter everywhere below it (Tom's standing multi-OEM requirement) — the tab shows whichever brand is selected; Norco is only the default.
| Tab label | Channel |
| Folder | src/modules/channel/ |
| Tab accent | #3A9BD5 (KVICK blue — nearest held hues are Service #2563eb and Website #1e3a5f) |
| Migrations | 125 (screen.channel — owner-only), 126 (channel_dealers — dealer roster is data), 133 (brand-groups — one brand can wear several labels) |
Owner-only visibility (mig 125)
screen.channel is granted to owner only, narrower than any other screen.* permission on purpose: Channel reports one brand's sell-through, revenue and stock position across the whole shop — commercial information the owner sees, staff do not. sys_admin holds every permission by break-glass.
Four views, driven by one selection
- Overview — headline numbers for the picked brand + period.
- Products — the brand's SKUs, sell-through per line, stock on hand.
- Orders — POs to the brand, with dates already stamped by the Hub (b5fc75c corrected an earlier "add order date" claim — it was already stamped).
- Dealers — the dealer roster (see below).
One selection drives all four (a97cb97) — the brand + period picker changes every view together, not each in isolation. The period control now changes the numbers (70c7d38) after an earlier build where it was cosmetic.
Preview panels, labelled (1af73ef) so a demo screenshot cannot pass for a live report; nothing on Channel writes.
Dealers = a data roster (mig 126)
The Dealers view used to render a single shop because that single shop was written into the code. Mig 126 makes the roster data — channel_dealers — so a second dealer is a row, not a rewrite. The view already reads an array; today that array has one element. The demo channel at 37 dealers (8507e83) is a demo dataset; the real roster starts at one.
What channel_dealers deliberately does NOT hold: any way to reach another dealer. No endpoint, no token, no credential. Each shop's Hub is its own Worker over its own D1; how one instance reads another is a separate design decision, not made here.
Brand groups — one brand, several labels (mig 133)
Swicked's ledger files the Norco group's product under three different manufacturer names:
- NORCO — 255 lines, $354,400, Dec 2023 → Aug 2026
- Ltp — 166 lines, $290,300, Oct 2023 → Nov 2025 (the SAME bikes: Indie VLT, Fluid FS 4, Fluid VLT C3 — the label simply changed)
- 49N — accessories filed under Norco's brand.
Without brand_groups the Channel tab believed they were three companies. Mig 133 defines the mapping so "one brand can wear several labels" — every roll-up on the tab respects it, and a shop adding a new brand alias adds a row.
Aggregation dropdown (2a591b8)
The Products / Overview views were per-single-dealer; the dropdown was reworked to pick dealers and aggregate the page, so the owner can look at one dealer or roll up several.
Read the shop's own name (e9358ea)
An earlier build had the shop name typed into the Channel copy — replaced with a read from the shop's identity substrate so a renamed shop propagates without a Channel edit.
Ordering flow — a walkthrough, not a pretence (800d3d4)
The Order modal reads as a walkthrough of what an order would look like, not a mock that could be mistaken for a real one. Said explicitly before it is acted on, not after (0853732). Both were later reverted (c37feb9 + fc07d2e) — the current shape is the simpler read-only preview.
See also
- Norco dealer-channel play (memory) — the multi-OEM canonical + adapter design this tab is the first sliver of
- Website module — the public-facing sibling: what the customer sees; Channel is what the brand sees