CRM · Customer create & edit

Tabbed customer record: general data (identity, contact, address, consents, tags, manual campaigns) plus receipts and loyalty tabs once the customer exists.

AreaCRM
Routescrm.users.new · crm.users.edit
Centre modulescrm
Staff levelsroot · admin · manager · crmmanager · crmoperator · weboperator
Modelscampaign · channel · extra · user · user-type
UI labelcrm.new-user / users.general_data
Coverage5 use cases · 3 happy · 9 failure

Missing translations

These keys are used on this screen but do not exist in translations.json, so users see the raw key:

  • access-to-account-types.client
  • access-to-account-types.employee-outsource
  • access-to-account-types.employee-shop

How it works

Tabs are computed in form-user.js: ‘general’ always, then ‘receipts’ and ‘loyalty’ only when model.id exists AND the centre has the tickets or loyalty-cards module. Required fields are partly centre-driven — auth.center.userRequired injects extra presence validations at runtime, so the same form has different mandatory fields per centre. name and cp are only required on create (if: _this.isNew); for existing records the controller instead shows a soft warning listing the missing recommended fields. Saving is two-stage: saveUser validates, then _hasAcceptedAllNotifications() opens a consent modal when any of mail / partner-mail / app notification consents is unchecked, and only patchUser actually persists. Email is also validated live on change via emailRegexValidator. A Pusher channel keyed on the user id streams in a captured signature URL, and willDestroyElement disconnects it. Existing customers show an identity QR code encoding user_id:<id> (download button hidden) next to the captured signature, so a desk device can scan a customer straight into their record.

Use cases

Why someone opens this (5)

  • Registering a walk-in customer at the information desk, including GDPR consent.
  • Updating contact details or consents on request.
  • Attaching user tags or manual (non-segmented) campaigns to a specific customer.
  • Recording single-parent / large-family status for benefit schemes.
  • Capturing a handwritten signature from a tablet and seeing it appear live on the record.

Path map

flowchart LR
    F(["Customer create and edit"]):::feat
    F --> H1["New customer saved with full consent"]:::ok
    F --> H2["Existing customer edited with partial consent"]:::ok
    F --> H3["Signature captured remotely"]:::ok
    F -.-> X1["Missing mandatory fields"]:::bad
    F -.-> X2["Invalid email format"]:::bad
    F -.-> X3["GDPR not accepted"]:::bad
    F -.-> X4["Centre-specific required field left blank"]:::bad
    F -.-> X5["Consent modal declined"]:::bad
    F -.-> X6["API rejection on save"]:::bad
    F -.-> X7["External sync failure"]:::bad
    F -.-> X8["Registration email resend fails"]:::bad
    F -.-> X9["Raw translation key on screen"]:::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

New customer saved with full consent

  1. Operator opens CRM → new customer and fills registration date, email, name, postal code and the centre’s extra required fields.
  2. GDPR (eula) and the notification consents are ticked.
  3. saveUser validates the model successfully and _hasAcceptedAllNotifications() returns true.
  4. patchUser saves, tracks CRM_USER_SAVED, shows crm.users.user-saved and scrolls to the top.

Existing customer edited with partial consent

  1. Operator edits a record and leaves third-party notifications unchecked.
  2. The consent modal lists the unchecked statements.
  3. Operator confirms; patchUser runs and the record is saved as-is.

Signature captured remotely

  1. Operator opens an existing customer; pusher.connectToChannel(user.id) subscribes.
  2. The customer signs on a paired device.
  3. The pushed URL is written to model.signatureUrl and the signature renders without a reload.

Failure paths

QA checklist

Tick these off while regression-testing this feature. The boxes are plain Markdown, so progress is visible in git diffs.

  • ✅ New customer saved with full consent
  • ✅ Existing customer edited with partial consent
  • ✅ Signature captured remotely
  • ⛔ Missing mandatory fields
  • ⛔ Invalid email format
  • ⛔ GDPR not accepted
  • ⛔ Centre-specific required field left blank
  • ⛔ Consent modal declined
  • ⛔ API rejection on save
  • ⛔ External sync failure
  • ⛔ Registration email resend fails
  • ⛔ Raw translation key on screen

Implementation


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