== Employee transfers tab == === Актери === * Employee === Scenario steps === 1. Employee selects a tab order 2. Employee chooses another front staff to transfer the tab to 3. Employee transfers tab to selected employee === SQL Queries === {{{ SELECT o.id AS order_id, t.table_number FROM tab_orders t JOIN orders o ON t.order_id = o.id WHERE t.frontstaff_id = 3 -- Current Employee ID }}} {{{ SELECT fs.employee_id FROM front_staff fs JOIN assignments a ON fs.employee_id = a.employee_id JOIN shifts s ON a.shift_id = s.shift_id WHERE a.clock_in_time IS NOT NULL AND a.clock_out_time IS NULL AND s.date = CURRENT_DATE AND fs.employee_id != 3 LIMIT 1; }}} {{{ UPDATE tab_orders SET frontstaff_id = 5 WHERE order_id = 12 AND frontstaff_id = 3; }}}