Changes between Initial Version and Version 1 of UseCase07


Ignore:
Timestamp:
01/24/26 14:27:17 (2 weeks ago)
Author:
231035
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UseCase07

    v1 v1  
     1= UseCase07 - Create an Appointment
     2** Initiating actor: Owner **
     3== Description
     4An owner schedules an appointment for one of their pets at a vet clinic they choose. The owner selects one of their animals, selects a clinic and submits the appointment request. The system then confirms the appointment has been created.
     5== Scenario
     61. Owner opens a specific vet clinic.
     7{{{
     8SELECT
     9  clinic_id,
     10  name,
     11  city,
     12  address,
     13  email,
     14  phone,
     15  open_time,
     16  close_time,
     17  not_working_isodow
     18FROM vet_clinics
     19WHERE clinic_id = $1;
     20}}}
     212. Owner clicks "Create an appointment".
     22{{{
     23SELECT
     24  a.animal_id,
     25  a.name,
     26  a.species,
     27  a.breed
     28FROM animals a
     29WHERE a.owner_id = $1
     30ORDER BY a.name;
     31}}}
     323. Owner fills in the form.
     33{{{
     34BEGIN;
     35
     36SELECT 1
     37FROM appointments ap
     38WHERE ap.clinic_id = $1
     39  AND ap.date_time = $2
     40  AND ap.status = 'CONFIRMED'
     41FOR UPDATE;
     42
     43INSERT INTO appointments (
     44  clinic_id,
     45  animal_id,
     46  responsible_owner_id,
     47  status,
     48  date_time,
     49  notes
     50)
     51VALUES (
     52  $1,
     53  $3,
     54  $4,
     55  'CONFIRMED',
     56  $2,
     57  $5
     58)
     59RETURNING appointment_id;
     60
     61COMMIT;
     62}}}