starting to support looking up by yodlee vendor.
This commit is contained in:
@@ -125,7 +125,8 @@
|
|||||||
(defn rule-applies? [transaction {:keys [:transaction-rule/description
|
(defn rule-applies? [transaction {:keys [:transaction-rule/description
|
||||||
:transaction-rule/dom-gte :transaction-rule/dom-lte
|
:transaction-rule/dom-gte :transaction-rule/dom-lte
|
||||||
:transaction-rule/amount-gte :transaction-rule/amount-lte
|
:transaction-rule/amount-gte :transaction-rule/amount-lte
|
||||||
:transaction-rule/client :transaction-rule/bank-account]} ]
|
:transaction-rule/client :transaction-rule/bank-account
|
||||||
|
:transaction-rule/yodlee-merchant]} ]
|
||||||
(println transaction description)
|
(println transaction description)
|
||||||
(let [transaction-dom (some-> transaction
|
(let [transaction-dom (some-> transaction
|
||||||
:transaction/date
|
:transaction/date
|
||||||
@@ -152,6 +153,10 @@
|
|||||||
(= (:transaction/client transaction)
|
(= (:transaction/client transaction)
|
||||||
(:db/id client))
|
(:db/id client))
|
||||||
true)
|
true)
|
||||||
|
(if yodlee-merchant
|
||||||
|
(= (:transaction/yodlee-merchant transaction)
|
||||||
|
(:db/id yodlee-merchant))
|
||||||
|
true)
|
||||||
(if bank-account
|
(if bank-account
|
||||||
(= (:transaction/bank-account transaction)
|
(= (:transaction/bank-account transaction)
|
||||||
(:db/id bank-account))
|
(:db/id bank-account))
|
||||||
@@ -178,6 +183,8 @@
|
|||||||
(more-specific? left right :transaction-rule/dom-gte)
|
(more-specific? left right :transaction-rule/dom-gte)
|
||||||
(more-specific? left right :transaction-rule/amount-lte)
|
(more-specific? left right :transaction-rule/amount-lte)
|
||||||
(more-specific? left right :transaction-rule/amount-gte)
|
(more-specific? left right :transaction-rule/amount-gte)
|
||||||
|
(more-specific? left right :transaction-rule/description)
|
||||||
|
(more-specific? left right :transaction-rule/yodlee-merchant)
|
||||||
|
|
||||||
true])))
|
true])))
|
||||||
|
|
||||||
@@ -201,8 +208,7 @@
|
|||||||
{:transaction-account/account (:db/id (:transaction-rule-account/account tra))
|
{:transaction-account/account (:db/id (:transaction-rule-account/account tra))
|
||||||
:transaction-account/amount (Math/abs (* (:transaction-rule-account/percentage tra)
|
:transaction-account/amount (Math/abs (* (:transaction-rule-account/percentage tra)
|
||||||
(:transaction/amount transaction)))
|
(:transaction/amount transaction)))
|
||||||
:transaction-account/location (:transaction-rule-account/location tra)}
|
:transaction-account/location (:transaction-rule-account/location tra)})
|
||||||
)
|
|
||||||
(:transaction-rule/accounts top-match))
|
(:transaction-rule/accounts top-match))
|
||||||
:transaction/vendor (:db/id (:transaction-rule/vendor top-match)))
|
:transaction/vendor (:db/id (:transaction-rule/vendor top-match)))
|
||||||
transaction)))))
|
transaction)))))
|
||||||
|
|||||||
Reference in New Issue
Block a user