CRM · Customer children (dependants)
Per-customer list of registered children with name, birth date and relationship, plus play-centre check-in and check-out directly from the row.
| Area | CRM |
| Routes | crm.children · crm.children.index · crm.children.new · crm.children.edit |
| Centre modules | playcenter |
| Staff levels | root · admin · manager · crmmanager · crmoperator · weboperator |
| Models | child · child-stay · user |
| UI label | children / crm.children.add |
| Coverage | 3 use cases · 2 happy · 5 failure |
How it works
Nested under a customer (users/:user_id/children). Check-in/check-out are the same operations as the play-centre screen but reached from the parent’s record; both map API errors through mapErrors(e, intl.t) into errorDetails, which is the better error-surfacing pattern in this codebase. The child ability makes the gating explicit: canCheckIn needs hasVatNumber && !isInPlayCenter, canCheckOut needs hasVatNumber && isInPlayCenter.
Use cases
Why someone opens this (3)
- Registering a customer’s children once so play-centre entry is a single click later.
- Checking a child in when the parent arrives at the play area.
- Checking a child out when collected.
Path map
flowchart LR F(["Customer children dependants"]):::feat F --> H1["Child registered and checked in"]:::ok F --> H2["Child checked out"]:::ok F -.-> X1["Parent has no VAT number"]:::bad F -.-> X2["Child data incomplete"]:::bad F -.-> X3["Check-in times missing"]:::bad F -.-> X4["Check-in/out rejected by the API"]:::bad F -.-> X5["Invalid record"]:::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
Child registered and checked in
- Operator opens a customer’s children list and adds a child with name, birth date, gender and relationship.
- Later, with the parent’s VAT number on file, the check-in modal is opened.
- Entry time and expected exit time are entered and confirmed.
child.checkin-success-messageis shown and the child appears as in the play centre.
Child checked out
- Operator opens the check-out modal for a child currently inside.
- Confirms;
child.checkout-success-messageis shown.
Failure paths
Parent has no VAT number
Cause —
hasVatNumberfalse.What happens —
canCheckIn/canCheckOutare false and the UI explains withchild.not-dni-error-message, telling the operator to set the VAT number on the customer profile first.
Child data incomplete
Cause — Name, relationship, gender or birth date missing.
What happens —
error.child.name.required,error.child.relationship.required,error.child.sex.required,error.child.bdate.required.
Check-in times missing
Cause — Entry or expected exit time blank.
What happens —
error.crm.children.entryTime.required/error.crm.children.expectedExitTime.required.
Check-in/out rejected by the API
Cause — Capacity reached, already inside, or server error.
What happens —
response.errorsare mapped throughmapErrorsintoerrorDetailsand listed to the operator.
Invalid record
Cause — Action called without a valid child.
What happens — Throws
TypeError('model' is not a valid child).
QA checklist
Tick these off while regression-testing this feature. The boxes are plain Markdown, so progress is visible in git diffs.
- ✅ Child registered and checked in
- ✅ Child checked out
- ⛔ Parent has no VAT number
- ⛔ Child data incomplete
- ⛔ Check-in times missing
- ⛔ Check-in/out rejected by the API
- ⛔ Invalid record
Implementation
app/controllers/crm/children/index.jsapp/routes/crm/children/*.jsapp/models/child.jsapp/abilities/child.js
Translation keys (13)
Key English childrenChildren crm.children.addAdd children crm.children.nameName crm.children.bdateBirthday date child.checkin-success-messageChild register correctly child.checkout-success-messageChild checkout confirmed child.not-dni-error-messageIt isn’t allowed to use the play center without entering a VAT number. Please, go to user profile to set it error.child.name.requiredName is required error.child.relationship.requiredRelationship is required error.child.sex.requiredGender is required error.child.bdate.requiredBirthday is required error.crm.children.entryTime.requiredEntry time is required error.crm.children.expectedExitTime.requiredExpected exit time is required
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 · Segment categories · 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 · Receipt verification queue · Store list, filters & exports · Store create & edit · Store CSV import · Store labels (store types) · Customer action log (dormant)
- Shares data with — Play centre stays (check-in - check-out) · Data-quality dashboard · Realtime updates (Pusher)
- Behind the same module — Children CSV import · Play centre stays (check-in - check-out)
Generated from doc/feature-inventory.json · id crm-children · commit 276788ca6