you can now import from yodlee, automatically trigger rules, and have it show up on the ledger.

This commit is contained in:
Bryce Covert
2019-05-15 22:37:53 -07:00
parent 31aee76e61
commit ac5ffd26fe
2 changed files with 30 additions and 6 deletions

View File

@@ -143,23 +143,39 @@
(let [apply-rules (sut/rule-applying-fn [{:db/id 1
:transaction-rule/description "XXX039"
:transaction-rule/transaction-approval-status :transaction-approval-status/approved
:transaction-rule/vendor {:db/id 123}}
:transaction-rule/vendor {:db/id 123}
:transaction-rule/accounts [{:transaction-rule-account/account {:db/id 9}
:transaction-rule-account/location "Z"
:transaction-rule-account/percentage 1.0}]}
{:db/id 2
:transaction-rule/description "OtherMatch"
:transaction-rule/transaction-approval-status :transaction-approval-status/requires-feedback
:transaction-rule/vendor {:db/id 456}}])]
:transaction-rule/vendor {:db/id 456}
:transaction-rule/accounts [{:transaction-rule-account/account {:db/id 9}
:transaction-rule-account/location "Z"
:transaction-rule-account/percentage 1.0}]}])]
(t/is (= {:transaction/description-original "Hello XXX039",
:transaction/vendor 123
:transaction/approval-status :transaction-approval-status/approved
:transaction/matched-rule 1}
(-> {:transaction/description-original "Hello XXX039"}
:transaction/accounts [{:transaction-account/account 9
:transaction-account/amount 30.0
:transaction-account/location "Z"}]
:transaction/matched-rule 1
:transaction/amount 30.0}
(-> {:transaction/description-original "Hello XXX039"
:transaction/amount 30.0}
apply-rules)))
(t/is (= {:transaction/description-original "OtherMatch",
:transaction/approval-status :transaction-approval-status/requires-feedback
:transaction/vendor 456
:transaction/matched-rule 2}
(-> {:transaction/description-original "OtherMatch"}
:transaction/amount 30.0
:transaction/matched-rule 2
:transaction/accounts [{:transaction-account/account 9
:transaction-account/amount 30.0
:transaction-account/location "Z"}]}
(-> {:transaction/description-original "OtherMatch"
:transaction/amount 30.0}
apply-rules)))
(t/is (= {:transaction/description-original "Hello Not match"}