Skip to content

Make Payment sheet url accessible#16337

Open
amjithtitus09 wants to merge 1 commit intodevelopfrom
payment-sheet-url
Open

Make Payment sheet url accessible#16337
amjithtitus09 wants to merge 1 commit intodevelopfrom
payment-sheet-url

Conversation

@amjithtitus09
Copy link
Copy Markdown
Member

@amjithtitus09 amjithtitus09 commented May 6, 2026

Proposed Changes

https://openhealthcarenetwork.atlassian.net/browse/ENG-255
Make Payment sheet url accessible to enable redirect to invoice view with payment sheet open.

Tagging: @ohcnetwork/care-fe-code-reviewers

Merge Checklist

  • Add specs that demonstrate the bug or test the new feature.
  • Update product documentation.
  • Ensure that UI text is placed in I18n files.
  • Prepare a screenshot or demo video for the changelog entry and attach it to the issue.
  • Request peer reviews.
  • Complete QA on mobile devices.
  • Complete QA on desktop devices.
  • Add or update Playwright tests for related changes

Summary by CodeRabbit

  • Refactor
    • Improved payment sheet state management across billing and pharmacy pages for better URL navigation and state persistence.

@amjithtitus09 amjithtitus09 requested review from a team and Copilot May 6, 2026 17:54
Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

⚠️ Merge Checklist Incomplete

Thank you for your contribution! To help us review your PR efficiently, please complete the merge checklist in your PR description.

Your PR will be reviewed once you have marked the appropriate checklist items.

To update the checklist:

  • Change - [ ] to - [x] for completed items
  • Only check items that are relevant to your PR
  • Leave items unchecked if they don't apply

The checklist helps ensure code quality, testing coverage, and documentation are properly addressed.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 6, 2026

Caution

Review failed

Failed to post review comments

Walkthrough

This PR refactors payment sheet state management across three billing and pharmacy components, replacing local React state with URL-driven query parameters via the raviger library. The change centralizes visibility state into the URL, enabling shareable links and consistent navigation behavior.

Changes

Payment Sheet State to URL Query Parameters

Layer / File(s) Summary
Import Updates
src/pages/Facility/billing/account/AccountShow.tsx, src/pages/Facility/billing/invoice/InvoiceShow.tsx, src/pages/Facility/services/pharmacy/DispensedMedicationList.tsx
useQueryParams is imported from raviger alongside existing route imports (Link, navigate).
State Management Refactoring
src/pages/Facility/billing/account/AccountShow.tsx, src/pages/Facility/billing/invoice/InvoiceShow.tsx, src/pages/Facility/services/pharmacy/DispensedMedicationList.tsx
Local useState hooks for payment sheet visibility are replaced with useQueryParams<{ payment?: string }>(). Payment sheet open/closed state now derives from the payment query parameter.
Setter Function Updates
src/pages/Facility/billing/account/AccountShow.tsx, src/pages/Facility/billing/invoice/InvoiceShow.tsx, src/pages/Facility/services/pharmacy/DispensedMedicationList.tsx
New setter functions update the URL query parameter (payment: "credit" or payment: "advance" when opening, cleared when closing) via setQueryParams with replace: true.
Query Parameter Access
src/pages/Facility/billing/invoice/InvoiceShow.tsx
Query parameters like sourceUrl and relatedInvoices are read directly from the qParams object instead of being destructured from the useQueryParams hook's return value.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Make Payment sheet url accessible' directly aligns with the main objective of exposing the payment sheet URL to enable redirecting to invoice views with the payment sheet open.
Description check ✅ Passed The PR description includes the required template structure with proposed changes, issue reference, tagging, and merge checklist, though most checklist items remain unchecked indicating incomplete QA and testing preparation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch payment-sheet-url

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

🎭 Playwright Test Results

Status: ❌ Failed
Test Shards: 3

Metric Count
Total Tests 21
✅ Passed 15
❌ Failed 6
⏭️ Skipped 0

📊 Detailed results are available in the playwright-final-report artifact.

Run: #8695

@parvathyns-creator
Copy link
Copy Markdown

@nihal467 this looks fine

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants