Files
sx-fc/config/routes.rb
2017-06-26 11:10:49 +06:30

256 lines
8.3 KiB
Ruby

require 'sidekiq/web'
Rails.application.routes.draw do
namespace :settings do
resources :membership_actions
end
root 'home#index'
mount Sidekiq::Web => '/kiq'
# Action Cable Creation
mount ActionCable.server => "/cable"
#--------- SmartSales Installation ------------#
get 'install' => 'install#index'
post 'install' => 'install#create'
#--------- Login/Authentication ------------#
post 'login' => 'home#create'
delete 'logout' => 'home#destroy'
get 'dashboard' => 'home#dashboard'
#--------- API Routes ------------#
namespace :api, :defaults => { :format => 'json' } do
#Session Login and Logout
post 'authenticate' => "authenticate#create"
delete 'authenticate' => "authenticate#destroy"
namespace :restaurant do
get 'zones' => "zones#index"
resources :menu, only:[:index, :show]
resources :menu_categories, only: [:index]
resources :menu_items, only: [:index, :show]
resources :menu_item_attributes, only: [:index]
resources :menu_item_options, only: [:index]
resources :menu_sold_out, only: [:index]
end
#User request move table or bills
post "bill/:booking_id" => "bill#create"
post "move" => "move#create"
#Order Controller
resources :orders, only: [:create, :show, :update] do
post "bill" => "bill#create"
end
get 'view_orders' => "orders#view_orders"
#Current active bookings
resources :bookings, only: [:index, :show, :create, :update]
resources :customers
#get customer details by order items
get "customers/get_order/:id" => "customers#get_customer_order"
#Generating Invoice and making payments - output render @sale
resources :invoices, only: [:index, :show, :create, :update, :destroy ] do
resources :sale_items, only:[:create, :update, :destroy]
resources :discounts, only: [:create, :update, :destroy]
resources :memberships, only:[:create]
post "payment/:payment_method" => "payment#create"
put "payment/:id" => "payment#update"
resources :receipt, only: [:create, :show] #generate receipt, show receipt
end
end
#--------- Cashier ------------#
namespace :origami do
root "home#index"
get "table/:dining_id" => "home#show" do #origami/:booking_id will show
# resources :discounts, only: [:index,:new, :create ] #add discount type
resources :customers #add customer type
end
post 'moving' => "movetable#moving"
get "/table/:table_id/sale/:sale_id/edit" => "sale_edit#edit"
get 'table/:dining_id/movetable' => "movetable#move_dining"
get 'table/:dining_id/moveroom' => "moveroom#move_dining"
get 'sale/:sale_id' => 'sales#show'
post 'sale/append_order' => 'sales#add_to_existing_invoice'
get 'room/:room_id' => 'rooms#show'
get 'order/:order_id' => "orders#show"
post '/:booking_id' => 'home#item_show'
get "/:id/discount" => "discounts#index"
post "/:id/discount" => "discounts#create"
post "/:id/request_bills" => "request_bills#print" ,:defaults => { :format => 'json' }
get '/:sale_id/reprint' => 'payments#reprint' ,:defaults => { :format => 'json' }
#--------- Payment ------------#
get 'sale/:sale_id/payment' => 'payments#show'
post 'payment/cash' => 'payments#create'
post 'payment/mpu' => "mpu#create"
post 'payment/jcb' => "jcb#create"
post 'payment/master' => "master#create"
post 'payment/visa' => "visa#create"
post 'payment/paypar' => 'paypar_payments#create'
get 'sale/:sale_id/payment/credit_payment' => "credit_payments#index"
get 'sale/:sale_id/payment/others_payment' => "others_payments#index"
get 'sale/:sale_id/payment/others_payment/MPU' => "mpu#index"
get 'sale/:sale_id/payment/others_payment/VISA' => "visa#index"
get 'sale/:sale_id/payment/others_payment/Master' => "master#index"
get 'sale/:sale_id/payment/others_payment/JCB' => "jcb#index"
get 'sale/:sale_id/payment/others_payment/Redeem' => "redeem_payments#index"
#---------Multiple Invoices --------------#
get 'table/:table_id/table_invoices' => "table_invoices#index" , :as => "table_invoice_index"
get 'table/:table_id/table_invoice/:invoice_id' => "table_invoices#show" , :as => "table_invoice_show"
get 'room/:room_id/room_invoices' => "room_invoices#index" , :as => "room_invoice_index"
get 'room/:room_id/room_invoice/:invoice_id' => "room_invoices#show" , :as => "room_invoice_show"
#---------Add Customer --------------#
#resources :customers
get '/:sale_id/customers', to: "customers#add_customer"
get '/:customer_id/get_customer' => 'home#get_customer',:as => "show_customer_details"
post '/:sale_id/update_sale' , to: "customers#update_sale_by_customer"#update customer id in sale table
end
#--------- Waiter/Ordering Station ------------#
namespace :oishi do
#zones
#tables
#orders
end
#--------- Customer Relationship Management ------------#
namespace :crm do
root "home#index"
resources :customers
resources :dining_queues
post "update_booking" , to: "bookings#update_booking", as: "update_booking"#assign and cancel
get '/print/:id', to: "home#print_order"#print order for crm
get "/dining_queues/:id/assign" =>"dining_queues#assign", :as => "assign"
post "/dining_queues/assign_table" =>"dining_queues#assign_table", :as => "assign_table"
end
#--------- Order Queue Station ------------#
namespace :oqs do
root "home#index"
get "/:table_id", to: "home#get_order_items"
post 'update_delivery', to: "home#update_delivery_status"
# Pass assigned_order_item_id
get 'print/print/:id', to: "print#print"
get 'print/print_order_summary/:id', to: "print#print_order_summary"
#dashboard
#
end
#--------- System Settings ------------#
namespace :settings do
#employees
resources :employees
#menu
resources :menus do
#menu_categories
resources :menu_categories, only: [:new, :create, :edit,:delete]
end
#accounts
resources :accounts
resources :menu_categories do
#menu_items
# resources :menu_items
resources :simple_menu_items
resources :set_menu_items
end
resources :simple_menu_items do
resources :menu_item_instances
end
resources :set_menu_items do
resources :menu_item_instances
end
#menu_item_attributes
resources :menu_item_attributes
#menu_item_options
resources :menu_item_options
#tax_profiles
resources :tax_profiles
#lookups
resources :lookups
#cashier_terminals
resources :cashier_terminals
#order_job_stations
#order_queue_stations
resources :order_queue_stations do
resources :processing_items, :only => [:new, :create]
end
#payment method settings
resources :payment_method_settings
#membership_settings
resources :membership_settings
#zones
resources :zones do
#tables
resources :tables
#rooms
resources :rooms
end
end
#--------- Transactions Sections ------------#
namespace :transactions do
resources :sales
resources :orders
get "/sales/:sale_id/manual_complete_sale" =>"manual_sales#manual_complete_sale", :as => "manual_complete_sale"
get "/sales/:sale_id/void" =>"manual_sales#void", :as => "void"
post "sales/:sale_id/manual_void_sale", to: "manual_sales#manual_void_sale", :as => "manual_void_sale"
end
#--------- Reports Controller Sections ------------#
namespace :reports do
resources :receipt_no, :only => [:index, :show]
resources :daily_sale, :only => [:index, :show]
resources :sale_item, :only => [:index, :show]
# resources :sales, :only => [:index, :show]
# resources :orders, :only => [:index, :show]
# resources :customers, :only => [:index, :show]
# resources :products, :only => [:index, :show]
# resources :inventory, :only => [:index, :show]
# resources :employees, :only => [:index, :show]
end
#mount_compendium at: '/report' #, controller: 'reports'
#--------- Reports ------------#
# namespace :reports do
# #dashboard
# #sales
# #orders
# #shifts
# resources :shifts do
# resources :orders
# resources :sales
# end
# end
#----------- Print Setup --------#
resources :print_settings
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end