def attach
import bendvy-ecs-core@0.1.0.4/ordinary_app_condition_schedule.bend as OrdinaryAppConditionScheduleimport Base
import bendvy-ecs-core@0.1.0.4/world.bend as W
import bendvy-ecs-core@0.1.0.4/ordinary_app_schema.bend as SchemaApp
import bendvy-ecs-core@0.1.0.4/ordinary_app_schedule.bend as Schedule
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_registration_fields.bend as Fields
import bendvy-ecs-core@0.1.0.4/ordinary_condition_declaration.bend as Condition
38# Materialize/structurally validate the closed condition Program, then
39# validate ordinary schedule attachment against existing registrations.
40# Invalid returns the original App owner; Attached retains App and entries.
41# No guard/system body or structural barrier executes while attaching.
42def attach(~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,Fields.Fields<S>>,~Ids:Data,~declaration:Condition.Program<S,C,R,E,Ids>,app:SchemaApp.Application<S,C,R,E,H,Rows,observe,fold>,name:String,ids:Ids) -> Schedule.Attachment<SchemaApp.Application<S,C,R,E,H,Rows,observe,fold>,Application<S,C,R,E,H,Rows,observe,fold,Ids,declaration>>:
43 prepared(~S,~C,~R,~E,~H,~Rows,~observe,~fold,~Ids,~declaration,app,name,Condition.materialize(~S,~C,~R,~E,~Ids,declaration,ids))
Uses (12)
Used by (0)
No other definition uses this definition.