-
Notifications
You must be signed in to change notification settings - Fork 29
Description
Complexity: Medium (150 points)
Description
Add endpoint for parties to mark escrow conditions as fulfilled, enabling milestone-based fund release.
Requirements and Context
Condition entity has isMet, metAt, metByUserId fields but no API to update them
Sellers need to mark conditions complete; buyers need to confirm fulfillment
Milestone escrows rely on condition fulfillment to release partial payments
Foundation for the automated release workflow
Suggested Execution
Fork repo, create branch feat/condition-fulfillment
Create FulfillConditionDto in apps/backend/src/modules/escrow/dto/
Add fulfillCondition and confirmCondition methods to EscrowService
Create endpoints:
POST /escrows/:id/conditions/:conditionId/fulfill (seller marks complete)
POST /escrows/:id/conditions/:conditionId/confirm (buyer confirms)
Add permission checks: seller fulfills, buyer confirms
Log events for condition state changes
Test and Commit
Test role-based access: seller vs buyer permissions
Test state validations: escrow must be active, condition not already met
Test all conditions met triggers escrow completion eligibility
Include test coverage report in PR
Example Commit Message
feat: add condition fulfillment and confirmation endpoints
Allow sellers to mark conditions as fulfilled and buyers to confirm,
enabling milestone-based escrow progression.
Guidelines
Implement two-step verification: seller fulfills, buyer confirms
Track who fulfilled and when
Consider adding optional notes/evidence field for fulfillment
Emit events for real-time UI updates (future websocket integration)