generated from coulomb/repo-seed
feat(T02-T11): IHF Phase 1 schema, controllers, views, and helpers
- Schema: hubs, widgets, widget_versions, interaction_events (append-only trigger), annotations, users — single migration file - Web layer: Types, Routes, FrontController with auth + AutoRefresh layout - Controllers: Hubs (CRUD), Widgets (CRUD + versioning), InteractionEvents (JSON capture, canonical event_type validation), Annotations (threaded, append-only) - Sessions controller for IHP auth - Views: Hubs (index/show/new/edit), Widgets (index/show/new/edit), Annotations (index/new), Sessions (login) - widgetEnvelope helper with full data-* governance attributes - Integration tests: Hub CRUD, Widget versioning, event capture, append-only guard, annotation threading, validation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
51
Web/Types.hs
Normal file
51
Web/Types.hs
Normal file
@@ -0,0 +1,51 @@
|
||||
module Web.Types where
|
||||
|
||||
import IHP.Prelude
|
||||
import IHP.ModelSupport
|
||||
import IHP.LoginSupport.Types
|
||||
import Generated.Types
|
||||
|
||||
-- | Authentication type alias
|
||||
type CurrentUserRecord = User
|
||||
|
||||
instance HasNewSessionUrl User where
|
||||
newSessionUrl _ = "/NewSession"
|
||||
|
||||
-- Controllers
|
||||
|
||||
data WebApplication = WebApplication deriving (Eq, Show)
|
||||
|
||||
data HubsController
|
||||
= HubsAction
|
||||
| NewHubAction
|
||||
| ShowHubAction { hubId :: !(Id Hub) }
|
||||
| CreateHubAction
|
||||
| EditHubAction { hubId :: !(Id Hub) }
|
||||
| UpdateHubAction { hubId :: !(Id Hub) }
|
||||
| DeleteHubAction { hubId :: !(Id Hub) }
|
||||
deriving (Eq, Show, Data)
|
||||
|
||||
data WidgetsController
|
||||
= WidgetsAction
|
||||
| NewWidgetAction
|
||||
| ShowWidgetAction { widgetId :: !(Id Widget) }
|
||||
| CreateWidgetAction
|
||||
| EditWidgetAction { widgetId :: !(Id Widget) }
|
||||
| UpdateWidgetAction { widgetId :: !(Id Widget) }
|
||||
deriving (Eq, Show, Data)
|
||||
|
||||
data InteractionEventsController
|
||||
= CreateInteractionEventAction { widgetId :: !(Id Widget) }
|
||||
deriving (Eq, Show, Data)
|
||||
|
||||
data AnnotationsController
|
||||
= WidgetAnnotationsAction { widgetId :: !(Id Widget) }
|
||||
| NewAnnotationAction { widgetId :: !(Id Widget) }
|
||||
| CreateAnnotationAction { widgetId :: !(Id Widget) }
|
||||
deriving (Eq, Show, Data)
|
||||
|
||||
data SessionsController
|
||||
= NewSessionAction
|
||||
| CreateSessionAction
|
||||
| DeleteSessionAction
|
||||
deriving (Eq, Show, Data)
|
||||
Reference in New Issue
Block a user