class WorkflowInstanceInputScrubber
  attr_reader :input
  DSLAM_NAME_REGEXP = /[a-zA-Z0-9\-]+[\/-]DSLA8?[\/-]\d+/
  EAP_FORMAT = /EAP\/\d+/i
  ZIPCODE_FORMAT = /\d{4}[a-zA-Z]{2}/
  XDF_SERVICE_ID_FORMAT = /[a-zA-Z]{3}\d{5}/

  def initialize(input)
    @input = input.to_s
  end

  def dslam_names
    input.scan(DSLAM_NAME_REGEXP).map do |input_name|
      # schuuring to kpn aanpassing
      input_name.sub('-DSLA-', '/DSLA/').sub('-DSLA8-', '/DSLA8/')
    end
  end

  def xdf_service_ids
    input.scan(XDF_SERVICE_ID_FORMAT)
  end

  def empty?
    dslam_names.empty?
  end
end
