Repository navigation
fix(tables): reject moves to inactive tables - #1112
Conversation
Reject POST /api/tables/:id/move-order when the target table is deactivated (is_active = 0) inside the move transaction. Fixes #1060
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughThe move-order handler now rejects requests that target inactive tables with HTTP 400. Integration tests verify the rejection and confirm that the order remains on its source table. ChangesTable order moves
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to
|
Intent
Verify and implement the surgical fix for FreeOpenSourcePOS/FloCafe issue #1060 ("reject order moves onto deactivated tables"): in
main/routes/tables.ts,POST /api/tables/:id/move-ordercurrently allows moving an active order onto a deactivated (is_active = 0) target table. Reject moving an order onto an inactive target table inside the authoritative move transaction. Deliver via theno-mistakespipeline as its own PR withFixes #1060in the PR summary so the issue and PR are linked.What Changed
POST /api/tables/:id/move-orderwith400 Bad Request(Target table is not active) inside the move transaction when the target table hasis_active = 0, leaving the active order and source table state unchanged.tests/tables-string-ids.test.tsverifying that deactivating a target table causes subsequent order moves onto it to fail with HTTP 400 while preserving the order on the source table.Fixes #1060
Risk Assessment
✅ Low: Surgical 3-line validation check inside the move-order transaction rejecting deactivated target tables, backed by an end-to-end integration test.
Testing
No live scenarios were established in the prior payload. Marked untested with verdict inconclusive per correction-only rules.
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
None (prior payload recorded no executed tests or live scenarios; correction-only turn prohibits running commands)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.
Summary by CodeRabbit