module WolfCore::Burnett::PositionsOperations

def create_position(erecruit_token:, erecruit_platform_url:, position:)

def create_position(erecruit_token:, erecruit_platform_url:, position:)
  parsed_http_post(
    headers: { "Authorization" => "Bearer #{erecruit_token}" },
    url: "#{erecruit_platform_url}/Position",
    body: position
  )
end

def create_position!(erecruit_token:, erecruit_platform_url:, position:, error_message:, error_data: nil)

def create_position!(erecruit_token:, erecruit_platform_url:, position:, error_message:, error_data: nil)
  response = safe_http_post(
    headers: { "Authorization" => "Bearer #{erecruit_token}" },
    url: "#{erecruit_platform_url}/Position",
    body: position,
    error_message: error_message,
    error_data: error_data
  )
  response.body
end

def update_position(erecruit_token:, erecruit_platform_url:, position_id:, position:)

def update_position(erecruit_token:, erecruit_platform_url:, position_id:, position:)
  parsed_http_put(
    headers: { "Authorization" => "Bearer #{erecruit_token}" },
    url: "#{erecruit_platform_url}/Position/#{position_id}",
    body: position
  )
end

def update_position!(erecruit_token:, erecruit_platform_url:, position_id:, position:, error_message:)

def update_position!(erecruit_token:, erecruit_platform_url:, position_id:, position:, error_message:)
  response = safe_http_put(
    headers: { "Authorization" => "Bearer #{erecruit_token}" },
    url: "#{erecruit_platform_url}/Position/#{position_id}",
    body: position,
    error_message: error_message
  )
  response.body
end