class GdsApi::Panopticon::Registerer

def record_to_artefact(record)

def record_to_artefact(record)
  hash = {
    slug: record.slug,
    owning_app: owning_app,
    kind: kind,
    name: record.title,
    description: record.description,
    state: record.state
  }
  if rendering_app
    hash[:rendering_app] = rendering_app
  end
  optional_params = [
    :need_id,
    :need_ids,
    :section,
    :primary_section,
    :sections,
    :paths,
    :prefixes,
    :specialist_sectors,
    :organisation_ids,
    :indexable_content,
    :public_timestamp,
    :latest_change_note,
    :content_id,
  ]
  deprecated_params = {
    section: [:primary_section, :sections]
  }
  deprecated_params.each do |attr_name, replacements|
    if record.respond_to?(attr_name)
      replacements = Array(replacements)
      logger.warn "#{attr_name} has been deprecated in favour of #{replacements.join(' and ')}"
    end
  end
  optional_params.each do |attr_name|
    if record.respond_to? attr_name
      hash[attr_name] = record.public_send(attr_name)
    end
  end
  hash
end