# AI Presentation And Fee Workspace Implementation Plan ## 1. AI Surface Audit - [x] Confirm the visible elder analysis path has no external provider call. - [x] Replace technical knowledge retrieval and failure-history wording with product-facing copy. - [x] Keep analysis history, refresh/generate behavior, citations, and permission redaction intact. - [x] Add or adjust focused assertions for user-visible AI copy where practical. ## 2. Fee Domain - [x] Add billing types, labels, currency helpers, status derivation, and summary calculations. - [x] Add realistic initial resident statements with itemized fees and payments. - [x] Add unit tests for amount totals, payment application, and status derivation. ## 3. Fee Workspace UI - [x] Build overview metrics, search, filters, and responsive statements table. - [x] Build statement detail with charge items and payment history. - [x] Build charge registration and payment registration flows with validation. - [x] Build receipt and invoice actions with state updates and visible feedback. ## 4. Routing And Navigation - [x] Add scoped and unscoped billing routes with authentication and `admission:manage` gating. - [x] Add `费用管理` and a Lucide icon to the operations navigation. - [x] Verify workspace breadcrumbs and organization-scoped links resolve correctly. ## 5. Validation - [x] Run focused billing and AI tests. - [x] Run `pnpm lint`. - [x] Run `pnpm type-check`. - [x] Run `pnpm test`. - [x] Run `pnpm build`. - [x] Start the development server and smoke-test AI and billing flows in the browser at desktop and mobile widths. - [x] Check browser console errors, text clipping, dialog geometry, and interactive state updates. ## Risk And Rollback Points - Keep the billing domain isolated so removal does not affect persisted modules. - Do not change `Permission`, role seed, schema, or migrations for the frontend-only workspace. - Reuse `admission:manage`; changing authorization is out of scope. - Do not alter AI API response shapes or stored analysis records.