Changes between Version 2 and Version 3 of UseCase18


Ignore:
Timestamp:
09/22/26 16:03:16 (21 hours ago)
Author:
236021
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UseCase18

    v2 v3  
    3939}}}
    4040
    41 3. Admin enters the new doctor's professional details, and the system creates the doctor profile first.
     413. Admin enters the new login credentials, and the system creates the user account first, since the doctor profile will need to reference it.
    4242
    4343{{{
    4444#!sql
    45 INSERT INTO doctors (specialization_id, department_id, first_name, last_name, email_address, level_id)
     45INSERT INTO users (username, password, role, first_name, last_name, is_active)
    4646VALUES (
    47   (SELECT specialization_id FROM doctor_specialization WHERE specialization_name = 'Cardiology'),
    48   (SELECT department_id FROM departments WHERE department_name = 'Cardiology'),
     47  'nikola.trajkov2@medora.com',
     48  '$2b$12$slaz0XboBErLVSsQBaQSQOkl2uOd8/RiEzyovbImHAS95rtMvKDiO',
     49  'DOCTOR',
    4950  'Nikola',
    5051  'Trajkov',
    51   'nikola.trajkov@cardio.com',
    52   (SELECT level_id FROM doctor_level WHERE level = 'RESIDENT')
     52  TRUE
    5353)
    54 RETURNING doctor_id;
     54RETURNING user_id;
    5555}}}
    5656
    57 4. Admin enters the new login credentials, and the system creates the user account linked to that doctor profile.
     574. Admin enters the new doctor's professional details, and the system creates the doctor profile linked to that user account.
    5858
    5959{{{
    6060#!sql
    61 INSERT INTO users (username, password, role, first_name, last_name, is_active, doctor_id)
     61INSERT INTO doctors (doctor_id, first_name, last_name, email_address, level_id, specialization_id, department_id, user_id)
    6262VALUES (
    63   'nikola.trajkov',
    64   'password123',
    65   'DOCTOR',
     63  (SELECT COALESCE(MAX(doctor_id), 0) + 1 FROM doctors),
    6664  'Nikola',
    6765  'Trajkov',
    68   TRUE,
    69   (SELECT MAX(doctor_id) FROM doctors)
     66  'nikola.trajkov2@medora.com',
     67  (SELECT level_id FROM doctor_level WHERE level = 'RESIDENT'),
     68  (SELECT specialization_id FROM doctor_specialization WHERE specialization_name = 'CARDIOLOGY'),
     69  (SELECT department_id FROM departments WHERE department_name = 'CARDIOLOGY_DEPT'),
     70  (SELECT MAX(user_id) FROM users)
    7071)
    71 RETURNING user_id;
     72RETURNING doctor_id;
    7273}}}
    7374