This commit is contained in:
Bryce Covert
2019-05-17 15:58:37 -07:00
parent e876dc7b6d
commit c56e5372e4
2 changed files with 12 additions and 11 deletions

View File

@@ -44,9 +44,9 @@
:db/id id
:account account_id
:location location}))
;; TODO ASSERT ADMIN
(defn upsert-transaction-rule [context {{:keys [id description yodlee_merchant_id note client_id bank_account_id amount_lte amount_gte vendor_id accounts transaction_approval_status dom_gte dom_lte]} :transaction_rule :as z} value]
#_(assert-admin (:id context))
(assert-admin (:id context))
(let [existing-transaction (tr/get-by-id id)
deleted (deleted-accounts existing-transaction accounts)
account-total (reduce + 0 (map (fn [x] (:percentage x)) accounts))
@@ -93,6 +93,7 @@
(re-find (re-pattern z) x))
(defn test-transaction-rule [{:keys [id]} {{:keys [description note client_id bank_account_id amount_lte amount_gte dom_lte dom_gte yodlee_merchant_id]} :transaction_rule :as z} value]
(assert-admin id)
(->>
(d/query
(cond-> {:query {:find ['(pull ?e [* {:transaction/client [:client/name]