Conversation
…NG_BUYER_INVOICE" to allow the order to become "ACTIVE"
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughUpdated Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 the current code and only fix it if needed.
Inline comments:
In `@bot/start.ts`:
- Around line 895-903: Remove the redundant ctx.deleteMessage() call in the
action handler and make the status routing explicit: instead of calling
addInvoicePHI in the else branch, check if order.status === 'PAID_HOLD_INVOICE'
and call addInvoicePHI(ctx, bot, ctx.match[1]) only in that case; for any other
status do not call either handler (or handle explicitly if needed). Update the
handler around the Order lookup (the block that calls addInvoice and
addInvoicePHI) to remove the standalone ctx.deleteMessage() and rely on the
deleteMessage calls inside addInvoice and addInvoicePHI, and replace the else
with an explicit status comparison to 'PAID_HOLD_INVOICE'.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
…ddInvoice and addInvoicePHI independently called ctx.deleteMessage()
There was a problem hiding this comment.
Approved, the change is aligned with issue #718 and the /setinvoice action already routes WAITING_BUYER_INVOICE through addInvoice, so the flow looks consistent. The only thing still missing for me is test coverage for this state transition.
A simple test idea would be to cover askForConfirmation(..., '/setinvoice') or the command handler and assert that orders in both PAID_HOLD_INVOICE and WAITING_BUYER_INVOICE are offered to the buyer. For example, create a buyer fixture, seed one order in WAITING_BUYER_INVOICE, run the /setinvoice command, and assert that the confirmation buttons include that order id. That would protect this exact regression in the future.
Fixes #718
Summary by CodeRabbit