Skip to content

Implement Condition Fulfillment Endpoint #60

@KuchiMercy

Description

@KuchiMercy

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions