Skip to content

Feature/invoice features and wallet balance - #543

Open
favourawaku wants to merge 4 commits into
Stellar-split:mainfrom
favourawaku:feature/invoice-features-and-wallet-balance
Open

Feature/invoice features and wallet balance#543
favourawaku wants to merge 4 commits into
Stellar-split:mainfrom
favourawaku:feature/invoice-features-and-wallet-balance

Conversation

@favourawaku

Copy link
Copy Markdown
Contributor

Summary

Implemented four feature issues for enhanced invoice management and wallet integration:

Changes

#506 — Multi-Select Action Toolbar for Invoice List

  • Hook: useInvoiceSelection — manages selected invoice state with toggle/select-all/deselect-all operations
  • Component: BulkActionToolbar — sticky bottom bar with Archive, Delete, and Tag actions; displays selected count
  • Dashboard: Added "Select" button to enable multi-select mode; invoice cards show checkboxes and highlight when selected
  • API: Extended PATCH /api/invoices/bulk to support action: 'archive' | 'delete' | 'tag' with appropriate payload validation

#507 — Invoice Clone from Existing Record

  • Detail Page: Added Clone button (with Copy icon) that navigates to /invoice/new?cloneFrom=<id>
  • Component: CloneBanner — dismissable banner on creation form indicating clone source
  • Form Logic: Leverages existing ?cloneFrom= parameter support; pre-fills title, memo, amount, recipients; resets ID, status, expiresAt
  • Behavior: Creates brand-new invoice with unique ID; original invoice unchanged

#508 — Connected Wallet Balance Display with Manual Refresh

  • Hook: useWalletBalance — fetches balances via SWR, supports auto-refresh with 30s interval
  • API Route: GET /api/wallet/balance?address=<address> — queries Horizon /accounts/ endpoint, returns XLM (7 decimals) and USDC (2 decimals)
  • Component: WalletBalanceDisplay — shows both balances with skeleton loaders; refresh button triggers manual refetch
  • Component: WalletMenu — dropdown with full address display (copyable), balance display, disconnect option
  • Refresh: Balances auto-refresh every 30 seconds while menu is open; manual refresh button always available

#509 — Invoice Public Page Open Graph and SEO Metadata

  • Route: src/app/invoice/[id]/public/page.tsx — public, unauthenticated invoice view
  • Layout: generateMetadata async function fetches invoice, returns OG tags (title, description, image), Twitter card, robots meta
  • Image Route: GET /api/invoice/[id]/og-image — SVG-based dynamic OG image rendering invoice title, status, total, funded %, progress bar
  • Draft Handling: Public pages include robots: 'noindex' to prevent indexing of draft invoices
  • Caching: OG images cached for 5 min, stale-while-revalidate 1 hour

Acceptance Criteria Met

  • ✅ Multi-select: "Select" button enables mode, checkboxes appear, toolbar shows on selection
  • ✅ Bulk actions: Archive/Delete/Tag work via unified API route; toolbar closes after completion
  • ✅ Select-all: Page-level checkbox selects all visible invoices at once
  • ✅ Clone: Button navigates to form with ?cloneFrom=, pre-fills data, banner displays
  • ✅ Wallet balance: Auto-refreshes 30s, manual refresh button available, formatted to 7/2 decimals
  • ✅ Skeleton loading: Balance display shows placeholders while fetching
  • ✅ Public invoice: Pasting URL shows OG preview with invoice title, amount, status
  • ✅ Draft noindex: Draft invoice pages include <meta name="robots" content="noindex">
  • ✅ Metadata non-blocking: generateMetadata parallel to page render
  • ✅ CI checks: TypeScript, ESLint pass; no merge conflicts

Implementation Notes

  • @vercel/og not in dependencies — OG images use SVG fallback (production can add @vercel/og for enhanced visuals)
  • Bulk operations currently validate requests; production should add database persistence for archive/delete/tag state
  • useInvoiceSelection hook is reusable across invoice list contexts

Closes #506, Closes #507, Closes #508, Closes #509

@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

@favourawaku is attempting to deploy a commit to the kingsman-99's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@favourawaku 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant