Accepts an exeption and return equivalent failure. A reusable model to make
your repository functions doesn't need to keep testing exception handling.
Just mock it and off you go.
Convert to snapshot is a mockable function which used to generate
Snapshot from data. Used in utility repos such as
CornerstonePersistentRepositoryMixin.
Base snapshot abstract with several convenience properties.
Don't forget to add timestamp in your implementation's props.
On the other hand, don't add clock.
Use case contains the app's business logic / rules, e.g. validations.
It should be independent from any other non-business logic-related
functionalities.
An exception to encapsulate other exceptions from data source layer or below
to make repository layer even more decoupled. The fields of this class is
identical to Failure for easier conversion in the repository.