Conversation
…ist and PDF/view links
…ngs component; clean up import statements for better readability
Greptile OverviewGreptile SummaryAdded Invoice History section to Organization Settings Billing tab that displays past invoices with amounts, dates, statuses, and download/view links. Data is fetched from
Confidence Score: 4/5
|
| Filename | Overview |
|---|---|
| lib/api/billing.ts | Added Invoice interface and getInvoices() function following existing API patterns |
| components/settings/OrganizationSettings.tsx | Added invoice history UI with loading states, status badges, and PDF/hosted invoice links |
Sequence Diagram
sequenceDiagram
participant User
participant UI as OrganizationSettings
participant API as billing.ts
participant Backend as /api/billing/invoices
User->>UI: Navigate to Billing tab
activate UI
UI->>UI: Check activeTab === 'billing' && currentOrgId
UI->>API: loadInvoices() → getInvoices()
activate API
API->>Backend: GET /api/billing/invoices
activate Backend
Backend-->>API: Invoice[] (id, amount_paid, currency, status, etc.)
deactivate Backend
API-->>UI: Invoice[]
deactivate API
UI->>UI: setInvoices(invs)
UI->>UI: setIsLoadingInvoices(false)
UI-->>User: Display invoice list
deactivate UI
alt User clicks Download PDF
User->>UI: Click DownloadIcon link
UI->>Backend: Open invoice.invoice_pdf URL
Backend-->>User: PDF file download
else User clicks View Invoice
User->>UI: Click ExternalLinkIcon link
UI->>Backend: Open invoice.hosted_invoice_url
Backend-->>User: Stripe hosted invoice page
end
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.
Work Item
PULSE-32
Summary
GET /api/billing/invoiceswhen the Billing tab is active.Changes
lib/api/billing.ts: AddedInvoiceinterface andgetInvoices()callingGET /api/billing/invoices.components/settings/OrganizationSettings.tsx: Addedinvoices/isLoadingInvoicesstate andloadInvoices(); "Invoice History" block below Current Plan with amount, date, status badge, PDF and hosted-invoice links (usingBookOpenIcon,DownloadIcon,ExternalLinkIconfrom@ciphera-net/ui). Empty and loading states.Test Plan