This commit is contained in:
BC
2018-07-05 20:36:09 -07:00
parent e5caab4285
commit 6d685ffd3b
7 changed files with 45 additions and 17 deletions

View File

@@ -10,6 +10,7 @@
#(not (str/blank? %))))
(s/def ::name ::required-identifier)
(s/def ::print-as (s/nilable string?))
(s/def ::email (s/nilable (s/and string? (s/or :is-email #(re-matches email-regex %)
:is-empty #(= % "")))))
@@ -30,17 +31,18 @@
(s/def ::vendor (s/keys :req-un [::name]
:opt-un [::code
::id
::invoice-reminder-schedule
::primary-contact
::primary-email
::primary-phone
::secondary-contact
::secondary-email
::secondary-phone
::address
::id
::print-as
::invoice-reminder-schedule
::primary-contact
::primary-email
::primary-phone
::secondary-contact
::secondary-email
::secondary-phone
::address
::default-expense-account
]))
]))
(def vendor-spec (apply hash-map (drop 1 (s/form ::vendor))))