generated from coulomb/repo-seed
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>
This commit is contained in:
21
Web/Controller/InteractionReportingContracts.hs
Normal file
21
Web/Controller/InteractionReportingContracts.hs
Normal file
@@ -0,0 +1,21 @@
|
||||
module Web.Controller.InteractionReportingContracts where
|
||||
|
||||
import Web.Types
|
||||
import Web.View.InteractionReportingContracts.Index
|
||||
import Web.View.InteractionReportingContracts.Show
|
||||
import Generated.Types
|
||||
import IHP.Prelude
|
||||
import IHP.ControllerPrelude
|
||||
|
||||
instance Controller InteractionReportingContractsController where
|
||||
beforeAction = ensureIsUser
|
||||
|
||||
action InteractionReportingContractsAction = do
|
||||
contracts <- query @InteractionReportingContract
|
||||
|> orderByDesc #createdAt
|
||||
|> fetch
|
||||
render IndexView { contracts }
|
||||
|
||||
action ShowInteractionReportingContractAction { interactionReportingContractId } = do
|
||||
contract <- fetch interactionReportingContractId
|
||||
render ShowView { contract }
|
||||
Reference in New Issue
Block a user