really improved vendor dialog code.

This commit is contained in:
Bryce Covert
2020-04-18 09:16:32 -07:00
parent 9204e18b98
commit ec10e6b823
13 changed files with 211 additions and 335 deletions

View File

@@ -11,6 +11,7 @@
(s/def ::name ::required-identifier)
(s/def ::hidden boolean?)
(s/def ::print-as (s/nilable string?))
(s/def ::terms (s/nilable int?))
(s/def ::invoice-reminder-schedule (s/nilable #{"Weekly" "Never" nil}))
@@ -25,6 +26,7 @@
(s/keys :req-un [::name]
:opt-un [::code
::default-account-id
::terms
::hidden
::id
::print-as
@@ -34,8 +36,7 @@
::address])
(s/or :hidden #(= (:hidden %) true)
:has-expense-account (and (s/keys :req-un [::default-account-id])
#(not (nil? (:default-account-id %)))))))
:has-expense-account #(not (nil? (:id (:default-account %)))))))
(def vendor-spec (apply hash-map (drop 1 (s/form ::vendor))))