Added bank accounts being credit card accounts

This commit is contained in:
Bryce Covert
2019-04-17 19:30:01 -07:00
parent 4fe52cad5a
commit 3ecfde69d0
11 changed files with 96 additions and 23 deletions

View File

@@ -23,9 +23,16 @@
(s/def ::checking-bank-account (s/and (s/keys :req-un [::code ::name ::bank-name ::number ::type]
:opt-un [::bank-code ::routing])
#(= (:type %) :check)))
(s/def ::credit-account (s/and (s/keys :req-un [::code ::name ::bank-name ::number ::type]
:opt-un [])
#(= (:type %) :credit)))
(s/def ::cash-account (s/and (s/keys :req-un [::type ::code ::name])
#(= (:type %) :cash)))
(s/def ::bank-account (s/or :cash ::cash-account :checking ::checking-bank-account))
(s/def ::bank-account (s/or :cash ::cash-account
:checking ::checking-bank-account
:credit ::credit-account))
(s/def ::bank-accounts (s/coll-of ::bank-account))
(s/def ::location string?)