making it possible to see a list of checks

This commit is contained in:
Bryce Covert
2018-06-07 15:17:07 -07:00
parent fbccc0b209
commit 970a27da56
7 changed files with 256 additions and 3 deletions

View File

@@ -13,6 +13,7 @@
[auto-ap.db.checks :as checks]
[auto-ap.routes.checks :as rchecks]
[auto-ap.graphql.users :as gq-users]
[auto-ap.graphql.checks :as gq-checks]
[auto-ap.graphql.expense-accounts :as expense-accounts]
[auto-ap.graphql.invoices :as gq-invoices]
[auto-ap.db.reminders :as reminders]
@@ -54,11 +55,17 @@
:scheduled {:type 'String}
:sent {:type 'String}
:vendor {:type :vendor
:resolve :get-vendor-for-invoice}}
:resolve :get-vendor-for-invoice}
}
}
:check {:fields {:id {:type 'Int}
:amount {:type 'String}
:vendor {:type :vendor
:resolve :get-vendor-for-check}
:company {:type :company
:resolve :get-company-for-check}
:date {:type 'String}
:s3_url {:type 'String}
:check_number {:type 'Int}}}
@@ -113,6 +120,12 @@
:start {:type 'Int}
:end {:type 'Int}}}
:check_page {:fields {:checks {:type '(list :check)}
:count {:type 'Int}
:total {:type 'Int}
:start {:type 'Int}
:end {:type 'Int}}}
:reminder_page {:fields {:reminders {:type '(list :reminder)}
:count {:type 'Int}
:total {:type 'Int}
@@ -136,6 +149,14 @@
:asc {:type 'Boolean}}
:resolve :get-invoice-page}
:check_page {:type '(list :check_page)
:args {:company_id {:type 'Int}
:start {:type 'Int}
:sort_by {:type 'String}
:asc {:type 'Boolean}}
:resolve :get-check-page}
:reminder_page {:type '(list :reminder_page)
:args {:start {:type 'Int}
:sort_by {:type 'String}
@@ -329,8 +350,11 @@
(def schema
(-> integreat-schema
(attach-resolvers {:get-invoice-page get-invoice-page
:get-check-page gq-checks/get-check-page
:get-reminder-page get-reminder-page
:get-vendor-for-invoice get-vendor-for-invoice
:get-vendor-for-check gq-checks/get-vendor-for-check
:get-company-for-check gq-checks/get-company-for-check
:get-company-for-invoice get-company-for-invoice
:get-invoices-checks get-invoices-checks
:get-check-by-id get-check-by-id