From c09d85ede6729af93dc32d620257a9d0a04d5039 Mon Sep 17 00:00:00 2001 From: Bryce Date: Thu, 18 Jun 2026 10:38:00 -0700 Subject: [PATCH] fix(ssr): fix Client Review (requires-feedback) status in bulk-code dialog The bulk-code "Requires Feedback" option submitted "requires_feedback" (underscore), which decoded to an enum keyword not present in the schema (idents use a hyphen), so selecting it failed validation. Use the hyphenated value and relabel the option, the reconciliation report header to "Client Review" to unify with the sidebar terminology. Co-Authored-By: Claude Opus 4.8 --- .../ssr/company/reports/reconciliation.clj | 24 ++++----- src/clj/auto_ap/ssr/transaction/bulk_code.clj | 54 +++++++++---------- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/clj/auto_ap/ssr/company/reports/reconciliation.clj b/src/clj/auto_ap/ssr/company/reports/reconciliation.clj index fce29a9a..d4469b14 100644 --- a/src/clj/auto_ap/ssr/company/reports/reconciliation.clj +++ b/src/clj/auto_ap/ssr/company/reports/reconciliation.clj @@ -28,7 +28,7 @@ (com/data-grid-header {} "Synced count") (com/data-grid-header {} "Approved transactions") (com/data-grid-header {} "Unapproved transactions") - (com/data-grid-header {} "Requires feedback transactions") + (com/data-grid-header {} "Client Review transactions") (com/data-grid-header {} "Missing transactions")]) #_#_:thead-params {:class "sticky top-0 z-50"}} (for [row report] @@ -84,18 +84,18 @@ (com/validated-field {:label "Start" :errors (fc/field-errors)} [:div {:class "w-64"} - (com/date-input {:name (fc/field-name) + (com/date-input {:name (fc/field-name) :class "w-64" - :value (some-> (fc/field-value) - (atime/unparse-local atime/normal-date))})])) + :value (some-> (fc/field-value) + (atime/unparse-local atime/normal-date))})])) (fc/with-field :end-date (com/validated-field {:label "End" :errors (fc/field-errors)} [:div {:class "w-64"} - (com/date-input {:name (fc/field-name) + (com/date-input {:name (fc/field-name) :class "w-64" - :value (some-> (fc/field-value) - (atime/unparse-local atime/normal-date))})])) + :value (some-> (fc/field-value) + (atime/unparse-local atime/normal-date))})])) (com/button {:color :primary :class "self-center w-24"} "Run")])] (if report (report* {:request request :report report}) @@ -104,15 +104,15 @@ (defn page [request] (base-page request - (com/page {:nav com/company-aside-nav + (com/page {:nav com/company-aside-nav :client-selection (:client-selection request) :client (:client request) :clients (:clients request) - :identity (:identity request) - :app-params {:hx-get (bidi/path-for ssr-routes/only-routes :company-reconciliation-report) + :identity (:identity request) + :app-params {:hx-get (bidi/path-for ssr-routes/only-routes :company-reconciliation-report) :hx-trigger "clientSelected from:body" :hx-select "#app-contents" - :hx-swap "outerHTML swap:300ms"}} + :hx-swap "outerHTML swap:300ms"}} (com/breadcrumbs {} [:a {:href (bidi/path-for ssr-routes/only-routes :company)} "My Company"] @@ -133,7 +133,7 @@ (defn get-report-data [start-date end-date client-ids] (let [client-codes (map first (dc/q '[:find ?cc :in $ [?c ...] :where [?c :client/code ?cc]] (dc/db conn) client-ids))] - (for [[ib ba c] (seq (apply get-intuit-bank-accounts (dc/db conn) client-codes)) + (for [[ib ba c] (seq (apply get-intuit-bank-accounts (dc/db conn) client-codes)) :let [raw-transactions (get-transactions (atime/unparse-local start-date atime/iso-date) (atime/unparse-local end-date atime/iso-date) ib) diff --git a/src/clj/auto_ap/ssr/transaction/bulk_code.clj b/src/clj/auto_ap/ssr/transaction/bulk_code.clj index 6191a5c3..2d9bda5f 100644 --- a/src/clj/auto_ap/ssr/transaction/bulk_code.clj +++ b/src/clj/auto_ap/ssr/transaction/bulk_code.clj @@ -185,28 +185,28 @@ :hx-target "#account-entries" :hx-swap "innerHTML" :hx-include "closest form"} - (fc/with-field :vendor - (com/validated-field {:label "Vendor" - :errors (fc/field-errors)} - (com/typeahead {:name (fc/field-name) - :placeholder "Search for vendor..." - :url (bidi/path-for ssr-routes/only-routes :vendor-search) - :value (fc/field-value) - :content-fn (fn [c] (pull-attr (dc/db conn) :vendor/name c))})))] + (fc/with-field :vendor + (com/validated-field {:label "Vendor" + :errors (fc/field-errors)} + (com/typeahead {:name (fc/field-name) + :placeholder "Search for vendor..." + :url (bidi/path-for ssr-routes/only-routes :vendor-search) + :value (fc/field-value) + :content-fn (fn [c] (pull-attr (dc/db conn) :vendor/name c))})))] ;; Status field - [:div - (fc/with-field :approval-status - (com/validated-field {:label "Status" - :errors (fc/field-errors)} - (com/select {:name (fc/field-name) - :value (some-> (fc/field-value) - name) - :options [["" "No Change"] - ["approved" "Approved"] - ["unapproved" "Unapproved"] - ["suppressed" "Suppressed"] - ["requires_feedback" "Requires Feedback"]]})))] + [:div + (fc/with-field :approval-status + (com/validated-field {:label "Status" + :errors (fc/field-errors)} + (com/select {:name (fc/field-name) + :value (some-> (fc/field-value) + name) + :options [["" "No Change"] + ["approved" "Approved"] + ["unapproved" "Unapproved"] + ["suppressed" "Suppressed"] + ["requires-feedback" "Client Review"]]})))] ;; Accounts section [:div.col-span-2.pt-4 @@ -219,10 +219,10 @@ (com/data-grid {:headers [(com/data-grid-header {} "Account") (com/data-grid-header {:class "w-32"} "Location") (com/data-grid-header {:class "w-16"} "%") - (com/data-grid-header {:class "w-16"})]} - (fc/cursor-map #(transaction-account-row* {:value %})) + (com/data-grid-header {:class "w-16"})]} + (fc/cursor-map #(transaction-account-row* {:value %})) - (com/data-grid-new-row {:colspan 4 + (com/data-grid-new-row {:colspan 4 :hx-get (bidi/path-for ssr-routes/only-routes ::route/bulk-code-new-account) :row-offset 0 @@ -357,10 +357,10 @@ {:errors (fc/field-errors)} (com/data-grid {:headers [(com/data-grid-header {} "Account") (com/data-grid-header {:class "w-32"} "Location") - (com/data-grid-header {:class "w-16"} "%") - (com/data-grid-header {:class "w-16"})]} - (fc/cursor-map #(transaction-account-row* {:value %})) - (com/data-grid-new-row {:colspan 4 + (com/data-grid-header {:class "w-16"} "%") + (com/data-grid-header {:class "w-16"})]} + (fc/cursor-map #(transaction-account-row* {:value %})) + (com/data-grid-new-row {:colspan 4 :hx-get (bidi/path-for ssr-routes/only-routes ::route/bulk-code-new-account) :row-offset 0