Implement adoptions API with tests and documentation#56
Conversation
AKV2703
left a comment
There was a problem hiding this comment.
The overall structure and CRUD flow for the Adoptions API is implemented well, and the RBAC setup/routes generally align with the proposal. However, there are still a few important areas that should be addressed before merge. The main issues are around validation consistency, proposal compliance, and test coverage. listAdoptions() currently only supports pagination but is missing the required filters (fob_id, adopter, year). Some validation paths are using incorrect error codes, and pagination parsing in the controller silently defaults invalid values instead of rejecting them. The current delete implementation/tests also hard delete records, while the proposal expects adoption history/cancellation data to be preserved, so this behaviour should be reviewed. On the testing side, unit/integration coverage should be expanded for RBAC restrictions, filter behaviour, invalid query params, stricter validation scenarios, and cleanup of created test data. Overall the foundation is good, but these gaps should be resolved to fully align with the project specification and avoid future issues.
AKV2703
left a comment
There was a problem hiding this comment.
Reviewed the latest updates and the implementation is now in a much better state overall. The service, controller, validation flow, RBAC handling, documentation, and test coverage have all been significantly improved and the main concerns raised earlier were addressed properly. Approving this PR now.
Adoptions API
This implements the Adoptions API for managing tree adoption records.
It includes:
Improvements:
Testing: