Creates vendors by default
This commit is contained in:
@@ -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))))
|
||||
|
||||
Reference in New Issue
Block a user