Skip to content

Test Cases: User Management

ModuleCORE-01URDUser Management URD

1. Coverage Summary

AreaURD reqsTest casesCovered
Authentication (AUTH)1413⚠️
User Account (USR)1112
Roles & Scoping (ROLE)88
Employee Management (EMP)88
Customer Management (CUS)66
User Configuration (CFG)33

Priority = P1 (critical) / P2 (major) / P3 (minor). Steps use Given / When / Then.

2. Test Cases

2.1 Authentication

TC IDURD refScenarioStepsExpectedP
TC-AUTH-001URD-AUTH-001Sign-up with valid username + passwordGiven a new user; When they sign upAccount created; Owner role assignedP1
TC-AUTH-002URD-AUTH-001Sign-up with a taken usernameGiven a username already registered; When a new user signs up with itRejected; identifier already in useP1
TC-AUTH-003URD-AUTH-002, URD-CFG-001Sign-up creates everything togetherGiven a valid sign-up; When it completesAccount, profile, identifiers, and default settings all existP1
TC-AUTH-004URD-AUTH-003Atomic sign-up rollbackGiven a sign-up where one step fails; When the transaction runsNothing is created — full rollbackP1
TC-AUTH-005URD-AUTH-004Sign-in with valid credentialsGiven a verified user; When they sign in with identifier + passwordAuthentication succeedsP1
TC-AUTH-006URD-AUTH-004Sign-in with wrong passwordGiven a registered user; When they sign in with a wrong passwordRejected; error does not reveal whether the account existsP1
TC-AUTH-007URD-AUTH-005Token carries scopeGiven a successful sign-in; When the token is inspectedToken contains user ID, roles, organization IDs, merchant IDsP1
TC-AUTH-008URD-AUTH-006Passwords are hashedGiven a created account; When credential storage is inspectedPassword is stored hashed, never in plain textP1
TC-AUTH-009URD-AUTH-007Change password — correct currentGiven an authenticated user; When they change password with the correct current oneUpdated; user signs in with the new passwordP1
TC-AUTH-010URD-AUTH-007Change password — wrong currentGiven an authenticated user; When they supply a wrong current passwordRejected; current password incorrectP1
TC-AUTH-011URD-AUTH-008, URD-USR-005Verify email via OTPGiven an unverified email; When the user requests and submits the correct OTPEmail identifier marked verifiedP1
TC-AUTH-012URD-AUTH-010Forgot-password resetGiven a user who forgot their password; When they request, verify the code, and set a new onePassword reset; user signs in with the new passwordP1
TC-AUTH-013URD-AUTH-012Last sign-in recordedGiven a successful sign-in; When user details are viewedLast sign-in timestamp is updated and visibleP2

Known gap — email verification on sign-up

Email verification is currently disabled on sign-up in code, while sign-in requires a verified identifier. A user who signs up and then tries to sign in by email may be blocked until the email is verified through a separate flow. TC-AUTH-011 covers the verification flow itself; the sign-up→sign-in-by-email path is a known defect, not a passing case. See developer docs.

2.2 User Account

TC IDURD refScenarioStepsExpectedP
TC-USR-001URD-USR-001Unique system IDGiven an account is created; When it is inspectedA unique, immutable, never-reused ID is assignedP1
TC-USR-002URD-USR-002Multiple identifiersGiven a user with an email; When a phone is addedBoth identifiers stored; user can be looked up by eitherP1
TC-USR-003URD-USR-003Email uniquenessGiven user A owns an email; When user B registers with the same emailRejected; email already in useP1
TC-USR-004URD-USR-003Phone uniquenessGiven user A owns a phone; When user B adds the same phoneRejected; identifier unique per typeP2
TC-USR-005URD-USR-004Username auto-verifiedGiven a new account; When the username identifier is inspectedUsername is verified immediatelyP1
TC-USR-006URD-USR-005Email starts unverifiedGiven a newly added email; When inspected before verificationStatus is unverified until OTP is completedP1
TC-USR-007URD-USR-006View / update profileGiven an authenticated user; When they update first name and localeProfile updated; changes reflected on next readP1
TC-USR-008URD-USR-007Deactivate then reactivateGiven an ACTIVATED account; When an admin deactivates then reactivates itStatus moves ACTIVATED → DEACTIVATED → ACTIVATED; sign-in restoredP1
TC-USR-009URD-USR-007Block for securityGiven an ACTIVATED account; When an admin blocks itStatus becomes BLOCKED; user cannot sign inP1
TC-USR-010URD-USR-008Deactivated cannot sign inGiven a DEACTIVATED account; When the user signs inRejected; account deactivatedP1
TC-USR-011URD-USR-009Soft-delete preserves dataGiven a user with data is removed; When records are checkedData preserved; no physical deletionP1
TC-USR-012URD-USR-011Archived is terminalGiven an ARCHIVED account; When an admin attempts to reactivate itRejected; ARCHIVED cannot be reactivatedP2

