supports testing with yodlee merchant.

This commit is contained in:
Bryce Covert
2019-05-16 23:02:28 -07:00
parent de7fecc364
commit d0b5772d94
2 changed files with 7 additions and 1 deletions

View File

@@ -93,7 +93,7 @@
(defn tr [z x]
(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]} :transaction_rule :as z} value]
(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]
(->>
(d/query
(cond-> {:query {:find ['(pull ?e [* {:transaction/client [:client/name]
@@ -119,6 +119,11 @@
'[(re-find ?description-regex ?do)]]}
:args [(re-pattern description)]})
yodlee_merchant_id
(merge-query {:query {:in ['?yodlee-merchant-id]
:where ['[?e :transaction/yodlee-merchant ?yodlee-merchant-id]]}
:args [yodlee_merchant_id]})
amount_gte
(merge-query {:query {:in ['?amount-gte]
:where ['[?e :transaction/amount ?ta]

View File

@@ -72,6 +72,7 @@
:dom-lte
:dom-gte
:note])
(assoc :yodlee-merchant-id (:id (:yodlee-merchant data)))
(assoc :client-id (:id (:client data)))
(assoc :bank-account-id (:id (:bank-account data))))}
[:id