class Api::V1::Projects::Sca::ReportService <  Api::V1::Projects::Sca::BaseService
  def initialize(sca,scan_id)
    @sca = sca
    @scan_id = scan_id
  end

  def call
    data  = if @sca == "SCA"
              %w[component vulnerability compliance]
            else
              %w[issue_code]
            end
    params = data.map { |e|
        {
          format: "pdf",
          language: "cn",
          scan_id: @scan_id,
          type: e
        }
      }

    sca_post_request("reports/", params)
  end

end

