refunds#2615
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
WalkthroughThe pull request extends the payment history feature with additional refund and credit states. The data contract now includes three new statuses ( 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. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
mcpjam-inspector/client/src/components/billing/__tests__/PaymentsHistorySection.test.tsx (1)
27-44:⚠️ Potential issue | 🟡 Minor | ⚡ Quick win
makeEntryomitsaccountCreditedCents, so split-refund fixtures are incomplete.The helper accepts overrides containing
accountCreditedCentsbut never forwards that field into the returnedPaymentHistoryEntry, so the new split refund+credit scenario is not fully represented.Suggested patch
function makeEntry( overrides: Partial<PaymentHistoryEntry> & { id: string } ): PaymentHistoryEntry { return { @@ ...(overrides.reversedPaidCents !== undefined ? { reversedPaidCents: overrides.reversedPaidCents } : {}), + ...(overrides.accountCreditedCents !== undefined + ? { accountCreditedCents: overrides.accountCreditedCents } + : {}), ...(overrides.receiptUrl !== undefined ? { receiptUrl: overrides.receiptUrl } : {}), }; }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@mcpjam-inspector/client/src/components/billing/__tests__/PaymentsHistorySection.test.tsx` around lines 27 - 44, The makeEntry factory is not including the accountCreditedCents field from overrides, so split-refund fixtures are incomplete; update the makeEntry function to forward overrides.accountCreditedCents into the returned PaymentHistoryEntry (similar to how reversedPaidCents and receiptUrl are conditionally spread) so the produced entries can represent split refunds and credits correctly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In
`@mcpjam-inspector/client/src/components/billing/__tests__/PaymentsHistorySection.test.tsx`:
- Around line 27-44: The makeEntry factory is not including the
accountCreditedCents field from overrides, so split-refund fixtures are
incomplete; update the makeEntry function to forward
overrides.accountCreditedCents into the returned PaymentHistoryEntry (similar to
how reversedPaidCents and receiptUrl are conditionally spread) so the produced
entries can represent split refunds and credits correctly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f0983b5f-67ce-46ad-82cb-cc12b7622ec1
📒 Files selected for processing (4)
mcpjam-inspector/client/src/components/billing/PaymentsHistorySection.tsxmcpjam-inspector/client/src/components/billing/__tests__/PaymentsHistorySection.test.tsxmcpjam-inspector/client/src/hooks/__tests__/usePaymentsHistory.test.tsmcpjam-inspector/client/src/hooks/usePaymentsHistory.ts
Internal previewPreview URL: https://mcp-inspector-pr-2615.up.railway.app |
516