export function formatOid(orderNumber: number | undefined, fallbackId: string, restaurantId?: string): string {
  const prefix = restaurantId ? restaurantId.replace(/-/g, '').slice(0, 4).toUpperCase() : null;
  if (orderNumber) {
    const padded = String(orderNumber).padStart(5, '0');
    return prefix ? `${prefix}-${padded}` : `ORD-${padded}`;
  }
  return fallbackId ? fallbackId.slice(0, 8).toUpperCase() : '—';
}
