| Version 2 (modified by , 17 hours ago) ( diff ) |
|---|
UseCase05 - Create a Listing
Initiating actor: Owner
Description
An owner creates a listing for an animal they own. After creation, the system shows the created listing.
Scenario
- Owner opens "My Animals" page.
SELECT a.animal_id, a.name, a.sex, a.date_of_birth, a.type, a.species, a.breed, a.located_name FROM animals a WHERE a.owner_id = (SELECT user_id FROM users WHERE username = 'client.mila') ORDER BY a.animal_id DESC;
- Clicks on the "Create Listing" button.
- Owner enters listing information and submits it.
- System creates the lisitng.
INSERT INTO listings (owner_id, animal_id, status, price, description, created_at) VALUES ( (SELECT user_id FROM users WHERE username = 'client.mila'), (SELECT animal_id FROM animals WHERE name = 'Max' AND owner_id = (SELECT user_id FROM users WHERE username = 'client.mila') LIMIT 1), 'ACTIVE', 45.00, 'A cute male puppy that it is already vaccinated.', NOW() ) RETURNING listing_id;
Attachments (4)
- listing.png (47.3 KB ) - added by 17 hours ago.
- listing2.png (54.3 KB ) - added by 17 hours ago.
- listing3.png (57.1 KB ) - added by 17 hours ago.
- mypets.png (105.2 KB ) - added by 17 hours ago.
Download all attachments as: .zip
Note:
See TracWiki
for help on using the wiki.



