Files
redmine_qbo/config/routes.rb
T
rickyandClaude Opus 5.5 0d143e6eb1 Remove orphaned code
* customers#filter_estimates_by_customer and #filter_invoices_by_customer,
  their routes, permission entries and template: they filled an estimate
  dropdown on the old issue form, which is gone.
* Routes with no action: accounts new/create/show/edit/update/destroy
  (only index, Set default and Sync exist) and customers#destroy.
* Unused methods: AuthHelper#require_user, #allowed_to?, #check_permission;
  CustomersController#address_to_s; CustomerToken#expired? and
  .remove_expired_tokens; QboBaseModel#skip_qbo_push?;
  QboDraft.writable_document?; SyncServiceBase#extract_value.
* CustomersController's before_action helpers are private.
* The unused .autocomplete-meta style and 28 unused translation keys.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 19:48:17 -05:00

107 lines
3.5 KiB
Ruby

#The MIT License (MIT)
#
#Copyright (c) 2016 - 2026 rick barrette
#
#Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
#The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#authentication
get 'qbo/authenticate', to: 'qbo#authenticate'
get 'qbo/oauth_callback', to: 'qbo#oauth_callback'
#manual sync
get 'qbo/sync', to: 'qbo#sync'
get 'invoices/sync', to: 'invoices#sync'
get 'estimates/sync', to: 'estimates#sync'
get 'employees/sync', to: 'employees#sync'
#webhook
post 'qbo/webhook', to: 'qbo#webhook'
# Estimate & Invoice PDF
get 'estimates/:id', to: 'estimates#show', as: :estimate
get 'estimates/doc/', to: 'estimates#doc', as: :estimate_doc
get 'invoices/:id', to: 'invoices#show', as: :invoice
#manual billing
post 'bill/:id', to: 'qbo#bill', as: :bill
#customer issue view
get 'customers/view/:token', to: 'customers#view', as: :view
get 'customers/share/:id', to: 'customers#share', as: :share
resources :customers, except: [:destroy] do
collection do
get :autocomplete
get :sync
end
end
# Estimate writer pages. Kept under /qbo_estimates so they don't clash with redmine_qbo's /estimates/:id PDF route.
resources :qbo_estimates, only: [:new, :create, :edit, :update] do
member do
post :send_email
get :issues_preview
post :create_issues
end
collection do
get :customer_info
get :items
post :refresh_company
end
end
# Invoice writer pages (redmine_qbo has /invoices/:id for the PDF)
resources :qbo_invoices, only: [:new, :create, :edit, :update] do
member do
post :send_email
end
collection do
get :import_options
end
end
# Estimate and invoice drafts, kept in Redmine until they're saved to QuickBooks (continued on the editors)
resources :qbo_drafts, only: [:index, :destroy]
# Customer refunds (SOP-OPS-014): /qbo_refunds/new?customer_id=
resources :qbo_refunds, only: [:new, :create, :show] do
member do
get :pdf
post :email
end
end
# Receive payment pages, and a customer's payments (/qbo_payments?customer_id=)
resources :qbo_payments, only: [:index, :new, :create, :show, :edit, :update] do
member do
get :pdf
end
collection do
get :sync
get :open_invoices
end
end
# QuickBooks product/service list (moved from redmine_qbo_lineitems; same URLs)
resources :items do
collection do
get :autocomplete
get :sync
end
end
# QuickBooks income accounts
resources :accounts, only: [:index] do
collection do
patch :set_default
get :sync
end
end
# Business report (estimates, invoices, payments and hours for a period)
get 'qbo_reports', to: 'qbo_reports#index', as: :qbo_reports