Skip to content

The open alternative to Salesforce, designed for AI.

286 B
Raw Blame
import { z } from 'zod';

export const nonNegativeAmountFieldSchema = z
  .string()
  .trim()
  .min(1)
  .refine(
    (value) => {
      const parsed = Number(value);
      return Number.isFinite(parsed) && parsed >= 0;
    },
    { error: 'Enter a valid non-negative amount.' },
  );