Skip to content

[server] - [frontend] - Implement Seller Rating System After Trade Completion #119

Description

@dark-sarge

Location: server/src/routes/ratings.ts, frontend/app/trades/[id]/rate/

Description

Buyers currently have no way to leave feedback after a trade. An off-chain rating system (1–5 stars + optional comment) stored in PostgreSQL complements the on-chain reputation score and gives future buyers richer seller information.

Acceptance Criteria

  • A ratings table is created: id, trade_id (unique), reviewer_id, reviewee_id, stars (1–5), comment (varchar 300), created_at.
  • POST /api/trades/:id/rate (authenticated, buyer only, trade must be Completed) accepts { stars: number, comment?: string } and creates a rating record.
  • A rating can only be submitted once per trade — duplicates return HTTP 409.
  • GET /api/users/:id/ratings returns a paginated list of ratings received by a user with their average star score.
  • The trade detail page shows a "Rate this seller" CTA for 7 days after completion, then hides it.
  • The seller's average rating and total review count are returned in GET /api/trades listing responses.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave program

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions