Yodlee exists as datomic entities!

This commit is contained in:
Bryce Covert
2020-12-22 13:12:22 -08:00
parent c28bd9635d
commit 6930a8c7c2
17 changed files with 883 additions and 478 deletions

View File

@@ -6,6 +6,7 @@
(defn cleanse [e]
(-> e
(assoc :client/yodlee-provider-accounts (get e :yodlee-provider-account/_client))
(update :client/location-matches
(fn [lms]
(map #(assoc % :location-match/match (first (:location-match/matches %))) lms)))
@@ -20,7 +21,9 @@
(defn get-all []
(->> (d/q '[:find (pull ?e [*
{:client/address [*]}
{:client/bank-accounts [* {:bank-account/type [*]}]}])
{:client/bank-accounts [* {:bank-account/type [*]
:bank-account/yodlee-account [:yodlee-account/name :yodlee-account/id :yodlee-account/number]}]}
{:yodlee-provider-account/_client [*]}])
:where [?e :client/name]]
(d/db (d/connect uri)))
(map first)
@@ -29,7 +32,10 @@
))
(defn get-by-id [id]
(->>
(d/query (-> {:query {:find ['(pull ?e [* {:client/bank-accounts [* {:bank-account/type [*]}]}])]
(d/query (-> {:query {:find ['(pull ?e [*
{:client/bank-accounts [* {:bank-account/type [*]
:bank-account/yodlee-account [:yodlee-account/name :yodlee-account/id :yodlee-account/number]}]}
{:yodlee-provider-account/_client [*]}])]
:in ['$ '?e]
:where [['?e]]}
:args [(d/db (d/connect uri)) id]}