Conversation
WalkthroughThe Beckn ChangesReceiver reconciliation actions
Estimated code review effort: 1 (Trivial) | ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@lib/mobility-core/src/Kernel/Types/Beckn/Context.hs`:
- Around line 125-126: Update mapToCbAction so ON_RECEIVER_RECON maps to Nothing
while preserving its request mapping to RECEIVER_RECON. Add regression tests
covering this callback mapping and getSubscriberType, verifying the callback is
classified as BPP rather than BAP.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 4d5f138a-74a1-4135-829a-0b8f9323a565
📒 Files selected for processing (1)
lib/mobility-core/src/Kernel/Types/Beckn/Context.hs
| RECEIVER_RECON -> Just ON_RECEIVER_RECON | ||
| ON_RECEIVER_RECON -> Just ON_RECEIVER_RECON |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Map ON_RECEIVER_RECON to Nothing.
getSubscriberType at Line 130 treats Just as Subscriber.BAP and Nothing as Subscriber.BPP. The new ON_RECEIVER_RECON -> Just ON_RECEIVER_RECON branch therefore classifies the callback as BAP.
withBecknCallbackMig in lib/mobility-core/src/Kernel/Utils/Callback.hs, Lines 59-78, uses the mapped value as cbContext.action. RSF identifies the receiver as the Seller App/BPP and uses on_receiver_recon as its callback. (ondc-static-website-media.s3.ap-south-1.amazonaws.com)
Keep the request mapping, but make the callback mapping terminal:
Proposed fix
RECEIVER_RECON -> Just ON_RECEIVER_RECON
- ON_RECEIVER_RECON -> Just ON_RECEIVER_RECON
+ ON_RECEIVER_RECON -> NothingAdd regression coverage for both mapToCbAction and getSubscriberType.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| RECEIVER_RECON -> Just ON_RECEIVER_RECON | |
| ON_RECEIVER_RECON -> Just ON_RECEIVER_RECON | |
| RECEIVER_RECON -> Just ON_RECEIVER_RECON | |
| ON_RECEIVER_RECON -> Nothing |
🤖 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 `@lib/mobility-core/src/Kernel/Types/Beckn/Context.hs` around lines 125 - 126,
Update mapToCbAction so ON_RECEIVER_RECON maps to Nothing while preserving its
request mapping to RECEIVER_RECON. Add regression tests covering this callback
mapping and getSubscriberType, verifying the callback is classified as BPP
rather than BAP.
Type of Change
Description
Additional Changes
Motivation and Context
How did you test it?
Checklist
./dev/format-all-files.shSummary by CodeRabbit