Skip to content

feat: add GET /api/v1/vouching/requests endpoint for incoming vouch requests#54

Merged
EmeditWeb merged 1 commit into
StepFi-app:mainfrom
daRk8238:add-GET-/vouching/requests
Jun 19, 2026
Merged

feat: add GET /api/v1/vouching/requests endpoint for incoming vouch requests#54
EmeditWeb merged 1 commit into
StepFi-app:mainfrom
daRk8238:add-GET-/vouching/requests

Conversation

@daRk8238

Copy link
Copy Markdown
Contributor

Summary

Mentors previously had no way to see who has requested a vouch from them. This PR adds GET /api/v1/vouching/requests so mentors can view all pending vouch requests for their wallet.

Changes

New endpoint

  • GET /api/v1/vouching/requests — JWT-auth required (mentor wallet). Returns only pending requests where the authenticated user is the mentor, ordered newest-first.

Response shape (array of VouchRequestItemDto)

Field Type Source
learnerWallet string vouches.learner_wallet
reputationScore number reputation_cache.score (defaults to 0 on miss)
requestedLoanAmount number | null vouches.loan_amount
loanPurpose string | null vouches.message
requestedAt string vouches.created_at (ISO 8601)

Files touched

File Change
src/modules/vouching/vouching.controller.ts Added @Get('requests') handler with full Swagger decorators
src/modules/vouching/vouching.service.ts Added getIncomingRequests() and getLearnerReputationScore()
src/modules/vouching/dto/vouch.dto.ts Added VouchRequestItemDto with @ApiProperty annotations
supabase/migrations/20260619000001_add_vouch_request_fields.sql Added loan_amount NUMERIC column to vouches table

Verification

  • npm run build passes
  • Full Swagger documentation on endpoint and response DTO
  • Filters by authenticated wallet only (JWT currentUser.wallet)
  • Includes learner reputation score from reputation_cache

Closes #21

@EmeditWeb EmeditWeb merged commit cb60433 into StepFi-app:main Jun 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add GET /vouching/requests endpoint for mentors

2 participants