Files
integreat/src/clj/auto_ap/graphql/yodlee2.clj
2022-07-24 08:41:32 -07:00

22 lines
859 B
Clojure

(ns auto-ap.graphql.yodlee2
(:require
[auto-ap.datomic.yodlee2 :as d-yodlee2]
[auto-ap.graphql.utils :refer [->graphql <-graphql assert-admin]]))
(defn get-yodlee-provider-account-page [context args value]
(let [args (assoc args :id (:id context))
[yodlee-provider-accounts cnt] (d-yodlee2/get-graphql (<-graphql (assoc args :id (:id context))))]
{:yodlee_provider_accounts (map ->graphql yodlee-provider-accounts)
:total cnt
:count (count yodlee-provider-accounts)
:start (:start args 0)
:end (+ (:start args 0) (count yodlee-provider-accounts))}))
(defn get-all-yodlee-provider-accounts [context args value]
(let [args (assoc args :id (:id context))]
(map
->graphql
(first (d-yodlee2/get-graphql (assoc (<-graphql args)
:count Integer/MAX_VALUE))))))