| 1 | == Employee clocks in == |
| 2 | |
| 3 | === Actors === |
| 4 | * Employee |
| 5 | === Steps in the Scenario === |
| 6 | 1. Employee logs in. |
| 7 | SELECT u.email, u.password FROM users u WHERE u.email = ?; -- and password application check |
| 8 | |
| 9 | 2. employee views his shift. |
| 10 | SELECT a.id, a.shift_id, a.manager_id, s.start_time, s.end_time FROM assignments a |
| 11 | LEFT JOIN public.shifts s on s.id = a.shift_id |
| 12 | LEFT JOIN public.managers m on a.manager_id = m.employee_id |
| 13 | WHERE s.date = current_date AND a.employee_id = 1; |
| 14 | |
| 15 | 3. Employee clocks in work. |
| 16 | UPDATE assignments SET clock_in_time = current_time WHERE assignments.employee_id = 1 AND assignments.shift_id = ?; |