Module: WolfCore::Burnett::CompanyOperations

Includes:
HttpOperations
Defined in:
lib/wolf_core/application/burnett/company_operations/company_operations.rb

Overview

rubocop:disable Style/Documentation

Instance Method Summary collapse

Methods included from HttpOperations

#async_http_get, #async_http_post, #async_http_put, #http_get, #http_post, #http_put, #parse_http_response, #parsed_http_get, #parsed_http_post, #parsed_http_put, #safe_http_get, #safe_http_post, #safe_http_put, #validate_http_response

Methods included from LoggingUtils

#log_object

Methods included from AsyncUtils

#run_async

Methods included from ExceptionOperations

#raise_service_error

Instance Method Details

#create_company(erecruit_token:, erecruit_platform_url:, company:) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/wolf_core/application/burnett/company_operations/company_operations.rb', line 16

def create_company(erecruit_token:, erecruit_platform_url:, company:)
  parsed_http_post(
    headers: { "Authorization" => "Bearer #{erecruit_token}" },
    url: erecruit_platform_url.to_s,
    body: company
  )
end

#create_company!(erecruit_token:, company:, erecruit_platform_url:, error_message:) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/wolf_core/application/burnett/company_operations/company_operations.rb', line 6

def create_company!(erecruit_token:, company:, erecruit_platform_url:, error_message:)
  response = safe_http_post(
    headers: { "Authorization" => "Bearer #{erecruit_token}" },
    url: erecruit_platform_url.to_s,
    body: company,
    error_message: error_message
  )
  response.body
end

#update_company(erecruit_token:, erecruit_platform_url:, company:, company_id:) ⇒ Object



34
35
36
37
38
39
40
# File 'lib/wolf_core/application/burnett/company_operations/company_operations.rb', line 34

def update_company(erecruit_token:, erecruit_platform_url:, company:, company_id:)
  parsed_http_put(
    headers: { "Authorization" => "Bearer #{erecruit_token}" },
    url: "#{erecruit_platform_url}/#{company_id}",
    body: company
  )
end

#update_company!(erecruit_token:, erecruit_platform_url:, company:, company_id:, error_message:) ⇒ Object



24
25
26
27
28
29
30
31
32
# File 'lib/wolf_core/application/burnett/company_operations/company_operations.rb', line 24

def update_company!(erecruit_token:, erecruit_platform_url:, company:, company_id:, error_message:)
  response = safe_http_put(
    headers: { "Authorization" => "Bearer #{erecruit_token}" },
    url: "#{erecruit_platform_url}/#{company_id}",
    body: company,
    error_message: error_message
  )
  response.body
end