renamed company to client.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
[com.walmartlabs.lacinia.resolve :as resolve]
|
||||
[buddy.auth :refer [throw-unauthorized]]
|
||||
[auto-ap.utils :refer [by]]
|
||||
[auto-ap.graphql.utils :refer [assert-admin can-see-company? assert-can-see-company]]
|
||||
[auto-ap.graphql.utils :refer [assert-admin can-see-client? assert-can-see-client]]
|
||||
[auto-ap.datomic.clients :as d-clients]
|
||||
[auto-ap.datomic.checks :as d-checks]
|
||||
[auto-ap.datomic.users :as d-users]
|
||||
@@ -32,13 +32,6 @@
|
||||
:serialize (schema/as-conformer #(.toString %))}}
|
||||
:objects
|
||||
{
|
||||
:company
|
||||
{:fields {:id {:type 'String}
|
||||
:name {:type 'String}
|
||||
:email {:type 'String}
|
||||
:address {:type :address}
|
||||
:locations {:type '(list String)}
|
||||
:bank_accounts {:type '(list :bank_account)}}}
|
||||
:client
|
||||
{:fields {:id {:type :id}
|
||||
:name {:type 'String}
|
||||
@@ -96,7 +89,6 @@
|
||||
:type {:type 'String}
|
||||
:amount {:type 'String}
|
||||
:vendor {:type :vendor}
|
||||
:company {:type :company}
|
||||
:date {:type 'String}
|
||||
:bank_account {:type :bank_account}
|
||||
:memo {:type 'String}
|
||||
@@ -168,7 +160,7 @@
|
||||
:status {:type 'String}
|
||||
:expense_accounts {:type '(list :invoices_expense_accounts)}
|
||||
:date {:type 'String}
|
||||
:company_id {:type 'Int}
|
||||
:client_id {:type 'Int}
|
||||
:payments {:type '(list :invoice_payment)}
|
||||
:vendor {:type :vendor}
|
||||
:client {:type :client}}}
|
||||
@@ -241,10 +233,8 @@
|
||||
|
||||
:resolve :get-payment-page}
|
||||
|
||||
:company {:type '(list :company)
|
||||
:resolve :get-company}
|
||||
:client {:type '(list :company)
|
||||
:resolve :get-company}
|
||||
:client {:type '(list :client)
|
||||
:resolve :get-client}
|
||||
:vendor {:type '(list :vendor)
|
||||
:resolve :get-vendor}
|
||||
:user {:type '(list :user)
|
||||
@@ -402,9 +392,9 @@
|
||||
:limit Integer/MAX_VALUE))))
|
||||
|
||||
|
||||
(defn get-company [context args value]
|
||||
(defn get-client [context args value]
|
||||
(->graphql
|
||||
(filter #(can-see-company? (:id context) %)
|
||||
(filter #(can-see-client? (:id context) %)
|
||||
(d-clients/get-all))))
|
||||
|
||||
(defn get-user [context args value]
|
||||
@@ -420,7 +410,7 @@
|
||||
|
||||
(defn print-checks [context args value]
|
||||
|
||||
(assert-can-see-company (:id context) (:client_id args))
|
||||
(assert-can-see-client (:id context) (:client_id args))
|
||||
(->graphql
|
||||
(gq-checks/print-checks (map (fn [i] {:invoice-id (:invoice_id i)
|
||||
:amount (:amount i)})
|
||||
@@ -439,7 +429,7 @@
|
||||
:get-payment-page gq-checks/get-payment-page
|
||||
:get-transaction-page gq-transactions/get-transaction-page
|
||||
|
||||
:get-company get-company
|
||||
:get-client get-client
|
||||
:get-user get-user
|
||||
:mutation/add-handwritten-check gq-checks/add-handwritten-check
|
||||
:mutation/print-checks print-checks
|
||||
|
||||
Reference in New Issue
Block a user