Replacing when matching.

This commit is contained in:
Bryce Covert
2019-05-17 08:47:35 -07:00
parent 2f6dc32546
commit e876dc7b6d
2 changed files with 61 additions and 6 deletions

View File

@@ -130,12 +130,15 @@
(throw (ex-info "Transaction already associated with a payment" {:validation-error "Transaction already associated with a payment"})))
@(d/transact (d/connect uri)
[(rm/apply-rule {:db/id (:db/id transaction)
:transaction/amount (:transaction/amount transaction)}
transaction-rule
(into
[(remove-nils (rm/apply-rule {:db/id (:db/id transaction)
:transaction/amount (:transaction/amount transaction)}
transaction-rule
;; TODO use bank account locations as well
(-> transaction :transaction/client :client/locations))]))
;; TODO use bank account locations as well
(-> transaction :transaction/client :client/locations)))]
(map (fn [x] [:db/retractEntity (:db/id x)] )
(:transaction/accounts transaction)))))
(-> (d-transactions/get-by-id transaction_id)
approval-status->graphql
->graphql))