== Add component to build == === Actors === User, Admin === Scenario === 1. In the forge, after the user chooses the desired existing component they click on the trash can icon 2. The server removes the component from the build {{{ BEGIN; SELECT * FROM build WHERE id = $buildId AND user_id = $userId LIMIT 1; DELETE FROM build_component WHERE build_id = $buildId AND component_id = $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; }}}