| | 1 | == User opens dashboard == |
| | 2 | |
| | 3 | === Actors === |
| | 4 | User, Admin |
| | 5 | |
| | 6 | === Scenario === |
| | 7 | 1. The user opens the completed builds page, opens the details popup for a build |
| | 8 | 2. The user clicks on "REVIEWS" |
| | 9 | 3. An option to rate and write a review for the build is displayed |
| | 10 | 4. The user rates the build and writes a review |
| | 11 | 5. The user clicks on "SUBMIT REVIEW" and the rating and review are submitted |
| | 12 | |
| | 13 | {{{ |
| | 14 | INSERT INTO rating_build (user_id, build_id, value) |
| | 15 | VALUES ($userId, $buildId, $value) |
| | 16 | ON CONFLICT (user_id, build_id) |
| | 17 | DO UPDATE SET |
| | 18 | value = $value |
| | 19 | }}} |
| | 20 | |
| | 21 | {{{ |
| | 22 | NSERT INTO review (user_id, build_id, content, created_at) |
| | 23 | VALUES ($userId, $buildId, $content, $createdAt) |
| | 24 | ON CONFLICT (build_id, user_id) |
| | 25 | DO UPDATE SET |
| | 26 | content = $content, |
| | 27 | created_at = $createdAt |
| | 28 | }}} |