Skip to content

URD: User Management

ModuleCORE-01Versionv0.6
StatusIn-progressDate2026-06-15

Business documentation. This URD is User Management's feature list - each feature below is one Functional Area (<AREA>). The same <AREA> keys the feature's PRDs (PRD-<AREA>-NNN) and tests (TC-<AREA>-NNN), and each feature is listed in the Delivery feature catalog. See the Feature Spine convention.

1. Purpose

Define what User Management must do for users: how they create accounts, authenticate, and manage profiles, and how business owners manage employees and customers within their organizations. It is the platform's foundation - every other module trusts the identity and scope issued here.

2. Scope

IncludedExcluded
Account creation (sign-up) and authentication (sign-in)Custom role creation → Permissions
Password management (change, forgot / reset)OAuth / OAuth2 login flow
OTP verification for email and phone; link accountSession management and remote revocation
Eight fixed system roles and role-based accessUser invitation system
Employee lifecycle (create, assign, deactivate, remove)Audit / login history
Customer lifecycle (create, update, soft-delete, promote)Multi-organization access for one user
User profile, identifier, and per-user configuration managementTwo-factor enforcement

3. Definitions

TermDefinition
UserAn authenticated identity - internal (operator) or external (owner, employee, customer).
CredentialA secret used to authenticate - a hashed password today; 2FA / OAuth schemes are defined but not enforced.
IdentifierA login value tied to a user - username, email, or phone. Each is globally unique within its type.
User ProfilePersonal info attached to a user - name, birthday, locale, contact details. One per user.
User ConfigurationA per-user key-value setting, grouped by code. A default set is created on registration.
RoleA classification that determines access level and data scope. Eight fixed roles exist.
OwnerThe user who creates a business during onboarding; has full access to their organization.
CashierA merchant-level staff role for cashiers, scoped to specific merchants (same tier as Employee).
EmployeeA staff member scoped to specific merchants within an organization.
CustomerAn end-customer linked to an organization; can be promoted from sale-level data to a full user.
GuestAn unauthenticated-style global role with no backend permissions; lowest priority.
OTPA one-time code delivered via email or SMS for identifier verification or password reset.
Session Token (JWT)Issued on sign-in; carries user ID, roles, organization IDs, and merchant IDs for stateless authorization.

4. Conceptual Model

Conceptual only - full schema lives in the developer domain model.

5. Feature Catalog

The feature list of this module. Each row is one feature (a Functional Area). Detail in §6. Mirrored in the Delivery feature catalog.

Feature IDFeaturePhaseStatusPriority
AUTHAuthenticationP1BuiltHigh
USRUser AccountP1BuiltHigh
ROLERoles & ScopingP1BuiltHigh
EMPEmployee ManagementP2In-progressHigh
CUSCustomer ManagementP2In-progressHigh
CFGUser ConfigurationP1BuiltHigh

Status: live from Plane where mapped, otherwise registry-declared. Vocabulary mirrors Plane (state-group / phase).

6. Features

