Module: OwnerDashboardPaths

Included in:
OwnerDecorator, RestaurantGroupDecorator, StaffDecorator
Defined in:
app/my_lib/owner_dashboard_paths.rb

Overview

This module used by Staff, Owner, and Restaurant Group owner on Owner dashboard

Instance Method Summary collapse

Instance Method Details

#dashboard_v2_block_inventories_pathObject



96
97
98
# File 'app/my_lib/owner_dashboard_paths.rb', line 96

def dashboard_v2_block_inventories_path
  helpers.send(fix_path('block_dashboard_v2_inventories_path'))
end

#dashboard_v2_confirm_reservation_path(*params) ⇒ Object



113
114
115
# File 'app/my_lib/owner_dashboard_paths.rb', line 113

def dashboard_v2_confirm_reservation_path(*params)
  helpers.send(fix_path('dashboard_v2_reservation_confirm_path'), *params)
end

#dashboard_v2_create_or_update_inventories_pathObject



108
109
110
111
# File 'app/my_lib/owner_dashboard_paths.rb', line 108

def dashboard_v2_create_or_update_inventories_path
  helpers.send(fix_path('create_or_update_dashboard_v2_inventories_path'),
               format: :json)
end

#dashboard_v2_create_reservation_pathObject



27
28
29
# File 'app/my_lib/owner_dashboard_paths.rb', line 27

def dashboard_v2_create_reservation_path
  helpers.send(fix_path('dashboard_v2_reservations_path'))
end

#dashboard_v2_edit_reservation_path(reservation, restaurant_id, _error_message = nil) ⇒ Object



31
32
33
34
# File 'app/my_lib/owner_dashboard_paths.rb', line 31

def dashboard_v2_edit_reservation_path(reservation, restaurant_id, _error_message = nil)
  helpers.send(fix_path('edit_dashboard_v2_reservation_path'), reservation,
               reservation: { restaurant_id: restaurant_id })
end

#dashboard_v2_filter_form_urlObject



18
19
20
# File 'app/my_lib/owner_dashboard_paths.rb', line 18

def dashboard_v2_filter_form_url
  helpers.send(fix_path('dashboard_v2_reservations_path'))
end

#dashboard_v2_group_voucher_marketplace_search_historyObject



169
170
171
# File 'app/my_lib/owner_dashboard_paths.rb', line 169

def dashboard_v2_group_voucher_marketplace_search_history
  helpers.send(fix_path('search_history_dashboard_v2_voucher_marketplaces_path'))
end

#dashboard_v2_group_voucher_marketplace_search_listObject



165
166
167
# File 'app/my_lib/owner_dashboard_paths.rb', line 165

def dashboard_v2_group_voucher_marketplace_search_list
  helpers.send(fix_path('search_list_dashboard_v2_voucher_marketplaces_path'))
end

#dashboard_v2_inventories_path(options = {}) ⇒ Object



104
105
106
# File 'app/my_lib/owner_dashboard_paths.rb', line 104

def dashboard_v2_inventories_path(options = {})
  helpers.send(fix_path('dashboard_v2_inventories_path'), options)
end

#dashboard_v2_inventory_undo_path(*params) ⇒ Object



92
93
94
# File 'app/my_lib/owner_dashboard_paths.rb', line 92

def dashboard_v2_inventory_undo_path(*params)
  helpers.send(fix_path('dashboard_v2_inventory_undo_path'), *params)
end

#dashboard_v2_log_out_pathObject



6
7
8
9
10
11
12
13
14
15
16
# File 'app/my_lib/owner_dashboard_paths.rb', line 6

def dashboard_v2_log_out_path
  if helpers.dashboard_v2_restaurant_group_signed_in?
    helpers.destroy_dashboard_v2_restaurant_group_session_path
  elsif helpers.dashboard_v2_owner_signed_in?
    helpers.destroy_dashboard_v2_owner_session_path
  elsif helpers.dashboard_v2_staff_signed_in?
    helpers.destroy_dashboard_v2_staff_session_path
  else
    raise NotImplementedError
  end
