Kakao 로그인을 SDK와 서버 커스텀 토큰으로 · sFPI 일 집계 직후 Stage 승급 판정

This commit is contained in:
Sn-Kinos
2026-10-05 19:07:47 +09:00
parent 576dcfbdfd
commit 65669b969e
24 changed files with 1034 additions and 57 deletions
+5 -2
View File
@@ -13,6 +13,7 @@ import { rankWithTies } from '../ledger/fpi.js';
import { txIdOf } from '../core/ids.js';
import { dayKey } from '../core/time.js';
import { notifyEclipseWarning } from '../notify/push.js';
import { promoteStages } from './evolution.js';
import { PUBLIC_NAME_FALLBACK, publicNameOf } from '../core/names.js';
/**
@@ -842,7 +843,7 @@ export const fnFpiDailySnapshot = onSchedule(
* 인정해 남긴 FPI 원천 이벤트(`fpiEvents`, verified · uid 있음) 1건 이상** — S01 확정 전
* 유지 기준. 활동 0명인 날도 `dau: 0` 으로 남긴다(C-27 「0명인 날 포함」).
*/
export async function closeDay(now: Date = new Date()): Promise<{ day: string; fandoms: number }> {
export async function closeDay(now: Date = new Date()): Promise<{ day: string; fandoms: number; promoted: number }> {
const db = getFirestore();
const day = dayKey(new Date(now.getTime() - 24 * 60 * 60 * 1000));
const from = Timestamp.fromDate(new Date(`${day}T00:00:00+09:00`));
@@ -881,7 +882,9 @@ export async function closeDay(now: Date = new Date()): Promise<{ day: string; f
tx.set(fandom.ref, { sfpi: FieldValue.increment(fpiScore) }, { merge: true });
});
}
return { day, fandoms: fandoms.size };
// 원장 B-54 — sFPI 누적 직후 누적 Growth POP 과 함께 Stage 승급을 판정한다.
const promoted = await promoteStages();
return { day, fandoms: fandoms.size, promoted: promoted.length };
}
/**