= 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 1. Owner opens "My Animals" page. [[Image(mypets.png)]] {{{ 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; }}} 2. Clicks on the "Create Listing" button. [[Image(listing.png)]] 3. Owner enters listing information and submits it. [[Image(listing2.png)]] 4. 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; }}} [[Image(listing3.png)]]