class FlowContentItem
  attr_reader :flow_presenter

  def initialize(flow_presenter)
    @flow_presenter = flow_presenter
  end

  def payload
    {
      base_path: flow_presenter.start_page_link,
      title: flow_presenter.title,
      update_type: "minor",
      details: {
        external_related_links: flow_presenter.external_related_links,
      },
      schema_name: "generic_with_external_related_links",
      document_type: "smart_answer",
      publishing_app: "smartanswers",
      rendering_app: "smartanswers",
      locale: "en",
      public_updated_at: Time.zone.now.iso8601,
      routes: [
        { type: "prefix", path: flow_presenter.start_page_link },
        { type: "prefix", path: "/#{flow_presenter.name}/flow" },
      ],
    }
  end

  def content_id
    flow_presenter.flow_content_id
  end
end
