Supports ledger ignore

This commit is contained in:
Bryce Covert
2020-10-06 07:25:46 -07:00
parent cdccaf0572
commit 71fc8f69eb
6 changed files with 114 additions and 83 deletions

View File

@@ -82,9 +82,10 @@
(let [err (str "Account " name " uses location " (:location a) ", but is supposed to be " location)]
(throw (ex-info err {:validation-error err}) )))
(when (not (get (into #{"Shared"} (:client/locations client))
(:location a)))
(let [err (str "Account " name " uses location " (:location a) ", but doesn't belong to the client " location)]
(when (and (not location)
(not (get (into #{"Shared"} (:client/locations client))
(:location a))))
(let [err (str "Account " name " uses location " (:location a) ", but doesn't belong to the client.")]
(throw (ex-info err {:validation-error err}) ))))
rule-id (if id
id