feat: 플레이 감사 장수 로그를 기수별로 조회

This commit is contained in:
2026-09-16 04:03:14 +00:00
parent 69a61b317c
commit 31c5927449
20 changed files with 437 additions and 21 deletions
@@ -18,7 +18,12 @@ const cityIds = [991_201, 991_202, 991_203, 991_204, 991_205, 991_206, 991_207];
const nationId = 991_201;
const yearbookProfile = 'monthly-boundary-pre-persistence';
const yearbookServerId = 'monthly-boundary-generation-20260731';
const archivedLogTexts = ['월경계 과거 정세', '월경계 과거 장수 동향', '월경계 과거 호환 행동'];
const archivedLogTexts = [
'월경계 과거 정세',
'월경계 과거 장수 동향',
'월경계 과거 호환 행동',
'월경계 감사 기수 로그',
];
integration('monthly pre-update persistence', () => {
let db: GamePrismaClient;
@@ -197,6 +202,12 @@ integration('monthly pre-update persistence', () => {
const hooks = await createDatabaseTurnHooks(databaseUrl!, world, { profileName: yearbookProfile });
try {
await world.advanceMonth(new Date('0201-01-01T00:00:00.000Z'));
world.pushLog({
scope: LogScope.GENERAL,
category: LogCategory.ACTION,
generalId: generalIds[0],
text: archivedLogTexts[3]!,
});
await hooks.hooks.flushChanges?.({
lastTurnTime: '0201-01-01T00:00:00.000Z',
processedGenerals: 0,
@@ -205,6 +216,12 @@ integration('monthly pre-update persistence', () => {
partial: false,
});
expect(await db.logEntry.findFirst({ where: { text: archivedLogTexts[3] } })).toMatchObject({
serverId: yearbookServerId,
});
expect(await db.logEntry.findFirst({ where: { text: archivedLogTexts[0] } })).toMatchObject({
serverId: null,
});
expect(
await db.generalAccessLog.findMany({
where: { generalId: { in: generalIds } },
@@ -214,7 +214,7 @@ integration('monthly nation betting persistence', () => {
currentMonth: 12,
tickSeconds: 600,
config: {},
meta: { lastBettingId: bettingId - 1 },
meta: { lastBettingId: bettingId - 1, serverId: 'audit-betting-fixture' },
},
});
const state: TurnWorldState = {
@@ -223,7 +223,7 @@ integration('monthly nation betting persistence', () => {
currentMonth: 12,
tickSeconds: 600,
lastTurnTime: new Date('2026-07-25T00:00:00.000Z'),
meta: { lastBettingId: bettingId - 1 },
meta: { lastBettingId: bettingId - 1, serverId: 'audit-betting-fixture' },
};
const scenarioConfig: TurnWorldSnapshot['scenarioConfig'] = {
stat: { total: 300, min: 10, max: 100, npcTotal: 150, npcMax: 75, npcMin: 10, chiefMin: 70 },
@@ -356,6 +356,7 @@ integration('monthly nation betting persistence', () => {
where: { text: { contains: '천통국 예상 내기의 결과' } },
})
).toMatchObject({
serverId: 'audit-betting-fixture',
year: 200,
month: 2,
text: '<C>●</>200년 2월:<B><b>【내기】</b></> 200년 1월에 열렸던 천통국 예상 내기의 결과가 나왔습니다!',