Skip to content

feat: Document Marketplace UI with SePay Checkout Flow - #3

Draft
ghost wants to merge 14 commits into
deployfrom
feature/document-marketplace-sepay
Draft

feat: Document Marketplace UI with SePay Checkout Flow#3
ghost wants to merge 14 commits into
deployfrom
feature/document-marketplace-sepay

Conversation

@ghost

@ghost ghost commented Mar 29, 2026

Copy link
Copy Markdown

Opened by @roomote-v0 on behalf of Visser Lucas

Summary

Adds the frontend UI for the document marketplace with SePay bank transfer payment integration. Companion PR to vanchuongmandam/api-server#39.

Changes

Types & API Layer

  • Added marketplace types: MarketDocument, Order, Purchase, UserProfile, BillingAddress
  • Added API functions for documents, orders, purchases, and user profile management

New Pages

Route Description
/documents Document marketplace listing with search, category filter, sort, pagination
/documents/[slug] Document detail with purchase/download buttons, stats, related articles
/documents/[slug]/checkout Multi-step checkout: billing address -> order confirmation -> QR payment -> success
/profile User profile editor with billing address management
/profile/purchases User document library (purchased documents with download)
/profile/orders Order history with status tracking and cancellation
/admin/documents Admin document management (CRUD table)
/admin/orders Admin order management with revenue stats and status filtering

Checkout Flow

  1. User clicks "Buy" on document detail page
  2. Billing address form (saved to profile for reuse)
  3. Order confirmation with item summary
  4. QR code payment page with bank transfer details
  5. Auto-polling for payment confirmation (5s intervals)
  6. Success page with download link

View task on Roo Code Cloud

- Add marketplace types (MarketDocument, Order, Purchase, UserProfile, BillingAddress)
- Add API functions for documents, orders, purchases, profile
- Add document listing page /documents with filtering and pagination
- Add document detail page /documents/[slug] with purchase flow
- Add checkout page /documents/[slug]/checkout with billing + QR payment
- Add profile page /profile with billing address management
- Add purchases page /profile/purchases (user document library)
- Add orders page /profile/orders (order history)
- Add admin documents page /admin/documents (CRUD management)
- Add admin orders page /admin/orders (order management + stats)
@ghost

ghost commented Mar 29, 2026

Copy link
Copy Markdown
Author

Rooviewer Clock   See task

Found 3 issues to address before merging.

  • PaginationControls prop mismatch (document-list-client.tsx): Component is called with { currentPage, totalPages, basePath } but expects { pagination, onPageChange, isLoading }, resulting in broken pagination on the documents listing page.
  • Payment polling ignores order expiry (checkout/page.tsx): pollPayment only handles paid/confirmed but never reacts to expired/cancelled, leaving the user stuck on the payment spinner indefinitely after expiry.
  • Unsafe document field cast in order link (profile/orders/page.tsx): order.items[0]?.document as string will produce [object Object] in the URL if the API returns a populated MarketDocument object.

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

Comment thread src/app/documents/document-list-client.tsx Outdated
Comment thread src/app/documents/[slug]/checkout/page.tsx Outdated
Comment thread src/app/profile/orders/page.tsx
longathelstan and others added 2 commits March 30, 2026 21:45
Co-authored-by: roomote-v0[bot] <219738659+roomote-v0[bot]@users.noreply.github.com>

@ngtlowk ngtlowk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay

…ror handling

- Added review editing capabilities for user purchases, allowing users to rate and comment on documents.
- Improved error messages for better user experience in Vietnamese.
- Updated UI components for better layout and interaction.
- Integrated dynamic imports for rich text editor and file uploads in admin document management.
- Implemented admin dashboard with statistics and charts for revenue and order trends.
- Created a new sidebar for admin navigation and structured the admin overview dashboard.
- Added breadcrumb component for better navigation context.
…document access with PDF viewing and unlocking features
…orders, users, and documents with secure authentication layout
…ling, and add article reading suggestions component
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.

3 participants