Skip to content

[TASK-15335] feat: add receipt for send link#1297

Merged
jjramirezn merged 2 commits intopeanut-wallet-devfrom
feat/receipt-for-send-link
Oct 8, 2025
Merged

[TASK-15335] feat: add receipt for send link#1297
jjramirezn merged 2 commits intopeanut-wallet-devfrom
feat/receipt-for-send-link

Conversation

@jjramirezn
Copy link
Contributor

WhatsApp.Video.2025-10-07.at.18.54.15.mp4

@vercel
Copy link

vercel bot commented Oct 7, 2025

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

Project Deployment Preview Comments Updated (UTC)
peanut-wallet Ready Ready Preview Comment Oct 8, 2025 8:28pm

@notion-workspace
Copy link

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 7, 2025

Walkthrough

Reworks getReceiptUrl in src/utils/history.utils.ts to prefer in-app receipt pages when transaction.extraDataForDrawer.originalType is one of MANTECA_QR_PAYMENT, MANTECA_OFFRAMP, MANTECA_ONRAMP, or SEND_LINK; otherwise falls back to transaction.extraDataForDrawer.link. Method signature unchanged.

Changes

Cohort / File(s) Summary of changes
History utils: receipt URL resolution
src/utils/history.utils.ts
Reworked getReceiptUrl: introduced hasReceiptPage guard based on extraDataForDrawer.originalType (includes SEND_LINK), uses asserted originalType to compute typeId and build in-app receipt URL; fallback to extraDataForDrawer.link. Removed previous separate MANTECA-type branch and missing-originalType checks.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • kushagrasarathe
  • Zishan-7

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description Check ❓ Inconclusive The description only contains a link to an asset and does not summarize or explain any of the code changes, making it too vague to convey the intent or scope of the pull request. Please replace the asset URL placeholder with a brief written summary of the changes introduced, including why the receipt for the send link was added and which parts of the code were modified.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The title clearly and concisely summarizes the main change of the pull request by indicating that a receipt feature is being added for the send link flow, which aligns with the updates made to the getReceiptUrl logic in history.utils.ts. It is specific enough for a reviewer to understand the primary feature introduced without extraneous information.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/receipt-for-send-link

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 535498a and 6f7b923.

📒 Files selected for processing (1)
  • src/utils/history.utils.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2024-10-04T13:10:49.199Z
Learnt from: Hugo0
PR: peanutprotocol/peanut-ui#413
File: src/components/Request/Pay/Views/Initial.view.tsx:71-72
Timestamp: 2024-10-04T13:10:49.199Z
Learning: In `src/components/Request/Pay/Views/Initial.view.tsx`, it's acceptable to use the `!` operator in TypeScript to assert that `selectedTokenData` is not `null` or `undefined`, and potential runtime errors from accessing its properties without checks can be disregarded.

Applied to files:

  • src/utils/history.utils.ts
📚 Learning: 2024-12-11T10:13:22.806Z
Learnt from: jjramirezn
PR: peanutprotocol/peanut-ui#564
File: src/components/Request/Pay/Views/Initial.view.tsx:430-430
Timestamp: 2024-12-11T10:13:22.806Z
Learning: In the React TypeScript file `src/components/Request/Pay/Views/Initial.view.tsx`, when reviewing the `InitialView` component, do not flag potential issues with using non-null assertion `!` on the `slippagePercentage` variable, as handling undefined values in this context is considered out of scope.

Applied to files:

  • src/utils/history.utils.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Deploy-Preview

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.

@coderabbitai coderabbitai bot added the enhancement New feature or request label Oct 7, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/utils/history.utils.ts (1)

1-1: Fix Prettier formatting before merge.

The pipeline indicates a Prettier formatting check failure. Run the following command to resolve this:

pnpm prettier --write src/utils/history.utils.ts
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3ffb529 and 535498a.

📒 Files selected for processing (1)
  • src/utils/history.utils.ts (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: Tests
src/utils/history.utils.ts

[error] 1-1: Prettier formatting check failed. Run 'pnpm prettier --write' to fix code style issues in this file.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Deploy-Preview
🔇 Additional comments (1)
src/utils/history.utils.ts (1)

131-136: Verify intentional behavior change for SEND_LINK receipt URL
Including SEND_LINK in the hasReceiptPage guard now makes getReceiptUrl return the in-app receipt page (/receipt/${id}?t=${typeId}) instead of extraDataForDrawer.link. Confirm this switch is deliberate and compatible with existing SEND_LINK flows.

@jjramirezn jjramirezn merged commit 324fd93 into peanut-wallet-dev Oct 8, 2025
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants