lib/wolf_core/application/burnett/match_operations/match_operattions.rb



module WolfCore # rubocop:disable Style/FrozenStringLiteralComment
  module Burnett
    module MatchOperations # rubocop:disable Style/Documentation
      include WolfCore::HttpOperations

      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 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 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

      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
    end
  end
end