One sub-section per feature, in catalog order. Each feature keeps its description, requirements, and acceptance together. Priority = MoSCoW (Must / Should / Could / Won't).

AUTH - Authentication Built

Feature ID: user-management/AUTH · Phase: P1 · PRDs: - · Dev: @nx/identity

What it does for users: people create an account and sign in with a username, email, or phone plus a password; they change or reset their password and verify their email and phone via one-time codes.

Requirements

IDPRequirement
URD-AUTH-001MUser can sign up with a username and password
URD-AUTH-002MSign-up creates account, profile, identifiers, and default settings in one operation
URD-AUTH-003MIf any part of sign-up fails, nothing is created (all-or-nothing)
URD-AUTH-004MUser can sign in with any verified identifier (username / email / phone) + password
URD-AUTH-005MSuccessful sign-in returns a session token carrying roles and organization / merchant scope
URD-AUTH-006MPasswords are securely hashed before storage and never stored in plain text
URD-AUTH-007MUser can change their password (current password verified first)
URD-AUTH-008MUser can verify their email via OTP (request → receive code → submit)
URD-AUTH-009MUser can verify their phone via OTP (same flow)
URD-AUTH-010MUser can reset a forgotten password (request → verify code → set new password)
URD-AUTH-011SUser can add (link) a verified email or phone to an authenticated account
URD-AUTH-012SSystem records the last sign-in timestamp
URD-AUTH-013CTwo-factor authentication is enforced Planned
URD-AUTH-014COAuth / third-party login is supported Planned

Acceptance

AC-AUTH-01: Sign-in
GivenWhenThen
Valid credentials, verified identifierUser signs inSession token issued with roles and scope
Invalid passwordUser signs inAuthentication rejected
Unverified identifierUser signs inSign-in rejected - identifier not verified
Deactivated / blocked userUser signs inAccess denied
Successful sign-in-Last sign-in timestamp updated
AC-AUTH-02: Sign-up
GivenWhenThen
New username + password + profileUser signs upAccount created with Owner role
Username already existsUser signs upConflict error
Successful registration-Default settings auto-created
Any step fails-Entire registration rolls back
AC-AUTH-03: OTP verification
GivenWhenThen
Unverified email or phoneUser requests OTPCode delivered, session token returned
Valid session + correct codeUser submitsIdentifier marked verified
Expired codeUser submitsError - code expired
Too many attemptsUser retriesError - max attempts exceeded
AC-AUTH-04: Forgot password
GivenWhenThen
User forgot passwordRequests resetReset session created
Valid reset codeUser verifiesSession confirmed
Verified sessionUser sets new passwordPassword updated (hashed)

USR - User Account Built

Feature ID: user-management/USR · Phase: P1 · PRDs: PRD-USR-001 · PRD-USR-002 · Dev: @nx/identity

What it does for users: each user has a unique account that can hold several identifiers (username, emails, phones), an editable profile, a language preference, and a status lifecycle - and account data is always preserved via soft-delete. Identifiers are themselves a managed resource: a user can list and add their own, each typed by a scheme, and any added identifier starts unverified.

Requirements

IDPRequirement
URD-USR-001MEach user has a unique system-generated ID
URD-USR-002MA user can have multiple identifiers (username, emails, phones)
URD-USR-003MEach identifier is globally unique within its type
URD-USR-004MUsername is required and automatically considered verified
URD-USR-005MEmail and phone identifiers start unverified and require OTP to verify
URD-USR-006MUser can view and update their own profile (name, birthday, locale, contacts)
URD-USR-007MAuthorized users can change a user's status (activate, deactivate, block, archive)
URD-USR-008MDeactivated and blocked users cannot sign in
URD-USR-009MUser data is always preserved - accounts are never permanently deleted (soft-delete)
URD-USR-010SUser can set a language / locale preference
URD-USR-011CARCHIVED is a terminal status and cannot be reactivated
URD-USR-012MEach identifier declares a scheme that types it - username, email, phone number - drawn from a fixed, validated set (alongside system-issued schemes)
URD-USR-013MIdentifiers are a managed resource: list, search, count, and single-record read, scoped to the caller's access
URD-USR-014MAdding an identifier always binds it to the requesting user and creates it unverified; a supplied user reference or verified flag cannot override this
URD-USR-015SIdentifiers can be updated and removed (single or by filter) via soft-delete; identifier data is preserved
URD-USR-016MEvery identifier operation (read / create / update / delete) is individually permission-gated and merchant-scoped

Acceptance

AC-USR-01: Account identity & lifecycle
GivenWhenThen
A new accountCreatedA unique system-generated ID is assigned; data is soft-deletable, never permanently deleted
A deactivated or blocked userAttempts sign-inAccess is denied
AC-USR-02: Identifier management
GivenWhenThen
A signed-in userLists their identifiersOnly identifiers within the caller's scope are returned, each labelled by its scheme
A user adds an identifierCreate is submittedThe identifier is owned by the requesting user and stored unverified
A create request naming another user or pre-set as verifiedSubmittedThe owner is still the caller and the identifier is still unverified - the request values are ignored
An identifier is removedDelete is submittedThe row is soft-deleted and preserved, never physically removed

ROLE - Roles & Scoping Built

Feature ID: user-management/ROLE · Phase: P1 · PRDs: - · Dev: @nx/identity

What it does for users: eight fixed system roles set each user's access level and data scope; higher-priority roles see more, list/count results are filtered to the caller's scope, and no one can manage a role at or above their own priority.

Requirements

IDPRequirement
URD-ROLE-001MSystem provides eight fixed roles: Super Admin, Admin, Operator, Owner, Cashier, Employee, Customer, Guest
URD-ROLE-002MRoles have a priority hierarchy; higher priority means broader access
URD-ROLE-003MSuper Admin and Admin bypass all data filtering
URD-ROLE-004MOwner sees only their own organization and its merchants
URD-ROLE-005MEmployee / Cashier see only merchants they are assigned to
URD-ROLE-006MList and count operations are filtered by the requesting user's scope
URD-ROLE-007MUsers cannot manage roles equal to or higher than their own priority
URD-ROLE-008MOwner role is automatically assigned during sign-up

Acceptance

AC-ROLE-01: Role-scoped access
GivenWhenThen
An OwnerLists or counts recordsOnly their own organization and its merchants are returned
A userAttempts to manage a role at or above their own priorityThe action is rejected

EMP - Employee Management In-progress

Feature ID: user-management/EMP · Phase: P2 · PRDs: - · Dev: @nx/identity

What it does for users: owners create employee accounts, assign them to one or more merchants in their organization, and update or deactivate those assignments; each employee signs in with their own credentials and sees only the merchants they are assigned to.

Requirements

IDPRequirement
URD-EMP-001MOwner can create employee accounts
URD-EMP-002MEmployee is linked to an organization and one or more merchants
URD-EMP-003MEmployee can access only merchants they are assigned to
URD-EMP-004MEmployee can sign in with their own credentials
URD-EMP-005MData queries for an employee are filtered by their merchant assignments
URD-EMP-006MOwner can update employee merchant assignments (replaces all previous assignments)
URD-EMP-007MOwner can deactivate or remove an employee account
URD-EMP-008MSystem validates that the owner actually owns the organization and all listed merchants

Acceptance

AC-EMP-01: Employee creation
GivenWhenThen
OwnerCreates employee with merchant listAccount created with Employee role, linked to org + merchants
Owner does not own the organizationCreates employeeForbidden
Merchant not under owner's organizationIncluded in listValidation error
AC-EMP-02: Merchant reassignment
GivenWhenThen
Existing employeeOwner updates assignmentsPrevious assignments replaced with new ones
--Employee sees only the new merchants

CUS - Customer Management In-progress

Feature ID: user-management/CUS · Phase: P2 · PRDs: - · Dev: @nx/identity

What it does for users: owners create and maintain customer accounts linked to their organization, and can promote an existing sale-level customer into a full user account, with identifier-conflict checks.

Requirements

IDPRequirement
URD-CUS-001MOwner can create customer accounts
URD-CUS-002MCustomer is linked to an organization and receives the Customer role automatically
URD-CUS-003MCustomer profile includes name and contact details
URD-CUS-004MCustomer information can be updated and soft-deleted
URD-CUS-005SA sale-level customer can be promoted to a full user account
URD-CUS-006SPromotion checks for identifier conflicts before creating the user

Acceptance

AC-CUS-01: Customer promotion
GivenWhenThen
Sale-level customerPromotion triggeredFull user created with Customer role
Identifier conflictPromotion attemptedBlocked with conflict error

CFG - User Configuration Built

Feature ID: user-management/CFG · Phase: P1 · PRDs: PRD-USR-001 · PRD-USR-002 · Dev: @nx/identity

What it does for users: each user gets a default set of personal settings on registration, grouped and uniquely identified by code, and can read and update their own settings - including saving a custom table view of their own columns and filters. Settings are readable as soon as a user signs in, before a merchant is selected.

Requirements

IDPRequirement
URD-CFG-001MDefault configurations are created automatically when a user registers
URD-CFG-002MConfigurations are grouped and uniquely identified by code per user
URD-CFG-003SUser can view and update their own configurations
URD-CFG-004MConfigurations belong to a fixed group set (system, table, integration) and are uniquely identified by code per user
URD-CFG-005MConfiguration reads are available to any authenticated user before a merchant is selected; create / update / delete are permission-gated
URD-CFG-006SA user can create a custom table view from a code + display name; the system clones the base table configuration's stored layout into a new per-user view in the table group
URD-CFG-007MCreating a custom view rejects a duplicate (user + code + name) view and requires the referenced base table configuration to exist

Acceptance

AC-CFG-01: Default configurations
GivenWhenThen
A new userRegistersA default set of configurations is created automatically, grouped and uniquely identified by code
AC-CFG-02: Custom table view
GivenWhenThen
A signed-in user, before any merchant is selectedReads their configurationsThe configurations are returned (authenticate-only, user-level)
A user, a code + display name, an existing base table layoutSaves a custom viewA new per-user view is created in the table group, cloning the base layout
A view reusing an existing (user + code + name)SavedRefused - the view already exists
A code with no matching base table configurationSavedRefused - the base table configuration does not exist

7. Constraints & Non-Goals

Constraints

IDConstraint
C-01Passwords must be securely hashed; plain-text storage is forbidden
C-02The eight fixed roles are pre-seeded and cannot be modified or deleted
C-03Role priority is enforced - no user can manage a role at their level or above
C-04Account creation is atomic - partial creation is not allowed
C-05All records use soft-delete - physical deletion is never performed
C-06Each identifier type is globally unique (one email belongs to only one user)
C-07Employees must be linked to both an organization and at least one merchant
C-08Session tokens are stateless - permission changes take effect on next sign-in
C-09All operations except sign-in / sign-up require authentication

Non-Goals

  • Custom role creation and dynamic permission management → Permissions
  • OAuth / OAuth2 third-party login flow
  • Session management and remote revocation
  • User invitation via email or phone
  • Login history and audit logging
  • Multi-organization access for a single user
  • MFA enforcement policies

8. Version History

DateAuthorDescriptionVer
2026-02-26P. Do - Product OwnerInitial user storiesv0.1
2026-04-16ProductRestructured into URD with requirement IDsv0.3
2026-05-29ProductMigrated to module-docs convention; corrected status (BLOCKED, no IDSAFE), added link-account + status-honest gapsv0.4
2026-06-04Claude (AI pair)Reorganize by feature (Feature Spine); each feature carries its own requirements + acceptance; constraints moved to cross-cutting CONv0.5
2026-06-15ProductExtend USR (identifier-management resource) + CFG (config resource, pre-merchant reads, custom views); link PRD-USR-002v0.6

Proprietary and Confidential. Unauthorized copying, distribution, or use of this software is strictly prohibited.