feat: 정지·종료 기수의 장수 참여를 허용하고 확정 기록 보호

This commit is contained in:
2026-09-06 13:39:30 +00:00
parent 4d64978cb6
commit b14d8d52f6
19 changed files with 458 additions and 22 deletions
@@ -464,6 +464,19 @@ integration('unification finalization transaction', () => {
expect(await db.message.count({ where: { mailbox: fixtureId } })).toBe(0);
expect(world.peekDirtyState().pendingUnificationFinalizations).toHaveLength(0);
const assertLateInheritanceIgnored = async () => {
const beforePoints = await db.inheritancePoint.findMany({ where: { userId }, orderBy: { id: 'asc' } });
const beforeLogs = await db.inheritanceLog.count({ where: { userId } });
world.queueInheritancePointAdjustment(userId, 'previous', 999999);
world.queueInheritancePointAdjustment(userId, 'tournament', 100);
world.queueInheritanceLog({ userId, year: 190, month: 7, text: '확정 후 보상은 기록하지 않음' });
await hooks.hooks.flushChanges?.(runResult);
expect(await db.inheritancePoint.findMany({ where: { userId }, orderBy: { id: 'asc' } })).toEqual(
beforePoints
);
expect(await db.inheritanceLog.count({ where: { userId } })).toBe(beforeLogs);
};
await db.gameHistory.create({
data: {
serverId,
@@ -597,6 +610,7 @@ integration('unification finalization transaction', () => {
},
});
expect(yearbook.globalHistory).toEqual(expect.arrayContaining([expect.stringContaining('【통일】')]));
await assertLateInheritanceIgnored();
expect(world.peekDirtyState().pendingUnificationFinalizations).toHaveLength(0);
await hooks.hooks.flushChanges?.(runResult);
@@ -772,6 +786,8 @@ integration('unification finalization transaction', () => {
await db.clockProjectionOutbox.findFirstOrThrow({ where: { suspensionId: suspension.id } })
).toMatchObject({ status: 'PENDING', targetRevision: 2n });
await assertLateInheritanceIgnored();
if (process.env.REDIS_URL) {
const redis = createRedisConnector({ url: process.env.REDIS_URL });
await redis.connect();