| Version 2 (modified by , 6 hours ago) ( diff ) |
|---|
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.
Attachments (4)
- completed.png (166.4 KB ) - added by 6 hours ago.
- favorite.png (165.3 KB ) - added by 6 hours ago.
- dashboard.png (82.3 KB ) - added by 6 hours ago.
- builds.png (98.0 KB ) - added by 6 hours ago.
Download all attachments as: .zip




