packages feed

keiro-dsl-0.4.0.1: test/conformance-structural/Generated/StructuralConformance/ArtifactCatalog/EventStream.hs

-- @generated by keiro-dsl; do not edit. Regenerated from the .keiro spec.
module Generated.StructuralConformance.ArtifactCatalog.EventStream (
    artifactCatalogCategory,
    artifactCatalogEventStream,
    artifactCatalogEventStreamDef,
    ArtifactCatalogEventStream,
    ArtifactCatalogEventStreamDef,
) where

import Generated.StructuralConformance.ArtifactCatalog.Codec (artifactCatalogCodec)
import Generated.StructuralConformance.ArtifactCatalog.Domain
import Keiki.Core (HsPred)
import Keiro.EventStream (EventStream (..), SnapshotPolicy (..))
import Keiro.EventStream.Validate (ValidatedEventStream, mkEventStreamOrThrow)
import Keiro.Stream qualified as Stream
import StructuralConformance.ArtifactCatalog.Holes (artifactCatalogTransducer)

-- 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.
artifactCatalogCategory :: Stream.StreamCategory a
artifactCatalogCategory = Stream.categoryUnsafe "artifactCatalog"

type ArtifactCatalogEventStreamDef =
    EventStream (HsPred ArtifactCatalogRegs ArtifactCatalogCommand) ArtifactCatalogRegs ArtifactCatalogVertex ArtifactCatalogCommand ArtifactCatalogEvent

type ArtifactCatalogEventStream =
    ValidatedEventStream (HsPred ArtifactCatalogRegs ArtifactCatalogCommand) ArtifactCatalogRegs ArtifactCatalogVertex ArtifactCatalogCommand ArtifactCatalogEvent

artifactCatalogEventStreamDef :: ArtifactCatalogEventStreamDef
artifactCatalogEventStreamDef =
    EventStream
        { transducer = artifactCatalogTransducer
        , initialState = ArtifactCatalogEmpty
        , initialRegisters = initialArtifactCatalogRegs
        , eventCodec = artifactCatalogCodec
        , resolveStreamName = Stream.streamName
        , snapshotPolicy = Never
        , stateCodec = Nothing
        }

artifactCatalogEventStream :: ArtifactCatalogEventStream
artifactCatalogEventStream =
    mkEventStreamOrThrow "ArtifactCatalog" artifactCatalogEventStreamDef