Stage 1: Problem
Problem
You are building a user management service. It needs to:
- Find users by ID, email, or role
- Create and update users
- Check if an email is already registered
- Get paginated lists with filters
Currently, TypeORM queries are scattered across controllers, services, and even middleware.
How would you centralize data access so business logic doesn't know whether you're using TypeORM, Prisma, raw SQL, or an in-memory store?
Write your approach before continuing.