QE finding — identifier uniqueness on update

The identifier-uniqueness check on update has inverted logic — it can allow a duplicate email / phone across users during an update. TC-USR-003 / TC-USR-004 cover the create path; the update path is a known defect.

2.3 Roles & Scoping

TC IDURD refScenarioStepsExpectedP
TC-ROLE-001URD-ROLE-001Eight fixed roles existGiven an initialized system; When roles are listedSuper Admin, Admin, Operator, Owner, Cashier, Employee, Customer, Guest existP1
TC-ROLE-002URD-ROLE-002Internal account creation respects hierarchyGiven an Admin; When they create an OperatorOperator created; an Operator cannot create another OperatorP1
TC-ROLE-003URD-ROLE-003Internal users bypass filtersGiven a Super Admin; When they query dataAll data returned system-wide; no scope filtering appliedP1
TC-ROLE-004URD-ROLE-004Owner scoped to own orgGiven Owner of Org X; When they query Org Y dataAccess denied; Owner limited to own org and its merchantsP1
TC-ROLE-005URD-ROLE-005Employee scoped to merchantsGiven an employee assigned to Merchant A; When they list orders across A and BOnly Merchant A orders returnedP1
TC-ROLE-006URD-ROLE-006Counts are scope-filteredGiven an employee on Merchant A only; When they request a product countCount includes only Merchant A productsP1
TC-ROLE-007URD-ROLE-007No self-escalationGiven an Employee; When they try to grant themselves OwnerRejected; cannot manage a role at or above own priorityP1
TC-ROLE-008URD-ROLE-008Owner auto-assigned at sign-upGiven a completed sign-up; When the user's roles are inspectedOwner role is assigned automaticallyP1

2.4 Employee Management

TC IDURD refScenarioStepsExpectedP
TC-EMP-001URD-EMP-001Owner creates employeeGiven an Owner; When they create an employeeAccount created with Employee role, linked to the organizationP1
TC-EMP-002URD-EMP-002Employee linked to merchantsGiven an employee assigned to A and B; When the mapping is inspectedEmployee mapped to org and to Merchants A and BP1
TC-EMP-003URD-EMP-003Cross-merchant access deniedGiven an employee on Merchant A only; When they access Merchant B dataAccess deniedP1
TC-EMP-004URD-EMP-004Employee sign-inGiven an employee with valid credentials; When they sign inAuthenticated with access scoped to assigned merchantsP1
TC-EMP-005URD-EMP-005Query filtered by assignmentGiven an employee on Merchant A; When they query ordersOnly Merchant A orders returned; B not visibleP1
TC-EMP-006URD-EMP-006Reassign merchantsGiven an employee on Merchant A; When the Owner updates to A + BPrevious assignments replaced; employee now sees A and B; no new accountP2
TC-EMP-007URD-EMP-007Deactivate / remove employeeGiven an active employee; When the Owner deactivates then removes themEmployee can no longer sign in; record soft-deleted; data preservedP1
TC-EMP-008URD-EMP-008Ownership validationGiven an Owner; When they create an employee for a merchant they do not ownRejected; org / merchant ownership validatedP1

2.5 Customer Management

TC IDURD refScenarioStepsExpectedP
TC-CUS-001URD-CUS-001Owner creates customerGiven an Owner; When they create a customerCustomer account created and linked to the organizationP1
TC-CUS-002URD-CUS-002Customer role auto-assignedGiven a created customer; When the account is inspectedCustomer role assigned; linked to the organizationP1
TC-CUS-003URD-CUS-003Customer profileGiven a customer; When the profile is inspectedProfile includes name and contact detailsP2
TC-CUS-004URD-CUS-004Update / soft-delete customerGiven a customer; When the Owner updates contact info then removes themChanges saved; customer soft-deleted, data preservedP1
TC-CUS-005URD-CUS-005Promote sale customerGiven a sale-level customer; When promotion is triggeredFull user created with Customer roleP2
TC-CUS-006URD-CUS-006Promotion conflict checkGiven a sale customer whose email is already taken; When promotion runsBlocked with a conflict errorP2

