def validated

bendvy-ecs-core@0.1.0.4 · decode_requests.bend:43

import bendvy-ecs-core@0.1.0.4/decode_requests.bend as DecodeRequests
import Base
import bendvy-ecs-core@0.1.0.4/bundle_batch.bend as Batch
import bendvy-ecs-core@0.1.0.4/bundle_requests.bend as Commands
import bendvy-ecs-core@0.1.0.4/decode_data.bend as D
import bendvy-ecs-core@0.1.0.4/persistence_declaration.bend as Decl
import bendvy-ecs-core@0.1.0.4/ordinary_declaration.bend as Identity

43def validated(~S:Data,~C:Type,~R:Type,~E:Data,~P:Type,~identity:Identity.Declaration<S,P>,~project:P -> P & D.Raw,declaration:Decl.Constructed<S,P,identity,project>,batch:Batch.Batch<S,C,R,E,Packet<P>>,operation:Commands.Operation<S>,receipt:D.Receipt<P>) -> Owner<S,C,R,E,P,identity,project> & Output<S,P>:
44  match receipt:
45    case D.Receipt{owner,D.Rejected{error}}:(Owner{batch,declaration},Refused{Some{owner},Validation{error}})
46    case D.Receipt{owner,D.Accepted{canonical}}:enqueue(~S,~C,~R,~E,~P,~identity,~project,declaration,batch,operation,canonical,project(owner))

Uses (15)

Used by (1)