fix(scheduling-webui): submit participant revisions

This commit is contained in:
2026-07-22 03:40:10 +02:00
parent 448546e487
commit 27fa24cf4d
4 changed files with 13 additions and 3 deletions

View File

@@ -27,6 +27,7 @@ export type SchedulingCandidateSlot = {
export type SchedulingParticipant = { export type SchedulingParticipant = {
id: string; id: string;
revision?: string | null;
is_current_participant: boolean; is_current_participant: boolean;
respondent_id?: string | null; respondent_id?: string | null;
display_name?: string | null; display_name?: string | null;
@@ -168,6 +169,7 @@ export type SchedulingCandidateSlotReconcilePayload = SchedulingCandidateSlotPay
export type SchedulingParticipantReconcilePayload = SchedulingParticipantPayload & { export type SchedulingParticipantReconcilePayload = SchedulingParticipantPayload & {
id?: string; id?: string;
revision?: string;
}; };
export type SchedulingCandidateSlotUpdatePayload = { export type SchedulingCandidateSlotUpdatePayload = {

View File

@@ -1696,7 +1696,9 @@ function notificationKindLabel(kind: string): string {
invitation: "i18n:govoplan-scheduling.invitation.6306ef74", invitation: "i18n:govoplan-scheduling.invitation.6306ef74",
reminder: "i18n:govoplan-scheduling.reminder.b87a1929", reminder: "i18n:govoplan-scheduling.reminder.b87a1929",
decision: "i18n:govoplan-scheduling.decision.7f59a1f1", decision: "i18n:govoplan-scheduling.decision.7f59a1f1",
cancellation: "i18n:govoplan-scheduling.cancellation.319aaae4" cancellation: "i18n:govoplan-scheduling.cancellation.319aaae4",
participant_removed: "i18n:govoplan-scheduling.participant_removed.0cf4ec4c",
participant_replaced: "i18n:govoplan-scheduling.participant_replaced.2623752d"
} as Record<string, string>)[kind] ?? kind; } as Record<string, string>)[kind] ?? kind;
} }

View File

@@ -11,6 +11,7 @@ const DIRECTORY_SELECTION_METADATA_KEY = "directory_selection";
export type SchedulingParticipantDraft = PeoplePickerItem & { export type SchedulingParticipantDraft = PeoplePickerItem & {
draftId: string; draftId: string;
sourceId?: string; sourceId?: string;
revision?: string;
respondent_id?: string | null; respondent_id?: string | null;
display_name: string; display_name: string;
email: string; email: string;
@@ -95,6 +96,7 @@ export function participantDraftFromResponse(
source_revision: selection?.source_revision ?? null, source_revision: selection?.source_revision ?? null,
draftId, draftId,
sourceId: participant.id, sourceId: participant.id,
revision: participant.revision ?? undefined,
respondent_id: participant.respondent_id, respondent_id: participant.respondent_id,
participant_type: normalizedParticipantType(participant.participant_type), participant_type: normalizedParticipantType(participant.participant_type),
required: participant.required ?? true, required: participant.required ?? true,
@@ -129,9 +131,11 @@ export function participantDraftsFromPicker(
export function participantPayload( export function participantPayload(
participant: SchedulingParticipantDraft participant: SchedulingParticipantDraft
): SchedulingParticipantPayload & { id?: string } { ): SchedulingParticipantPayload & { id?: string; revision?: string } {
return { return {
...(participant.sourceId ? { id: participant.sourceId } : {}), ...(participant.sourceId
? { id: participant.sourceId, revision: participant.revision }
: {}),
respondent_id: participant.respondent_id ?? null, respondent_id: participant.respondent_id ?? null,
display_name: participant.display_name.trim() || null, display_name: participant.display_name.trim() || null,
email: participant.email.trim() || null, email: participant.email.trim() || null,

View File

@@ -70,6 +70,7 @@ test("maps visible account and contact selections into bounded scheduling partic
test("reconstructs saved directory selections and preserves existing reconciliation identity", () => { test("reconstructs saved directory selections and preserves existing reconciliation identity", () => {
const responseParticipant = { const responseParticipant = {
id: "stored-participant", id: "stored-participant",
revision: "a".repeat(64),
is_current_participant: false, is_current_participant: false,
respondent_id: "account-2", respondent_id: "account-2",
display_name: "Ada Account", display_name: "Ada Account",
@@ -95,6 +96,7 @@ test("reconstructs saved directory selections and preserves existing reconciliat
assert.equal(draft.sourceId, "stored-participant"); assert.equal(draft.sourceId, "stored-participant");
assert.equal(draft.identityLocked, true); assert.equal(draft.identityLocked, true);
assert.equal(participantPayload(draft).id, "stored-participant"); assert.equal(participantPayload(draft).id, "stored-participant");
assert.equal(participantPayload(draft).revision, "a".repeat(64));
}); });
const now = new Date("2026-07-20T10:00:00Z"); const now = new Date("2026-07-20T10:00:00Z");