keiro-dsl-0.10.0.0: test/conformance-process-full/Generated/SurgeDemo/Hospital/Projection.hs
-- @generated by keiro-dsl 0.9.0.0 (language keiro-dsl 4) from aggregate Hospital; do not edit.
module Generated.SurgeDemo.Hospital.Projection
( hospitalProjection
, hospitalStatusFor
) where
import Generated.SurgeDemo.Hospital.Domain
import SurgeDemo.Hospital.Holes (applyHospital)
import Data.Text (Text)
import Keiro.Projection (InlineProjection (..))
-- The deterministic event->status mapping (hole-kind 3, /mapping/), derived
-- from the spec's status-map. The read-model SQL that consumes it lives in
-- the hand-owned Holes module (a DB-coupled hole, delegated to codd).
-- WARNING: no readmodel node declares 'hospital'; unqualified SQL depends on search_path.
hospitalStatusFor :: HospitalEvent -> Maybe Text
hospitalStatusFor = \case
SurgeActivated {} -> Just "surging"
hospitalProjection :: InlineProjection HospitalEvent
hospitalProjection =
InlineProjection
{ name = "surge-demo-hospital-inline"
, apply = applyHospital
}