renamed company to client.

This commit is contained in:
Bryce Covert
2019-01-18 07:44:12 -08:00
parent 583752d740
commit 775150131e
38 changed files with 250 additions and 306 deletions

View File

@@ -35,7 +35,7 @@
:active-page handler
:user token)
:graphql {:token token
:query-obj {:venia/queries [[:company
:query-obj {:venia/queries [[:client
[:id :name :locations [:bank-accounts [:id :number :check-number :name :type] ]
[:address [:street1 :street2 :city :state :zip]]]]
@@ -59,7 +59,7 @@
::logged-in
(fn [{:keys [db]} [_ token user]]
{:graphql {:token token
:query-obj {:venia/queries [[:company
:query-obj {:venia/queries [[:client
[:id :name [:bank-accounts [:id :number :check-number :name :type]]]]
[:vendor
[:id :name :default-expense-account [:primary-contact [:name :phone :email :id]] [:secondary-contact [:id :name :phone :email]] :print-as :invoice-reminder-schedule :code]]]}
@@ -69,15 +69,15 @@
(re-frame/reg-event-db
::received-initial
(fn [db [_ {companies :company vendors :vendor :as x}]]
(fn [db [_ {clients :client vendors :vendor :as x}]]
(-> db
(assoc :companies (by :id companies) )
(assoc :clients (by :id clients) )
(assoc :vendors (by :id vendors) ))))
(re-frame/reg-event-db
::swap-company
(fn [db [_ company]]
(assoc db :company (:id company))))
::swap-client
(fn [db [_ client]]
(assoc db :client (:id client))))
(re-frame/reg-event-db
::change-form
@@ -123,8 +123,8 @@
{:db (assoc-in (:db cofx) [:status :loading] true)
:graphql {:token (-> cofx :db :user)
:query-obj {:venia/queries [[:invoice
{:imported false :company_id (:id @(re-frame/subscribe [::subs/company]))}
[:id :total :invoice-number :date [:vendor [:name :id]] [:company [:name :id]]]]]}
{:imported false :client_id (:id @(re-frame/subscribe [::subs/client]))}
[:id :total :invoice-number :date [:vendor [:name :id]] [:client [:name :id]]]]]}
:on-success [::received-invoices :pending]}}))
@@ -134,8 +134,8 @@
{:db (assoc-in (:db cofx) [:status :loading] true)
:graphql {:token (-> cofx :db :user)
:query-obj {:venia/queries [[:invoice
{:imported true :company_id (:id @(re-frame/subscribe [::subs/company]))}
[:id :total :invoice-number :date [:vendor [:name :id]] [:company [:name :id]]]]]}
{:imported true :client_id (:id @(re-frame/subscribe [::subs/client]))}
[:id :total :invoice-number :date [:vendor [:name :id]] [:client [:name :id]]]]]}
:on-success [::received-invoices :unpaid]}}))
(re-frame/reg-event-db
@@ -146,7 +146,7 @@
(re-frame/reg-event-fx
::logout
(fn [{:keys [db]} [_]]
{:db (assoc db :user nil :menu {:company {:active? false}
{:db (assoc db :user nil :menu {:client {:active? false}
:account {:active? false}})
:redirect (bidi/path-for routes/routes :login)
:set-local-storage ["jwt" nil]}))