5 Commits
Author SHA1 Message Date
a04d484451 refactor(email): SES -> @bitbaum/mail-kit; drop @aws-sdk/client-ses (#178)
The playbook expected no SES call sites, but lib/email/service.ts is live
(consultations route sends welcome + admin mails through it), so a bare dep
removal would have broken the build. Instead the transport is swapped to the
fleet's mail layer:

- EmailService now sends via @bitbaum/mail-kit sendMail; the throw-on-failure
  contract is preserved for the catching caller
- Sender comes from RESEND_FROM (fleet SSOT) with conventionalFrom('Botsmann')
  fallback; FROM_EMAIL and NEXT_AWS_* reads deleted from email config paths
- @aws-sdk/client-ses removed; tests mock @bitbaum/mail-kit instead of SES,
  with a new failed-send assertion


Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-05 10:14:55 +00:00
g-butandClaude Opus 4.6 5c046fd1dc refactor(logging): replace console calls with structured logger
Create lib/logger.ts — lightweight wrapper that outputs plain text in dev
and structured JSON in production. Replace 117 console.log/error/warn
calls across 31 files (27 API routes + 4 lib files) with logger.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 17:55:28 +01:00
g-butandClaude Opus 4.5 1c7abeebac docs(claude): add global standards reference and update date
- Add @~/.claude/CLAUDE.md import for global engineering standards
- Update Last Updated date to 2026-01-23

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 15:22:36 +01:00
g-butandClaude Opus 4.5 0c2b798cb8 refactor: modularize large components and centralize email config
Component splits (all >400 lines to modular directories):
- AICaseAnalysis.tsx → ai-case-analysis/ (utils, states, report)
- DemoSection.tsx → demo-section/ (steps, navigation, progress)
- WorkspaceDashboard.tsx → workspace-dashboard/ (sections, UI)
- ExampleSection.tsx → example-section/ (tabs for different views)
- AgencyProfile.tsx → agency-profile/ (tabs for overview, etc)
- CitizenProfile.tsx → citizen-profile/ (sections, tabs)
- TransactionWithTraceability.tsx → transaction-traceability/

Email configuration:
- Created lib/config/email.ts with centralized settings
- Replaced hardcoded emails with environment variables
- Added EmailServiceError class for proper error handling
- Updated templates to use centralized config

Added Zod validation schemas for API input validation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 08:39:31 +01:00
g-butandClaude Opus 4.5 532457299e refactor: major codebase cleanup and consolidation
## Dead Code Removed
- lib/nlp.ts (418 lines - unused duplicate)
- DemoSection.old.tsx (obsolete file)
- src/components/bots/BotPage.tsx (never imported)
- TextGenerator.tsx & EmailGenerator.tsx duplicates

## Unused Packages Removed
- @sendgrid/mail (not used - only AWS SES active)
- mailgun.js (not used)
- form-data (not used)

## Structure Consolidated
- Moved all src/lib/* to lib/ (SSOT)
- Moved src/components/navigation/* to components/
- Removed empty src/ directory
- Updated all imports to use @/lib/

## Type Fixes
- Fixed implicit any types in WorkspaceDashboard.tsx
- Fixed type union in AICaseAnalysis.tsx
- Fixed typed routes issue in page.tsx
- Fixed MongoDB module load-time error

## Build
- npm run build passes successfully

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 00:01:42 +01:00