Adds the ability to set up read only users, adds linking filtering

This commit is contained in:
2024-01-03 21:42:30 -08:00
parent 48f70ef93d
commit 810c3aacb2
10 changed files with 192 additions and 63 deletions

View File

@@ -40,6 +40,7 @@
(defn raw-graphql-ids
([args] (raw-graphql-ids (dc/db conn) args))
([db args]
(auto-ap.logging/peek args)
(let [valid-clients (extract-client-ids (:clients args)
(:client-id args)
(when (:client-code args)
@@ -104,6 +105,20 @@
:where ['[?e :transaction/approval-status ?approval-status]]}
:args [(:approval-status args)]})
(= (:linked-to args) :payment)
(merge-query {:query {:where ['[?e :transaction/payment]]}})
(= (:linked-to args) :expected-deposit)
(merge-query {:query {:where ['[?e :transaction/expected-deposit]]}})
(= (:linked-to args) :invoice)
(merge-query {:query {:where ['[?e :transaction/payment ?p]
'[_ :invoice-payment/payment ?p]]}})
(= (:linked-to args) :none)
(merge-query {:query {:where ['(not [?e :transaction/payment])
'(not [?e :transaction/expected-deposit])]}})
(:original-id args)
(merge-query {:query {:in ['?original-id]
:where ['[?e :transaction/client ?c]