Overhaul of the frontend on waiters, orders, and payment events
Manager Dashboard: product reorder/bulk actions, preference sub-choices UI, expanded reports with DateInput component, waiter management updates, order detail improvements, Docker config and backend dockerignore added. Backend: table groups, auto-numbering, has_active_order flag, expanded reporting endpoints, waiter zone management, user schema updates, system router additions, table router fixes. Waiter PWA: TableDetailPage order/payment event improvements. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -44,10 +44,8 @@ export default function TableDetailPage() {
|
||||
|
||||
const activeItems = order?.items?.filter(i => i.status === 'active') || []
|
||||
const allPaid = order && activeItems.length === 0
|
||||
|
||||
const isMyOrder = order && (
|
||||
order.opened_by === user?.id || order.waiters?.some(w => w.waiter_id === user?.id)
|
||||
)
|
||||
// Any waiter whose zone covers this table can interact with orders on it
|
||||
const canInteract = !!order
|
||||
|
||||
async function openOrder() {
|
||||
try {
|
||||
@@ -123,12 +121,12 @@ export default function TableDetailPage() {
|
||||
<div className="detail-body">
|
||||
<OrderSummary
|
||||
order={order}
|
||||
selectable={isMyOrder && !paying}
|
||||
selectable={canInteract && !paying}
|
||||
selectedIds={selectedIds}
|
||||
onToggle={toggleItem}
|
||||
/>
|
||||
|
||||
{isMyOrder && activeItems.length > 0 && (
|
||||
{canInteract && activeItems.length > 0 && (
|
||||
<div style={{ padding: '4px 12px 8px' }}>
|
||||
<button className="link-btn" onClick={selectAll} style={{ fontSize: 15 }}>
|
||||
{allActiveSelected ? '☑ Αποεπιλογή όλων' : '☐ Επιλογή όλων'}
|
||||
@@ -136,7 +134,7 @@ export default function TableDetailPage() {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{isMyOrder && (
|
||||
{canInteract && (
|
||||
<div className="action-bar">
|
||||
<button className="btn btn--accent" onClick={() => navigate(`/tables/${tableId}/add`)}>
|
||||
+ Προσθήκη
|
||||
@@ -159,12 +157,6 @@ export default function TableDetailPage() {
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{!isMyOrder && (
|
||||
<p style={{ textAlign: 'center', color: '#64748b', padding: 16 }}>
|
||||
Ανάγνωση μόνο — άλλος σερβιτόρος
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user