def insert
import bendvy-ecs-core@0.1.0.4/ordinary_app_schedules.bend as OrdinaryAppSchedulesimport Base
import bendvy-ecs-core@0.1.0.4/ordinary_app_registration_fields.bend as Records
import bendvy-ecs-core@0.1.0.4/ordinary_app_observation_data.bend as DTO
import bendvy-ecs-core@0.1.0.4/ordinary_app_schedule.bend as Single
import bendvy-ecs-core@0.1.0.4/world.bend as W
import bendvy-ecs-core@0.1.0.4/schedule_provision.bend as SP
82# Validate plan attachment against the actual World registration catalog. Valid
83# replacement retains the label's position; a new label appends. Return previous
84# plan on success; invalid attachment leaves named plans unchanged. Does not run
85# the plan, reset Local/capture owners or accept duplicate/unknown system ids.
86# See test-fixtures/public-schedules/named-app-v1/matched-feature-v1/main.bend.
87def insert(~S:Data,~C:Type,~R:Type,~E:Data,~H:Type,~Rows:Data,~observe:W.World<S,C,R,E> -> W.World<S,C,R,E> & DTO.Observation<Rows>,~fold:H -> H & List<&2,Records.Fields<S>>,value:Application<S,C,R,E,H,Rows,observe,fold>,+label:String,+plan:SP.Plan<S>) -> Insertion<Application<S,C,R,E,H,Rows,observe,fold>,S>:
88 match value:
89 case Application{app,plans}:inserted(~S,~C,~R,~E,~H,~Rows,~observe,~fold,plans,label,plan,Single.attach(~S,~C,~R,~E,~H,~Rows,~observe,~fold,app,label,plan))
Uses (11)
Used by (0)
No other definition uses this definition.