expose vendor approval and suspension endpoints#105
Open
Obiajulu-gif wants to merge 3 commits into
Open
Conversation
Obiajulu-gif
marked this pull request as ready for review
July 22, 2026 15:16
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
Closes #98
Adds the missing admin-driven vendor approval lifecycle: guarded endpoints return unsigned Soroban XDR, while local vendor status changes only after the existing transaction checker confirms the signed operation on Stellar.
This repo is for the NestJS backend API only
Type of change
What changed
pending,approved,suspended, andrejectedvendor states and backfilled existing rows topending.buildApproveVendorXdr(admin, vendor)andbuildSuspendVendorXdr(admin, vendor)without server-side signing or submission.POST /vendors/:id/approveandPOST /vendors/:id/suspend, guarded by JWT plus the shared admin allowlist.is_activeandget_vendor_infofunction names.Problem this solves
Vendors registered in
Pendingon-chain but the API had no write path to approve them, so every loan validation failed withVendorNotActive. Admins can now prepare the correct contract operations for wallet signing, and off-chain state cannot claim approval for a transaction that was never submitted or confirmed.Testing
npm run buildpasses with zero TypeScript errorsnpm test -- --runInBandpasses — 33 suites, 335 testsanytypes introducedgit diff --cached --checkpassesContext files reviewed
context/architecture-context.mdcontext/code-standards.mdcontext/progress-tracker.mdupdatedAdditional notes
No admin key is held server-side. The client signs the returned XDR and submits it through the existing transaction endpoint using
vendor_approveorvendor_suspendas the transaction type.