Skip to content

feat(report): add template system with CRUD API and 3-mode generation UI (#618)#621

Merged
Kewton merged 2 commits intodevelopfrom
feature/618-report-template
Apr 4, 2026
Merged

feat(report): add template system with CRUD API and 3-mode generation UI (#618)#621
Kewton merged 2 commits intodevelopfrom
feature/618-report-template

Conversation

@Kewton
Copy link
Copy Markdown
Owner

@Kewton Kewton commented Apr 4, 2026

Summary

  • SQLite DB に report_templates テーブル追加(マイグレーション v25)
  • template-db.ts でテンプレートCRUD実装(最大5件制限)
  • /api/templates および /api/templates/[id] CRUD API追加
  • Review画面に Template タブ追加(3タブ構成: Review/Report/Template)
  • ReportTab に3モード切替UI(指示なし/テンプレート選択/カスタム入力)

Closes #618

Test plan

  • npm run lint — PASS
  • npx tsc --noEmit — PASS
  • npm run test:unit — 6095 passed (37 new tests)
  • npm run build — PASS

🤖 Generated with Claude Code

Kewton and others added 2 commits April 4, 2026 10:56
…tion UI

- Add report_templates table (migration v25) with CRUD operations in template-db.ts
- Add /api/templates GET/POST and /api/templates/[id] PUT/DELETE endpoints
  with validation (name max 100 chars, content max 1000 chars, 5 template limit)
- Add TemplateTab component for template management in Review page
- Add useReportGeneration hook for 3-mode generation (none/template/custom)
- Update ReportTab with generation mode radio buttons and template selector
- Update Review page to 3-tab layout (Review/Report/Template)
- Add unit tests for template-db, API endpoints, ReportTab component
- Update existing tests for schema v25, 3-tab layout, report_templates table

Resolves #618

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tion

- Extract serializeTemplate, UUID_V4_REGEX, and validation functions
  into src/lib/api/template-helpers.ts (DRY)
- Remove duplicate TemplateData interface from TemplateTab.tsx,
  import from useReportGeneration instead
- Remove verbose JSDoc comments that repeat function signatures
- Simplify inline validation in API routes to use shared validators

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Kewton Kewton merged commit 7a983a4 into develop Apr 4, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant