Changes between Initial Version and Version 1 of UseCase6


Ignore:
Timestamp:
12/28/25 15:02:57 (8 hours ago)
Author:
233144
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UseCase6

    v1 v1  
     1== Use-case 6 - Favorite Build
     2
     3Initiating actor: User \\
     4Other actors: / \\
     5
     6The 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.
     7
     8== Scenario
     9
     10Step 1. User goes to the COMPLETED BUILDS page. \\
     11Step 2. System gets the approved builds that the user can see. \\
     12{{{
     13SELECT
     14  b.id,
     15  b.name,
     16  b.total_price,
     17  b.created_at
     18FROM build b
     19WHERE b.is_approved = TRUE;
     20}}}
     21Step 3. The user selects a build that he wants to favorite from the page.
     22Step 4. The user clicks on ADD TO FAVORITES button.
     23Step 5. The system checks if the build has already been added to the favorites list:
     24{{{
     25SELECT *
     26FROM favorite_builds
     27WHERE user_id = userId
     28  AND build_id = buildId
     29LIMIT 1;
     30}}}
     31* If the build hasn't already been favorited, the system inserts it:
     32{{{
     33INSERT INTO favorite_builds (user_id, build_id)
     34VALUES (userId, buildId);
     35}}}
     36* If the build was already favorited, the system removes it from the favorites list:
     37{{{
     38DELETE FROM favorite_builds
     39WHERE user_id = userId
     40  AND build_id = buildId;
     41}}}
     42Step 6. The user can see his favorited builds in the user dashboard, by clicking on the username in the top right corner.