VSN-2055 : Adding method of retrieving user by its own UUID.
Merge Request Description
Title
User Retrieval by UUID – Service, Endpoint & Exception Handling
Overview
This merge request introduces a new feature for retrieving a specific user by their UUID. The implementation follows a clean, layered architecture, covering the full flow from service definition to controller exposition, with proper exception handling and documentation updates.
Scope of Changes
The changes add a new API capability that allows clients to fetch a user using a UUID identifier. The feature includes service and controller layers, robust error handling, and changelog documentation.
Detailed Changes
1. API Endpoint Definition
- Added a new endpoint dedicated to retrieving a specific user by their UUID.
- The endpoint provides a clear and explicit contract for user lookup based on a unique identifier.
- Designed to align with existing API naming and structural conventions.
2. Service Method Signature
- Introduced a new service method signature responsible for user retrieval by UUID.
- The service abstraction ensures:
- Separation of concerns
- Ease of future extension (e.g., caching, authorization, enrichment)
3. Service Implementation
- Implemented the service logic to:
- Fetch the user entity using the provided UUID
- Handle non-existing users gracefully
- Added a new exception code mapping to clearly identify cases where a user cannot be found by UUID.
- Ensures consistent error behavior across the application.
4. Feature Exposition via Controller
- Exposed the new user retrieval feature through the controller layer.
- The controller delegates all business logic to the service, maintaining a thin and readable API layer.
- Ensures correct HTTP responses for both successful and failure scenarios.
5. Documentation Update
- Updated the changelog markdown file to document:
- The new user retrieval endpoint
- Associated service and exception changes
- Keeps project documentation accurate and up to date.
Benefits
- Clear and reliable user lookup by UUID
- Improved API expressiveness and usability
- Consistent exception handling for unfound users
- Clean separation between controller and service layers
- Well-documented changes for traceability
Impacted Areas
- Controller layer (new endpoint)
- Service layer (new method signature and implementation)
- Exception mapping
- Documentation (changelog)
Backward Compatibility
- The changes are fully additive.
- No existing endpoints or services are impacted.
Conclusion
This merge request delivers a complete and well-structured feature for retrieving users by UUID. With proper layering, explicit error handling, and updated documentation, the feature is ready for integration and aligns with existing architectural standards.
Closes VSN-2055