keiro-dsl-0.2.0.0: test/conformance-process-full/Generated/SurgeDemo/Hospital/EventStream.hs
-- @generated by keiro-dsl; do not edit. Regenerated from the .keiro spec.
module Generated.SurgeDemo.Hospital.EventStream (
hospitalCategory,
hospitalEventStream,
hospitalEventStreamDef,
HospitalEventStream,
HospitalEventStreamDef,
) where
import Generated.SurgeDemo.Hospital.Codec (hospitalCodec)
import Generated.SurgeDemo.Hospital.Domain
import Keiki.Core (HsPred)
import Keiro.EventStream (EventStream (..), SnapshotPolicy (..))
import Keiro.EventStream.Validate (ValidatedEventStream, mkEventStreamOrThrow)
import Keiro.Stream qualified as Stream
import SurgeDemo.Hospital.Holes (hospitalTransducer)
-- The validated aggregate stream category (hole-kind 5: referenced, never retyped).
-- Entity streams are '<category>-<id>' via Keiro.Stream.entityStream.
-- categoryUnsafe is safe here because this generated literal passed the DSL category proof.
hospitalCategory :: Stream.StreamCategory a
hospitalCategory = Stream.categoryUnsafe "hospital"
type HospitalEventStreamDef =
EventStream (HsPred HospitalRegs HospitalCommand) HospitalRegs HospitalVertex HospitalCommand HospitalEvent
type HospitalEventStream =
ValidatedEventStream (HsPred HospitalRegs HospitalCommand) HospitalRegs HospitalVertex HospitalCommand HospitalEvent
hospitalEventStreamDef :: HospitalEventStreamDef
hospitalEventStreamDef =
EventStream
{ transducer = hospitalTransducer
, initialState = HospitalIdle
, initialRegisters = initialHospitalRegs
, eventCodec = hospitalCodec
, resolveStreamName = Stream.streamName
, snapshotPolicy = Never
, stateCodec = Nothing
}
hospitalEventStream :: HospitalEventStream
hospitalEventStream =
mkEventStreamOrThrow "Hospital" hospitalEventStreamDef