Merge branch 'master' of bitbucket.org:brycecovertoperations/integreat

This commit is contained in:
BC
2018-06-16 18:57:40 -07:00
13 changed files with 126 additions and 62 deletions

View File

@@ -19,7 +19,9 @@
(-> x
(assoc-in [:data :bank-accounts] (:bank-accounts x))
(assoc-in [:data :address] (:address x))
(assoc-in [:data :locations] (:locations x))
(dissoc :bank-accounts)
(dissoc :locations)
(dissoc :address)))
(defn get-all []

View File

@@ -34,6 +34,7 @@
{:fields {:id {:type 'Int}
:name {:type 'String}
:email {:type 'String}
:locations {:type '(list String)}
:bank_accounts {:type '(list :bank_account)}}}
:bank_account
@@ -106,6 +107,7 @@
{:fields {:id {:type 'Int}
:invoice_id {:type 'Int}
:expense_account_id {:type 'Int}
:location {:type 'String}
:expense_account {:type :expense_account
:resolve :get-expense-account}
:amount {:type 'String}}}
@@ -212,6 +214,7 @@
:edit_expense_account
{:fields {:id {:type 'Int}
:expense_account_id {:type 'Int}
:location {:type 'String}
:amount {:type 'String}}}
:add_invoice

View File

@@ -34,9 +34,10 @@
(invoices-expense-accounts/get-for-invoice (:id value))))
(defn edit-expense-accounts [context args value]
(invoices-expense-accounts/replace-for-invoice (:invoice_id args) (map (fn [{:keys [id expense_account_id amount]}]
(invoices-expense-accounts/replace-for-invoice (:invoice_id args) (map (fn [{:keys [id expense_account_id amount location]}]
{
:expense-account-id expense_account_id
:location location
:amount (Double/parseDouble amount)} )
(:expense_accounts args)))
(->graphql