you can void checks now.

This commit is contained in:
Bryce Covert
2018-07-25 19:35:26 -07:00
parent 581e5e8798
commit 8bb35d70c0
3 changed files with 39 additions and 2 deletions

View File

@@ -64,5 +64,12 @@
:invoices [(invoices/get-by-id (:invoice_id args))]})))
(defn void-check [context {id :check_id} value]
(let [check (checks/get-by-id id)]
(assert-can-see-company (:id context) (:company-id check))
(assert (= "pending" (:status check)))
(checks/update! {:id id
:amount 0
:status "voided"})
(-> (checks/get-by-id id)
(->graphql))))