Add vendor pre-population for bulk code and individual edit forms

- Add vendor-changed HTMX handlers for both bulk code and individual edit
- Pre-populate default account at 100% when vendor is selected and no accounts exist
- Fix render-accounts-section to render from step-params correctly
- Change bulk code vendor-changed from hx-get to hx-post to include form data
- Add routes for vendor-changed endpoints
- Update e2e tests to cover vendor pre-population
- Run lein cljfmt fix across codebase
This commit is contained in:
2026-05-21 14:45:19 -07:00
parent 8bd0cee1b1
commit ba87805d4c
210 changed files with 8694 additions and 9627 deletions

View File

@@ -19,9 +19,9 @@
(defn get-admin-client [context {:keys [id]} _]
(assert-admin (:id context))
(->graphql
(-> (d-clients/get-by-id id)
(update :client/bank-accounts (fn [bas]
(map #(set/rename-keys % {:bank-account/use-date-instead-of-post-date? :use-date-instead-of-post-date}) bas))))))
(-> (d-clients/get-by-id id)
(update :client/bank-accounts (fn [bas]
(map #(set/rename-keys % {:bank-account/use-date-instead-of-post-date? :use-date-instead-of-post-date}) bas))))))
(defn get-client-page [context args _]
(assert-admin (:id context))
@@ -29,7 +29,7 @@
[clients clients-count] (d-clients/get-graphql-page (assoc (<-graphql (:filters args))
:clients (:clients context)))
clients (->> clients
(map (fn [c]
(update c :client/bank-accounts (fn [bas]
(map #(set/rename-keys % {:bank-account/use-date-instead-of-post-date? :use-date-instead-of-post-date}) bas)))))
@@ -47,13 +47,6 @@
bank-accounts))))))]
(result->page clients clients-count :clients (:filters args))))
(def objects
{:location_match
{:fields {:location {:type 'String}
@@ -102,15 +95,13 @@
:yodlee_provider_accounts {:type '(list :yodlee_provider_account)}
:plaid_items {:type '(list :plaid_item)}}}
:client_page
:client_page
{:fields {:clients {:type '(list :client)}
:count {:type 'Int}
:total {:type 'Int}
:start {:type 'Int}
:end {:type 'Int}}}
:bank_account
{:fields {:id {:type :id}
:integration_status {:type :integration_status}
@@ -139,9 +130,7 @@
:forecasted_transaction {:fields {:identifier {:type 'String}
:id {:type :id}
:day_of_month {:type 'Int}
:amount {:type :money}}}
})
:amount {:type :money}}}})
(def queries
{:client {:type '(list :client)
@@ -158,12 +147,12 @@
{})
(def input-objects
{ :client_filters
{:client_filters
{:fields {:code {:type 'String}
:name_like {:type 'String}
:start {:type 'Int}
:per_page {:type 'Int}
:sort {:type '(list :sort_item)}}} })
:sort {:type '(list :sort_item)}}}})
(def enums
{:bank_account_type {:values [{:enum-value :check}
@@ -173,11 +162,10 @@
(def resolvers
{:get-client get-client
:get-admin-client get-admin-client
:get-client-page get-client-page })
:get-client-page get-client-page})
(defn attach [schema]
(->
(->
(merge-with merge schema
{:objects objects
:queries queries