Less error prone

This commit is contained in:
2022-01-19 08:05:43 -08:00
parent cd5b1cbb8a
commit 6e0720c3b3
8 changed files with 284 additions and 308 deletions

View File

@@ -127,7 +127,7 @@
:detailed_status {:type 'String}
:last_updated {:type :iso_date}
:accounts {:type '(list :yodlee_account)}}}
:yodlee_account
{:fields {:id {:type 'Int}
:status {:type 'String}
@@ -198,7 +198,6 @@
{:fields {:id {:type :id}
:client {:type :client}
:terms {:type 'Int}}}
:schedule_payment_dom
{:fields {:id {:type :id}
@@ -240,7 +239,7 @@
:legal_entity_tin_type {:type :tin_type}
:legal_entity_1099_type {:type :type_1099}}}
:reminder
{:fields {:id {:type 'Int}
:email {:type 'String}
@@ -249,7 +248,6 @@
:scheduled {:type 'String}
:sent {:type 'String}
:vendor {:type :vendor}}}
:journal_entry_line
{:fields {:id {:type :id}
@@ -302,8 +300,6 @@
:charges {:type '(list :charge)}
:line_items {:type '(list :order_line_item)}}}
:check {:fields {:id {:type :id}
:type {:type 'String}
:amount {:type 'String}
@@ -315,7 +311,6 @@
:check_number {:type 'Int}
:status {:type 'String}
:invoices {:type '(list :invoice_payment)}}}
:payment {:fields {:id {:type :id}
:type {:type :payment_type}
@@ -331,7 +326,6 @@
:status {:type :ident}
:transaction {:type :transaction}
:invoices {:type '(list :invoice_payment)}}}
:yodlee_merchant {:fields {:id {:type :id}
:yodlee_id {:type 'String}
@@ -343,7 +337,6 @@
:forecast_match {:fields {:id {:type :id}
:identifier {:type 'String}}}
:transaction_rule {:fields {:id {:type :id}
:note {:type 'String}
@@ -387,60 +380,24 @@
:name {:type 'String}
:client_overrides {:type '(list :account_client_override)}}}
:invoices_expense_accounts
{:fields {:id {:type :id}
:invoice_id {:type 'String}
:account {:type :account}
:location {:type 'String}
:amount {:type 'String}}}
:percentage_account
{:fields {:id {:type :id}
:account {:type :account}
:location {:type 'String}
:percentage {:type :percentage}}}
:invoice
{:fields {:id {:type :id}
:original_id {:type 'Int}
:client_identifier {:type 'String}
:total {:type 'String}
:source_url {:type 'String}
:outstanding_balance {:type 'String}
:invoice_number {:type 'String}
:status {:type 'String}
:expense_accounts {:type '(list :invoices_expense_accounts)}
:date {:type :iso_date}
:due {:type :iso_date}
:client_id {:type 'Int}
:payments {:type '(list :invoice_payment)}
:vendor {:type :vendor}
:client {:type :client}
:scheduled_payment {:type :iso_date}}}
:yodlee_provider_account_page {:fields {:yodlee_provider_accounts {:type '(list :yodlee_provider_account)}
:count {:type 'Int}
:total {:type 'Int}
:start {:type 'Int}
:end {:type 'Int}}}
:invoice_page {:fields {:invoices {:type '(list :invoice)}
:outstanding {:type :money}
:count {:type 'Int}
:total {:type 'Int}
:start {:type 'Int}
:end {:type 'Int}}}
:payment_page {:fields {:payments {:type '(list :payment)}
:count {:type 'Int}
:total {:type 'Int}
:start {:type 'Int}
:end {:type 'Int}}}
:transaction_rule_page {:fields {:transaction_rules {:type '(list :transaction_rule)}
:count {:type 'Int}
:total {:type 'Int}
@@ -452,7 +409,7 @@
:total {:type 'Int}
:start {:type 'Int}
:end {:type 'Int}}}
:sales_order_page {:fields {:sales_orders {:type '(list :sales_order)}
:count {:type 'Int}
:total {:type 'Int}
@@ -460,10 +417,6 @@
:end {:type 'Int}
:sales_order_total {:type :money}
:sales_order_tax {:type :money}}}
:reminder_page {:fields {:reminders {:type '(list :reminder)}
:count {:type 'Int}
@@ -488,7 +441,6 @@
:existing {:type '(list :import_ledger_entry_result)}
:ignored {:type '(list :import_ledger_entry_result)}
:errors {:type '(list :import_ledger_entry_result)}}}
:upcoming_transaction {:fields {:amount {:type :money}
:identifier {:type 'String}
@@ -499,9 +451,6 @@
:outstanding_payments {:type :money}
:upcoming_credits {:type '(list :upcoming_transaction)}
:upcoming_debits {:type '(list :upcoming_transaction)}}}}
:queries
{:expense_account_stats {:type '(list :expense_account_stat)
@@ -542,38 +491,10 @@
:periods {:type '(list :date_range)}}
:resolve :get-profit-and-loss}
:yodlee_provider_account_page {:type :yodlee_provider_account_page
:args {:client_id {:type :id}}
:resolve :get-yodlee-provider-account-page}
:invoice_page {:type '(list :invoice_page)
:args {:import_status {:type 'String}
:exact_match_id {:type :id}
:date_range {:type :date_range}
:due_range {:type :date_range}
:status {:type :invoice_status}
:unresolved {:type 'Boolean}
:scheduled_payments {:type 'Boolean}
:client_id {:type :id}
:vendor_id {:type :id}
:amount_lte {:type :money}
:amount_gte {:type :money}
:invoice_number_like {:type 'String}
:location {:type 'String}
:start {:type 'Int}
:per_page {:type 'Int}
:sort {:type '(list :sort_item)}}
:resolve :get-invoice-page}
:all_invoices {:type '(list :invoice)
:args {:client_id {:type :id}
:client_code {:type 'String}
:original_id {:type 'Int}
:statuses {:type '(list String)}}
:resolve :get-all-invoices}
:accounts {:type '(list :account)
:args {:account_set {:type 'String}}
:resolve :get-accounts}
@@ -585,8 +506,6 @@
:statuses {:type '(list String)}}
:resolve :get-all-payments}
:all_sales_orders {:type '(list :sales_order)
:args {:client_id {:type :id}
:date_range {:type :date_range}
@@ -596,15 +515,11 @@
:yodlee_merchants {:type '(list :yodlee_merchant)
:args {}
:resolve :get-yodlee-merchants}
:intuit_bank_accounts {:type '(list :intuit_bank_account)
:args {}
:resolve :get-intuit-bank-accounts}
:transaction_rule_page {:type :transaction_rule_page
:args {:client_id {:type :id}
:vendor_id {:type :id}
@@ -629,11 +544,8 @@
:start {:type 'Int}
:per_page {:type 'Int}
:sort {:type '(list :sort_item)}}
:resolve :get-sales-order-page}
:payment_page {:type '(list :payment_page)
:args {:client_id {:type :id}
:vendor_id {:type :id}
@@ -647,9 +559,8 @@
:start {:type 'Int}
:per_page {:type 'Int}
:sort {:type '(list :sort_item)}}
:resolve :get-payment-page}
:client {:type '(list :client)
:resolve :get-client}
:vendor {:type '(list :vendor)
@@ -657,8 +568,6 @@
:user {:type '(list :user)
:resolve :get-user}}
:input-objects
{
:sort_item
@@ -666,9 +575,6 @@
:sort_name {:type 'String}
:asc {:type 'Boolean}}}
:ledger_filters {:fields {:client_id {:type :id}
:vendor_id {:type :id}
:account_id {:type :id}
@@ -728,7 +634,7 @@
:location_matches {:type '(list :edit_location_match)}
:bank_accounts {:type '(list :edit_bank_account)}
:forecasted_transactions {:type '(list :edit_forecasted_transaction)}}}
:edit_bank_account
{:fields {:id {:type :id}
:code {:type 'String}
@@ -771,7 +677,6 @@
{:fields {:id {:type :id}
:client_id {:type :id}
:terms {:type 'Int}}}
:add_account_override
{:fields {:id {:type :id}
@@ -790,54 +695,21 @@
:terms_overrides {:type '(list :add_terms_override)}
:code {:type 'String}
:automatically_paid_when_due {:type '(list :id)}
:hidden {:type 'Boolean}
:print_as {:type 'String}
:primary_contact {:type :add_contact}
:secondary_contact {:type :add_contact}
:address {:type :add_address}
:default_account_id {:type :id}
:account_overrides {:type '(list :add_account_override)}
:schedule_payment_dom {:type '(list :add_schedule_payment_dom)}
:invoice_reminder_schedule {:type 'String}
:legal_entity_first_name {:type 'String}
:legal_entity_middle_name {:type 'String}
:legal_entity_last_name {:type 'String}
:legal_entity_tin {:type 'String}
:legal_entity_tin_type {:type :tin_type}
:legal_entity_1099_type {:type :type_1099}}}
:edit_expense_account
{:fields {:id {:type :id}
:account_id {:type :id}
:location {:type 'String}
:amount {:type :money}}}
:add_invoice
{:fields {:id {:type :id}
:invoice_number {:type 'String}
:expense_accounts {:type '(list :edit_expense_account)}
:location {:type 'String}
:scheduled_payment {:type :iso_date}
:date {:type :iso_date}
:due {:type :iso_date}
:client_id {:type :id}
:vendor_id {:type :id}
:vendor_name {:type 'String}
:total {:type :money}}}
:edit_invoice
{:fields {:id {:type :id}
:invoice_number {:type 'String}
:expense_accounts {:type '(list :edit_expense_account)}
:date {:type :iso_date}
:scheduled_payment {:type :iso_date}
:due {:type :iso_date}
:total {:type :money}}}
:edit_percentage_account
{:fields {:id {:type :id}
@@ -888,9 +760,6 @@
:type_1099 {:values [{:enum-value :none}
{:enum-value :misc}
{:enum-value :landlord}]}
:invoice_status {:values [{:enum-value :paid}
{:enum-value :unpaid}
{:enum-value :voided}]}
:bank_account_type {:values [{:enum-value :check}
{:enum-value :credit}
{:enum-value :cash}]}
@@ -902,28 +771,17 @@
{:enum-value :asset}
{:enum-value :liability}
{:enum-value :equity}
{:enum-value :revenue}]}
}
{:enum-value :revenue}]}}
:mutations
{:request_import {:type 'String
:args {:which {:type 'String}}
:resolve :mutation/request-import}
:reject_invoices {:type '(list :id)
:args {:invoices {:type '(list :id)}}
:resolve :mutation/reject-invoices}
:approve_invoices {:type '(list :id)
:args {:invoices {:type '(list :id)}}
:resolve :mutation/approve-invoices}
:delete_external_ledger {:type :message
:args {:filters {:type :ledger_filters}
:ids {:type '(list :id)}}
:resolve :mutation/delete-external-ledger}
:delete_transaction_rule {:type :id
:args {:transaction_rule_id {:type :id}}
:resolve :mutation/delete-transaction-rule}
@@ -932,12 +790,6 @@
:to {:type :id}}
:resolve :mutation/merge-vendors}
:add_and_print_invoice {:type :check_result
:args {:invoice {:type :add_invoice}
:bank_account_id {:type :id}
:type {:type :payment_type}}
:resolve :mutation/add-and-print-invoice}
:print_checks {:type :check_result
:args {:invoice_payments {:type '(list :invoice_payment_amount)}
:bank_account_id {:type :id}
@@ -966,38 +818,18 @@
:upsert_transaction_rule {:type :transaction_rule
:args {:transaction_rule {:type :edit_transaction_rule}}
:resolve :mutation/upsert-transaction-rule}
:add_invoice {:type :invoice
:args {:invoice {:type :add_invoice}}
:resolve :mutation/add-invoice}
:import_ledger {:type :import_ledger_result
:args {:entries {:type '(list :import_ledger_entry)}}
:resolve :mutation/import-ledger}
:edit_invoice {:type :invoice
:args {:invoice {:type :edit_invoice}}
:resolve :mutation/edit-invoice}
:upsert_account {:type :account
:args {:account {:type :edit_account}}
:resolve :mutation/upsert-account}
:void_invoice {:type :invoice
:args {:invoice_id {:type :id}}
:resolve :mutation/void-invoice}
:unvoid_invoice {:type :invoice
:args {:invoice_id {:type :id}}
:resolve :mutation/unvoid-invoice}
:unautopay_invoice {:type :invoice
:args {:invoice_id {:type :id}}
:resolve :mutation/unautopay-invoice}
:void_payment {:type :payment
:args {:payment_id {:type :id}}
:resolve :mutation/void-payment}
:edit_expense_accounts {:type :invoice
:args {:invoice_id {:type :id}
:expense_accounts {:type '(list :edit_expense_account)}}
:resolve :mutation/edit-expense-accounts}}})
:resolve :mutation/void-payment}}})
(defn snake->kebab [s]
@@ -1226,8 +1058,7 @@
(def schema
(-> integreat-schema
(attach-resolvers {:get-invoice-page gq-invoices/get-invoice-page
:get-all-invoices gq-invoices/get-all-invoices
(attach-resolvers {:mutation/void-payment gq-checks/void-check
:get-yodlee-provider-account-page gq-yodlee2/get-yodlee-provider-account-page
:get-all-payments get-all-payments
:get-all-sales-orders get-all-sales-orders
@@ -1250,12 +1081,7 @@
:mutation/add-handwritten-check gq-checks/add-handwritten-check
:mutation/delete-transaction-rule gq-transaction-rules/delete-transaction-rule
:mutation/print-checks print-checks
:mutation/reject-invoices gq-invoices/reject-invoices
:mutation/approve-invoices gq-invoices/approve-invoices
:mutation/edit-user gq-users/edit-user
:mutation/add-invoice gq-invoices/add-invoice
:mutation/add-and-print-invoice gq-invoices/add-and-print-invoice
:mutation/edit-invoice gq-invoices/edit-invoice
:mutation/delete-external-ledger gq-ledger/delete-external-ledger
:mutation/upsert-transaction-rule gq-transaction-rules/upsert-transaction-rule
:test-transaction-rule gq-transaction-rules/test-transaction-rule
@@ -1264,11 +1090,6 @@
:mutation/upsert-vendor gq-vendors/upsert-vendor
:mutation/upsert-account gq-accounts/upsert-account
:mutation/merge-vendors gq-vendors/merge-vendors
:mutation/void-invoice gq-invoices/void-invoice
:mutation/unvoid-invoice gq-invoices/unvoid-invoice
:mutation/unautopay-invoice gq-invoices/unautopay-invoice
:mutation/void-payment gq-checks/void-check
:mutation/edit-expense-accounts gq-invoices/edit-expense-accounts
:mutation/import-ledger gq-ledger/import-ledger
:mutation/request-import gq-requests/request-import
:get-vendor gq-vendors/get-graphql})
@@ -1276,6 +1097,7 @@
gq-import-batches/attach
gq-transactions/attach
gq-expected-deposit/attach
gq-invoices/attach
schema/compile))