Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement User Rating and Reputation System #18

Open
6 tasks
AndreaDiazCorreia opened this issue Dec 12, 2024 · 0 comments
Open
6 tasks

Implement User Rating and Reputation System #18

AndreaDiazCorreia opened this issue Dec 12, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@AndreaDiazCorreia
Copy link
Collaborator

Description

Implement the rating system for users to rate their counterparties after completed trades, following the Mostro protocol specification for reputation management.

Implementation Requirements

  1. Rating functionality:
interface RatingSystem {
  async rateUser(order: Order, rating: number): Promise<MostroMessage>;
  async getRating(pubkey: string): Promise<UserRating>;
  async handleRatingConfirmation(orderId: string): Promise<void>;
}

interface UserRating {
  totalReviews: number;
  averageRating: number;
  lastRating: number;
  maxRating: number;
  minRating: number;
}
  1. Rating message handling:
interface RatingMessage {
  order: {
    version: number;
    id: string;
    action: Action.RateUser;
    content: {
      rating_user: number;
    };
  };
}

Testing Requirements

describe('RatingSystem', () => {
  it('should submit ratings correctly');
  it('should validate rating values');
  it('should calculate average ratings');
  it('should handle rating confirmations');
  it('should track rating history');
});

Acceptance Criteria

  • Rating submission implemented
  • Rating validation working
  • Confirmation handling complete
  • Rating calculation correct
  • History tracking implemented
  • Documentation complete

References

@grunch grunch added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants