| Version 2 (modified by , 2 weeks ago) ( diff ) |
|---|
UseCase07 - Create an Appointment
Initiating actor: Owner
Description
An 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.
Scenario
- Owner opens a specific vet clinic.
SELECT clinic_id, name, city, address, email, phone FROM vet_clinics WHERE clinic_id = $1;
- Owner clicks "Create an appointment"(In the form there are all the animals of that owner, so he can choose witch animal is the appointment for).
SELECT a.animal_id, a.name, a.species, a.breed FROM animals a WHERE a.owner_id = $1 ORDER BY a.name;
- Owner fills in the form.
- Owner submits the form.
BEGIN; SELECT 1 FROM appointments ap WHERE ap.clinic_id = $1 AND ap.date_time = $2 AND ap.status = 'CONFIRMED' FOR UPDATE; INSERT INTO appointments ( clinic_id, animal_id, responsible_owner_id, status, date_time, notes ) VALUES ( $1, $3, $4, 'CONFIRMED', $2, $5 ) RETURNING appointment_id; COMMIT;
Note:
See TracWiki
for help on using the wiki.
