wiki:UseCase6

Use-case 6 - Favorite Build

Initiating actor: User
Other actors: /

The registered user wants to add a build to a list of favorite builds. The system ensures the user is logged in and that the build exists. Then it stores the build as 'favorited' for that user.

Scenario

Step 1. User goes to the COMPLETED BUILDS page.
Step 2. System gets the approved builds that the user can see.

SELECT 
  b.id,
  b.name,
  b.total_price,
  b.created_at
FROM build b
WHERE b.is_approved = TRUE;

Step 3. The user selects a build that he wants to favorite from the page.

Step 4. The user clicks on ADD TO FAVORITES button.

Step 5. The system checks if the build has already been added to the favorites list:

SELECT *
FROM favorite_builds
WHERE user_id = userId
  AND build_id = buildId
LIMIT 1;
  • If the build hasn't already been favorited, the system inserts it:
    INSERT INTO favorite_builds (user_id, build_id)
    VALUES (userId, buildId);
    

  • If the build was already favorited, the system removes it from the favorites list:
    DELETE FROM favorite_builds
    WHERE user_id = userId
      AND build_id = buildId;
    

Step 6. The user can see his favorited builds in the user dashboard, by clicking on the username in the top right corner.

Last modified 2 hours ago Last modified on 12/28/25 15:06:02

Attachments (4)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.