Class: OnboardingService

Inherits:
Object
  • Object
show all
Defined in:
app/services/onboarding_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(current_user:, current_company:, current_tenant:, tenant_params:, company_params:, ship_name:, payroll_periods_params:, app_mode:) ⇒ OnboardingService

Returns a new instance of OnboardingService.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/services/onboarding_service.rb', line 5

def initialize(
  current_user:,
  current_company:,
  current_tenant:,
  tenant_params:,
  company_params:,
  ship_name:,
  payroll_periods_params:,
  app_mode:
)
  @current_user = current_user
  @current_company = current_company
  @current_tenant = current_tenant
  @tenant_params = tenant_params
  @company_params = company_params
  @ship_name = ship_name
  @payroll_periods_params = payroll_periods_params
  @app_mode = app_mode
end

Instance Attribute Details

#app_modeObject (readonly)

Returns the value of attribute app_mode.



2
3
4
# File 'app/services/onboarding_service.rb', line 2

def app_mode
  @app_mode
end

#company_paramsObject (readonly)

Returns the value of attribute company_params.



2
3
4
# File 'app/services/onboarding_service.rb', line 2

def company_params
  @company_params
end

#current_companyObject (readonly)

Returns the value of attribute current_company.



2
3
4
# File 'app/services/onboarding_service.rb', line 2

def current_company
  @current_company
end

#current_tenantObject (readonly)

Returns the value of attribute current_tenant.



2
3
4
# File 'app/services/onboarding_service.rb', line 2

def current_tenant
  @current_tenant
end

#current_userObject (readonly)

Returns the value of attribute current_user.



2
3
4
# File 'app/services/onboarding_service.rb', line 2

def current_user
  @current_user
end

#payroll_periods_paramsObject (readonly)

Returns the value of attribute payroll_periods_params.



2
3
4
# File 'app/services/onboarding_service.rb', line 2

def payroll_periods_params
  @payroll_periods_params
end

#ship_nameObject (readonly)

Returns the value of attribute ship_name.



2
3
4
# File 'app/services/onboarding_service.rb', line 2

def ship_name
  @ship_name
end

#tenant_paramsObject (readonly)

Returns the value of attribute tenant_params.



2
3
4
# File 'app/services/onboarding_service.rb', line 2

def tenant_params
  @tenant_params
end

Instance Method Details

#callObject



25
26
27
28
29
30
31
32
33
# File 'app/services/onboarding_service.rb', line 25

def call
  ActiveRecord::Base.transaction do
    update_tenant
    update_company
    create_contact
    create_periods
    create_event_notification_configurations
  end
end