feat: implement custody return flow with escrow resolution and trust …#90
Open
Christopherdominic wants to merge 5 commits intoamina69:mainfrom
Open
feat: implement custody return flow with escrow resolution and trust …#90Christopherdominic wants to merge 5 commits intoamina69:mainfrom
Christopherdominic wants to merge 5 commits intoamina69:mainfrom
Conversation
…updates - Add returnCustody() endpoint for successful custody returns - Add violationCustody() endpoint for custody violations (admin only) - Implement escrow release on successful return - Implement escrow refund on violation - Create TrustScoreService for managing user trust scores - Reward +5 trust score on successful custody return - Penalize -15 trust score on custody violation - Update pet status to AVAILABLE after custody ends - Emit CUSTODY_RETURNED and ESCROW_RELEASED events - Add comprehensive unit tests for return flow Closes amina69#63
- Remove manual pet status updates (now derived from custody/adoption status) - Remove PetsService dependency from custody module - Update tests to reflect new architecture - Pet availability automatically updates when custody status changes to RETURNED/VIOLATION
…hristopherdominic/PetAd-backend into feature/custody-return-flow-63
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.
…updates
Closes #63
PR: Pet Status Lifecycle Implementation (Closes #17)
Overview
This PR implements the Pet Status Lifecycle feature, enforcing a state machine for pet status transitions throughout the adoption and custody process. It ensures that pets can only move between valid states, maintaining data integrity and preventing invalid transitions.
Features
PATCH /pets/:id/status: Update pet status with validation and audit logging.GET /pets/:id/transitions: Get allowed transitions and current status for a pet.GET /pets/:id/transitions/allowed: Get allowed transitions for the current user (role-aware).Acceptance Criteria
Closes
Please review the implementation and test the endpoints via Swagger UI (
/api/docs).