Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@BilalG1
Copy link
Contributor

@BilalG1 BilalG1 commented Jan 16, 2026

Screenshot 2026-01-16 at 10 33 54 AM

@vercel
Copy link

vercel bot commented Jan 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
stack-backend Ready Ready Preview, Comment Jan 16, 2026 7:24pm
stack-dashboard Ready Ready Preview, Comment Jan 16, 2026 7:24pm
stack-demo Ready Ready Preview, Comment Jan 16, 2026 7:24pm
stack-docs Ready Ready Preview, Comment Jan 16, 2026 7:24pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 16, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 16, 2026

Greptile Summary

Added an invoice history table to the payments panel that displays the most recent 10 customer invoices with date, status, amount, and a link to view the full invoice on Stripe.

  • Added three formatting helper functions (formatInvoiceStatus, formatInvoiceAmount, formatInvoiceDate) with proper null/undefined handling
  • Integrated useInvoices hook to fetch invoice data with a limit of 10
  • Created a responsive table with proper i18n support for all labels
  • Included graceful handling for missing hostedInvoiceUrl by showing "Unavailable" text
  • Used proper key generation for table rows with fallback for invalid dates

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation is straightforward with proper error handling for edge cases (NaN dates, null values, missing URLs). The formatting functions handle all edge cases correctly, and the UI components are used appropriately. No security concerns as the invoice URLs come from Stripe's trusted API.
  • No files require special attention

Important Files Changed

Filename Overview
packages/template/src/components-page/account-settings/payments/payments-panel.tsx Added invoice list display with proper formatting and error handling for dates, amounts, and status values

Sequence Diagram

sequenceDiagram
    participant User
    participant PaymentsPanel
    participant CustomerHook as customer.useInvoices()
    participant ClientApp
    participant API as /api/.../invoices/[type]/[id]
    participant DB as Database

    User->>PaymentsPanel: View payments panel
    PaymentsPanel->>CustomerHook: useInvoices({ limit: 10 })
    CustomerHook->>ClientApp: Fetch invoice data
    ClientApp->>API: GET invoices list
    API->>DB: Query subscriptionInvoice table
    DB-->>API: Return invoice records
    API-->>ClientApp: Return formatted invoices
    ClientApp-->>CustomerHook: Return CustomerInvoicesList
    CustomerHook-->>PaymentsPanel: Invoices array with data
    PaymentsPanel->>PaymentsPanel: formatInvoiceDate(createdAt)
    PaymentsPanel->>PaymentsPanel: formatInvoiceStatus(status)
    PaymentsPanel->>PaymentsPanel: formatInvoiceAmount(amountTotal)
    PaymentsPanel->>User: Display invoice table
    User->>PaymentsPanel: Click "View" button
    PaymentsPanel->>User: Open hostedInvoiceUrl in new tab
Loading

@BilalG1 BilalG1 requested a review from N2D4 January 16, 2026 19:35
@BilalG1 BilalG1 assigned N2D4 and unassigned BilalG1 Jan 16, 2026
@github-actions github-actions bot assigned BilalG1 and unassigned N2D4 Jan 20, 2026
Base automatically changed from payments-invoice-history to payment-chargeback-notifications January 20, 2026 00:30
Base automatically changed from payment-chargeback-notifications to payment-email-templates January 20, 2026 00:30
@N2D4 N2D4 merged commit edc8fe5 into payment-email-templates Jan 20, 2026
28 of 33 checks passed
@N2D4 N2D4 deleted the payments-invoice-history-frontend branch January 20, 2026 00:31
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