Changes between Version 2 and Version 3 of UseCase07
- Timestamp:
- 01/25/26 15:12:25 (2 weeks ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
UseCase07
v2 v3 14 14 phone 15 15 FROM vet_clinics 16 WHERE clinic_id = $1;16 WHERE clinic_id = (SELECT clinic_id FROM vet_clinics WHERE name = 'Happy Paws Clinic'); 17 17 }}} 18 18 2. 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). … … 24 24 a.breed 25 25 FROM animals a 26 WHERE a.owner_id = $126 WHERE a.owner_id = (SELECT user_id FROM users WHERE username = 'client.mila') 27 27 ORDER BY a.name; 28 28 }}} … … 31 31 {{{ 32 32 BEGIN; 33 34 33 SELECT 1 35 34 FROM appointments ap 36 WHERE ap.clinic_id = $137 AND ap.date_time = $235 WHERE ap.clinic_id = (SELECT clinic_id FROM vet_clinics WHERE name = 'Happy Paws Clinic') 36 AND ap.date_time = (NOW() + INTERVAL '3 days') 38 37 AND ap.status = 'CONFIRMED' 39 38 FOR UPDATE; … … 48 47 ) 49 48 VALUES ( 50 $1, 51 $3, 52 $4, 49 (SELECT clinic_id FROM vet_clinics WHERE name = 'Happy Paws Clinic'), 50 (SELECT animal_id 51 FROM animals 52 WHERE name = 'Max' 53 AND owner_id = (SELECT user_id FROM users WHERE username = 'client.mila') 54 LIMIT 1), 55 (SELECT user_id FROM users WHERE username = 'client.mila'), 53 56 'CONFIRMED', 54 $2,55 $557 (NOW() + INTERVAL '3 days'), 58 'Regular check-up' 56 59 ) 57 60 RETURNING appointment_id;
