Files
integreat/src/cljc/auto_ap/ssr_routes.cljc

93 lines
6.2 KiB
Clojure

(ns auto-ap.ssr-routes
(:require
[auto-ap.routes.admin.excel-invoices :as ei-routes]
[auto-ap.routes.admin.import-batch :as ib-routes]
[auto-ap.routes.admin.vendors :as v-routes]
[auto-ap.routes.admin.transaction-rules :as tr-routes]))
(def routes {"impersonate" :impersonate
"logout" :logout
"search" :search
"invoice" {"/glimpse" {"" {:get :invoice-glimpse
:post :invoice-glimpse-upload
["/" [#"\w+" :textract-invoice-id]] {:get :invoice-glimpse-textract-invoice
"/create" {:post :invoice-glimpse-create-invoice}
"/update" {:patch :invoice-glimpse-update-textract-invoice}}}}}
"account" {"/search" {:get :account-search}}
"admin" {"" :auto-ap.routes.admin/page
"/history" {"" :admin-history
"/" :admin-history
#"/search/?" :admin-history-search
["/" [#"\d+" :entity-id] #"/?"] :admin-history
["/inspect/" [#"\d+" :entity-id] #"/?"] :admin-history-inspect}
"/user" {"" {:get :users
:put :user-edit-save}
"/client/new" :user-client-new
"/table" :user-table
"/impersonate" :user-impersonate
["/" [#"\d+" :db/id] "/edit"] {:get :user-edit-dialog}}
"/account" {"" {:get :admin-accounts
:put :admin-account-save
:post :admin-account-save}
"/table" :admin-account-table
"/new" {:get :admin-account-new-dialog}
["/" [#"\d+" :db/id] "/edit"] :admin-account-edit-dialog
"/override/new" :admin-account-client-override-new}
"/background-job" {"" {:get :admin-jobs
:post :admin-job-start}
"/table" :admin-job-table
"/new" {:get :admin-job-start-dialog}
"/subform" :admin-job-subform}
"/vendor" v-routes/routes
"/ezcater-xls" :admin-ezcater-xls
"/import-batch" ib-routes/routes
"/transaction-rule" tr-routes/routes
"/excel-invoice" ei-routes/routes}
"transaction" {"/insights" {"" :transaction-insights
"/table" :transaction-insight-table
["/code/" [#"\d+" :transaction-id]] {:post :transaction-insight-code}
["/disapprove/" [#"\d+" :transaction-id]] {:delete :transaction-insight-disapprove}
["/rows/" [#"\d+" :after]] {:get :transaction-insight-rows}
["/explain/" [#"\d+" :transaction-id]] {:get :transaction-insight-explain}}}
"pos" {"/sales" {"" {:get :pos-sales}
"/table" {:get :pos-sales-table}}
"/expected-deposit" {"" {:get :pos-expected-deposits}
"/table" {:get :pos-expected-deposit-table}}
"/tenders" {"" {:get :pos-tenders}
"/table" {:get :pos-tender-table}}
"/refunds" {"" {:get :pos-refunds}
"/table" {:get :pos-refund-table}}
"/cash-drawer-shifts" {"" {:get :pos-cash-drawer-shifts}
"/table" {:get :pos-cash-drawer-shift-table}}}
"vendor" {"/search" :vendor-search}
"company" {"" :company
"/dropdown" :company-dropdown-search-results
"/search" :company-search
"/bank-account/typeahead" :bank-account-typeahead
["/" [#"\d+" :db/id] "/bank-account"] {"/search" :bank-account-search}
"/active" {:put :active-client}
"/1099" :company-1099
"/1099/table" {:get :company-1099-vendor-table}
"/1099/vendor-dialog" {["/" [#"\d+" :vendor-id]] {:get :company-1099-vendor-dialog
:post :company-1099-vendor-save}}
"/reports" {"" {:get :company-reports
:delete :company-reports-delete}
"/table" :company-reports-table}
"/yodlee" {"" {:get :company-yodlee}
"/table" {:get :company-yodlee-table}
"/fastlink" {:get :company-yodlee-fastlink-dialog}
"/refresh" {:put :company-yodlee-provider-account-refresh}
"/reauthenticate" {:put :company-yodlee-provider-account-reauthenticate}}
"/plaid" {"" {:get :company-plaid}
"/table" {:get :company-plaid-table}
"/link" {:post :company-plaid-link}
"/relink" {:put :company-plaid-relink}
#_#_"/fastlink" {:get :company-yodlee-fastlink-dialog}
#_#_"/refresh" {:put :company-yodlee-provider-account-refresh}}}})
(def only-routes ["/" routes])