end

#dashboard_v2_new_reservation_path(restaurant_id = nil) ⇒ Object



22
23
24
25
# File 'app/my_lib/owner_dashboard_paths.rb', line 22

def dashboard_v2_new_reservation_path(restaurant_id = nil)
  helpers.send(fix_path('new_dashboard_v2_reservation_path'),
               reservation: { restaurant_id: restaurant_id })
end

#dashboard_v2_package_menus_pathObject



72
73
74
# File 'app/my_lib/owner_dashboard_paths.rb', line 72

def dashboard_v2_package_menus_path
  helpers.send(fix_path('dashboard_v2_package_menus_path'))
end

#dashboard_v2_reports_pathObject



117
118
119
# File 'app/my_lib/owner_dashboard_paths.rb', line 117

def dashboard_v2_reports_path
  helpers.send(fix_path('dashboard_v2_reports_path'))
end

#dashboard_v2_reservation_cancel_path(reservation) ⇒ Object



45
46
47
# File 'app/my_lib/owner_dashboard_paths.rb', line 45

def dashboard_v2_reservation_cancel_path(reservation)
  helpers.send(fix_path('dashboard_v2_reservation_cancel_path'), reservation)
end

#dashboard_v2_reservation_send_reminder_path(reservation) ⇒ Object



54
55
56
57
# File 'app/my_lib/owner_dashboard_paths.rb', line 54

def dashboard_v2_reservation_send_reminder_path(reservation)
  helpers.send(fix_path('dashboard_v2_reservation_send_reminder_path'),
               reservation, format: :json)
end


49
50
51
52
# File 'app/my_lib/owner_dashboard_paths.rb', line 49

def dashboard_v2_reservation_send_review_link_path(reservation)
  helpers.send(fix_path('dashboard_v2_reservation_send_review_link_path'),
               reservation, format: :json)
end

#dashboard_v2_reservations_pathObject



41
42
43
# File 'app/my_lib/owner_dashboard_paths.rb', line 41

def dashboard_v2_reservations_path
  helpers.send(fix_path('dashboard_v2_reservations_path'))
end

#dashboard_v2_reset_inventories_pathObject



100
101
102
# File 'app/my_lib/owner_dashboard_paths.rb', line 100

def dashboard_v2_reset_inventories_path
  helpers.send(fix_path('reset_dashboard_v2_inventories_path'))
end

#dashboard_v2_reviews_pathObject



64
65
66
# File 'app/my_lib/owner_dashboard_paths.rb', line 64

def dashboard_v2_reviews_path
  helpers.send(fix_path('dashboard_v2_reviews_path'))
end

#dashboard_v2_root_pathObject



129
130
131
# File 'app/my_lib/owner_dashboard_paths.rb', line 129

def dashboard_v2_root_path
  helpers.send(fix_path('dashboard_v2_root_path'))
end

#dashboard_v2_self_checkin_pathObject



141
142
143
# File 'app/my_lib/owner_dashboard_paths.rb', line 141

def dashboard_v2_self_checkin_path
  helpers.send(fix_path('self_checkin_form_dashboard_v2_reservations_path'))
end

#dashboard_v2_self_redeem_pathObject



157
158
159
# File 'app/my_lib/owner_dashboard_paths.rb', line 157

def dashboard_v2_self_redeem_path
  helpers.send(fix_path('self_redeem_form_dashboard_v2_voucher_marketplaces_path'))
end

#dashboard_v2_send_custom_sms_pathObject



59
60
61
62
# File 'app/my_lib/owner_dashboard_paths.rb', line 59

def dashboard_v2_send_custom_sms_path
  helpers.send(fix_path('send_custom_sms_dashboard_v2_reservations_path'),
               format: :json)
end

#dashboard_v2_staff_path(staff) ⇒ Object



