= UseCase02PrototypeImplementation - Doctor Login / Authentication = == Initiating Actor - `Doctor` == == Description == A doctor logs into the Medora healthcare system using their email address and password. The system verifies the credentials, checks that the account is active, retrieves the doctor's profile with specialization and department, and grants access to the doctor portal. == Scenario == 1. Doctor navigates to the Medora login page. [[Image(login_nocredidentials.png, width=100%)]] 2. Doctor enters their email address and password and submits the login form. [[Image(doctor_login.png, width=100%)]] {{{ #!sql SELECT u.user_id, u.username, u.password, u.role, u.first_name, u.last_name, u.is_active FROM users u JOIN doctors d ON u.user_id = d.user_id WHERE d.email_address = 'elena.kirova@medora.com'; }}} 3. System verifies if the account is active and the password matches. {{{ #!sql SELECT u.user_id FROM users u WHERE u.user_id = 2 AND u.is_active = TRUE; }}} 4. System retrieves the linked doctor profile with specialization and department. {{{ #!sql SELECT d.doctor_id, d.first_name, d.last_name, d.email_address, ds.specialization_name, dep.department_name, dl.level FROM doctors d JOIN doctor_specialization ds ON d.specialization_id = ds.specialization_id JOIN departments dep ON d.department_id = dep.department_id JOIN doctor_level dl ON d.level_id = dl.level_id WHERE d.user_id = 2; }}} 5. Doctor is authenticated and redirected to their dashboard. [[Image(doctor_overview.png, width=100%)]]