# Renders a calculator for the publishing-api.
class CalculatorContentItem
  attr_reader :calculator

  def initialize(calculator)
    @calculator = calculator
  end

  def base_path
    '/' + calculator.slug
  end

  def content_id
    calculator.content_id
  end

  def update_type
    'minor'
  end

  def payload
    {
      title: calculator.title,
      base_path: base_path,
      format: 'placeholder_calculator',
      publishing_app: 'calculators',
      rendering_app: 'calculators',
      locale: 'en',
      public_updated_at: Time.now.iso8601,
      routes: [
        { type: 'exact', path: base_path }
      ]
    }
  end
end

# Renders a calculator for the publishing-api.
class CalculatorContentItem
  attr_reader :calculator

  def initialize(calculator)
    @calculator = calculator
  end

  def base_path
    '/' + calculator.slug
  end

  def content_id
    calculator.content_id
  end

  def update_type
    'minor'
  end

  def payload
    {
      title: calculator.title,
      base_path: base_path,
      format: 'placeholder_calculator',
      details: {},
      publishing_app: 'calculators',
      rendering_app: 'calculators',
      locale: 'en',
      public_updated_at: Time.now.iso8601,
      routes: [
        { type: 'exact', path: base_path }
      ]
    }
  end
end

Add empty `details` to content item payload sent to publishing api
Add empty `details` to content item payload sent to publishing api

The govuk-content-schemas have changed since the last time this
application was updated. The govuk-content-schemas now expects all
content payloads pushed to it to contain a `details` item.

This problem also occurred in the smart-answers repo.
See PR: https://github.com/alphagov/smart-answers/pull/2539
