class StoreSerializer < Blueprinter::Base
  include WarpEngine::TimestampFields

  field :name
  # camelCase, as the catalog's own payloads use — one convention for a client
  # that reads both.
  field(:catalogUrl) { |store| store.catalog_url }
  # Null rather than an empty string when there is no repository: the client
  # branches on its absence, and "" is not an absence a JSON reader can trust.
  field(:storeRepositoryUrl) { |store| store.store_repository_url.presence }
end
