fix(assistant): taking a proposal needs place rights, and a card's choices wait while a change runs

Plan this checks place_edit like the tour routes, the include choices of a
run or group stay disabled while the chat applies a change, and a follow-up
can say when it applies, so Confirm the pending bookings shows only when the
card holds a pending booking of this trip.
This commit is contained in:
Maurice
2026-10-22 22:46:35 +00:00
parent cf8cf9058d
commit 3eded5f5be
13 changed files with 195 additions and 39 deletions
@@ -150,10 +150,11 @@ describe('AssistantController', () => {
expect(() => controller.addFoundPlace(user, '5', 'x', body)).toThrow(DomainError);
});
it('ASTCTL-008: sharing needs the right to write in the trip chat; nothing else here asks for a right', () => {
it('ASTCTL-008: sharing asks for the trip chat right, "Plan this" for editing places; nothing else asks', () => {
const handlers = AssistantController.prototype as unknown as Record<string, object>;
expect(Reflect.getMetadata(TRIP_PERMISSION_KEY, handlers.share)).toBe('collab_edit');
for (const name of ['chat', 'decide', 'undo', 'addFoundPlace', 'takeProposal']) {
expect(Reflect.getMetadata(TRIP_PERMISSION_KEY, handlers.takeProposal)).toBe('place_edit');
for (const name of ['chat', 'decide', 'undo', 'addFoundPlace']) {
expect(Reflect.getMetadata(TRIP_PERMISSION_KEY, handlers[name]), name).toBeUndefined();
}
});