testing ADR - architectural decisions
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 14m37s

This commit is contained in:
2025-12-12 00:23:12 -08:00
parent 0b3d095c9c
commit 1bd27d7112
16 changed files with 90 additions and 90 deletions

View File

@@ -57,14 +57,14 @@ router.get('/:id', validateRequest(getFlyerSchema), async (req, res, next) => {
### Positive
* **DRY and Declarative**: Validation logic is defined once in a schema and removed from route handlers.
* **Improved Readability**: Route handlers become much cleaner and focus exclusively on their core business logic.
* **Type Safety**: `zod` schemas provide strong compile-time and runtime type safety, reducing bugs.
* **Consistent and Detailed Errors**: The `errorHandler` can be configured to provide consistent, detailed validation error messages for all routes (e.g., "Query parameter 'limit' must be a positive integer").
* **Robustness**: Prevents invalid data from ever reaching the service or database layers.
**DRY and Declarative**: Validation logic is defined once in a schema and removed from route handlers.
**Improved Readability**: Route handlers become much cleaner and focus exclusively on their core business logic.
**Type Safety**: `zod` schemas provide strong compile-time and runtime type safety, reducing bugs.
**Consistent and Detailed Errors**: The `errorHandler` can be configured to provide consistent, detailed validation error messages for all routes (e.g., "Query parameter 'limit' must be a positive integer").
**Robustness**: Prevents invalid data from ever reaching the service or database layers.
### Negative
* **New Dependency**: Introduces `zod` as a new project dependency.
* **Learning Curve**: Developers need to learn the `zod` schema definition syntax.
* **Refactoring Effort**: Requires a one-time effort to create schemas and refactor all existing routes to use the `validateRequest` middleware.
**New Dependency**: Introduces `zod` as a new project dependency.
**Learning Curve**: Developers need to learn the `zod` schema definition syntax.
**Refactoring Effort**: Requires a one-time effort to create schemas and refactor all existing routes to use the `validateRequest` middleware.