import { getJson, postJson, putJson } from './client'; export type WaiterAssignment = { waiterId: string; tableId: string; status: string; activeOrders: number; }; export type WaiterAssignmentsResponse = { contextId: string; locationId: string; summary: string; assignments: WaiterAssignment[]; recentActivity: string[]; }; export type WaiterRecentActivityResponse = { contextId: string; locationId: string; summary: string; recentActivity: string[]; }; export type SubmitFloorOrderRequest = { contextId: string; tableId: string; orderId: string; itemCount: number; }; export type SubmitFloorOrderResponse = { contextId: string; orderId: string; accepted: boolean; summary: string; status: string; processedAtUtc: string; }; export type UpdateFloorOrderRequest = { contextId: string; tableId: string; orderId: string; itemCount: number; }; export type UpdateFloorOrderResponse = { contextId: string; orderId: string; accepted: boolean; summary: string; status: string; processedAtUtc: string; }; export async function loadDashboard(contextId: string): Promise { return getJson(`/api/waiter/floor/assignments?contextId=${encodeURIComponent(contextId)}`); } export async function loadRecentActivity(contextId: string): Promise { return getJson(`/api/waiter/floor/activity?contextId=${encodeURIComponent(contextId)}`); } export async function submitFloorOrder(request: SubmitFloorOrderRequest): Promise { return postJson('/api/waiter/floor/orders', request); } export async function updateFloorOrder(request: UpdateFloorOrderRequest): Promise { return putJson(`/api/waiter/floor/orders/${encodeURIComponent(request.orderId)}`, { contextId: request.contextId, tableId: request.tableId, itemCount: request.itemCount }); }