Creates vendors by default

This commit is contained in:
Bryce Covert
2019-05-05 08:12:26 -07:00
parent 3dafdd66c2
commit 86d9c1c10c
5 changed files with 42 additions and 12 deletions

View File

@@ -17,20 +17,25 @@
(s/def ::primary-contact (s/nilable ::contact/contact))
(s/def ::secondary-contact (s/nilable ::contact/contact))
(s/def ::address (s/nilable ::address/address))
(s/def ::default-account-id string?)
(s/def ::default-account-id (s/nilable string?))
(s/def ::code (s/nilable string?))
(s/def ::vendor (s/keys :req-un [::name
::default-account-id
::hidden]
:opt-un [::code
::id
::print-as
::invoice-reminder-schedule
::primary-contact
::secondary-contact
::address]))
(s/def ::vendor (s/and
(s/keys :req-un [::name]
:opt-un [::code
::default-account-id
::hidden
::id
::print-as
::invoice-reminder-schedule
::primary-contact
::secondary-contact
::address])
(s/or :hidden #(= (:hidden %) true)
:has-expense-account (and (s/keys :req-un [::default-account-id])
#(not (nil? (:default-account-id %)))))))
(def vendor-spec (apply hash-map (drop 1 (s/form ::vendor))))