Files

28 lines
614 B
TypeScript

import type { Branch } from '@/domain/table/table-id';
import type { OrderLine } from '@/domain/shared/order-line';
export interface TableOrderPayload {
branch: Branch;
tableNumber: string;
tableIdentifier: string;
items: OrderLine[];
notes?: string;
createdAt: string;
}
export function buildTableOrderPayload(
branch: Branch,
tableNumber: string,
tableIdentifier: string,
items: OrderLine[],
notes?: string
): TableOrderPayload {
return {
branch,
tableNumber,
tableIdentifier,
items,
notes: notes?.trim() || undefined,
createdAt: new Date().toISOString(),
};
}