adds total.

This commit is contained in:
2022-02-07 19:06:52 -08:00
parent 4ad0e13c27
commit 24cc03ccd2
3 changed files with 30 additions and 14 deletions

View File

@@ -30,13 +30,14 @@
(defn get-invoice-page [context args _]
(let [args (assoc args :id (:id context))
[invoices invoice-count outstanding] (-> args
(assoc :id (:id context))
(<-graphql)
(update :status enum->keyword "invoice-status")
(d-invoices/get-graphql))]
[invoices invoice-count outstanding total-amount] (-> args
(assoc :id (:id context))
(<-graphql)
(update :status enum->keyword "invoice-status")
(d-invoices/get-graphql))]
[{:invoices (mapv #(->graphql % (:id context)) invoices)
:outstanding outstanding
:total_amount total-amount
:total invoice-count
:count (count invoices)
:start (:start args 0)
@@ -307,6 +308,7 @@
:invoice_page {:fields {:invoices {:type '(list :invoice)}
:outstanding {:type :money}
:total_amount {:type :money}
:count {:type 'Int}
:total {:type 'Int}
:start {:type 'Int}