feat(gateway): 프로필별 첫 기수 번호를 관리한다

첫 기수 번호를 완료 게임 수의 기준값으로 적용하고 0기를 API와 화면에서 보존한다. 시즌 번호와 독립된 RESET 계약을 관리 패널, 테스트, 운영 문서에 반영한다.
This commit is contained in:
2026-08-21 13:49:11 +00:00
parent 32d69d7049
commit 88be40f729
15 changed files with 192 additions and 19 deletions
@@ -0,0 +1,16 @@
import { describe, expect, it } from 'vitest';
import { resolveProfileFirstGameIdx } from '../src/orchestrator/gatewayOrchestrator.js';
describe('profile first game index', () => {
it('preserves an explicitly configured zero', () => {
expect(resolveProfileFirstGameIdx({ firstGameIdx: 0 })).toBe(0);
});
it('defaults missing or invalid metadata to one', () => {
expect(resolveProfileFirstGameIdx({})).toBe(1);
expect(resolveProfileFirstGameIdx({ firstGameIdx: -1 })).toBe(1);
expect(resolveProfileFirstGameIdx({ firstGameIdx: 0.5 })).toBe(1);
expect(resolveProfileFirstGameIdx({ firstGameIdx: 'invalid' })).toBe(1);
});
});