From 6b4e4e490c9f5f2fb42812e39bdb0c00b38372b1 Mon Sep 17 00:00:00 2001 From: hided62 Date: Fri, 21 Aug 2026 17:11:40 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=82=B4=EC=A0=95=EB=B3=B4=EC=99=80=20?= =?UTF-8?q?=EA=B0=90=EC=B0=B0=EB=B6=80=EC=97=90=20=EA=B0=9C=EC=9D=B8=20?= =?UTF-8?q?=EB=B4=89=EA=B8=89=EC=9D=84=20=ED=91=9C=EC=8B=9C=ED=95=9C?= =?UTF-8?q?=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 공헌 등급에서 계산한 개인 봉급을 두 read model에 투영하고 공통 요약 첫 행에 배치한다. 전투·계략·사관 행과 봉급 snapshot이 없는 과거 플레이의 빈 slot은 유지한다. --- app/game-api/src/router/general/index.ts | 3 ++- .../src/router/nation/endpoints/getBattleCenter.ts | 3 ++- app/game-api/test/inGameMenuPermissions.test.ts | 3 +++ app/game-frontend/e2e/inGameMenus.spec.ts | 9 +++++++-- .../src/components/main/GeneralBattleSummary.vue | 10 ++++++++-- app/game-frontend/src/views/BattleCenterView.vue | 1 + app/game-frontend/src/views/MyPageView.vue | 1 + 7 files changed, 24 insertions(+), 6 deletions(-) diff --git a/app/game-api/src/router/general/index.ts b/app/game-api/src/router/general/index.ts index 29f39cbb..b07c1550 100644 --- a/app/game-api/src/router/general/index.ts +++ b/app/game-api/src/router/general/index.ts @@ -1,7 +1,7 @@ import { TRPCError } from '@trpc/server'; import { z } from 'zod'; -import { LogCategory, LogScope } from '@sammo-ts/logic'; +import { getBillByLevel, LogCategory, LogScope } from '@sammo-ts/logic'; import { asRecord, type RankDataType } from '@sammo-ts/common'; import type { GameApiContext } from '../../context.js'; @@ -517,6 +517,7 @@ export const getGeneralContext = async (ctx: GameApiContext) => { injury: general.injury, experience: general.experience, dedication: general.dedication, + bill: getBillByLevel(dedicationLevel), age: general.age, retirementYear, turnTime: general.turnTime.toISOString(), diff --git a/app/game-api/src/router/nation/endpoints/getBattleCenter.ts b/app/game-api/src/router/nation/endpoints/getBattleCenter.ts index 0601df8a..502adbca 100644 --- a/app/game-api/src/router/nation/endpoints/getBattleCenter.ts +++ b/app/game-api/src/router/nation/endpoints/getBattleCenter.ts @@ -1,7 +1,7 @@ import { TRPCError } from '@trpc/server'; import { asRecord, type RankDataType } from '@sammo-ts/common'; -import { LogCategory } from '@sammo-ts/logic'; +import { getBillByLevel, LogCategory } from '@sammo-ts/logic'; import { accessAuthedProcedure } from '../../../trpc.js'; import { @@ -201,6 +201,7 @@ export const getBattleCenter = accessAuthedProcedure.query(async ({ ctx }) => { }, experience: general.experience, dedication: general.dedication, + bill: getBillByLevel(dedicationLevel), injury: general.injury, gold: general.gold, rice: general.rice, diff --git a/app/game-api/test/inGameMenuPermissions.test.ts b/app/game-api/test/inGameMenuPermissions.test.ts index 4ed4e01f..9cd5752f 100644 --- a/app/game-api/test/inGameMenuPermissions.test.ts +++ b/app/game-api/test/inGameMenuPermissions.test.ts @@ -297,6 +297,7 @@ describe('in-game my information ownership', () => { statUpgradeLimit: 20, dex: [350, 1_375, 3_500, 7_125, 12_650], }, + bill: 1_000, }, city: { population: 322_886, @@ -433,6 +434,7 @@ describe('in-game my information ownership', () => { stats: { attack: 100, defence: 150, speed: 7, avoid: 10, magicCoef: 0, cost: 9, rice: 9 }, }, progression: { experienceLevel: 4, dedicationLevel: 2, dedicationText: '29품관' }, + bill: 800, itemNames: { horse: '노새(+3)' }, itemInfo: { horse: '통솔 +3' }, }, @@ -855,6 +857,7 @@ describe('battle-center general and user permissions', () => { statUpgradeLimit: 20, dex: [0, 0, 0, 0, 0], }, + bill: 600, serviceYears: 3, battleStats: { kills: 5, diff --git a/app/game-frontend/e2e/inGameMenus.spec.ts b/app/game-frontend/e2e/inGameMenus.spec.ts index cb5265b8..5c5a86e8 100644 --- a/app/game-frontend/e2e/inGameMenus.spec.ts +++ b/app/game-frontend/e2e/inGameMenus.spec.ts @@ -112,6 +112,7 @@ const myGeneral = (state: FixtureState) => ({ injury: 0, experience: 100, dedication: 200, + bill: 800, age: 30, turnTime: '2026-01-01 00:10:00', recentWar: '2026-01-01 00:00:00', @@ -296,6 +297,7 @@ const battleCenter = (state: FixtureState) => ({ stats: { leadership: 70, strength: 60, intelligence: 50 }, experience: 100, dedication: 200, + bill: 800, injury: 0, gold: 1_000, rice: 2_000, @@ -334,6 +336,7 @@ const battleCenter = (state: FixtureState) => ({ stats: { leadership: 50, strength: 50, intelligence: 50 }, experience: 0, dedication: 0, + bill: 400, injury: 0, gold: 500, rice: 500, @@ -1245,6 +1248,7 @@ test('내 정보&설정 keeps desktop density and becomes a 390px horizontal-ide await expect(page.locator('.general-table')).toContainText('병종보병'); await expect(page.locator('.general-table')).toContainText('삭턴6 턴'); await expect(page.locator('.battle-general-extra')).toContainText('계급29품관'); + await expect(page.locator('.battle-general-extra')).toContainText('봉급800'); await expect(page.locator('.battle-general-extra')).toContainText('전투8회'); await expect(page.locator('.battle-general-extra')).toContainText('계략12'); await expect(page.locator('.battle-general-extra')).toContainText('사관4년'); @@ -1255,7 +1259,7 @@ test('내 정보&설정 keeps desktop density and becomes a 390px horizontal-ide await expect(page.locator('.battle-general-extra__recent-value')).toHaveText('01-01 00:00'); await expect(page.locator('.legacy-general-details')).toHaveCount(0); expect(await readGeneralSummaryRows(page.locator('.battle-general-extra'))).toEqual([ - ['명성', '계급', ''], + ['명성', '계급', '봉급'], ['전투', '계략', '사관'], ['승률', '승리', '패배'], ['살상률', '사살', '피살'], @@ -2039,6 +2043,7 @@ test('감찰부 keeps the selector interaction and shows the permission error pa await expect(page.locator('.battle-general-name')).toContainText('간의대부'); await expect(page.locator('.battle-general-name')).toContainText('건강'); await expect(page.locator('.battle-general-extra')).toContainText('계급29품관'); + await expect(page.locator('.battle-general-extra')).toContainText('봉급800'); await expect(page.locator('.battle-general-card')).toContainText('병종보병'); await expect(page.locator('.battle-general-card')).not.toContainText('che_'); await expect(page.locator('.battle-general-card')).toHaveAttribute('data-general-basic-card', ''); @@ -2049,7 +2054,7 @@ test('감찰부 keeps the selector interaction and shows the permission error pa await expect(page.locator('.battle-general-extra')).toContainText('승률62.50%'); await expect(page.locator('.battle-general-extra')).toContainText('살상률181.84%'); expect(await readGeneralSummaryRows(page.locator('.battle-general-extra'))).toEqual([ - ['명성', '계급', ''], + ['명성', '계급', '봉급'], ['전투', '계략', '사관'], ['승률', '승리', '패배'], ['살상률', '사살', '피살'], diff --git a/app/game-frontend/src/components/main/GeneralBattleSummary.vue b/app/game-frontend/src/components/main/GeneralBattleSummary.vue index 7b2ec503..b7b97216 100644 --- a/app/game-frontend/src/components/main/GeneralBattleSummary.vue +++ b/app/game-frontend/src/components/main/GeneralBattleSummary.vue @@ -7,6 +7,7 @@ export type GeneralBattleSummaryData = { available?: boolean; experience?: number | null; dedicationText?: string | null; + bill?: number | null; warnum?: number | null; wins?: number | null; losses?: number | null; @@ -62,8 +63,13 @@ const killRate = computed(() => {