simplifies alpine for syncing props.

This commit is contained in:
Bryce
2024-03-21 21:09:18 -07:00
parent 2891503377
commit 87952b79d1
11 changed files with 6850 additions and 115 deletions

View File

@@ -31,6 +31,7 @@
[auto-ap.ssr.grid-page-helper :as helper :refer [wrap-apply-sort]]
[auto-ap.ssr.hiccup-helper :as hh]
[auto-ap.ssr.hx :as hx]
[auto-ap.ssr.invoice.new-invoice-wizard :as new-invoice-wizard]
[auto-ap.ssr.pos.common :refer [date-range-field*]]
[auto-ap.ssr.svg :as svg]
[auto-ap.ssr.utils
@@ -1467,57 +1468,59 @@
(def key->handler
(apply-middleware-to-all-handlers
{::route/all-page (-> (helper/page-route grid-page)
(wrap-implied-route-param :status nil))
::route/paid-page (-> (helper/page-route grid-page)
(wrap-implied-route-param :status :invoice-status/paid))
::route/unpaid-page (-> (helper/page-route grid-page)
(wrap-implied-route-param :status :invoice-status/unpaid))
::route/voided-page (-> (helper/page-route grid-page)
(wrap-implied-route-param :status :invoice-status/voided))
::route/pay-button (-> pay-button
(wrap-schema-enforce :query-schema query-schema))
::route/delete (-> delete
(wrap-entity [:route-params :db/id] default-read)
(wrap-schema-enforce :route-params [:map [:db/id entity-id]]))
::route/bulk-delete-confirm (-> bulk-delete-dialog-confirm
(wrap-schema-enforce :form-schema query-schema)
(wrap-admin))
::route/bulk-delete (-> bulk-delete-dialog
(wrap-admin))
::route/pay-wizard (-> mm/open-wizard-handler
(->
{::route/all-page (-> (helper/page-route grid-page)
(wrap-implied-route-param :status nil))
::route/paid-page (-> (helper/page-route grid-page)
(wrap-implied-route-param :status :invoice-status/paid))
::route/unpaid-page (-> (helper/page-route grid-page)
(wrap-implied-route-param :status :invoice-status/unpaid))
::route/voided-page (-> (helper/page-route grid-page)
(wrap-implied-route-param :status :invoice-status/voided))
::route/pay-button (-> pay-button
(wrap-schema-enforce :query-schema query-schema))
::route/delete (-> delete
(wrap-entity [:route-params :db/id] default-read)
(wrap-schema-enforce :route-params [:map [:db/id entity-id]]))
::route/bulk-delete-confirm (-> bulk-delete-dialog-confirm
(wrap-schema-enforce :form-schema query-schema)
(wrap-admin))
::route/bulk-delete (-> bulk-delete-dialog
(wrap-admin))
::route/pay-wizard (-> mm/open-wizard-handler
(mm/wrap-wizard pay-wizard)
(mm/wrap-init-multi-form-state initial-pay-wizard-state))
::route/new-wizard (-> mm/open-wizard-handler
(mm/wrap-wizard pay-wizard)
(mm/wrap-init-multi-form-state initial-pay-wizard-state))
::route/new-wizard (-> mm/open-wizard-handler
(mm/wrap-wizard new-wizard)
(mm/wrap-init-multi-form-state initial-new-wizard-state))
::route/new-wizard-navigate (-> mm/next-handler
(mm/wrap-wizard new-wizard)
(mm/wrap-decode-multi-form-state))
::route/new-wizard-new-account (->
(add-new-entity-handler [:step-params :invoice/expense-accounts]
(fn render [cursor request]
(transaction-rule-account-row*
cursor
(:client-id (:query-params request))
(some->> (:client-id (:query-params request)) (pull-attr (dc/db conn) :client/locations))))
(fn build-new-row [base _]
(assoc base :transaction-rule-account/location "Shared")))
(wrap-schema-enforce :query-schema [:map
[:client-id {:optional true}
[:maybe entity-id]]]))
::route/pay-submit (-> mm/submit-handler
(mm/wrap-wizard new-wizard)
(mm/wrap-init-multi-form-state initial-new-wizard-state))
::route/new-wizard-navigate (-> mm/next-handler
(mm/wrap-wizard new-wizard)
(mm/wrap-decode-multi-form-state))
::route/new-wizard-new-account (->
(add-new-entity-handler [:step-params :invoice/expense-accounts]
(fn render [cursor request]
(transaction-rule-account-row*
cursor
(:client-id (:query-params request))
(some->> (:client-id (:query-params request)) (pull-attr (dc/db conn) :client/locations))))
(fn build-new-row [base _]
(assoc base :transaction-rule-account/location "Shared")))
(wrap-schema-enforce :query-schema [:map
[:client-id {:optional true}
[:maybe entity-id]]]))
::route/pay-submit (-> mm/submit-handler
(mm/wrap-wizard pay-wizard)
(mm/wrap-decode-multi-form-state))
::route/pay-wizard-navigate
(-> mm/next-handler
(mm/wrap-wizard pay-wizard)
(mm/wrap-decode-multi-form-state))
(mm/wrap-wizard pay-wizard)
(mm/wrap-decode-multi-form-state))
::route/pay-wizard-navigate
(-> mm/next-handler
(mm/wrap-wizard pay-wizard)
(mm/wrap-decode-multi-form-state))
::route/table (helper/table-route grid-page)}
::route/table (helper/table-route grid-page)}
(merge new-invoice-wizard/key->handler))
(fn [h]
(-> h
(wrap-status-from-source)