import { ReturnProcess } from '../models';

export function isReturnProcessTypeGuard(
  input: unknown,
): input is ReturnProcess {
  if (typeof input !== 'object' || input === null) return false;

  const inp = input as Partial<ReturnProcess>;

  return (
    typeof inp.id === 'number' &&
    typeof inp.processId === 'number' &&
    typeof inp.receiptId === 'number' &&
    typeof inp.answers === 'object' &&
    inp.answers !== null &&
    'receiptItem' in inp
  );
}
