feat: 직접 writer를 내구성 변화 저널에 연결

86개 API mutation을 분류하고 메시지 mailbox, 베팅, 국가 설정, 예약 명령의 revision/outbox 표식을 소유 transaction에 연결한다. 공개 SSE는 식별자 없는 invalidation만 노출한다.
This commit is contained in:
2026-08-16 18:38:08 +00:00
parent e4ac2a60b1
commit dd4645e4d0
22 changed files with 485 additions and 55 deletions
+4
View File
@@ -346,6 +346,7 @@ export const turnsRouter = router({
const snapshot = await mutateReservedTurns(() =>
setGeneralTurn(ctx.db, input.generalId, input.turnIndex, input.action, args, input.expectedRevision)
);
ctx.changeJournal?.mark('reserved.general', input.generalId);
return { ok: true, ...snapshot };
}),
shiftGeneral: authedProcedure
@@ -362,6 +363,7 @@ export const turnsRouter = router({
const snapshot = await mutateReservedTurns(() =>
shiftGeneralTurns(ctx.db, input.generalId, input.amount, input.expectedRevision)
);
ctx.changeJournal?.mark('reserved.general', input.generalId);
return { ok: true, ...snapshot };
}),
repeatGeneral: authedProcedure
@@ -377,6 +379,7 @@ export const turnsRouter = router({
const snapshot = await mutateReservedTurns(() =>
repeatGeneralTurns(ctx.db, input.generalId, input.amount, input.expectedRevision)
);
ctx.changeJournal?.mark('reserved.general', input.generalId);
return { ok: true, ...snapshot };
}),
setGeneralBulk: authedProcedure
@@ -403,6 +406,7 @@ export const turnsRouter = router({
const snapshot = await mutateReservedTurns(() =>
setGeneralTurns(ctx.db, input.generalId, updates, input.expectedRevision)
);
ctx.changeJournal?.mark('reserved.general', input.generalId);
return { ok: true, ...snapshot };
}),
setNation: authedProcedure