class DistributionType
  # distibution type and UPC must always both have values or neither have values

  def self.validate(row)
    reasons = []

    supported_types = ['Digital', 'Physical']

    if row[:distribution_type]
      unless supported_types.include?(row[:distribution_type])
        reasons << 'Distribution type not supported'
      end

      unless row[:upc]
        reasons << 'Distribution type must be blank if UPC is blank'
      end
    end

    reasons
  end
end
