Adds capability back for all accounts export
This commit is contained in:
@@ -372,6 +372,10 @@
|
|||||||
:sort {:type '(list :sort_item)}}
|
:sort {:type '(list :sort_item)}}
|
||||||
:resolve :get-accounts}
|
:resolve :get-accounts}
|
||||||
|
|
||||||
|
:all_accounts {:type '(list :account)
|
||||||
|
:args {}
|
||||||
|
:resolve :get-all-accounts}
|
||||||
|
|
||||||
:search_vendor {:type '(list :search_result)
|
:search_vendor {:type '(list :search_result)
|
||||||
:args {:query {:type 'String}}
|
:args {:query {:type 'String}}
|
||||||
:resolve :search-vendor}
|
:resolve :search-vendor}
|
||||||
@@ -810,6 +814,7 @@
|
|||||||
:get-yodlee-provider-account-page gq-yodlee2/get-yodlee-provider-account-page
|
:get-yodlee-provider-account-page gq-yodlee2/get-yodlee-provider-account-page
|
||||||
:get-all-sales-orders get-all-sales-orders
|
:get-all-sales-orders get-all-sales-orders
|
||||||
:get-accounts gq-accounts/get-graphql
|
:get-accounts gq-accounts/get-graphql
|
||||||
|
:get-all-accounts gq-accounts/get-all-graphql
|
||||||
:get-sales-order-page gq-sales-orders/get-sales-orders-page
|
:get-sales-order-page gq-sales-orders/get-sales-orders-page
|
||||||
:get-transaction-rule-page gq-transaction-rules/get-transaction-rule-page
|
:get-transaction-rule-page gq-transaction-rules/get-transaction-rule-page
|
||||||
:get-transaction-rule-matches gq-transaction-rules/get-transaction-rule-matches
|
:get-transaction-rule-matches gq-transaction-rules/get-transaction-rule-matches
|
||||||
|
|||||||
@@ -18,6 +18,12 @@
|
|||||||
[accounts accounts-count ] (d-accounts/get-graphql (<-graphql args))]
|
[accounts accounts-count ] (d-accounts/get-graphql (<-graphql args))]
|
||||||
(result->page accounts accounts-count :accounts args)))
|
(result->page accounts accounts-count :accounts args)))
|
||||||
|
|
||||||
|
(defn get-all-graphql [context args _]
|
||||||
|
(assert-admin (:id context))
|
||||||
|
(let [args (assoc args :id (:id context))
|
||||||
|
[accounts accounts-count ] (d-accounts/get-graphql (assoc (<-graphql args) :per-page Integer/MAX_VALUE))]
|
||||||
|
accounts))
|
||||||
|
|
||||||
(defn default-for-vendor [context args _]
|
(defn default-for-vendor [context args _]
|
||||||
(assert-can-see-client (:id context) (:client_id args))
|
(assert-can-see-client (:id context) (:client_id args))
|
||||||
(let [result (d-accounts/get-for-vendor (:vendor_id args) (:client_id args))]
|
(let [result (d-accounts/get-for-vendor (:vendor_id args) (:client_id args))]
|
||||||
|
|||||||
@@ -279,7 +279,7 @@
|
|||||||
(statsd/time! [(str "export.time") {:tags #{(client-tag query-params)
|
(statsd/time! [(str "export.time") {:tags #{(client-tag query-params)
|
||||||
"export:accounts"}}]
|
"export:accounts"}}]
|
||||||
(let [client-id (d-clients/code->id (query-params "client-code"))
|
(let [client-id (d-clients/code->id (query-params "client-code"))
|
||||||
query [[:accounts
|
query [[:all-accounts
|
||||||
[:id :numeric_code :type :applicability :location :name [:client_overrides [:name [:client [:id :code :name]]]]]]]
|
[:id :numeric_code :type :applicability :location :name [:client_overrides [:name [:client [:id :code :name]]]]]]]
|
||||||
all-accounts (graphql/query identity (venia/graphql-query {:venia/queries (->graphql query)}))]
|
all-accounts (graphql/query identity (venia/graphql-query {:venia/queries (->graphql query)}))]
|
||||||
|
|
||||||
@@ -302,7 +302,7 @@
|
|||||||
(dissoc :client-overrides))))))
|
(dissoc :client-overrides))))))
|
||||||
conj
|
conj
|
||||||
(list)
|
(list)
|
||||||
(:accounts (:data all-accounts)))))))
|
(:all-accounts (:data all-accounts)))))))
|
||||||
|
|
||||||
(GET "/transactions/export" {:keys [query-params identity]}
|
(GET "/transactions/export" {:keys [query-params identity]}
|
||||||
(assert-admin identity)
|
(assert-admin identity)
|
||||||
|
|||||||
Reference in New Issue
Block a user