Files
sx-fc/config/routes.rb
2017-08-31 15:29:36 +06:30

367 lines
13 KiB
Ruby

require 'sidekiq/web'
Rails.application.routes.draw do
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 ------------#
get 'auth/:emp_id' => 'home#show', as: :emp_login
patch "auth/:emp_id" => 'home#update', as: :emp_login_update
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, :show]
resources :menu_items, only: [:index, :show]
resources :menu_item_attributes, only: [:index]
resources :menu_item_options, only: [:index]
resources :menu_sold_out, only: [:index]
get "item_sets" => "item_sets#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
resources :cash_ins, only: [:new, :create]
resources :cash_outs, only: [:new, :create]
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"
post 'item_void' => "sale_edit#item_void"
post 'item_foc' => "sale_edit#item_foc"
post 'item_edit' => "sale_edit#item_edit"
post 'item_void_cancel' => "sale_edit#item_void_cancel"
post 'cancel_all_void' => 'sale_edit#cancel_all_void'
post 'apply_void' => 'sale_edit#apply_void'
# in_juties
get '/table/:table_id/assign_in_juty' => 'in_juties#assign_in_juty', as: 'assign_in_juty'
get 'assign_in_juty/:table_id' => 'in_juties#index_in_juty', as: 'index_in_juty'
post 'assign_in_juty/:table_id' => 'in_juties#create_for_in_juty'
get 'assign_in_juty/table/:table_id/in_juty/:id/edit' => 'in_juties#edit_in_juty' ,as: 'edit_in_juty'
patch 'edit_in_juty/:id' => 'in_juties#update_for_in_juty', as: 'update_for_in_juty'
delete 'table/:table_id/destroy_in_juty/:id' => 'in_juties#destroy_in_juty', as: 'destroy_in_juty'
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'
# Other Charges
get "/:sale_id/other_charges" => "other_charges#index"
post "/:sale_id/other_charges" => "other_charges#create"
# Discount
get "/:id/discount" => "discounts#index"
post "/:id/discount" => "discounts#create"
get "/:id/remove_all_discount" => "discounts#remove_all_discount"
post "/:id/remove_discount_items" => "discounts#remove_discount_items"
# Discount for Member
post "/:id/member_discount" => "discounts#member_discount"
get "/:id/request_bills" => "request_bills#print", :as => "request_bill"
get '/:sale_id/reprint' => 'payments#reprint', :defaults => {:format => 'json'}
#---------Shift ---------------#
resources :shifts, only: [:index, :new, :create, :edit]
post 'close_shift' => 'shifts#update_shift'
get 'shift/close' => 'shifts#show'
get 'shift/sale_summary' => 'shifts#sale_summary'
#shift - index (open/close shift landing page)
#shift - show (sales summary display)
#shift - new (open shift)
#shift - edit (close shift)
resources :cash_mgmt, only: [:new, :create]
#payment - accepting or expending money from cashier - [Cash Journal]
#payment - Incoming payments - [accept all payment types (cash, other payments (except rebate))
#payment - Outing payments - Cash only [ *Misc expeness tracking]
#--------- Payment ------------#
post 'sale/:sale_id/rounding_adj' => 'payments#rounding_adj', :as => "calculate_rouding_adjs"
get 'sale/:sale_id/first_bill' => 'payments#first_bill', :defaults => {:format => 'json'}
get 'sale/:sale_id/payment' => 'payments#show'
post 'payment/foc' => 'payments#foc', :defaults => {:format => 'json'}
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'
post 'payment/credit' => 'credit_payments#create'
post 'payment/voucher' => 'voucher_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"
get 'sale/:sale_id/payment/others_payment/Voucher' => "voucher#index"
#---------Void --------------#
post 'sale/:sale_id/void' => 'void#overall_void'
#---------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
post '/:sale_id/get_customer' => "customers#get_customer"
resources :addorders
resources :in_juties
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"
post "/dining_queues/cancel_queue" => "dining_queues#cancel_queue", :as => "cancel_queue"
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"
# qty update
get "/:id/edit", to: "edit#index"
post "/:id", to: "edit#update"
# Pass assigned_order_item_id
get 'print/print/:id', to: "print#print"
get 'print/print_order_summary/:id', to: "print#print_order_summary"
get "/get_items/:id" => "home#get_items_by_oqs", :as => "get_order_items_by_oqs"
#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
resources :item_sets
resources :menu_item_sets
#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
#products
resources :products
#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
resources :membership_actions
#zones
resources :zones do
#tables
resources :tables do
resources :dining_charges
end
#rooms
resources :rooms do
resources :dining_charges
end
end
#promotion
resources :promotions do
resources :promotion_products
end
get '/find_item_instance' => 'promotions#find_item_instance', as:'find_item_instance'
# commission
resources :commissions
resources :commissioners
get '/get_transactions_by_commissioner' => 'commissioners#get_transaction_by_commissioner', as:'get_transaction_by_commissioner'
end
# commissions
get 'origami/table/:table_id/sale/:sale_id/load_commissioners' => 'settings/commissions#load_commissioners', as: 'load_commissioners'
post 'origami/select_sale_item' => 'settings/commissions#select_sale_item', as: 'select_sale_item'
# product_commission
post 'origami/select_commissioner' => 'origami/product_commissions#set_commissioner_to_sale_item', as: 'select_commissioner'
#--------- Transactions Sections ------------#
namespace :transactions do
resources :sales
resources :orders
resources :credit_notes
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
resources :dailysale, :only => [:index, :show]
resources :saleitem, :only => [:index, :show]
resources :shiftsale, :only => [:index, :show]
resources :credit_payment, :only => [:index, :show]
resources :void_sale, :only => [:index, :show]
resources :commission, :only => [:index, :show]
get "receipt_no/get_shift_by_date", to: "receipt_no#get_shift_by_date", as: "get_shift_by_date"
end
# ----------- Inventory ---------------------------
namespace :inventory do
get '/' => 'inventory#index'
get '/stock_checks' => 'stock_checks#index'
post 'save_stock' => 'stock_checks#create', as:'stock_check_save'
get '/stock_checks/:id' => 'stock_checks#show'
post 'save_to_journal' => 'stock_checks#save_to_journal', as: 'save_to_journal'
post 'print_stock_check' => 'stock_checks#print_stock_check', as: 'print_stock_check'
# resources :stock_checks
resources :stock_journals
resources :inventory_definitions
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
resources :commissioners
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end