Configuration · Staff member editor (levels, scope, API token)

Creates and edits a back-office account: identity, level, which centres and stores it can see, which dashboards it gets, channel and country, contactability, GDPR acceptance, employee-account-type access, an API token to copy, and an action to email the user a password link.

AreaConfiguration
Routesconfiguration.staff-members.new · configuration.staff-members.edit
Centre modulesemployees_segments
Staff levelsroot · admin · manager
Modelsbuilding · center · channel · commerce · country · dashboard · staff-member · user-account-type
UI labelgeneral-data
Coverage5 use cases · 2 happy · 10 failure

Known issues (1)

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

Scope is the heart of this form. allowedLevels is derived from the current user’s role through the creators arrays, so the UI cannot grant a level the actor is not entitled to grant. allowedCenters limits which centres can be assigned, and selectedCommercesFiltered / onChangeSelectedCommerces restrict a commerce-level account to its stores — enforced by a conditional validation (commerces required when level === 'commerce'). calibrator level requires a default building. dashboardsAssociatedToRole pre-selects the dashboards that match the chosen level. copyToken exposes an API token for external-level integrations (staff-member.copy-token-success). openModalSendPasswordEmail → confirmSendPasswordEmail is the invitation flow, with sendPasswordEmailIsDisabled guarding it, and disableSubmit blocking premature saves. When the centre has employee segments, accessToAccountTypes must be non-empty.

Use cases

Why someone opens this (5)

  • Creating a store-level account scoped to a single tenant.
  • Giving a regional manager access to several centres at once.
  • Issuing an external account with an API token for a system integration.
  • Inviting a new user by emailing them a password link instead of setting a password manually.
  • Restricting a CRM operator to specific employee account types.

Path map

flowchart LR
    F(["Staff member editor levels, scope, API token"]):::feat
    F --> H1["Store-level account created and invited"]:::ok
    F --> H2["API token issued"]:::ok
    F -.-> X1["Identity fields missing"]:::bad
    F -.-> X2["Commerce level without stores"]:::bad
    F -.-> X3["Calibrator without a default building"]:::bad
    F -.-> X4["Password invalid"]:::bad
    F -.-> X5["GDPR not accepted"]:::bad
    F -.-> X6["Contactable without a phone"]:::bad
    F -.-> X7["Employee account types missing"]:::bad
    F -.-> X8["Reference data unavailable"]:::bad
    F -.-> X9["Level not grantable"]:::bad
    F -.-> X10["Raw translation key on screen"]:::bad
    classDef feat fill:#566066,stroke:#566066,color:#ffffff,font-weight:bold
    classDef ok fill:#e3f1ea,stroke:#0d6b42,color:#0d4a2e
    classDef bad fill:#f7e6e2,stroke:#9a2d1c,color:#6e1f13

Happy paths

Store-level account created and invited

  1. Admin enters name, surname, email, channel and country and accepts GDPR on the user’s behalf.
  2. Level is set to commerce, so the stores field appears and is filled.
  3. Centres are assigned from allowedCenters; dashboards default from the level.
  4. The account saves, then openModalSendPasswordEmail → confirmSendPasswordEmail emails the password link.
  5. The user completes update_password/:token to set their own password.

API token issued

  1. Admin creates an external-level account.
  2. copyToken copies the bearer token and staff-member.copy-token-success confirms.
  3. The integration authenticates with that token.

Failure paths

QA checklist

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

  • ✅ Store-level account created and invited
  • ✅ API token issued
  • ⛔ Identity fields missing
  • ⛔ Commerce level without stores
  • ⛔ Calibrator without a default building
  • ⛔ Password invalid
  • ⛔ GDPR not accepted
  • ⛔ Contactable without a phone
  • ⛔ Employee account types missing
  • ⛔ Reference data unavailable
  • ⛔ Level not grantable
  • ⛔ Raw translation key on screen

Implementation


Generated from doc/feature-inventory.json · id config-staff-editor · commit 276788ca6