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.

AreaCRM
Routescrm.children · crm.children.index · crm.children.new · crm.children.edit
Centre modulesplaycenter
Staff levelsroot · admin · manager · crmmanager · crmoperator · weboperator
Modelschild · child-stay · user
UI labelchildren / crm.children.add
Coverage3 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

  1. Operator opens a customer’s children list and adds a child with name, birth date, gender and relationship.
  2. Later, with the parent’s VAT number on file, the check-in modal is opened.
  3. Entry time and expected exit time are entered and confirmed.
  4. child.checkin-success-message is shown and the child appears as in the play centre.

Child checked out

  1. Operator opens the check-out modal for a child currently inside.
  2. Confirms; child.checkout-success-message is shown.

Failure paths

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


Generated from doc/feature-inventory.json · id crm-children · commit 276788ca6