import type { StatisticsInputCommonInfoBase } from "@/entities/statistics/model/statistics-interface"; import { normalizeVerificationResultMap, type VerificationResultLikeMap, } from "./verification-result-display"; export function isVerificationFailedFromCommonInfo( commonInfo: Pick | null | undefined, ): boolean { return commonInfo?.isVerificationFailed === true; } export function patchVerificationFailedByTab( prev: Map, tabKey: string, commonInfo: Pick | null | undefined, ): Map { const next = new Map(prev); next.set(tabKey, isVerificationFailedFromCommonInfo(commonInfo)); return next; } /** commonInfo.verificationResult → 탭별 총계 footer 검증 (우선보기 대상 아님) */ export function patchFooterVerificationByTab( prev: Map, tabKey: string, commonInfo: | { verificationResult?: VerificationResultLikeMap | null } | null | undefined, ): Map { const next = new Map(prev); next.set( tabKey, normalizeVerificationResultMap(commonInfo?.verificationResult) ?? null, ); return next; }