From 020ea01d36972be69e9bef3680603384a316b7db Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Wed, 18 Mar 2026 00:08:56 -0400 Subject: [PATCH] renamed controllers and updated routes --- ..._controller.rb => employees_controller.rb} | 2 +- ..._controller.rb => estimates_controller.rb} | 2 +- ...e_controller.rb => invoices_controller.rb} | 2 +- app/views/estimates/_list.html.erb | 2 +- config/routes.rb | 22 +++++++++++++------ 5 files changed, 19 insertions(+), 11 deletions(-) rename app/controllers/{employee_controller.rb => employees_controller.rb} (96%) rename app/controllers/{estimate_controller.rb => estimates_controller.rb} (98%) rename app/controllers/{invoice_controller.rb => invoices_controller.rb} (97%) diff --git a/app/controllers/employee_controller.rb b/app/controllers/employees_controller.rb similarity index 96% rename from app/controllers/employee_controller.rb rename to app/controllers/employees_controller.rb index 5b273c0..9e4b43f 100644 --- a/app/controllers/employee_controller.rb +++ b/app/controllers/employees_controller.rb @@ -7,7 +7,7 @@ #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. -class EmployeeController < ApplicationController +class EmployeesController < ApplicationController include AuthHelper before_action :require_user, unless: -> { session[:token].nil? } diff --git a/app/controllers/estimate_controller.rb b/app/controllers/estimates_controller.rb similarity index 98% rename from app/controllers/estimate_controller.rb rename to app/controllers/estimates_controller.rb index 33cd576..5c528b1 100644 --- a/app/controllers/estimate_controller.rb +++ b/app/controllers/estimates_controller.rb @@ -7,7 +7,7 @@ #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. -class EstimateController < ApplicationController +class EstimatesController < ApplicationController include AuthHelper before_action :require_user, unless: -> { session[:token].nil? } diff --git a/app/controllers/invoice_controller.rb b/app/controllers/invoices_controller.rb similarity index 97% rename from app/controllers/invoice_controller.rb rename to app/controllers/invoices_controller.rb index 77f2177..128d683 100644 --- a/app/controllers/invoice_controller.rb +++ b/app/controllers/invoices_controller.rb @@ -7,7 +7,7 @@ #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. -class InvoiceController < ApplicationController +class InvoicesController < ApplicationController include AuthHelper before_action :require_user, unless: -> { session[:token].nil? } diff --git a/app/views/estimates/_list.html.erb b/app/views/estimates/_list.html.erb index 9974e7a..87dd382 100644 --- a/app/views/estimates/_list.html.erb +++ b/app/views/estimates/_list.html.erb @@ -2,7 +2,7 @@ <% estimates.sort.reverse.each do |estimate| %>
- <%= check_box_tag "estimate_ids[]", estimate.id, false, onchange: "updateLink()", data: { url: estimate_path(estimate), text: "Estimate ##{estimate.to_s}" }, class: "estimate-checkbox appointment" %> + <%= check_box_tag "estimate_ids[]", estimate.id, false, onchange: "updateLink()", data: { url: estimates_path(estimate), text: "Estimate ##{estimate.to_s}" }, class: "estimate-checkbox appointment" %> <%= link_to "##{estimate.doc_number}", estimate_path(estimate), target: :_blank %> <%= estimate.txn_date %>
<% end %> diff --git a/config/routes.rb b/config/routes.rb index 2f59360..0a7439b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -14,18 +14,13 @@ get 'qbo/oauth_callback', to: 'qbo#oauth_callback' #manual sync get 'qbo/sync', to: 'qbo#sync' -get 'customers/sync', to: 'customers#sync' -get 'employees/sync', to: 'employee#sync' -get 'invoices/sync', to: 'invoice#sync' -get 'estimates/sync', to: 'estimate#sync' #webhook post 'qbo/webhook', to: 'qbo#webhook' # Estimate & Invoice PDF -get 'estimates/sync', to: 'estimate#sync' -get 'estimates/doc/', to: 'estimate#doc', as: :estimate_doc -get 'invoices/:id', to: 'invoice#show', as: :invoice +get 'estimates/doc/', to: 'estimates#doc', as: :estimate_doc +get 'invoices/:id', to: 'invoices#show', as: :invoice #manual billing get 'bill/:id', to: 'qbo#bill', as: :bill @@ -42,3 +37,16 @@ resources :customers do get :autocomplete_customer_name, on: :collection get :sync end + +resources :estimates do + get :sync + get :doc, as: :estimate_doc +end + +resources :employees do + get :sync +end + +resources :invoices do + get :sync +end