/**
 * Pure helpers for workbench scan-pick (not server actions — keep out of `actions.ts` with "use server").
 */

/**
 * When true, the server created/reshaped lines (e.g. split pick); UI should reload hierarchical workbench data.
 * Normal scans only need to patch the row from `entity`.
 */
export function workbenchScanPickResponseNeedsFullRefresh(res: {
  message?: string | null;
}): boolean {
  const m = (res.message ?? "").toLowerCase();
  return m.includes("next stock-out line") || m.includes("remaining quantity allocated");
}
