You can now kind of choose a yodlee merchant
This commit is contained in:
14
src/clj/auto_ap/datomic/yodlee_merchants.clj
Normal file
14
src/clj/auto_ap/datomic/yodlee_merchants.clj
Normal file
@@ -0,0 +1,14 @@
|
||||
(ns auto-ap.datomic.yodlee-merchants
|
||||
(:require [datomic.api :as d]
|
||||
[auto-ap.graphql.utils :refer [->graphql]]
|
||||
[auto-ap.datomic :refer [uri merge-query]]))
|
||||
|
||||
(defn get-merchants [args]
|
||||
;; TODO admin?
|
||||
(let [query {:query {:find ['(pull ?e [:yodlee-merchant/name :yodlee-merchant/yodlee-id])]
|
||||
:in ['$]
|
||||
:where [['?e :yodlee-merchant/name]]}
|
||||
:args [(d/db (d/connect uri))]}]
|
||||
(->>
|
||||
(d/query query)
|
||||
(mapv first))))
|
||||
@@ -17,6 +17,7 @@
|
||||
[auto-ap.datomic.invoices :as d-invoices]
|
||||
[auto-ap.datomic.vendors :as d-vendors]
|
||||
[auto-ap.graphql.users :as gq-users]
|
||||
[auto-ap.graphql.yodlee-merchants :as ym]
|
||||
[auto-ap.graphql.ledger :as gq-ledger]
|
||||
[auto-ap.graphql.accounts :as gq-accounts]
|
||||
[auto-ap.graphql.clients :as gq-clients]
|
||||
@@ -371,6 +372,10 @@
|
||||
:statuses {:type '(list String)}}
|
||||
:resolve :get-all-payments}
|
||||
|
||||
:yodlee_merchants {:type '(list :yodlee_merchant)
|
||||
:args {}
|
||||
:resolve :get-yodlee-merchants}
|
||||
|
||||
:transaction_page {:type '(list :transaction_page)
|
||||
:args {:client_id {:type :id}
|
||||
:bank_account_id {:type :id}
|
||||
@@ -783,6 +788,7 @@
|
||||
:get-transaction-rule-page gq-transaction-rules/get-transaction-rule-page
|
||||
:get-expense-account-stats get-expense-account-stats
|
||||
:get-invoice-stats get-invoice-stats
|
||||
:get-yodlee-merchants ym/get-yodlee-merchants
|
||||
|
||||
:get-client gq-clients/get-client
|
||||
:get-user get-user
|
||||
|
||||
7
src/clj/auto_ap/graphql/yodlee_merchants.clj
Normal file
7
src/clj/auto_ap/graphql/yodlee_merchants.clj
Normal file
@@ -0,0 +1,7 @@
|
||||
(ns auto-ap.graphql.yodlee-merchants
|
||||
(:require [auto-ap.graphql.utils :refer [->graphql <-graphql]]
|
||||
[auto-ap.datomic.yodlee-merchants :as d-yodlee-merchants]))
|
||||
|
||||
(defn get-yodlee-merchants [context args value]
|
||||
(->graphql (d-yodlee-merchants/get-merchants (<-graphql args))))
|
||||
|
||||
Reference in New Issue
Block a user