wiki:UseCase18

UseCase18 - System Administrator Manages Users

Initiating Actor - System Administrator

Description

A system administrator creates new user accounts and manages existing ones. The admin can register patients, doctors, lab technicians, and other admins, and can view and filter all users in the system.

Scenario

  1. Admin navigates to the user management section and views all users in the system.
SELECT
  u.user_id,
  u.username,
  u.role,
  u.first_name,
  u.last_name,
  u.is_active
FROM users u
ORDER BY u.role, u.username;
  1. Admin filters users by role.
SELECT
  u.user_id,
  u.username,
  u.role,
  u.first_name,
  u.last_name,
  u.is_active
FROM users u
WHERE u.role = 'DOCTOR'
ORDER BY u.username;
  1. Admin clicks "Create User" and enters the new user's details.
INSERT INTO users (username, password, role, first_name, last_name, is_active)
VALUES (
  'nikola.trajkov',
  'password123',
  'DOCTOR',
  'Nikola',
  'Trajkov',
  TRUE
)
RETURNING user_id;
  1. System creates the role-specific profile linked to the new user.
INSERT INTO doctors (user_id, specialization_id, department_id, first_name, last_name, email_address, level_id)
VALUES (
  (SELECT user_id FROM users WHERE username = 'nikola.trajkov'),
  (SELECT specialization_id FROM doctor_specialization WHERE specialization_name = 'Cardiology'),
  (SELECT department_id FROM departments WHERE department_name = 'Cardiology'),
  'Nikola',
  'Trajkov',
  'nikola.trajkov@cardio.com',
  (SELECT level_id FROM doctor_level WHERE level = 'RESIDENT')
);
  1. System displays the updated user list confirming the new account.
SELECT
  u.user_id,
  u.username,
  u.role,
  u.first_name,
  u.last_name,
  u.is_active
FROM users u
ORDER BY u.role, u.username;
Last modified 5 days ago Last modified on 06/14/26 21:05:57
Note: See TracWiki for help on using the wiki.