Skip to content

fix(pos): resolve three support ticket follow-ups - #1636

Merged
itsbkm merged 1 commit into
mainfrom
codex/support-ticket-followups
Nov 26, 2026
Merged

itsbkm merged 1 commit into
mainfrom
codex/support-ticket-followups

Conversation

@itsbkm

@itsbkm itsbkm commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Changes

  • Reuse a support ticket when the same POS operation and failure are reported again.
  • Offer the full business-day product sales PDF from cash close using the report date and existing export permission.
  • Show waiter-app PIN roster status and allow retry after a failed load.

Closes #1632
Closes #1633
Closes #1634

Verification

  • Backend and frontend builds, lint, and translation checks passed.
  • Four focused Chromium tests passed, covering the three fixes and existing PIN sign-in.

@coderabbitai

coderabbitai Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

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

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
  • 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

@itsbkm
itsbkm enabled auto-merge (squash) November 26, 2026 20:24
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Resolve POS support, cash-close export, and waiter PIN follow-ups

🐞 Bug fix 🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Reuse support tickets for repeated POS failures instead of submitting duplicates.
• Offer a permission-gated, full-business-day product sales PDF from cash close.
• Explain waiter PIN roster states and let staff retry failed loads.
Merge Risk 🟡 Medium

Blast radius 🔴 High 💥 3 capabilities

  • 3 affected capabilities span independent functional scopes: cash_close_reporting, pos_support_diagnostics, server_app_authentication.
  • The changed path starts at the cash-close dashboard action, selects the closeout business date, and invokes the existing daily-sales export for that reporting workflow.
  • The changed behavior concerns the Server App PIN-user roster and its login-screen feedback; it does not change the separate email/password authentication path or KDS consumers.
  • The changed behavior begins when POS presents an operation failure and ends at support-ticket submission and queued-status UI; it does not alter the underlying order or payment operation.
Behavioral complexity 🔴 High 🧩 Coordinated invariants, Concurrent ordering

  • Before, each displayed failure generated a fresh client ticket ID and submission state.
  • After, correlated failures share a mutable ticket record and asynchronous submission checks its status and session token.
  • New correctness conditions: identical failures must reuse one ID, distinct failures must remain independent, and stale completions must not mutate the current failure UI.
Potential damage 🟡 Medium 🩹 Incorrect results

  • A date-selection or close-step regression could generate a product report for the wrong business date or fail to reflect the closeout being reviewed.
  • No persistent sales state is modified.
  • Re-running the export after correcting the date or code restores the report; stored sales data and external financial records do not require repair.
Assessed commit 5ef19aa
Diagram

