Skip to content

feat: add marketplace filter - #101

Merged
Chucks1093 merged 2 commits into
StellarState:devfrom
ONEONUORA:marketplace-filter
Aug 26, 2026
Merged

feat: add marketplace filter#101
Chucks1093 merged 2 commits into
StellarState:devfrom
ONEONUORA:marketplace-filter

Conversation

@ONEONUORA

Copy link
Copy Markdown
Contributor

close #84
close #85
close #86
close #87

Overview

This PR delivers key user experience and administrative features across onboarding, invoice review, marketplace filtering, and investor payout auditing.


Features & Changes Included

1. Onboarding Checklist (components/dashboard/OnboardingChecklist.tsx)

  • Completion Conditions:
    • Step 1 transitions to complete when kycStatus is pending or approved.
    • Step 2 transitions to complete when displayName is non-null/non-empty.
    • Step 3 transitions to complete when invoiceCount $\ge 1$.
  • Visibility & Persistence: Hides the checklist when all three steps are complete or when explicitly dismissed by the user. Persists dismissal state to localStorage.
  • Testing: Added unit tests covering all step state transitions, completion hiding, and localStorage persistence (OnboardingChecklist.test.tsx).

2. Admin Pending Invoice Review Page (app/admin/invoices/page.tsx & components/admin/AdminInvoicesReview.tsx)

  • Access Control: Restricted /admin/invoices route exclusively to authenticated users with admin JWT role.
  • Pending Invoices List: Fetches pending invoices via GET /admin/invoices?status=pending with cursor pagination.
  • Row Details: Displays sellerName, invoiceId, faceValue, submittedAt, and a View Document button launching an IPFS PDF preview modal.
  • Action Workflows:
    • Approve: Updates invoice status to approved, displays success toast, and removes the row.
    • Reject: Requires an inline rejection reason input before confirming action, displays success toast, and removes the row.
  • Testing: Added unit tests verifying role authorization, document modal opening, row approval, and rejection reason enforcement (admin/invoices/__tests__/page.test.tsx).

3. Marketplace Filter Panel (components/marketplace/FilterPanel.tsx & app/marketplace/page.tsx)

  • Collapsible Sidebar: Positioned to the left of the marketplace grid.
  • Filter Controls:
    • Funding Status multi-select (Open, Funded, Settled, Expired).
    • Minimum yield slider range ($0%$ to $30%$).
    • Due date range picker (From and To inputs).
  • API & URL Sync: Syncs filter state dynamically with URL search query parameters and passes filters directly to GET /invoices. Clearing all filters restores the full list.
  • Testing: Added unit tests validating individual filters, URL parameter synchronization, and clear-all behavior (marketplace-filter.test.tsx).

4. Investor Dashboard Payout History (components/dashboard/PayoutHistoryTable.tsx & InvestorPortfolio.tsx)

  • Payout History Tab: Added a dedicated tab on the investor portfolio dashboard.
  • Data Audit Trail: Fetches historical payouts from GET /investor/payouts with cursor pagination.
  • Table Output: Displays invoiceId, sellerName, amountInvested, amountReceived, yield, and settledAt.
  • Shortfall Highlighting: Highlights rows in amber when amountReceived < amountInvested.
  • Empty State: Renders a dedicated "No payouts yet" empty state when no payouts exist.
  • Testing: Added unit tests validating column rendering, shortfall highlighting, pagination loading, and empty state behavior (PayoutHistoryTable.test.tsx).

Verification

  • Ran full Vitest test suite (npm test), verifying all unit tests pass clean.

@drips-wave

drips-wave Bot commented Aug 26, 2026

Copy link
Copy Markdown

@ONEONUORA Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Chucks1093
Chucks1093 merged commit 6bc9339 into StellarState:dev Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment