Behaviour for a host-application module that supplies fixture data.
A host implements scenarios/0 and example_events/0; StatifierUI.Fixtures.from_source/1
calls both and routes the results through the same validation new/1 applies
to a JSON sidecar, so the two delivery paths in ADR-0003 converge on one
struct. datasets/0 and expressions/0 are optional (ADR-0006): a host
with no expressions to evaluate need not implement either.
use StatifierUI.Fixtures.Source injects empty defaults for all four
callbacks, so a host that only has scenarios (or only events, or only
datasets, or only expressions) can implement just the one it has.
Summary
Types
A named example datamodel for evaluating expressions, as datasets/0 returns it.
A named example event payload, as example_events/0 returns it.
A named free-standing expression fixture, as expressions/0 returns it.
A named example datamodel, as scenarios/0 returns it.
Callbacks
Named example datamodels for evaluating expressions against (ADR-0006): a dataset name mapped to a situation, which may be as small as an expression needs.
Example event payloads: an event name mapped to a sample _event.data
value.
Named free-standing expression fixtures (ADR-0006): an expression name
mapped to a predicator "source" string and an optional "expect" map of
expected results keyed by dataset name.
Named example datamodels: a scenario name mapped to a complete example datamodel for that situation.
Types
A named example datamodel for evaluating expressions, as datasets/0 returns it.
A named example event payload, as example_events/0 returns it.
A named free-standing expression fixture, as expressions/0 returns it.
A named example datamodel, as scenarios/0 returns it.
Callbacks
@callback datasets() :: datasets()
Named example datamodels for evaluating expressions against (ADR-0006): a dataset name mapped to a situation, which may be as small as an expression needs.
@callback example_events() :: example_events()
Example event payloads: an event name mapped to a sample _event.data
value.
@callback expressions() :: expressions()
Named free-standing expression fixtures (ADR-0006): an expression name
mapped to a predicator "source" string and an optional "expect" map of
expected results keyed by dataset name.
@callback scenarios() :: scenarios()
Named example datamodels: a scenario name mapped to a complete example datamodel for that situation.