graph TD
  POS["POS Failure"] --> CACHE["Ticket Cache"] --> SUPPORT["Support API"]
  CASH["Cash Close"] --> SALES["Sales Export"]
  SIGNIN["Waiter Sign-in"] --> ROSTER["PIN Roster API"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Backend-enforced ticket idempotency
  • ➕ Could prevent duplicate submissions across page reloads, sessions, or devices.
  • ➖ Requires backend identity and retention rules for deciding when failures represent the same ticket.

Recommendation: Keep the scoped frontend ticket cache for these repeated failures: it reuses the existing submission API without changing backend semantics. Consider backend idempotency separately if duplicate prevention must extend beyond the current POS session.

Files changed (39) +251 / -25

Bug fix (4) +130 / -24
page.tsxPass business-date PDF export into cash close +15/-6

Pass business-date PDF export into cash close

• Allows daily sales export to use an explicit business date and exposes the PDF action to the cash-close modal only for tenants with the existing export permission.

frontend/src/app/(dashboard)/dashboard/page.tsx

page.tsxReuse support tickets for matching POS failures +53/-11

Reuse support tickets for matching POS failures

• Keys ticket IDs and draft, submitting, or queued status to the operation failure and session context. Repeated failures retain queued status; new failures receive new tickets, and asynchronous completion updates only the relevant visible ticket.

frontend/src/app/(dashboard)/pos/page.tsx

page.tsxDistinguish PIN roster loading, failure, and emptiness +39/-6

Distinguish PIN roster loading, failure, and emptiness

• Replaces the ambiguous empty roster state with explicit loading, error, and ready states. Shows guidance when no staff have PIN access and offers a retry after a failed request.

frontend/src/app/server-standalone/page.tsx

CashCloseModal.tsxOffer full-day product PDF during cash close +23/-1

Offer full-day product PDF during cash close

• Adds a permission-dependent PDF action and explanatory hint. Uses the X-report or completed Z-report business date rather than restricting the product report to a shift.

frontend/src/components/dashboard/CashCloseModal.tsx

Tests (3) +57 / -1
cash-close-phase1-ui.spec.tsVerify cash-close product report export +15/-0

Verify cash-close product report export

• Checks that the cash-close modal explains the report scope and requests a PDF using the business date, without a session filter.

frontend/e2e/cash-close-phase1-ui.spec.ts

diagnostics-checkout-recovery.spec.tsCover repeated and distinct POS print failures +20/-1

Cover repeated and distinct POS print failures

• Verifies that repeating the same KOT failure keeps its queued support request, while a new correlation ID creates a distinct ticket.

frontend/e2e/diagnostics-checkout-recovery.spec.ts

server-app-ordering.spec.tsCover PIN roster failure and retry +22/-0

Cover PIN roster failure and retry

• Simulates a failed roster request followed by an empty successful response, checking the retry action, empty-state guidance, and continued password access.

frontend/e2e/server-app-ordering.spec.ts

Documentation (32) +64 / -0
ar.jsonAdd Arabic guidance for cash close and PIN roster +2/-0

Add Arabic guidance for cash close and PIN roster

• Adds Arabic text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/ar.json

bn.jsonAdd Bengali guidance for cash close and PIN roster +2/-0

Add Bengali guidance for cash close and PIN roster

• Adds Bengali text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/bn.json

de.jsonAdd German guidance for cash close and PIN roster +2/-0

Add German guidance for cash close and PIN roster

• Adds German text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/de.json

en.jsonAdd English guidance for cash close and PIN roster +2/-0

Add English guidance for cash close and PIN roster

• Adds source messages explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/en.json

es.jsonAdd Spanish guidance for cash close and PIN roster +2/-0

Add Spanish guidance for cash close and PIN roster

• Adds Spanish text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/es.json

fa.jsonAdd Persian guidance for cash close and PIN roster +2/-0

Add Persian guidance for cash close and PIN roster

• Adds Persian text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/fa.json

fil.jsonAdd Filipino guidance for cash close and PIN roster +2/-0

Add Filipino guidance for cash close and PIN roster

• Adds Filipino text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/fil.json

fr.jsonAdd French guidance for cash close and PIN roster +2/-0

Add French guidance for cash close and PIN roster

• Adds French text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/fr.json

ha.jsonAdd Hausa guidance for cash close and PIN roster +2/-0

Add Hausa guidance for cash close and PIN roster

• Adds Hausa text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/ha.json

hi.jsonAdd Hindi guidance for cash close and PIN roster +2/-0

Add Hindi guidance for cash close and PIN roster

• Adds Hindi text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/hi.json

id.jsonAdd Indonesian guidance for cash close and PIN roster +2/-0

Add Indonesian guidance for cash close and PIN roster

• Adds Indonesian text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/id.json

it.jsonAdd Italian guidance for cash close and PIN roster +2/-0

Add Italian guidance for cash close and PIN roster

• Adds Italian text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/it.json

ja.jsonAdd Japanese guidance for cash close and PIN roster +2/-0

Add Japanese guidance for cash close and PIN roster

• Adds Japanese text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/ja.json

jv.jsonAdd Javanese guidance for cash close and PIN roster +2/-0

Add Javanese guidance for cash close and PIN roster

• Adds Javanese text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/jv.json

ko.jsonAdd Korean guidance for cash close and PIN roster +2/-0

Add Korean guidance for cash close and PIN roster

• Adds Korean text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/ko.json

mr.jsonAdd Marathi guidance for cash close and PIN roster +2/-0

Add Marathi guidance for cash close and PIN roster

• Adds Marathi text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/mr.json

ne.jsonAdd Nepali guidance for cash close and PIN roster +2/-0

Add Nepali guidance for cash close and PIN roster

• Adds Nepali text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/ne.json

nl.jsonAdd Dutch guidance for cash close and PIN roster +2/-0

Add Dutch guidance for cash close and PIN roster

• Adds Dutch text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/nl.json

pa.jsonAdd Punjabi guidance for cash close and PIN roster +2/-0

Add Punjabi guidance for cash close and PIN roster

• Adds Punjabi text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/pa.json

pt.jsonAdd Portuguese guidance for cash close and PIN roster +2/-0

Add Portuguese guidance for cash close and PIN roster

• Adds Portuguese text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/pt.json

ru.jsonAdd Russian guidance for cash close and PIN roster +2/-0

Add Russian guidance for cash close and PIN roster

• Adds Russian text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/ru.json

sq.jsonAdd Albanian guidance for cash close and PIN roster +2/-0

Add Albanian guidance for cash close and PIN roster

• Adds Albanian text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/sq.json

sw.jsonAdd Swahili guidance for cash close and PIN roster +2/-0

Add Swahili guidance for cash close and PIN roster

• Adds Swahili text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/sw.json

ta.jsonAdd Tamil guidance for cash close and PIN roster +2/-0

Add Tamil guidance for cash close and PIN roster

• Adds Tamil text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/ta.json

te.jsonAdd Telugu guidance for cash close and PIN roster +2/-0

Add Telugu guidance for cash close and PIN roster

• Adds Telugu text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/te.json

th.jsonAdd Thai guidance for cash close and PIN roster +2/-0

Add Thai guidance for cash close and PIN roster

• Adds Thai text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/th.json

tr.jsonAdd Turkish guidance for cash close and PIN roster +2/-0

Add Turkish guidance for cash close and PIN roster

• Adds Turkish text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/tr.json

uk.jsonAdd Ukrainian guidance for cash close and PIN roster +2/-0

Add Ukrainian guidance for cash close and PIN roster

• Adds Ukrainian text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/uk.json

ur.jsonAdd Urdu guidance for cash close and PIN roster +2/-0

Add Urdu guidance for cash close and PIN roster

• Adds Urdu text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/ur.json

vi.jsonAdd Vietnamese guidance for cash close and PIN roster +2/-0

Add Vietnamese guidance for cash close and PIN roster

• Adds Vietnamese text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/vi.json

zh-tw.jsonAdd Traditional Chinese guidance for cash close and PIN roster +2/-0

Add Traditional Chinese guidance for cash close and PIN roster

• Adds Traditional Chinese text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/zh-tw.json

zh.jsonAdd Simplified Chinese guidance for cash close and PIN roster +2/-0

Add Simplified Chinese guidance for cash close and PIN roster

• Adds Simplified Chinese text explaining the full-day product report and how to obtain PIN access when the roster is empty.

frontend/src/lib/i18n/messages/zh.json

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Informational

1. A failed help request can go unreported 🐞 Bug ◔ Observability
Description
The catch block shows supportRequestQueueFailed only when `supportSubmitTokenRef.current ===
submitToken, but dismissing the card runs clearSupportErrorState()`, which nulls that token. When
the same failure comes back, the recreated card picks up the in-flight request
(setSupportSubmitting(true) from the submitting status). If that request then fails, the
finally block resets the ticket to draft and turns the Get Help button back on with no error
toast, so staff can't tell the report was never queued.
Code

frontend/src/app/(dashboard)/pos/page.tsx[R4414-4420]

+                      if (ticket?.status === 'submitting') ticket.status = 'draft';
                     if (supportSubmitTokenRef.current === submitToken) {
                       supportSubmitTokenRef.current = null;
+                      }
+                      if (currentSupportTicketRef.current === targetError.clientTicketId) {
                       setSupportSubmitting(false);
                     }
Evidence
clearSupportErrorState (the dismiss handler) sets supportSubmitTokenRef.current = null. When the
card is recreated, the new branch at 972-978 leaves the token null and sets submitting to true
because the stored ticket status is submitting. When the original request fails, the catch guard
supportSubmitTokenRef.current === submitToken is false, so no toast appears. The finally block
then resets the status to draft and clears submitting because currentSupportTicketRef matches.

frontend/src/app/(dashboard)/pos/page.tsx[477-484]
frontend/src/app/(dashboard)/pos/page.tsx[972-979]
frontend/src/app/(dashboard)/pos/page.tsx[4406-4421]
frontend/src/app/(dashboard)/pos/page.tsx[4206-4212]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
If a support submit is in flight and the card is dismissed and then recreated for the same failure, a later request failure re-enables Get Help without any error toast. The toast is gated on a submit token that the dismiss handler cleared.
## Fix Focus Areas
- frontend/src/app/(dashboard)/pos/page.tsx[4406-4421]
## Recommended Fix
In the `catch` block, show `toast.error(t('supportRequestQueueFailed'))` when `supportSubmitTokenRef.current === submitToken` OR `currentSupportTicketRef.current === targetError.clientTicketId`, so the card currently on screen for that ticket always reports the failure.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can tweak Display settings with a live preview to see your comment before it ships

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@itsbkm
itsbkm merged commit 1a52443 into main Nov 26, 2026
23 checks passed
@itsbkm
itsbkm deleted the codex/support-ticket-followups branch November 26, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant