packages feed

keiro-dsl-0.18.0.0: test/conformance-structural-text-sets/Generated/StructuralTextSets/LabelStore/Domain.hs

{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE TemplateHaskell #-}
-- @generated by keiro-dsl 0.18.0.0 (language keiro-dsl 6) from aggregate LabelStore; do not edit.
module Generated.StructuralTextSets.LabelStore.Domain where

import Data.Aeson (FromJSON, ToJSON)
import Data.Proxy (Proxy (..))
import GHC.Generics (Generic)
import Keiki.Core (RegFile (..))
import Keiki.Shape (CanonicalStateShape, CanonicalTypeName)
import Conformance.StructuralTextSets.Bindings qualified as Bindings
import Conformance.StructuralTextSets.Domain (LabelEnvelope, MaybeTextLabels, TextLabels)
import Keiki.Generics.TH (deriveAggregateCtorsAll, deriveWireCtorsAll)

data LabelStoreVertex = LabelStoreEmpty | LabelStoreStored
  deriving stock (Generic, Eq, Ord, Show, Enum, Bounded)
  deriving anyclass (ToJSON, FromJSON)
instance CanonicalStateShape LabelStoreVertex
instance CanonicalTypeName LabelStoreVertex

data StoreLabelsData = StoreLabelsData
  { labels :: !TextLabels
  , optionalLabels :: !MaybeTextLabels
  , envelope :: !LabelEnvelope
  }
  deriving stock (Generic, Eq, Show)

data ImportLegacyLabelsData = ImportLegacyLabelsData
  { labels :: !TextLabels
  , optionalLabels :: !MaybeTextLabels
  , envelope :: !LabelEnvelope
  }
  deriving stock (Generic, Eq, Show)

data LabelStoreCommand = StoreLabels !StoreLabelsData
  | ImportLegacyLabels !ImportLegacyLabelsData
  deriving stock (Generic, Eq, Show)

data LabelsStoredData = LabelsStoredData
  { labels :: !TextLabels
  , optionalLabels :: !MaybeTextLabels
  , envelope :: !LabelEnvelope
  }
  deriving stock (Generic, Eq, Show)

data LabelsAuditedData = LabelsAuditedData
  { labels :: !TextLabels
  , optionalLabels :: !MaybeTextLabels
  , envelope :: !LabelEnvelope
  }
  deriving stock (Generic, Eq, Show)

data LegacyLabelsImportedData = LegacyLabelsImportedData
  { labels :: !TextLabels
  , optionalLabels :: !MaybeTextLabels
  , envelope :: !LabelEnvelope
  }
  deriving stock (Generic, Eq, Show)

data LabelStoreEvent = LabelsStored !LabelsStoredData
  | LabelsAudited !LabelsAuditedData
  | LegacyLabelsImported !LegacyLabelsImportedData
  deriving stock (Generic, Eq, Show)

type LabelStoreRegs =
  '[ '("current", TextLabels)
   ]

initialLabelStoreRegs :: RegFile LabelStoreRegs
initialLabelStoreRegs =
  RCons (Proxy @"current") Bindings.initialTextLabels RNil

$(deriveAggregateCtorsAll ''LabelStoreCommand ''LabelStoreRegs)



$(deriveWireCtorsAll ''LabelStoreEvent)