you can void checks now.
This commit is contained in:
@@ -293,6 +293,9 @@
|
||||
:void_invoice {:type :invoice
|
||||
:args {:invoice_id {:type 'Int}}
|
||||
:resolve :mutation/void-invoice}
|
||||
:void_check {:type :check
|
||||
:args {:check_id {:type 'Int}}
|
||||
:resolve :mutation/void-check}
|
||||
:edit_expense_accounts {:type :invoice
|
||||
:args {:invoice_id {:type 'Int}
|
||||
:expense_accounts {:type '(list :edit_expense_account)}}
|
||||
@@ -508,6 +511,7 @@
|
||||
:mutation/add-invoice gq-invoices/add-invoice
|
||||
:mutation/edit-invoice gq-invoices/edit-invoice
|
||||
:mutation/void-invoice gq-invoices/void-invoice
|
||||
:mutation/void-check gq-checks/void-check
|
||||
:mutation/edit-expense-accounts gq-invoices/edit-expense-accounts
|
||||
:get-vendor get-vendor
|
||||
:get-expense-account expense-accounts/get-expense-account
|
||||
|
||||
@@ -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))))
|
||||
|
||||
Reference in New Issue
Block a user