-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroutes.rb
86 lines (72 loc) · 2.76 KB
/
routes.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
Rails.application.routes.draw do
devise_for :users, controllers: {
registrations: 'registrations',
passwords: 'passwords'
}, skip: [:registrations]
get "/stores/listing", to: "stores#listing"
get 'sign_up', to: 'registrations#new', as: :sign_up_registration
post 'sign_up' => 'registrations#create'
get 'users' => 'registrations#index'
resources :registrations, only: [:edit, :update]
delete "deactivate_user/:id", to: "registrations#deactivate_user", as: :deactivate_user
get "me", to: "registrations#me"
post "new", to: "registrations#create", as: :create_registration
post "sign_in", to: "registrations#sign_in"
post 'refresh', to: 'registrations#refresh'
resources :stores do
get 'items', on: :member
resources :products, only: [:index, :show, :new, :create, :edit, :update, :destroy] do
collection do
get 'listing', to: "products#listing_within_token"
end
end
get "orders/new" => "stores#new_order"
member do
put 'reactivate_store', to: 'stores#reactivate', as: :reactivate_store
put 'reactivate_product', to: 'products#reactivate', as: :reactivate_product
end
resources :orders, only: [:index, :show] do
member do
put 'accept'
put 'start_progress'
put 'ready_for_delivery'
put 'start_delivery'
put 'deliver'
put 'cancel'
end
end
end
resources :credentials, only: [:index, :create, :update]
delete '/credentials/:id', to: 'credentials#destroy', as: 'delete_credential'
scope :buyers do
resources :orders, only: [:index, :create, :update, :destroy] do
member do
put 'pay'
end
end
get 'orders/stream', to: 'orders#stream'
get 'orders/:id', to: 'orders#show', as: 'buyer_order'
get 'orders/last-three', to: 'orders#last_three'
get 'orders/:id/pay', to: 'orders#show_pay', as: 'buyer_order_pay'
end
get 'orders/create', to: 'orders#new'
get "listing", to: "products#listing"
scope :analysis do
get 'anacor', to: 'analysis#anacor'
get 'monthly_analysis', to: 'analysis#monthly_analysis'
get 'total_orders', to: 'analysis#total_orders'
get 'pending_orders', to: 'analysis#pending_orders'
get 'total_sales', to: 'analysis#total_sales'
end
root to: "welcome#index"
get "up", to: "rails/health#show", as: :rails_health_check
mount Rswag::Ui::Engine => '/api-docs'
mount Rswag::Api::Engine => '/api-docs'
mount ActionCable.server => '/cable'
direct :rails_blob do |blob|
route_for(:rails_service_blob, blob.signed_id, blob.filename)
end
direct :rails_blob_representation do |representation|
route_for(:rails_service_blob_representation, representation.blob.signed_id, representation.variation_key, representation.blob.filename)
end
end