define reference snap and include in FaciaContentUtils.fold #339
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this change?
Adds a 3rd variety of Snap, the "ReferenceSnap" (the existing one being "LinkSnap" and "LatestSnap").
The intent is that the "ReferenceSnap" would be used on Fronts to point to an arbitrary entity that can be identified by the
snapReferenceType
andsnapReferenceId
which the platforms can look-up and render some element representing that entity (or safely render nothing if the platform does not support an element for the entity type or does not have access to the data/content needed).The current use-case envisaged is promotion blocks for newsletters (currently done using thrashers) - for example the, first dog on the moon newsletter could be represented by a "ReferenceSnap" with {snapReferenceType: "newsletter", snapReferenceId: "first-dog"}.
It could also be used to reflex other non-article entities, such as guardian podcast series or custom content of the sort added in guardian/dotcom-rendering#12593
TO DO
How to test
This PR is only adding the new case class.
How can we measure success?
Consumers of the API can use the new snap type.
Have we considered potential risks?
Before supporting the ability to add the new snap type in the facia tool, need to ensure all consumers are able to handle them - even if only by ignoring (IE make sure they will not break)
Deployment