feat: testing architecture#1
Merged
Merged
Conversation
- Updated error handling in controllers to use the new ApiResponse facade. - Replaced legacy response helpers with ApiResponse methods for consistency. - Enhanced documentation for RFC9457 error handling and quick start guides. - Introduced helper functions for accessing Application and Prisma client from Fastify. - Improved dependency injection pattern by attaching Application instance to Fastify. - Added new database module with enhanced Prisma client management features. - Updated service provider registration to streamline command registration. - Refactored README files for clarity and accuracy regarding application structure and commands.
Refactor error handling and response management
…on and database test cases - Added IntegrationTestCase for full integration testing with server and database lifecycle management. - Created DatabaseTestCase for handling database operations in tests. - Implemented TestCase as a base class for common testing functionality and lifecycle hooks. - Developed a setup script for configuring the test environment, including server and database setup. - Added factory utilities for generating test data and fake data generators. - Updated vite.config.mts to use the new testing setup. - Created migration guide for transitioning to the new testing framework. - Added example integration tests for health and user endpoints. - Enhanced README documentation for the testing module and its usage.
- Added DatabaseManager class for managing database connections and providing direct access to Prisma and Drizzle clients. - Introduced DatabaseManager interface for type safety and structure. - Created README.md for database module with usage examples and configuration details. - Updated index.ts to export new DatabaseManager and related types. - Added support for multiple database connections and transactions. - Implemented graceful shutdown and health check methods. - Deprecated legacy Prisma utilities in favor of the new DB facade. feat(http): Introduce ApiResponseBuilder for streamlined response handling - Added ApiResponseBuilder class for building API responses with validation and error handling. - Updated ApiResponse to export ApiResponseBuilder and maintain backward compatibility with ResponseBuilder. - Created tests for ApiResponseBuilder to ensure validation and response handling works as expected. - Updated example controller to utilize ApiResponseBuilder for cleaner validation logic. fix(config): Refactor database configuration to support multiple drivers - Updated database configuration to support both Prisma and Drizzle ORM. - Simplified connection definitions and added example configurations for read replicas and analytics. - Ensured type safety with updated DatabaseConfig type definitions.
…ation - Created Prisma schema for User model with fields: id, name, email, age, createdAt, and updatedAt. - Added seed files for development and production environments. - Implemented IUserRepository interface for user operations. - Developed UserRepositoryDrizzle and UserRepository classes for Drizzle and Prisma ORM respectively. - Configured Drizzle ORM with PostgreSQL settings. - Updated package.json scripts for migration and seeding processes. - Added necessary dependencies for Drizzle ORM and PostgreSQL.
…n handling and initialization feat(tests): Update IntegrationTestCase and setup to utilize HttpKernel for server initialization feat(migrations): Add User table migration with createdAt and updatedAt fields chore: Update migration_lock.toml comments for clarity refactor: Remove deprecated app initialization logic from app.ts
…ing create, find, update, delete, and pagination functionalities
…, delete, and pagination functionalities
… module and improving setup
…mproved database testing utilities
…allowing custom driver integration
…update error handling
…mentation for database errors
…ProblemDetails function
…ensive HTTP request methods
…mDetails function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.