Changes between Version 2 and Version 3 of UseCase07


Ignore:
Timestamp:
01/25/26 15:12:25 (2 weeks ago)
Author:
231035
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UseCase07

    v2 v3  
    1414  phone
    1515FROM vet_clinics
    16 WHERE clinic_id = $1;
     16WHERE clinic_id = (SELECT clinic_id FROM vet_clinics WHERE name = 'Happy Paws Clinic');
    1717}}}
    18182. 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).
     
    2424  a.breed
    2525FROM animals a
    26 WHERE a.owner_id = $1
     26WHERE a.owner_id = (SELECT user_id FROM users WHERE username = 'client.mila')
    2727ORDER BY a.name;
    2828}}}
     
    3131{{{
    3232BEGIN;
    33 
    3433SELECT 1
    3534FROM appointments ap
    36 WHERE ap.clinic_id = $1
    37   AND ap.date_time = $2
     35WHERE ap.clinic_id = (SELECT clinic_id FROM vet_clinics WHERE name = 'Happy Paws Clinic')
     36  AND ap.date_time = (NOW() + INTERVAL '3 days')
    3837  AND ap.status = 'CONFIRMED'
    3938FOR UPDATE;
     
    4847)
    4948VALUES (
    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'),
    5356  'CONFIRMED',
    54   $2,
    55   $5
     57  (NOW() + INTERVAL '3 days'),
     58  'Regular check-up'
    5659)
    5760RETURNING appointment_id;