feat: Business hours

Data models and APIs for business hours

ref: #234
This commit is contained in:
Adam Zysko
2020-10-31 19:44:33 +01:00
committed by GitHub
parent 3d64ba49fc
commit 65ed4c78a4
23 changed files with 329 additions and 7 deletions

View File

@@ -80,6 +80,7 @@ class Api::V1::Accounts::InboxesController < Api::V1::Accounts::BaseController
def inbox_update_params
params.permit(:enable_auto_assignment, :name, :avatar, :greeting_message, :greeting_enabled,
:working_hours_enabled, :out_of_office_message,
channel: [
:website_url,
:widget_color,

View File

@@ -0,0 +1,18 @@
class Api::V1::Accounts::WorkingHoursController < Api::V1::Accounts::BaseController
before_action :check_authorization
before_action :fetch_webhook, only: [:update]
def update
@working_hour.update!(working_hour_params)
end
private
def working_hour_params
params.require(:working_hour).permit(:inbox_id, :open_hour, :open_minutes, :close_hour, :close_minutes, :closed_all_day)
end
def fetch_working_hour
@working_hour = Current.account.working_hours.find(params[:id])
end
end