| | 1 | = UseCase05 - Create a Listing |
| | 2 | ** Initiating actor: Owner ** |
| | 3 | == Description |
| | 4 | An owner creates a listing for an animal they own. After creation, the system shows the created listing. |
| | 5 | == Scenario |
| | 6 | 1. Owner opens "My Animals" page. |
| | 7 | {{{ |
| | 8 | SELECT |
| | 9 | a.animal_id, |
| | 10 | a.name, |
| | 11 | a.sex, |
| | 12 | a.date_of_birth, |
| | 13 | a.type, |
| | 14 | a.species, |
| | 15 | a.breed, |
| | 16 | a.located_name |
| | 17 | FROM animals a |
| | 18 | WHERE a.owner_id = $1 |
| | 19 | ORDER BY a.animal_id DESC; |
| | 20 | }}} |
| | 21 | 2. Owner clicks on a specific animal and clicks "Create Listing". |
| | 22 | 3. Owner enters listing information and submits it. |
| | 23 | 4. System creates the lisitng. |
| | 24 | {{{ |
| | 25 | INSERT INTO listings (owner_id, animal_id, status, price, description, created_at) |
| | 26 | VALUES ($1, $2, 'ACTIVE', $3, $4, NOW()) |
| | 27 | RETURNING listing_id; |
| | 28 | }}} |
| | 29 | |
| | 30 | |
| | 31 | |
| | 32 | |
| | 33 | |