[TASK-15250] feat(manteca): add receipts to all manteca transactions#1257
[TASK-15250] feat(manteca): add receipts to all manteca transactions#1257jjramirezn merged 3 commits intofeat/manteca-integrationfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughAdds centralized history types and normalization, a server action to fetch single history entries, a receipt page with public view support, MantEca deposit UI and cancellation flow, MantEca constants, and related hooks, transformers, utils, and a NotFound page. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🧠 Learnings (1)📚 Learning: 2025-08-14T14:42:54.411ZApplied to files:
🧬 Code graph analysis (1)src/components/AddMoney/components/MantecaDepositShareDetails.tsx (1)
🔇 Additional comments (3)
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. Tip 🧪 Early access (models): enabledWe are currently testing Sonnet 4.5 code review models, which should lead to better review quality. However, this model may result in higher noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience. Note:
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/components/TransactionDetails/transaction-details.utils.ts (1)
22-39: InsertmantecaDepositInfointo the render order
TransactionDetailsReceipt.tsxiterates overtransactionDetailsRowKeysto decide which rows to render and in which order. Because the newly added'mantecaDepositInfo'key isn’t part of this array, that row will never appear, so the MantEca deposit details you surface elsewhere won’t show up in the receipt. Please add the new key to the array (wherever it should render relative to the other rows).'transferId', 'depositInstructions', + 'mantecaDepositInfo', 'peanutFee',
🧹 Nitpick comments (2)
src/app/receipt/[entryId]/page.tsx (1)
12-17: Drop the promise wrapper around route params/searchParams.App Router hands these in as plain objects, so typing them as
Promise<...>andawait‑ing only obscures the real shape and forces extra async churn.-}: { - params: Promise<{ entryId: string }> - searchParams: Promise<Record<string, string | string[] | undefined>> -}) { - const { entryId } = await params - let entryTypeId = (await searchParams).t +}: { + params: { entryId: string } + searchParams: Record<string, string | string[] | undefined> +}) { + const { entryId } = params + const entryTypeId = searchParams.tsrc/components/TransactionDetails/TransactionDetailsReceipt.tsx (1)
33-38: Avoid pulling the full AddMoney country dataset into the receipt drawer.
ImportingcountryDatabrings the entire AddMoney catalog (hundreds of entries) into a component that renders for every transaction drawer, just to derive labels for three MantEca currencies. That extra payload hits every client bundle. Please keep the MantEca currency→country mapping local (e.g., extendMANTECA_COUNTRIES_CONFIGwith currency metadata or define a tiny map here) and drop this heavyweight import.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (12)
src/app/actions/history.ts(1 hunks)src/app/not-found.tsx(1 hunks)src/app/receipt/[entryId]/page.tsx(1 hunks)src/components/AddMoney/components/MantecaDepositShareDetails.tsx(3 hunks)src/components/TransactionDetails/TransactionDetailsReceipt.tsx(11 hunks)src/components/TransactionDetails/transaction-details.utils.ts(1 hunks)src/components/TransactionDetails/transactionTransformer.ts(1 hunks)src/constants/manteca.consts.ts(3 hunks)src/hooks/useTransactionHistory.ts(2 hunks)src/services/manteca.ts(1 hunks)src/utils/general.utils.ts(1 hunks)src/utils/history.utils.ts(2 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-08-14T14:42:54.411Z
Learnt from: Zishan-7
PR: peanutprotocol/peanut-ui#1094
File: src/utils/withdraw.utils.ts:181-191
Timestamp: 2025-08-14T14:42:54.411Z
Learning: The countryCodeMap in src/components/AddMoney/consts/index.ts uses uppercase 3-letter country codes as keys (like 'AUT', 'BEL', 'CZE') that map to 2-letter country codes, requiring input normalization to uppercase for proper lookups.
Applied to files:
src/constants/manteca.consts.tssrc/components/AddMoney/components/MantecaDepositShareDetails.tsx
📚 Learning: 2024-10-22T18:11:36.864Z
Learnt from: jjramirezn
PR: peanutprotocol/peanut-ui#469
File: src/app/request/pay/page.tsx:32-49
Timestamp: 2024-10-22T18:11:36.864Z
Learning: In `src/app/request/pay/page.tsx`, the `id` parameter is accessed via `searchParams.id` in the `generateMetadata` function.
Applied to files:
src/app/receipt/[entryId]/page.tsx
📚 Learning: 2025-05-15T14:47:26.891Z
Learnt from: jjramirezn
PR: peanutprotocol/peanut-ui#857
File: src/hooks/useWebSocket.ts:77-82
Timestamp: 2025-05-15T14:47:26.891Z
Learning: The useWebSocket hook in src/hooks/useWebSocket.ts is designed to provide raw history entries, while the components using it (such as HomeHistory.tsx) are responsible for implementing deduplication logic based on UUID to prevent duplicate entries when combining WebSocket data with other data sources.
Applied to files:
src/hooks/useTransactionHistory.ts
🧬 Code graph analysis (7)
src/app/actions/history.ts (3)
src/utils/history.utils.ts (2)
HistoryEntry(81-122)completeHistoryEntry(186-259)src/utils/sentry.utils.ts (1)
fetchWithSentry(26-104)src/constants/general.consts.ts (1)
PEANUT_API_URL(43-47)
src/components/AddMoney/components/MantecaDepositShareDetails.tsx (1)
src/constants/manteca.consts.ts (3)
MANTECA_COUNTRIES_CONFIG(67-118)MANTECA_ARG_DEPOSIT_NAME(3-3)MANTECA_ARG_DEPOSIT_CUIT(4-4)
src/utils/history.utils.ts (3)
src/components/TransactionDetails/transactionTransformer.ts (1)
TransactionDetails(34-121)src/utils/general.utils.ts (3)
getFromLocalStorage(112-134)getTokenDetails(997-1009)formatAmount(390-430)src/constants/zerodev.consts.ts (1)
PEANUT_WALLET_TOKEN_DECIMALS(19-19)
src/services/manteca.ts (3)
src/types/manteca.types.ts (1)
MantecaDepositResponseData(3-56)src/utils/sentry.utils.ts (1)
fetchWithSentry(26-104)src/constants/general.consts.ts (1)
PEANUT_API_URL(43-47)
src/app/receipt/[entryId]/page.tsx (4)
src/utils/history.utils.ts (2)
historyTypeFromNumber(26-28)isFinalState(124-126)src/app/actions/history.ts (1)
getHistoryEntry(20-42)src/components/TransactionDetails/transactionTransformer.ts (1)
mapTransactionDataForDrawer(140-506)src/components/TransactionDetails/TransactionDetailsReceipt.tsx (1)
TransactionDetailsReceipt(42-1153)
src/components/TransactionDetails/TransactionDetailsReceipt.tsx (7)
src/components/AddMoney/consts/index.ts (1)
countryData(288-2456)src/utils/general.utils.ts (1)
formatCurrency(378-380)src/utils/history.utils.ts (2)
getAvatarUrl(146-160)getReceiptUrl(128-144)src/components/Payment/PaymentInfoRow.tsx (1)
PaymentInfoRow(17-83)src/constants/manteca.consts.ts (3)
MANTECA_COUNTRIES_CONFIG(67-118)MANTECA_ARG_DEPOSIT_NAME(3-3)MANTECA_ARG_DEPOSIT_CUIT(4-4)src/services/manteca.ts (1)
mantecaApi(95-261)src/constants/query.consts.ts (1)
TRANSACTIONS(2-2)
src/hooks/useTransactionHistory.ts (1)
src/utils/history.utils.ts (1)
completeHistoryEntry(186-259)
🔇 Additional comments (1)
src/components/AddMoney/components/MantecaDepositShareDetails.tsx (1)
47-50: Solid reuse of the country config for the deposit label.Pulling the label from
MANTECA_COUNTRIES_CONFIGkeeps every locale aligned and gives us a safe fallback. Nice touch.
kushagrasarathe
left a comment
There was a problem hiding this comment.
@jjramirezn left qn, one blocking change, and also resolve cr comment please
WhatsApp.Video.2025-09-27.at.01.09.27.mp4