Known gap — customers cannot sign in

Customer accounts are created without credentials or login identifiers, so they cannot currently authenticate. TC-CUS-001..004 verify customer-record management by the Owner; customer self-service sign-in is not yet supported. See developer docs.

2.6 User Configuration

TC IDURD refScenarioStepsExpectedP
TC-CFG-001URD-CFG-001Defaults created on registrationGiven a new sign-up; When the account is createdA default set of user configurations existsP1
TC-CFG-002URD-CFG-002Config uniqueness per userGiven a user with configs; When a duplicate code is addedRejected; codes are unique per userP2
TC-CFG-003URD-CFG-003View / update configsGiven an authenticated user; When they read and update a settingSetting is returned and the update persistsP2

3. Traceability

Every Must requirement must map to ≥1 test case. Gaps are flagged explicitly.

URD requirementTest case(s)Status
URD-AUTH-001TC-AUTH-001, TC-AUTH-002✅ Covered
URD-AUTH-002TC-AUTH-003✅ Covered
URD-AUTH-003TC-AUTH-004✅ Covered
URD-AUTH-004TC-AUTH-005, TC-AUTH-006✅ Covered
URD-AUTH-005TC-AUTH-007✅ Covered
URD-AUTH-006TC-AUTH-008✅ Covered
URD-AUTH-007TC-AUTH-009, TC-AUTH-010✅ Covered
URD-AUTH-008TC-AUTH-011✅ Covered
URD-AUTH-009⚠️ Uncovered — phone OTP verification (mirror of TC-AUTH-011)
URD-AUTH-010TC-AUTH-012✅ Covered
URD-AUTH-011⚠️ Uncovered (Should) — link account
URD-AUTH-012TC-AUTH-013✅ Covered
URD-AUTH-013⚠️ Planned — 2FA enforcement not built
URD-AUTH-014⚠️ Planned — OAuth login not built
URD-USR-001TC-USR-001✅ Covered
URD-USR-002TC-USR-002✅ Covered
URD-USR-003TC-USR-003, TC-USR-004✅ Covered
URD-USR-004TC-USR-005✅ Covered
URD-USR-005TC-USR-006, TC-AUTH-011✅ Covered
URD-USR-006TC-USR-007✅ Covered
URD-USR-007TC-USR-008, TC-USR-009, TC-USR-012✅ Covered
URD-USR-008TC-USR-010✅ Covered
URD-USR-009TC-USR-011✅ Covered
URD-USR-010TC-USR-007✅ Covered
URD-USR-011TC-USR-012✅ Covered
URD-ROLE-001TC-ROLE-001✅ Covered
URD-ROLE-002TC-ROLE-002✅ Covered
URD-ROLE-003TC-ROLE-003✅ Covered
URD-ROLE-004TC-ROLE-004✅ Covered
URD-ROLE-005TC-ROLE-005✅ Covered
URD-ROLE-006TC-ROLE-006✅ Covered
URD-ROLE-007TC-ROLE-007✅ Covered
URD-ROLE-008TC-ROLE-008✅ Covered
URD-EMP-001TC-EMP-001✅ Covered
URD-EMP-002TC-EMP-002✅ Covered
URD-EMP-003TC-EMP-003✅ Covered
URD-EMP-004TC-EMP-004✅ Covered
URD-EMP-005TC-EMP-005✅ Covered
URD-EMP-006TC-EMP-006✅ Covered
URD-EMP-007TC-EMP-007✅ Covered
URD-EMP-008TC-EMP-008✅ Covered
URD-CUS-001TC-CUS-001✅ Covered
URD-CUS-002TC-CUS-002✅ Covered
URD-CUS-003TC-CUS-003✅ Covered
URD-CUS-004TC-CUS-004✅ Covered
URD-CUS-005TC-CUS-005✅ Covered
URD-CUS-006TC-CUS-006✅ Covered
URD-CFG-001TC-CFG-001✅ Covered
URD-CFG-002TC-CFG-002✅ Covered
URD-CFG-003TC-CFG-003✅ Covered

Open gaps: one Must requirement (URD-AUTH-009, phone OTP) lacks a dedicated test case — add a TC mirroring TC-AUTH-011. URD-AUTH-011 (link account, Should) is also uncovered. URD-AUTH-013/014 are Planned and intentionally untested.

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