fix: restore legacy gameplay messages and record details

This commit is contained in:
2026-08-04 13:30:51 +00:00
parent 8b8a285bc7
commit c4c4ee6e0f
12 changed files with 147 additions and 31 deletions
@@ -241,10 +241,10 @@ describe('in-game my information ownership', () => {
expect(fixture.db.logEntry.findMany).toHaveBeenNthCalledWith(
1,
expect.objectContaining({
where: { scope: 'SYSTEM', category: 'SUMMARY', id: { gte: 0 } },
where: { scope: 'SYSTEM', category: { in: ['SUMMARY', 'ACTION'] }, id: { gte: 0 } },
orderBy: { id: 'desc' },
take: 16,
select: { id: true, text: true },
select: { id: true, text: true, createdAt: true },
})
);
expect(fixture.db.logEntry.findMany).toHaveBeenNthCalledWith(
@@ -253,7 +253,7 @@ describe('in-game my information ownership', () => {
where: { scope: 'GENERAL', category: 'ACTION', generalId: 7, id: { gte: 0 } },
orderBy: { id: 'desc' },
take: 16,
select: { id: true, text: true },
select: { id: true, text: true, createdAt: true },
})
);
expect(fixture.db.logEntry.findMany).toHaveBeenNthCalledWith(
@@ -262,7 +262,7 @@ describe('in-game my information ownership', () => {
where: { scope: 'SYSTEM', category: 'HISTORY', id: { gte: 0 } },
orderBy: { id: 'desc' },
take: 16,
select: { id: true, text: true },
select: { id: true, text: true, createdAt: true },
})
);
});
+4 -4
View File
@@ -24,13 +24,13 @@ const auth: GameSessionTokenPayload = {
type LogQuery = {
where: {
scope: LogScope;
category: LogCategory;
category: LogCategory | { in: LogCategory[] };
generalId?: number;
id: { gte: number };
};
orderBy: { id: 'desc' };
take: number;
select: { id: true; text: true };
select: { id: true; text: true; createdAt: true };
};
const buildContext = (findMany: (query: LogQuery) => Promise<Array<{ id: number; text: string }>>) =>
@@ -56,7 +56,7 @@ describe('general.getRecentRecords', () => {
{ id: 20, text: '개인 cursor' },
];
}
if (query.where.category === LogCategory.SUMMARY) {
if (typeof query.where.category === 'object' && query.where.category.in.includes(LogCategory.SUMMARY)) {
return [
{ id: 32, text: '장수 최신' },
{ id: 20, text: '장수 cursor' },
@@ -89,7 +89,7 @@ describe('general.getRecentRecords', () => {
},
orderBy: { id: 'desc' },
take: 16,
select: { id: true, text: true },
select: { id: true, text: true, createdAt: true },
});
});
+12
View File
@@ -92,6 +92,7 @@ const buildContext = (options: {
voteRows?: Array<{ selection: number[]; cnt: number }>;
pollRow?: typeof poll;
configConst?: Record<string, unknown>;
metaDevelCost?: number;
auctionTargets?: string[];
}) => {
const auth = options.auth === undefined ? buildAuth() : options.auth;
@@ -136,6 +137,7 @@ const buildContext = (options: {
tickSeconds: 3600,
config: { const: { develCost: 18, allItems: {}, ...(options.configConst ?? {}) } },
meta: {
...(options.metaDevelCost === undefined ? {} : { develcost: options.metaDevelCost }),
hiddenSeed: 'seed',
scenarioId: 200,
initYear: 180,
@@ -216,6 +218,16 @@ describe('vote router actor and permission boundaries', () => {
);
});
it('uses the current world develcost for the legacy five-times survey reward', async () => {
const fixture = buildContext({ metaDevelCost: 30, configConst: { develCost: 0 } });
await expect(appRouter.createCaller(fixture.context).vote.getVoteList()).resolves.toMatchObject({
voteReward: 150,
});
await appRouter.createCaller(fixture.context).vote.submitVote({ voteId: 1, selection: [0] });
expect(fixture.requestCommand).toHaveBeenCalledWith(expect.objectContaining({ goldReward: 150 }));
});
it('includes active unique auctions in the API-side reward expectation', async () => {
const fixture = buildContext({
configConst: {