cd /Users/marcus.hinz/projects/adesso-cpq
echo "=== buildCreateEvent Signatur + GroupCreateEvent-Struktur ==="
grep -nE 'buildCreateEvent|GroupCreateEvent|type: "group-create"|rootHandleId|groupId:' packages/frontend/src/configurator/model/GroupProcessor.ts | head
sed -n "$(grep -n 'buildCreateEvent' packages/frontend/src/configurator/model/GroupProcessor.ts | head -1 | cut -d: -f1),+15p" packages/frontend/src/configurator/model/GroupProcessor.ts

Read buildCreateEvent structure


=== buildCreateEvent Signatur + GroupCreateEvent-Struktur ===
52:export interface GroupCreateEvent {
53:    type: "group-create";
55:    groupId: string;
57:    rootHandleId: string; // the element root among `handles`
78:    groupId: string;
91:    newGroups: Array<{ members: string[]; edges: Edge[]; groupId: string; groupKey: string; transform: Transform }>;
100:    newGroups: Array<{ members: string[]; edges: Edge[]; groupId: string; groupKey: string; transform: Transform }>;
104:    | GroupCreateEvent
133:    buildCreateEvent(productScene: Scene, position: Vec3): GroupCreateEvent {
134:        const { handles, rootHandleId } = this.reidentify(productScene);
    buildCreateEvent(productScene: Scene, position: Vec3): GroupCreateEvent {
        const { handles, rootHandleId } = this.reidentify(productScene);
        return {
            type: "group-create",
            timestamp: Date.now(),
            groupId: this.nextId("g"),
            groupKey: this.nextId("gk"),
            rootHandleId,
            handles,
            position,
            rotation: IDENTITY_QUAT,
        };
    }

    private reidentify(productScene: Scene): { handles: Handle[]; rootHandleId: string } {
        const src = structuredClone(productScene);