module WolfCore::Burnett::MatchOperations

def create_match(erecruit_token:, erecruit_platform_url:, position_id:, candidate_id:)

def create_match(erecruit_token:, erecruit_platform_url:, position_id:, candidate_id:)
  parsed_http_post(
    headers: { "Authorization" => "Bearer #{erecruit_token}" },
    url: "#{erecruit_platform_url}/",
    query: { tenant: tenant }
  )
end

def create_match!(erecruit_token:, erecruit_platform_url:, position_id:, candidate_id:, error_message:)

def create_match!(erecruit_token:, erecruit_platform_url:, position_id:, candidate_id:, error_message:)
  response = safe_http_post(
    headers: { "Authorization" => "Bearer #{erecruit_token}" },
    url: "#{erecruit_platform_url}/",
    query: { tenant: tenant },
    error_message: error_message
  )
  nil if response.code == 200
end

def update_match(erecruit_token:, erecruit_platform_url:, position_id:, candidate_id:)

def update_match(erecruit_token:, erecruit_platform_url:, position_id:, candidate_id:)
  response = parsed_http_put(
    headers: { "Authorization" => "Bearer #{erecruit_token}" },
    url: "#{erecruit_platform_url}/",
    query: { tenant: tenant }
  )
  nil if response.code == 200
end

def update_match!(erecruit_token:, erecruit_platform_url:, position_id:, candidate_id:, error_message:)

def update_match!(erecruit_token:, erecruit_platform_url:, position_id:, candidate_id:, error_message:)
  response = safe_http_put(
    headers: { "Authorization" => "Bearer #{erecruit_token}" },
    url: "#{erecruit_platform_url}/",
    query: { tenant: tenant },
    error_message: error_message
  )
  nil if response.code == 200
end