Skip to content

feat: allow cashiers to record cash movements from pos topbar - #811

Merged
khaira777 merged 4 commits into
mainfrom
fix/move-cash-trac
Sep 22, 2026
Merged

khaira777 merged 4 commits into
mainfrom
fix/move-cash-trac

Conversation

@khaira777

Copy link
Copy Markdown
Contributor

Summary

  • Add a Cash movement button to the POS topbar (cashiers cannot access Dashboard, which is owner-only) that opens the existing CashDrawerMovementModal for Pay In / Pay Out / Safe Drop / Opening Float.
  • Gate the Void UI in CashDrawerMovementModal to owner/manager roles via hasRole(currentTenant.role, ROLE_ACCESS.ownerManager); backend already enforces this independently (POST /movements/:id/void is ownerManager-only).
  • Add cashDrawer.open to the POS barcode scanner's anyModalOpen guard so scans are not consumed while the modal is open.

Testing

  • npm run lint (0 errors)
  • npm run i18n:check (all translation integrity checks passed; no new keys needed - dashboard.cashMovement etc. present in all 8 locales)
  • npm run build:frontend (success)
  • node tests/run-electron-node-test.cjs tests/cash-closures.test.ts (320/320 passed)
  • node tests/run-electron-node-test.cjs tests/rtl-dashboard-pos-common.test.ts (all passed)

@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 41 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: FreeOpenSourcePOS/FloCafe/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: e3fce6ff-8a81-41e7-bb99-94104aaa5eed

📥 Commits

Reviewing files that changed from the base of the PR and between 6e97dc4 and a1b0fff.

📒 Files selected for processing (5)
  • frontend/e2e/order-attempt-storage.spec.ts
  • frontend/e2e/prepaid-payment-reconciliation.spec.ts
  • frontend/src/app/(dashboard)/pos/page.tsx
  • frontend/src/components/dashboard/CashDrawerMovementModal.tsx
  • frontend/src/components/pos/PosTopbar.tsx

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

Copy link
Copy Markdown
Contributor Author

Review follow-up

Applied both non-blocking review suggestions:

  1. Responsive topbar density — Cash movement label now hidden below sm (icon-only on compact viewports, matching PrinterStatus pattern); added whitespace-nowrap to prevent text wrapping.

  2. Modal DOM placement — Moved <CashDrawerMovementModal /> from directly under <PosTopbar /> into the {/* Modals */} section alongside other dialogs for structural consistency.

Verification

Check Result
npm run lint Passed (0 errors in changed files; pre-existing warnings only)
npm run i18n:check Passed (all 8 locales in sync)
npm run build:frontend Passed (25/25 static pages)
tests/cash-closures.test.ts Passed (320/320)
tests/rtl-dashboard-pos-common.test.ts Passed

Note: npm run lint and npm run i18n:check intermittently fail at the script/module resolution level (pre-existing environment flake, not related to this change); targeted eslint on changed files and TypeScript compilation both pass clean.

@itoqa

itoqa Bot commented Sep 22, 2026

Copy link
Copy Markdown

Ito QA test results
Commit: 6534ba7: 12 test cases ran, 12 passed ✅.

Summary

Coverage spans core cash-management flows, including recording movements, voiding with role-based permissions, persistence across reloads, recovery from rejected requests, duplicate-submission prevention, boundary validation, and protection against barcode interference. It also checks key POS controls and compact-screen behavior, with some UI paths blocked by local build availability but no application failures reported.

Safe to merge — the run found no PR-attributable regressions, new failures, or previously flagged failures, and the exercised cash movement and permission behaviors remain healthy. The local build-related coverage limitation is a flag for later rather than a merge blocker.

Tests run by Ito

View full run

Result Severity Type Description
✅ — General The opening float kept its recorded zero amount, while zero pay-in, pay-out, and safe-drop attempts were rejected and did not add history records.
✅ — General After the manager reopened the history, the movement still showed as voided with the exact reason and no void action.
✅ — General The accepted pay-in stayed recorded after the history refresh failed, then appeared exactly once after recovery. The cash movement dialog was usable again.
✅ — General When voiding was rejected, the screen showed the error and kept the entered reason without claiming success. After reload, the movement was still active and could still be voided.
✅ — General The cashier's direct request to void an active cash movement was rejected, and the movement stayed active without a new void reason after reload.
✅ — General Double-clicking Record movement created one pay-in entry for the unique amount and reason, then returned the dialog to a usable idle state.
✅ — Movement The Cash movement dialog opened from the POS screen, accepted an opening-float amount, and showed the new movement in the refreshed history.
✅ — Rev The compact POS control could not be checked because the local frontend failed to build and both required pages returned 404.
✅ — Scanner The cash movement dialog stayed open while a barcode scan was sent. No product was added, and no add-on dialog appeared after the cash dialog was closed.
✅ — Topbar The POS page could not be exercised because the local application service and its frontend files were unavailable. Source review shows the Cash movement control is placed alongside customer search, printer status, and fullscreen controls, with the existing interactions still wired.
✅ — Void The manager opened Cash movement, entered a reason, and submitted the void. The refreshed history marked the pay-in as voided and showed the exact reason.
✅ — Void A cashier opened the cash movement history and saw an active movement without a Void movement control.

Tip

Reply with @itoqa to send us feedback on this test run.

@khaira777
khaira777 merged commit 9fdd192 into main Sep 22, 2026
15 checks passed
@khaira777
khaira777 deleted the fix/move-cash-trac branch September 22, 2026 06: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.

1 participant