now all payments can go through datomic, but pdfs need work.

This commit is contained in:
Bryce Covert
2018-08-23 22:39:12 -07:00
parent 2ea6ca576f
commit a9224dad22
6 changed files with 137 additions and 89 deletions

View File

@@ -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 )