[:map
   [:account/id {:primary-key true} uuid?]
   [:account/email
    [:re {:error/message "Invalid email"} #".+@.+\..+"]]
   [:account/password {:before-save [:bcrypt]} [:string {:min 6}]]
   [:account/password-confirmation {:virtual true} [:string {:min 6}]]]})

(defn password-match? [m]
  (= (:account/password m)
     (:account/password-confirmation m)))

(defmethod gungnir.model/validator :register/password-match? [_]
  {:validator/key :account/password-confirmation
   :validator/fn password-match?
  