Commit Graph

5 Commits

Author SHA1 Message Date
95a4678340 Handle overloaded AI provider responses
- Preserve upstream AI provider HTTP status codes and expose AI-specific error codes for overload, rate limit, unavailable, and generic provider failures.

- Add short retries for transient AI provider 429/5xx chat completion responses, with configurable retry delays.

- Show friendly AI busy/unavailable messages in the report editor instead of raw provider JSON.

- Preserve custom backend error codes in the shared API exception filter.

- Add AI service tests for retry behavior and overload error mapping.

- Update API, feature, and testing documentation for AI proxy retry and error handling.
2026-05-09 03:35:55 +08:00
03b54fe18b Remove frontend JSON export actions
- Remove user-visible JSON export options from report editor, report management, template management, bulk template export, and AI debug logs.

- Keep HTML template package and PDF/browser print exports as the supported frontend export formats.

- Change per-template export to generate reusable HTML template packages.

- Preserve legacy JSON template import compatibility without exposing new JSON export buttons.

- Update README, AGENTS, feature, requirement, design, module, API contract, progress, and testing docs for the export policy change.
2026-05-02 04:21:08 +08:00
911b96b883 Add demo mode factory reset
- Align the backend seeded default surgery template with the report editor's default report content.

- Add backend demo defaults for the default template, Kimi provider, and Xunfei speech proxy configuration.

- Change system reset into a super-admin demo mode factory reset that clears reports, audit logs, files, custom templates, and non-default users.

- Keep only the default admin, manager, doctor, and default surgery template after demo reset.

- Replace the old local-only reset all data button with a two-confirmation backend reset flow.

- Add tests covering demo default alignment and database-backed demo reset behavior.

- Update docs to describe demo mode reset semantics and production credential cautions.
2026-05-02 02:52:30 +08:00
750cf4129d Add audit log UI and backend API seeded E2E
- Add Auth Context route role guards so doctors cannot directly enter template management, user management, or audit logs.

- Add Audit Logs page, sidebar entry, frontend audit API client, and API client test.

- Add backend audit log query endpoint with super/admin visibility rules and query filtering.

- Extend PostgreSQL integration tests to cover audit log query permissions.

- Move Playwright E2E away from localStorage seed data to real backend API login and seed helpers.

- Add E2E coverage for route guards and audit log visibility.

- Run Playwright backend on port 3100 and proxy Vite API requests there to avoid local port conflicts.

- Make server:dev use the compiled NestJS server path, avoiding tsx parameter-property injection issues.

- Update README, AGENTS, feature, testing, security, deployment, progress, API, backendization, and auth/user module docs.
2026-05-02 02:04:56 +08:00
014aca8619 Initialize backendized SurClaw report system
- Add React/Vite frontend for login, dashboard, reports, templates, users, settings, AI, speech, and media workflows.

- Add NestJS/Prisma/PostgreSQL backend with auth, dashboard stats, reports, templates, users, departments, settings, files, AI, speech, audit logs, and HTML sanitization.

- Add Prisma schema, migrations, seed data, persistent app sessions, Docker/Nginx deployment files, and upload volume configuration.

- Add Vitest, Playwright, backend integration tests, and project documentation for requirements, design, permissions, API contracts, testing, deployment, security, and progress.

- Configure production local fallback switch and remove unused Gemini direct dependency/env wiring.
2026-05-02 01:41:57 +08:00