Return programme snapshot from Events link-room API.
Deploy Ladill Events / deploy (push) Successful in 31s

Meet can persist the agenda locally when linking, even if the service-to-service Meet sync fails.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-04 22:25:12 +00:00
co-authored by Cursor
parent 422c7e01bf
commit 6cf069d630
3 changed files with 22 additions and 2 deletions
@@ -110,11 +110,14 @@ class EventMeetRoomLinkService
$event = $this->sync->sync($event->fresh(), $owner);
$linkedSession = collect($event->content()['virtual_sessions'] ?? [])
->first(fn ($session) => is_array($session) && (string) ($session['id'] ?? '') === $sessionId);
return array_merge($this->summarizeEvent($event), [
'entity_id' => $sessionId,
'meet_room_uuid' => $roomUuid,
'join_url' => $joinUrl,
]);
], $this->sync->programmePayloadForSession($event, is_array($linkedSession) ? $linkedSession : $sessions[$matchedIndex]));
}
/** @return array<string, mixed> */
@@ -137,6 +137,21 @@ class EventMeetSyncService
}
}
/**
* @param array<string, mixed> $session
* @return array{programme_snapshot: array<string, mixed>|null, linked_programme_items: list<array<string, mixed>>}
*/
public function programmePayloadForSession(QrCode $event, array $session): array
{
$programmeSnapshot = $this->programmeSnapshotFor($event);
$itemRefs = (array) ($session['programme_item_refs'] ?? []);
return [
'programme_snapshot' => $programmeSnapshot,
'linked_programme_items' => $this->programmes->itemsForRefs($programmeSnapshot, $itemRefs),
];
}
/** @return array<string, mixed>|null */
private function programmeSnapshotFor(QrCode $event): ?array
{
+3 -1
View File
@@ -149,7 +149,9 @@ class ServiceMeetLinkTest extends TestCase
'title' => 'Opening keynote',
])
->assertOk()
->assertJsonPath('event.meet_room_uuid', 'existing-room-uuid');
->assertJsonPath('event.meet_room_uuid', 'existing-room-uuid')
->assertJsonPath('event.programme_snapshot.title', 'Summit programme')
->assertJsonPath('event.programme_snapshot.days.0.items.0.title', 'Opening keynote');
Http::assertSent(function ($request) {
return $request->method() === 'PATCH'