fix(dynasty): normalize archived nation records

This commit is contained in:
2026-07-31 15:28:04 +00:00
parent 6e8f048876
commit 8a17412fcd
9 changed files with 266 additions and 56 deletions
@@ -330,6 +330,26 @@ integration('unification finalization transaction', () => {
expect(await db.inheritanceResult.count({ where: { serverId } })).toBe(1);
expect(await db.oldGeneral.count({ where: { serverId } })).toBe(1);
expect(await db.oldNation.count({ where: { serverId } })).toBe(2);
expect(
(
await db.oldNation.findUniqueOrThrow({
where: {
serverId_nation_sourceId: { serverId, nation: fixtureId, sourceId: 0 },
},
})
).data
).toMatchObject({
nation: fixtureId,
name: '원자통일국',
type: 'che_중립',
typeCode: 'che_중립',
tech: 123,
maxPower: 3_500,
maxCrew: 400,
maxCities: ['원자도시'],
aux: { maxPower: 3_500, maxCrew: 400, maxCities: ['원자도시'] },
generals: [fixtureId],
});
expect(await db.emperor.count({ where: { serverId } })).toBe(1);
expect(
(await db.inheritancePoint.findUniqueOrThrow({ where: { userId_key: { userId, key: 'previous' } } }))