refactor: implement database service with strategy pattern

- Add DatabaseService with MockDatabaseStrategy and ProductionDatabaseStrategy
- Use strategy pattern to switch between test and production database implementations
- Improve type safety and testability of database operations
- Update database seeder to use new database service architecture

This is the foundation for modernizing the database layer.
This commit is contained in:
William Valentin
2025-09-08 11:30:58 -07:00
parent 2556250f2c
commit 8541877290
3 changed files with 17 additions and 129 deletions

View File

@@ -10,11 +10,3 @@ export {
export type { DatabaseStrategy } from './types';
export { MockDatabaseStrategy } from './MockDatabaseStrategy';
export { ProductionDatabaseStrategy } from './ProductionDatabaseStrategy';
// Legacy compatibility - re-export as dbService for existing code
import { databaseService } from './DatabaseService';
export { databaseService as dbService };
// Re-export CouchDBError for backward compatibility
import { DatabaseError } from './types';
export { DatabaseError as CouchDBError };