!7 srecord Line ( S type, // 'user, 'suggestion, 'bot, 'metaComment S text ) {} concept Interaction { new L lines; } sS lineToString(Line line) { ret lpad(10, firstToUpper(replaceCompleteValue(line.type, 'metaComment, 'comment))) + ": " + line.text; } module TrainedInteractions > DynCRUD { *() { super(Interaction); } // API void addInteraction(O interaction) { L lines = cast get(interaction, 'lines); cnew(Interaction, lines := map(lines, func(O line) -> Line { shallowCloneToClassWithFields(line, Line, 'type, 'text) })); infoBox("Interaction saved."); } }