Add component to build
Actors
User, Admin
Scenario
- In the forge, after the user chooses the desired compatible component they click on "ADD"
- The server adds the component to the build
BEGIN; SELECT * FROM build WHERE id = $buildId AND user_id = $userId LIMIT 1; SELECT * FROM build_component WHERE build_id = $buildId AND component_id = $componentId LIMIT 1; INSERT INTO build_component (build_id, component_id) VALUES ($buildId, $componentId); SELECT c.price FROM build_component bc JOIN components c ON c.id = bc.component_id WHERE bc.build_id = $buildId; UPDATE build SET total_price = ( SELECT COALESCE(ROUND(SUM(c.price), 2), 0) FROM build_component bc JOIN components c ON c.id = bc.component_id WHERE bc.build_id = $buildId ) WHERE id = $buildId; COMMIT;
Last modified
48 minutes ago
Last modified on 12/29/25 02:23:02
Attachments (2)
- addComponent.png (170.7 KB ) - added by 48 minutes ago.
- addedComponent.png (123.1 KB ) - added by 48 minutes ago.
Download all attachments as: .zip
Note:
See TracWiki
for help on using the wiki.


