wiki:UseCase04

Version 1 (modified by 231035, 2 weeks ago) ( diff )

--

UseCase04 - Saves a Listing

Initiating actor: Client

Description

A client browses listings and can save a listing into their favourites for quick access later. When the client clicks “Save” on a listing, the system verifies the client is logged in, verifies the listing exists, then stores the favourite record. The client can later view or remove saved listings.

Scenario

  1. Client clicks a listing from the lisiting page.
    SELECT
      l.listing_id,
      l.status,
      l.price,
      l.description,
      l.created_at,
      a.animal_id,
      a.name AS animal_name,
      a.species,
      a.breed,
      a.located_name,
      l.owner_id
    FROM listings l
    JOIN animals a ON a.animal_id = l.animal_id
    WHERE l.listing_id = $1;
    
    
  2. Client clicks "Save Listing".
  3. The system saves the listing to favorites to the client.
    INSERT INTO favourite_listings (user_id, listing_id)
    VALUES ($1, $2);
    
Note: See TracWiki for help on using the wiki.