Adding more filters, for fun.
This commit is contained in:
@@ -58,7 +58,7 @@
|
||||
(defn raw-graphql-ids [db args]
|
||||
(let [query (cond-> {:query {:find ['?e]
|
||||
:in ['$ ]
|
||||
:where ['[?e :transaction/id]]}
|
||||
:where []}
|
||||
:args [db]}
|
||||
|
||||
(:sort-by args) (add-sorter-field {"client" ['[?e :transaction/client ?c]
|
||||
@@ -73,16 +73,25 @@
|
||||
(merge-query {:query {:in ['[?xx ...]]
|
||||
:where ['[?e :transaction/client ?xx]]}
|
||||
:args [(set (map :db/id (limited-clients (:id args))))]})
|
||||
(:bank-account-id args)
|
||||
(merge-query {:query {:in ['?bank-account-id]
|
||||
:where ['[?e :transaction/bank-account ?bank-account-id]]}
|
||||
:args [(:bank-account-id args)]})
|
||||
|
||||
(:client-id args)
|
||||
(merge-query {:query {:in ['?client-id]
|
||||
:where ['[?e :transaction/client ?client-id]]}
|
||||
:args [(:client-id args)]})
|
||||
|
||||
|
||||
(:original-id args)
|
||||
(merge-query {:query {:in ['?original-id]
|
||||
:where ['[?e :transaction/client ?c]
|
||||
'[?c :client/original-id ?original-id]]}
|
||||
:args [(:original-id args)]}))]
|
||||
:args [(:original-id args)]})
|
||||
|
||||
true
|
||||
(merge-query {:query {:where ['[?e :transaction/id]]}}))]
|
||||
(cond->> query
|
||||
true (d/query)
|
||||
(:sort-by args) (apply-sort args second)
|
||||
|
||||
@@ -225,6 +225,7 @@
|
||||
|
||||
:transaction_page {:type '(list :transaction_page)
|
||||
:args {:client_id {:type :id}
|
||||
:bank_account_id {:type :id}
|
||||
:start {:type 'Int}
|
||||
:sort_by {:type 'String}
|
||||
:asc {:type 'Boolean}}
|
||||
|
||||
Reference in New Issue
Block a user