feat(vouching): add decline endpoint for pending vouch requests - #109
Open
Obiajulu-gif wants to merge 1 commit into
Open
feat(vouching): add decline endpoint for pending vouch requests#109Obiajulu-gif wants to merge 1 commit into
Obiajulu-gif wants to merge 1 commit into
Conversation
The frontend (StepFi-Web issue StepFi-app#66) needs to persist a mentor's decline action, but no such endpoint existed on this API — vouching.controller.ts only had request/approve/mine/mentor/requests/revoke. Added: - VouchStatus.DECLINED enum value - DeclineVouchDto (learnerWallet, same shape as ApproveVouchDto) - VouchingService.declineVouch(mentorWallet, dto) — mirrors approveVouch: finds the mentor's pending vouch for the given learner, sets status to DECLINED. Since getIncomingRequests() already filters on status = PENDING, a declined request naturally stops appearing in the mentor's incoming-requests list with no further query changes needed. - POST /vouching/decline controller route, mentor-role-gated like approve Tests: extended vouching.service.spec.ts with declineVouch coverage (happy path + not-found). Verified: 6/6 passing (npx jest). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The corresponding frontend fix (StepFi-Web issue #66) needs to persist a mentor's decline action, but no such endpoint actually existed on this API -- vouching.controller.ts only had request/approve/mine/mentor/requests/revoke routes. The issue's premise (the API endpoint exists but was never wired) turned out to be inaccurate; this adds the missing endpoint.
Companion frontend PR (wiring Vouch.tsx to this endpoint) is separate, in StepFi-Web.
Test plan