feat(web): 对账中心上线——恒等式B5只读端点+前端恒等式区块,双轨对账页升级为对账中心(issue#42-A) [nas]
- API: GET /paper/reconcile/identity?date&refresh——缺省读 supervisor 15:10/23:27
已存 identity_reconcile 行,无存行现算并落库(与 build/save 同套幂等);
路由置于 /paper/{aid} 前,与既有 reconcile 端点同组
- 前端: Reconcile.vue 顶部新增恒等式卡片(账户级红绿/未归因±/占比vs容忍0.5%/
可展开逐票缺口+实例市值拆分),页面与菜单更名为「对账中心」;
api/paper.ts 补 IdentityReport 类型族
- 测试: 绿线(50/10050=0.497%pass)+存行复用+refresh强制重算(200=1.96%红)+
snapshot_missing 如实标注,12/12 绿
- 附: docs/session_prompts/ 两份 session 移交提示词入库(fundamentals 18min→
数据session / 统一ex定寸→策略session,用户08-26拍板)
This commit is contained in:
@@ -222,3 +222,41 @@ export async function getReconcilePairs(date?: string): Promise<ReconcilePair[]>
|
||||
'/paper/reconcile', { params: date ? { date } : {} })
|
||||
return data.pairs
|
||||
}
|
||||
|
||||
// ===== 账户恒等式(B5):全账户市值 = Σ实例账本市值 + 未归因(容忍 ≤0.5%) =====
|
||||
|
||||
export interface IdentityUnattrPosition {
|
||||
symbol: string
|
||||
snapshot_volume: number
|
||||
instance_volume: number
|
||||
diff: number
|
||||
}
|
||||
|
||||
export interface ReconcileIdentityRow {
|
||||
account: string
|
||||
date: string
|
||||
status: string // pass | unattributed_over_tol | snapshot_missing | no_instances
|
||||
snapshot_mv: number | null
|
||||
instance_mv_total: number
|
||||
unattributed_mv: number | null
|
||||
unattributed_pct: number | null
|
||||
tolerance_pct: number
|
||||
instances: { id: number; name: string; mv: number }[]
|
||||
unattributed_positions: IdentityUnattrPosition[]
|
||||
}
|
||||
|
||||
export interface ReconcileIdentityReport {
|
||||
date: string
|
||||
rows: ReconcileIdentityRow[]
|
||||
identity_passed: boolean
|
||||
}
|
||||
|
||||
export async function getReconcileIdentity(
|
||||
date?: string,
|
||||
refresh = false,
|
||||
): Promise<ReconcileIdentityReport> {
|
||||
const { data } = await apiClient.get<ReconcileIdentityReport>(
|
||||
'/paper/reconcile/identity',
|
||||
{ params: { ...(date ? { date } : {}), ...(refresh ? { refresh: true } : {}) } })
|
||||
return data
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user