| | 1 | = UseCase17 - Billing Admin Login / Authentication = |
| | 2 | |
| | 3 | == Initiating Actor - `Billing Admin` == |
| | 4 | |
| | 5 | == Description == |
| | 6 | A system administrator logs into the Medora system using their credentials. The admin gains access to billing administrative functions. |
| | 7 | |
| | 8 | == Scenario == |
| | 9 | |
| | 10 | 1. Administrator navigates to the Medora login page. |
| | 11 | |
| | 12 | 2. Administrator enters their username and password and submits the login form. |
| | 13 | |
| | 14 | {{{ |
| | 15 | #!sql |
| | 16 | SELECT |
| | 17 | u.user_id, |
| | 18 | u.username, |
| | 19 | u.password, |
| | 20 | u.role, |
| | 21 | u.first_name, |
| | 22 | u.last_name, |
| | 23 | u.is_active |
| | 24 | FROM users u |
| | 25 | WHERE u.username = 'admin_ilija' |
| | 26 | AND u.role = 'ADMIN'; |
| | 27 | }}} |
| | 28 | |
| | 29 | 3. System verifies the account is active and the password matches. |
| | 30 | |
| | 31 | {{{ |
| | 32 | #!sql |
| | 33 | SELECT u.user_id |
| | 34 | FROM users u |
| | 35 | WHERE u.username = 'admin_ilija' |
| | 36 | AND u.is_active = TRUE |
| | 37 | AND u.role = 'ADMIN'; |
| | 38 | }}} |
| | 39 | |
| | 40 | 4. System retrieves the linked admin profile. |
| | 41 | |
| | 42 | {{{ |
| | 43 | #!sql |
| | 44 | SELECT |
| | 45 | a.admin_id, |
| | 46 | a.user_id, |
| | 47 | a.permissions |
| | 48 | FROM admin a |
| | 49 | WHERE a.user_id = (SELECT user_id FROM users WHERE username = 'admin_ilija'); |
| | 50 | }}} |
| | 51 | |
| | 52 | 5. Administrator is authenticated and redirected to the admin dashboard. |