diff --git a/src/clj/auto_ap/ssr/admin/clients.clj b/src/clj/auto_ap/ssr/admin/clients.clj index 3356ff7f..a87d0ec1 100644 --- a/src/clj/auto_ap/ssr/admin/clients.clj +++ b/src/clj/auto_ap/ssr/admin/clients.clj @@ -491,12 +491,19 @@ (defn- decode-info [request] (->edn-safe-dates (decode-with info-schema request))) +(def ^:private humanize-opts + "Friendlier text for a missing required field than Malli's default + \"missing required key\" (e.g. the Info step with no location added)." + {:errors (assoc-in me/default-errors + [:malli.core/missing-key :error/message] + "This is required.")}) + (defn- validate-with "Per-step validation: a step can't advance until its fields satisfy the step schema. Returns a humanized errors map or nil." [schema data _request] (when-not (mc/validate schema data) - (me/humanize (mc/explain schema data)))) + (me/humanize (mc/explain schema data) humanize-opts))) (defn- client-timeline [active] (let [steps ["Info" "Matches" "Contact" "Bank Accounts" "Integrations" "Cash Flow" "Other Settings"]