CRM · Segment categories
Simple CRUD for the taxonomy used to group segments, so long segment lists stay navigable.
| Area | CRM |
| Routes | crm.segment-categories · crm.segment-categories.index · crm.segment-categories.new · crm.segment-categories.edit |
| Centre modules | crm |
| Staff levels | root · admin · manager · crmmanager |
| Models | segment-category |
| UI label | title.header.crm.segment-categories / menu.navbar.segment-categories.show |
| Coverage | 2 use cases · 1 happy · 2 failure |
How it works
A minimal list (name + edit/delete) built on the standard nf-crud + routes/form.js pattern; deletion goes through the shared confirm-deletion service.
Use cases
Why someone opens this (2)
- Separating lifecycle segments from campaign segments and employee segments.
- Keeping a centre’s segment list organised as it grows.
Path map
flowchart LR F(["Segment categories"]):::feat F --> H1["Category created and assigned"]:::ok F -.-> X1["Name missing"]:::bad F -.-> X2["Deleting a category still in use"]:::bad classDef feat fill:#157068,stroke:#157068,color:#ffffff,font-weight:bold classDef ok fill:#e3f1ea,stroke:#0d6b42,color:#0d4a2e classDef bad fill:#f7e6e2,stroke:#9a2d1c,color:#6e1f13
Happy paths
Category created and assigned
- User creates a category with a name.
routes/form.js#saveModelvalidates and saves, then returns to the list.- The category becomes selectable in the segment builder.
Failure paths
Name missing
Cause — Blank name on save.
What happens — Model validation rejects and
saveModelsurfaces the field error.
Deleting a category still in use
Cause — Segments still reference it.
What happens — Rejected by the API;
routes/form.jssetserrorMessagefromresponse.errors[0].detail.
QA checklist
Tick these off while regression-testing this feature. The boxes are plain Markdown, so progress is visible in git diffs.
- ✅ Category created and assigned
- ⛔ Name missing
- ⛔ Deleting a category still in use
Implementation
app/controllers/crm/segment-categories/index.jsapp/routes/crm/segment-categories/*.jsapp/models/segment-category.js
Translation keys (2)
Key English title.header.crm.segment-categoriesSegment categories segment-categories.newNew segment categories
Related
- Same area — Customer list & filtering · Customer create & edit · Customer deletion with unsubscribe notice · Customer CSV export with column picker · Customer CSV import · Children CSV import · AI natural-language customer filter · Save current filters as a segment · Segment list, refresh & export · Segment builder with automatic tag actions · User tags (user types) · Customer receipts tab & ticket-stamp generation · Customer loyalty — raffle tickets · Customer loyalty — cards & stamps · Customer loyalty — rewards · Customer loyalty — coupon exchanges · Customer children (dependants) · Receipt verification queue · Store list, filters & exports · Store create & edit · Store CSV import · Store labels (store types) · Customer action log (dormant)
Generated from doc/feature-inventory.json · id crm-segment-categories · commit 276788ca6