Skip to content

fix: compute VouchImpactPreview from real reputation data #67

Description

@EmeditWeb

Problem

The VouchImpactPreview component (lines 6, 21-23) uses hardcoded values:

  • VOUCH_REPUTATION_BOOST = 12 (line 6)
  • currentRate = 8 (8%) and newRate = 6 (6%) (line 21)

These should be calculated from the learner's actual reputation score and the mentor's tier. The hardcoded values mislead mentors about the actual impact of their vouch.

Root Cause

Preview values were hardcoded during initial component development. The API provides real reputation data via GET /reputation/:wallet but it's not used here.

What To Build

  1. Fetch learner reputation via reputationService.getReputation(learnerWallet)
  2. Calculate vouch impact: boost = mentor_tier_multiplier (not always 12)
  3. Calculate new interest rate based on boosted score (not always 6%)
  4. Add loading state while reputation data fetches
  5. Add error state if data unavailable

Files To Touch

  • src/components/vouch/VouchImpactPreview.tsx — replace hardcoded values

Acceptance Criteria

  • Boost value calculated from mentor tier × base boost
  • Current interest rate from learner's actual reputation
  • New rate reflects boosted score
  • Loading state shown while fetching
  • No hardcoded boost or rate values

Mandatory Checks

  • context/ files read
  • npm run build passes
  • PR references this issue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions