RESTRUCTURING ACCOMPLISHED:
• Split monolithic EventService into focused services (EventsV1Service, EventsV2Service, PendingEventsService)
• Migrated ALL remaining direct SQL to shared sql::events functions
• Updated all handlers to use appropriate focused services
• Removed obsolete EventService completely
CONSISTENCY FIXES:
• ScheduleService: migrated to sql::schedule pattern (eliminated all direct SQL)
• HymnalService: fixed DRY/KISS violations using sql::hymnal for CRUD operations
• AuthService: ensured consistent sql::users usage
RESULT: All major services now follow Handler→Service→sql:: pattern consistently.
No more direct SQL violations. No more debugging nightmare inconsistencies.
Zero downtime maintained - HTTP responses unchanged.
- Eliminate manual ApiResponse construction in 5 handlers
- Add MemberService + sql::members following established pattern
- Create success_message_only() utility for empty responses
- Fix members handler: db::members direct calls → service layer
- Add SanitizeOutput for LoginResponse trait consistency
- All examined handlers now follow Handler → Service → SQL pattern
BREAKING: Removed CreateEventRequest - unused for direct creation
ADDED: UpdateEventRequest - clean editing with image support
IMPROVED: EventService now contains business logic, not wrapper calls
Architecture Changes:
- Before: Handler → Service → db::events → SQL (wasteful)
- After: Handler → Service → Direct SQL + Business Logic (clean)
Key Improvements:
✅ All EventService methods use direct SQL with real business logic
✅ Eliminated pointless db::events wrapper functions
✅ Added missing V2 service methods for consistency
✅ Fixed handler pattern violations (no more direct db calls)
✅ Preserved email notifications and HTTP response formats
✅ Applied sanitization, validation, error handling in services
Changes:
- Remove CreateEventRequest/V2 (unused create paths)
- Add UpdateEventRequest with image field (no redundant thumbnail)
- Migrate all EventService methods to direct SQL + business logic
- Fix v2/events.rs to use proper service methods consistently
- Remove create/update routes and handlers (unused)
- Maintain backward compatibility for all APIs
Next: Apply same DRY/KISS cleanup to BulletinService and others