76
77
78
# File 'app/my_lib/owner_dashboard_paths.rb', line 76

def dashboard_v2_staff_path(staff)
  helpers.send(fix_path('dashboard_v2_staff_path'), staff)
end

#dashboard_v2_staffs_pathObject



68
69
70
# File 'app/my_lib/owner_dashboard_paths.rb', line 68

def dashboard_v2_staffs_path
  helpers.send(fix_path('dashboard_v2_staffs_path'))
end

#dashboard_v2_update_reservation_path(reservation, args = {}) ⇒ Object



36
37
38
39
# File 'app/my_lib/owner_dashboard_paths.rb', line 36

def dashboard_v2_update_reservation_path(reservation, args = {})
  args = { format: :json }.merge(args)
  helpers.send(fix_path('dashboard_v2_reservation_path'), reservation, args)
end

#dashboard_v2_voucher_marketplace_edit_historyObject



161
162
163
# File 'app/my_lib/owner_dashboard_paths.rb', line 161

def dashboard_v2_voucher_marketplace_edit_history
  helpers.send(fix_path('edit_history_dashboard_v2_voucher_marketplaces_path'))
end

#dashboard_v2_voucher_marketplace_historyObject



149
150
151
# File 'app/my_lib/owner_dashboard_paths.rb', line 149

def dashboard_v2_voucher_marketplace_history
  helpers.send(fix_path('history_dashboard_v2_voucher_marketplaces_path'))
end

#dashboard_v2_voucher_marketplace_listObject



145
146
147
# File 'app/my_lib/owner_dashboard_paths.rb', line 145

def dashboard_v2_voucher_marketplace_list
  helpers.send(fix_path('list_dashboard_v2_voucher_marketplaces_path'))
end

#dashboard_v2_voucher_marketplace_redeemObject



153
154
155
# File 'app/my_lib/owner_dashboard_paths.rb', line 153

def dashboard_v2_voucher_marketplace_redeem
  helpers.send(fix_path('redeem_dashboard_v2_voucher_marketplaces_path'))
end

#edit_dashboard_v2_staff_path(staff) ⇒ Object



84
85
86
# File 'app/my_lib/owner_dashboard_paths.rb', line 84

def edit_dashboard_v2_staff_path(staff)
  helpers.send(fix_path('edit_dashboard_v2_staff_path'), staff)
end

#many_restaurants?Boolean

Returns:

  • (Boolean)


121
122
123
124
125
126
127
# File 'app/my_lib/owner_dashboard_paths.rb', line 121

def many_restaurants?
  return @many_restaurants if defined?(@many_restaurants)

  return false if object.instance_of?(Owner)

  @many_restaurants = object.restaurants.count > 1
end

#new_dashboard_v2_staff_pathObject



80
81
82
# File 'app/my_lib/owner_dashboard_paths.rb', line 80

def new_dashboard_v2_staff_path
  helpers.send(fix_path('new_dashboard_v2_staff_path'))
end

#override_report_dashboard_v2_inventories_pathObject



88
89
90
# File 'app/my_lib/owner_dashboard_paths.rb', line 88

def override_report_dashboard_v2_inventories_path
  helpers.send(fix_path('override_report_dashboard_v2_inventories_path'))
end

#partner_pathObject



173
174
175
176
# File 'app/my_lib/owner_dashboard_paths.rb', line 173

def partner_path
  base_url = AdminSetting.partner_portal_host.chomp('/')
  base_url + (helpers.group_owner_type? ? '/login?loginType=group' : '')
end

#restaurant_group_id_hashObject



137
138
139
# File 'app/my_lib/owner_dashboard_paths.rb', line 137

def restaurant_group_id_hash
  object.to_url_hash
end

#restaurant_id_hashObject



133
134
135
# File 'app/my_lib/owner_dashboard_paths.rb', line 133

def restaurant_id_hash
  object.restaurant.to_url_hash
end