DomainModel

edomata.core.DomainModel

A purely functional, event driven domain model

Type parameters

Event

domain events

Rejection

domain error type

State

state model of your program, a.k.a aggregate root

Attributes

Source
Model.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object TestDomain.type
Self type
DomainModel[State, Event, Rejection]

Members list

Type members

Classlikes

trait Service[C, N]

Attributes

Source
Model.scala
Supertypes
class Object
trait Matchable
class Any

Value members

Abstract methods

def initial: State

Initial or empty value for this domain model

Initial or empty value for this domain model

for any aggregate, it is either created and have a history, or is in initial state

Attributes

Source
Model.scala
def transition: Event => State => ValidatedNec[Rejection, State]

A function that defines how this model transitions in response to events; it is like an event handler, but is pure.

A function that defines how this model transitions in response to events; it is like an event handler, but is pure.

An event that can't be applied results in a rejection or conflict, based on whether it is read from journal or applied for decision

Attributes

Source
Model.scala

Givens

Givens

given given_ModelTC_State_Event_Rejection: ModelTC[State, Event, Rejection]

Attributes

Source
Model.scala