VSN-2106 : Adding feature of fetching the boolean flag related to contract existance.
Merge Request Description
Title
Contract Existence Check by Title
Overview
This merge request introduces a new feature that allows checking the existence of a contract based solely on its title. The feature is implemented end-to-end, covering the repository, service, and controller layers, and is fully documented through the project changelog.
Detailed Changes
1. API Layer
- Added a new REST endpoint dedicated to verifying contract existence by title.
- The endpoint is lightweight and focused, returning a clear existence flag without fetching full contract details.
- Ensures proper exposure of the feature via the controller.
2. Service Layer
- Introduced a new service method signature responsible for handling the contract existence use case.
- Implemented the service logic to delegate the existence check to the repository layer.
- Ensures separation of concerns and keeps controller logic minimal.
3. Repository Layer
- Added a new repository method to efficiently determine whether a contract exists based on its title.
- The method returns a boolean-like existence flag, optimized for read-only checks.
4. Implementation
- Completed the full implementation chain:
- Controller → Service → Repository.
- Ensured consistency in naming, return types, and error handling strategy.
- Verified that the method integrates cleanly with existing domain logic.
5. Documentation
- Updated the changelog to reflect the addition of the new contract existence feature.
- Ensures traceability of changes and better visibility for future maintenance.
Benefits
- Performance-friendly: Avoids loading full contract entities when only existence information is required.
- Cleaner API design: Introduces a dedicated endpoint for a clear, single responsibility.
- Reusability: The service method can be reused in future validation or pre-check workflows.
- Maintainability: Proper layering and documentation reduce future technical debt.
Impact & Compatibility
- No breaking changes introduced.
- Existing features remain unaffected.
- New endpoint can be safely consumed by frontend or other backend services without side effects.
Conclusion
This merge request delivers a complete and well-structured feature to check contract existence by title. It enhances the system’s validation capabilities while keeping the architecture clean, efficient, and well-documented.
Closes VSN-2106