Files
inter-hub/Web/Controller/EnvelopeEmissionContracts.hs
Bernd Worsch 14779f0768 feat(P6/T02-T03): EnvelopeEmissionContract and InteractionReportingContract
T02: EnvelopeEmissionContractsController (index+show, read-only); widgetEnvelope
helper validates against contract v1.0 required attributes with inline warning
on missing view-context; adapterStatusBadge helper added to Application.Helper.View.

T03: InteractionReportingContractsController (index+show, read-only); API endpoint
POST /api/v1/interaction-events with bearer token auth against hub.api_key,
contract v1.0 field validation, and 201/422/401 responses.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-29 21:11:03 +00:00

22 lines
706 B
Haskell

module Web.Controller.EnvelopeEmissionContracts where
import Web.Types
import Web.View.EnvelopeEmissionContracts.Index
import Web.View.EnvelopeEmissionContracts.Show
import Generated.Types
import IHP.Prelude
import IHP.ControllerPrelude
instance Controller EnvelopeEmissionContractsController where
beforeAction = ensureIsUser
action EnvelopeEmissionContractsAction = do
contracts <- query @EnvelopeEmissionContract
|> orderByDesc #createdAt
|> fetch
render IndexView { contracts }
action ShowEnvelopeEmissionContractAction { envelopeEmissionContractId } = do
contract <- fetch envelopeEmissionContractId
render ShowView { contract }