feat(portal-shell): restore codegen typescript-operations for data-ana domain (P1-7)
ARCHITECTURE.md §10 P1-7: dashboard domain's 6 operations strictly match the schema, so disable skipDocumentsValidation for that output and restore per-operation type generation. Changes: - codegen.yml: add dashboard-types.ts output (typescript + typescript-operations plugins, skipDocumentsValidation: false); move documents config into each generates entry - dashboard.ts: remove 14 handwritten interfaces and 6 internal query type aliases; derive types via NonNullable<GetXxxQuery['xxx']> so the public hook API shape stays unchanged - admin/student/teacher page.tsx: add ?? "--" / ?? 0 null guards on StatCard value props to match schema nullable semantics (parent page already uses toFixed chain, no change needed) Acceptance (ARCHITECTURE.md §10 P1-7): - codegen 3 outputs all SUCCESS - tsc 0 errors / eslint 0 errors / vitest 231 passed / next build ok - 6 operations strictly match schema with 0 errors Refs: ARCHITECTURE.md §5.3 data layer / §10 P1-7
This commit is contained in:
@@ -49,15 +49,19 @@ export default function AdminDashboardPage(): React.ReactElement {
|
||||
description="全校概览"
|
||||
stats={
|
||||
<>
|
||||
<StatCard title="教师总数" value={data.total_teachers} icon={Users} />
|
||||
<StatCard
|
||||
title="教师总数"
|
||||
value={data.total_teachers ?? "--"}
|
||||
icon={Users}
|
||||
/>
|
||||
<StatCard
|
||||
title="学生总数"
|
||||
value={data.total_students}
|
||||
value={data.total_students ?? "--"}
|
||||
icon={GraduationCap}
|
||||
/>
|
||||
<StatCard
|
||||
title="班级总数"
|
||||
value={data.total_classes}
|
||||
value={data.total_classes ?? "--"}
|
||||
icon={Building2}
|
||||
/>
|
||||
<StatCard
|
||||
|
||||
Reference in New Issue
Block a user