Adds the ability to suppress transactions
This commit is contained in:
@@ -185,9 +185,13 @@
|
||||
client-id (:db/id client)
|
||||
valid-locations (or (:bank-account/locations bank-account) (:client/locations client))
|
||||
|
||||
date (time/parse date "YYYY-MM-dd")]
|
||||
date (time/parse date "YYYY-MM-dd")
|
||||
id (sha-256 (str id))]
|
||||
|
||||
(cond (existing (sha-256 (str id)))
|
||||
(cond (= :transaction-approval-status/suppressed (existing id))
|
||||
:suppressed
|
||||
|
||||
(existing id)
|
||||
:extant
|
||||
|
||||
(not client-id)
|
||||
@@ -293,11 +297,13 @@
|
||||
|
||||
|
||||
(defn get-existing []
|
||||
(transduce (map first) conj #{}
|
||||
(d/query {:query {:find ['?tid]
|
||||
:in ['$]
|
||||
:where ['[_ :transaction/id ?tid]]}
|
||||
:args [(d/db (d/connect uri))]})))
|
||||
(into {}
|
||||
(d/query {:query {:find ['?tid '?as2]
|
||||
:in ['$]
|
||||
:where ['[?e :transaction/id ?tid]
|
||||
'[?e :transaction/approval-status ?as]
|
||||
'[?as :db/ident ?as2]]}
|
||||
:args [(d/db (d/connect uri))]})))
|
||||
|
||||
(defn get-all-bank-accounts []
|
||||
(->> (d-clients/get-all)
|
||||
|
||||
Reference in New Issue
Block a user