Skip to content

User Management Phase A In-progress

Account lifecycle, authentication, and role-scoped access for every user type — internal operators, business owners, store employees, and customers. It is the platform's foundation: every other module trusts the identity and scope this module issues.

1. Identity

PropertyValue
Module IDCORE-01
TierCore
StatusIn-progress
PhaseP1 (auth + owner) shipped · P2 (employee + customer) in progress
PriorityHIGH
Primary usersOwner · Cashier · Employee · Customer · Internal operators (Super Admin / Admin / Operator)

2. Purpose & Scope

IncludedExcluded
Sign-up, sign-in (username / email / phone + password)OAuth / third-party login (scheme defined, no provider)
Password change + forgot-password resetSession revocation / remote logout (stateless JWT)
Email & phone verification via OTPTwo-factor enforcement (scheme defined, not enforced)
User profile, identifiers, and per-user settingsCustom role creation → Permissions
Employee lifecycle + merchant assignmentUser invitations
Customer lifecycle + promote-to-userMulti-organization access for one user
Eight fixed roles + role-scoped data filteringAudit / login history

3. Capabilities

CapabilityWhat the user can doStatus
Sign-upCreate an account with username + password; profile, identifiers, and default settings are created togetherBuilt
Sign-inAuthenticate with any verified identifier + password; receive a scoped session tokenBuilt
Change passwordVerify current password, then set a new oneBuilt
Forgot passwordReset a forgotten password via OTP (request → verify code → set new)Built
Email / phone verificationVerify an email or phone identifier with a one-time codeBuilt
Link accountAdd a verified email or phone to an existing accountBuilt
User profile & identifiersMaintain name, birthday, locale, and multiple emails / phonesBuilt
Per-user settingsDefault settings auto-created on registration; user can read / update themBuilt
Fixed roles & scopingEight system roles; list / count operations filtered by the caller's scopeBuilt
Employee managementOwner creates, assigns to merchants, updates, deactivates, removes employeesIn-progress
Customer managementOwner creates / updates / soft-deletes customers; promote a sale customer to a full userIn-progress
Two-factor authCredential scheme exists; enforcement not builtPlanned
OAuth loginCredential scheme exists; login flow not builtPlanned

Known gaps (status-honest): email verification on sign-up is currently disabled in code, so a fresh sign-up may not be able to sign in by email until verified through a separate flow; customer accounts are created without credentials, so they cannot sign in yet. See the developer docs for details.

4. Module Dependencies

Depends onWhy
PermissionsRoles, permissions, and policy edges that define what each user can do
CommerceOwners and employees belong to organizations; employees and customers scope to merchants
CRMCustomer accounts feed customer relationship management

5. Backend Packages

Implementation detail lives in the developer docs — this section only maps the module to the services that power it.

PackageRoleDeveloper docs
@nx/identityJWKS issuer (ES256); owns users, credentials, identifiers, roles, employees, customers, OTPidentity

Feature deep-dives: Authentication · User Management · Customer Management · RBAC · MFA & OTP.

6. Key User Flows

Sign-in

Sign-up & onboarding

Employee lifecycle

7. Roles & Permissions

Eight fixed system roles, ordered by priority. They are pre-seeded and cannot be edited or deleted. Custom roles are out of scope here — see Permissions.

RoleTypeScopeCanCannot
Super AdminInternalSystem-wideEverything; bypasses all data filters
AdminInternalSystem-wideEverything; bypasses all data filters
OperatorInternalSystem-wideRead-focused platform operationsMutate beyond support scope
OwnerExternalOwn organizationManage own org and all its merchants, employees, customersTouch other organizations
CashierExternalAssigned merchantsOperate assigned merchants (same tier as Employee)Access unassigned merchants
EmployeeExternalAssigned merchantsOperate only assigned merchantsAccess unassigned merchants
CustomerExternalLinked organizationCustomer-scoped accessOperate stores
GuestExternalGlobalUnauthenticated-style accessAny backend permission (lowest priority)

Rule: a user can never create, grant, or manage a role with priority equal to or higher than their own.

8. Status & Roadmap

PhaseCapabilities
P1Sign-up / sign-in, password change & reset, email/phone OTP, profile & identifiers, per-user settings, fixed roles & scoping, Owner auto-assignment
P2Employee lifecycle + merchant assignment, customer lifecycle + promote-to-user, full user status lifecycle, role-based data filtering
P3Custom role creation (→ Permissions), OAuth / third-party login, two-factor enforcement, login history, session revocation, user invitations, multi-organization

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