EventsQuerySchemas

class EventsQuerySchemas(manifest: Manifest, strategies: MaskStrategyResolver = MaskStrategyResolver.NONE) : QuerySchemaSource

The query schema of each aggregate's events model as the Manifest states it: the source of the events array's declaration and the EventsQueryModelProfile of each aggregate type.

events[] is a union discriminated by name: one variant per event of the aggregate (its variant the event's name, <context>.<aggregate>.<Name>), {name, revision, body} with name that one name and body the event's schema in $defs, its x-wow-* keywords included, plus the system events wow.ScheduleSet and wow.ScheduleCancelled, whose bodies are objects of no declared property, as is the body of an event whose schema $defs lacks. An aggregate the Manifest does not hold has one variant of any name and a body of unknown shape. The stream's system fields come from the profile.

Revision-stable body fields. A pushed-down condition reads the body as the log stores it, at the revision it was committed at, while a record shows it upgraded to the current revision. A body path is stable when every event that declares it is at revision 1: no upgrader ever ran, so the stored body is the body read. A body path an event past revision 1 declares keeps only PRESENCE (adapter): filters, sorts and aggregations on it are rejected (UNSUPPORTED_CAPABILITY), as are those on the undescribed bodies.

Custom mask strategies (x-wow-mask.strategy) are resolved through strategies.

Constructors

Link copied to clipboard
constructor(manifest: Manifest, strategies: MaskStrategyResolver = MaskStrategyResolver.NONE)

Properties

Link copied to clipboard
open override val priority: Int

Functions

Link copied to clipboard

storage of type's events with the revision rule (see the class): a body path an upgraded event declares keeps only PRESENCE.

Link copied to clipboard

The declaration of type's events and of its declared access attributes (accessDeclaration), compiled once.

Link copied to clipboard
open suspend override fun load(context: QuerySchemaContext): List<QuerySchemaDeclaration>

The declarations of context's model this source holds.

Link copied to clipboard

The profile of type's events: its events' stored names, its retired names and its events' revisions.