Skip to content

fix(tables): reject moves to inactive tables - #1112

Merged
khaira777 merged 2 commits into
mainfrom
fm/flocafe-issue-1060-r1
Oct 13, 2026
Merged

khaira777 merged 2 commits into
mainfrom
fm/flocafe-issue-1060-r1

Conversation

@khaira777

@khaira777 khaira777 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

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-order currently 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 the no-mistakes pipeline as its own PR with Fixes #1060 in the PR summary so the issue and PR are linked.

What Changed

  • Reject POST /api/tables/:id/move-order with 400 Bad Request (Target table is not active) inside the move transaction when the target table has is_active = 0, leaving the active order and source table state unchanged.
  • Add integration test coverage in tests/tables-string-ids.test.ts verifying 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.

  • Live validation: ⚠️ inconclusive - 0 of 1 scenarios driven live against the product
Scenario Result Live Evidence
Live product validation of the change ⏸️ untested no The rejected payload did not record any live scenario execution or evidence, and this correction-only turn prohibits running commands or accessing the workspace.
  • Outcome: ⚠️ 1 warning across 1 run (24m42s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

⚠️ **Test** - 1 warning
  • ⚠️ live validation verdict: inconclusive (0 of 1 scenarios were driven live against the product); untested: Live product validation of the change
  • Live validation: ⚠️ inconclusive - 0 of 1 scenarios driven live against the product
Scenario Result Live Evidence
Live product validation of the change ⏸️ untested no The rejected payload did not record any live scenario execution or evidence, and this correction-only turn prohibits running commands or accessing the workspace.
  • 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

  • Bug Fixes
    • Moving an order to an inactive table now returns a clear error and leaves the order on its original table.
  • Tests
    • Added coverage for moves to inactive tables and expanded table-capacity validation checks.

Reject POST /api/tables/:id/move-order when the target table is deactivated (is_active = 0) inside the move transaction.

Fixes #1060
@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: FreeOpenSourcePOS/FloCafe/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9abac664-03a4-4696-92ef-b91fcde0a26e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: FreeOpenSourcePOS/FloCafe/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 83d362ef-9c29-4380-9103-dba7a5b73479
📥 Commits

Reviewing files that changed from the base of the PR and between 0f5baed and bea4a73.

📒 Files selected for processing: 2
  • main/routes/tables.ts
  • tests/tables-string-ids.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Walkthrough

The 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.

Changes

Table order moves

Layer / File(s) Summary
Inactive target validation
main/routes/tables.ts
The move-order handler rejects an inactive target table with HTTP 400 and the error Target table is not active.
Table route integration coverage
tests/tables-string-ids.test.ts
A new integration case checks the rejection and verifies that the order remains on its source table. Existing scenarios are reformatted, and malformed-capacity tests add status-code and stable error-code assertions.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to bea4a

Moving an order to an inactive table is now rejected with a 400 error, and the order stays on its source table. The change is narrow and has test coverage, so merge risk is minimal.

Pre-merge checks: Passed 2 · Failed 3

Failed Failed checks: 3 warnings

Check name Status Explanation Resolution
Out of Scope Changes check Warning The PR scope is limited to rejecting moves to inactive target tables. The test diff also adds stable error-code checks and boolean and array capacity coverage for unrelated table-property create and e… Remove the unrelated table-property test additions and retain only the move-order regression coverage and changes required for issue #1060. Avoid broad test-file reformatting unless it is required for the retained change.
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check Warning The description explains the intent, implementation, risk, and test scenario, but it does not follow the required template. It omits or incompletely covers related work, scope, exact verification comm… Rewrite the description using the repository template. Add the missing sections and document the exact commands and results. Mark non-applicable sections explicitly, complete the cross-cutting surface table, and complete the contributor che…
Passed Passed checks: 2 passed
Check name Status Explanation
Linked Issues check Passed Issue #1060 is open and directly linked. The PR adds validation inside the move-order transaction for an inactive target table. It returns HTTP 400 with Target table is not active. The integration t…
Title check Passed The title clearly and concisely identifies the main change: rejecting order moves to inactive tables.
Full details: Out of Scope Changes check

Explanation

The PR scope is limited to rejecting moves to inactive target tables. The test diff also adds stable error-code checks and boolean and array capacity coverage for unrelated table-property create and edit scenarios. These changes do not validate the move-order invariant and are outside issue #1060. The repository diff could not be fetched for further line-level verification, but the supplied change summary identifies these unrelated additions.

Full details: Description check

Explanation

The description explains the intent, implementation, risk, and test scenario, but it does not follow the required template. It omits or incompletely covers related work, scope, exact verification commands and results, compatibility and data safety, screenshots, cross-cutting surfaces, developer documentation, and the contributor checklist.

Resolution

Rewrite the description using the repository template. Add the missing sections and document the exact commands and results. Mark non-applicable sections explicitly, complete the cross-cutting surface table, and complete the contributor checklist.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@khaira777 khaira777 changed the title fix(tables): reject order moves onto deactivated tables fix(tables): reject moves to inactive tables Oct 13, 2026
@khaira777
khaira777 enabled auto-merge (squash) October 13, 2026 19:50
@khaira777
khaira777 merged commit 41532a1 into main Oct 13, 2026
23 checks passed
@khaira777
khaira777 deleted the fm/flocafe-issue-1060-r1 branch October 13, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(tables): reject order moves onto deactivated tables

1 participant