π― Goal
Implement complete custody return lifecycle.
This includes escrow resolution and trust updates.
π Description
When custody ends (RETURNED):
- Validate custody is ACTIVE
- Change status β RETURNED
- Release escrow (if exists)
- Emit EventLog:
- Recalculate trust score
- Update pet derived availability
If violation:
- Change status β VIOLATION
- Trigger escrow refund logic
- Emit violation event
- Penalize trust score
π Tasks
- Implement returnCustody(custodyId)
- Implement violationCustody(custodyId)
- Integrate escrow service
- Emit proper EventLogs
- Trigger trust recalculation service
π Flow Example
User returns pet
β custody.status = RETURNED
β escrow RELEASED
β trustScore updated
β Pet becomes available again
β
Acceptance Criteria
- Successful custody releases escrow
- Violation refunds escrow
- Trust score updated
- EventLog entries created
- Pet availability updated
π― Goal
Implement complete custody return lifecycle.
This includes escrow resolution and trust updates.
π Description
When custody ends (RETURNED):
If violation:
π Tasks
π Flow Example
User returns pet
β custody.status = RETURNED
β escrow RELEASED
β trustScore updated
β Pet becomes available again
β Acceptance Criteria