added apply all rule.
This commit is contained in:
@@ -92,11 +92,12 @@
|
||||
(defn tr [z x]
|
||||
(re-find (re-pattern z) x))
|
||||
|
||||
(defn -test-transaction-rule [id {:keys [:transaction-rule/description :transaction-rule/note :transaction-rule/client :transaction-rule/bank-account :transaction-rule/amount-lte :transaction-rule/amount-gte :transaction-rule/dom-lte :transaction-rule/dom-gte :transaction-rule/yodlee-merchant]} include-coded?]
|
||||
(defn -test-transaction-rule [id {:keys [:transaction-rule/description :transaction-rule/note :transaction-rule/client :transaction-rule/bank-account :transaction-rule/amount-lte :transaction-rule/amount-gte :transaction-rule/dom-lte :transaction-rule/dom-gte :transaction-rule/yodlee-merchant]} include-coded? count]
|
||||
(->>
|
||||
(d/query
|
||||
(cond-> {:query {:find ['(pull ?e [* {:transaction/client [:client/name]
|
||||
:transaction/bank-account [:bank-account/name]}
|
||||
:transaction/bank-account [:bank-account/name]
|
||||
:transaction/payment [:db/id]}
|
||||
])]
|
||||
:in ['$ ]
|
||||
:where []}
|
||||
@@ -167,7 +168,7 @@
|
||||
(merge-query {:query {:where ['[?e :transaction/id]]}})))
|
||||
|
||||
(transduce (comp
|
||||
(take 15)
|
||||
(take (or count 15))
|
||||
(map first)
|
||||
(map #(dissoc % :transaction/id))
|
||||
(map (fn [x]
|
||||
@@ -185,9 +186,9 @@
|
||||
:dom-lte dom_lte
|
||||
:dom-gte dom_gte
|
||||
:yodlee-merchant (when yodlee_merchant_id {:db/id yodlee_merchant_id})}
|
||||
true))
|
||||
true 15))
|
||||
|
||||
|
||||
(defn run-transaction-rule [{:keys [id]} {:keys [transaction_rule_id]} value]
|
||||
(defn run-transaction-rule [{:keys [id]} {:keys [transaction_rule_id count]} value]
|
||||
(assert-admin id)
|
||||
(-test-transaction-rule id (tr/get-by-id transaction_rule_id) false))
|
||||
(-test-transaction-rule id (tr/get-by-id transaction_rule_id) false count))
|
||||
|
||||
Reference in New Issue
Block a user