now all payments can go through datomic, but pdfs need work.
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
(map first)
|
||||
(map #(update % :payment/date c/from-date))
|
||||
(map #(update % :payment/status :db/ident))
|
||||
(map #(update % :payment/type :db/ident))
|
||||
(map #(rename-keys % {:invoice-payment/_payment :payment/invoices}))))
|
||||
|
||||
(defn add-arg [query name value where & rest]
|
||||
@@ -22,12 +23,13 @@
|
||||
{:invoice-payment/_payment [* {:invoice-payment/invoice [*]}]}
|
||||
{:payment/client [:client/name :db/id]}
|
||||
{:payment/vendor [:vendor/name :db/id]}
|
||||
{:payment/status [:db/ident]}]))
|
||||
{:payment/status [:db/ident]}
|
||||
{:payment/type [:db/ident]}]))
|
||||
|
||||
(defn raw-graphql [args]
|
||||
(let [query (cond-> {:query {:find [default-read]
|
||||
:in ['$]
|
||||
:where ['[?e :payment/original-id]]}
|
||||
:where ['[?e :payment/client]]}
|
||||
:args [(d/db (d/connect uri))]}
|
||||
|
||||
(:client-id args) (add-arg '?client-id (cond-> (:client-id args) (string? (:client-id args)) Long/parseLong )
|
||||
|
||||
Reference in New Issue
Block a user