Skip to content

chore(release): prepare 3.14.14 - #1671

Merged
itsbkm merged 2 commits into
mainfrom
codex/release-3.14.14
Nov 29, 2026
Merged

itsbkm merged 2 commits into
mainfrom
codex/release-3.14.14

Conversation

@itsbkm

@itsbkm itsbkm commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Changes

  • Add invoice soft deletion, restore, and confirmed permanent deletion for eligible unpaid invoices, with linked-record impact and optional customer deactivation or cashback reversal.
  • Add a visual invoice layout editor for backend thermal printing.
  • Add customer and Google Contacts CSV import and menu CSV review.
  • Add accent color controls and official tax packs for Belgium, Colombia, Indonesia, and Yemen.
  • Set the desktop package and lockfile version to 3.14.14.

Verification

  • GitHub CI passed all four core test shards, all four browser shards, native Electron E2E, lint, build, documentation, and Windows checks.
  • CodeQL and dependency review passed.
  • Stable-release device QA is pending. The iOS simulator failed to complete startup on the available host.

Add invoice retention and thermal layout editing, customer and menu CSV import, customizable accent colors, and four official tax packs.
@coderabbitai

coderabbitai Bot commented Nov 29, 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

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

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

Copy link
Copy Markdown

PR Summary by Qodo

Prepare 3.14.14 with invoice management and import workflows

✨ Enhancement 🧪 Tests 📝 Documentation ⚙️ Configuration changes 🕐 40+ Minutes

Grey Divider

AI Description

• Add owner-controlled invoice retention, restoration, and guarded deletion while preserving
 financial history.
• Add thermal invoice design, customer CSV import, and reviewed menu CSV import.
• Add personal accent colors, four official tax packs, and release version 3.14.14.
Merge Risk 🔴 High

Blast radius 🔴 High 💥 6 capabilities

  • 6 affected capabilities span independent functional scopes: billing and invoice retention integration, catalog import and category resolution, country tax-pack integration, customer management and onboarding, merchant print-template integration, user appearance preferences.
  • The route changes invoice visibility and lifecycle while traversing bill items, payments, refunds, loyalty, print, WhatsApp, inventory, and the linked customer.
  • These are one bounded invoice-retention outcome.
  • The changed route, parser, category resolver, and review UI jointly implement one end-to-end catalog import outcome: products and their categories are resolved and persisted together.
  • The parser, endpoint, permission gate, and settings tab implement one bounded customer-onboarding behavior; they do not independently alter orders or loyalty.
  • The four artifacts and release preparation change one bounded country-tax integration: selected-country metadata drives tax rules, rounding, registration validation, and associated print templates through the existing engine.
  • The designer, settings entry point, stored template payload, and thermal receipt selector form one bounded merchant-printing capability.
  • The picker, local-storage key, derived palette, and global CSS tokens jointly implement one per-user visual preference.
Behavioral complexity 🔴 High 🧩 State transitions, Coordinated invariants

  • Before, bills had no archive, restore, or delete lifecycle exposed here.
  • After, eligibility depends on order status, payment, refund, print, WhatsApp, loyalty, inventory, customer links, wallet balance, confirmation, and retired invoice numbers.
  • New correctness conditions are that eligibility is recomputed inside the transaction and customer, loyalty, bill, order, and invoice-number invariants agree.
Potential damage 🔴 High 🩹 Integrity

  • A wrong eligibility or side-effect calculation can hide or delete the wrong invoice, alter loyalty balance, deactivate a customer, or leave linked financial history inconsistent.
  • Reverting stops new mutations, but already archived or deleted bills, wallet entries, and customer state require targeted repair or compensation.
  • Archive and restore are code-reversible; loyalty and customer mutations persist independently, and permanent deletion is not fully recoverable without a backup.
Assessed commit 775af3f
Diagram

graph TD
  UI["Dashboard workflows"] --> Contracts["Shared contracts"] --> Retention["Invoice retention"] --> DB[("SQLite data")]
  Contracts --> CSV["CSV import routes"] --> DB
  UI --> Templates["Print template API"] --> DB
  UI --> Theme["Accent tokens"]
  Packs["Official tax packs"] --> Templates
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Plan menu imports without database writes
  • ➕ Preview would not need an exception-driven transaction rollback.
  • ➕ A pure planner could be easier to test independently.
  • ➖ Preview and confirmation could diverge from the actual write path.
  • ➖ Would duplicate category and product resolution logic.

Recommendation: Keep the shared transactional execution path for menu preview and confirmation: it makes the proposed result reflect real writes, rolls previews back, and detects changed reviews before commit. Review the rollback and token behavior carefully; retaining the existing print-template API and isolating invoice eligibility in its own route are appropriate choices.

Files changed (84) +7680 / -491

Enhancement (27) +2389 / -372
page.tsxExpose invoice management from Orders +23/-1

Expose invoice management from Orders

• Opens the permission-gated retention dialog and refreshes affected orders after an action.

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

page.tsxAdd review and confirmation to product CSV imports +159/-48

Add review and confirmation to product CSV imports

• Previews product and category changes, accepts category edits, handles stale reviews, and presents import results.

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

page.tsxWire customer import, accents, and invoice designer into settings +65/-1

Wire customer import, accents, and invoice designer into settings

• Adds permission-gated customer import and print-design entry points, appearance controls, and active-template selection cards. Adds project funding information to About.

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

globals.cssConnect brand styling to accent tokens +16/-15

Connect brand styling to accent tokens

• Replaces fixed brand and selected-state colors with accent-aware CSS variables while retaining light and dark fallbacks.

frontend/src/app/globals.css

layout.tsxApply the selected accent at the application root +2/-0

Apply the selected accent at the application root

• Mounts the accent theme component alongside existing theme synchronization.

frontend/src/app/layout.tsx

AccentTheme.tsxProvide per-user accent controls +104/-0

Provide per-user accent controls

• Stores preset or custom colors in browser storage by user and applies derived CSS tokens across the application.

frontend/src/components/layout/AccentTheme.tsx

Sidebar.tsxAdd account-menu appearance access +21/-0

Add account-menu appearance access

• Opens the accent picker from the sidebar account menu, including for staff without settings access.

frontend/src/components/layout/Sidebar.tsx

BillRetentionDialog.tsxProvide guided invoice retention actions +353/-0

Provide guided invoice retention actions

• Lists active and archived invoices, displays linked-record impact, and offers eligible archive, restore, and confirmed deletion actions with optional customer effects.

frontend/src/components/orders/BillRetentionDialog.tsx

MenuImportReview.tsxPresent category proposals and import issues +173/-0

Present category proposals and import issues

• Displays proposed menu changes, groups affected rows, and lets users edit or map categories before confirmation.

frontend/src/components/products/MenuImportReview.tsx

CustomersSettingsTab.tsxAdd customer CSV upload interface +106/-0

Add customer CSV upload interface

• Accepts bounded UTF-8 CSV files and reports created, skipped, and invalid contact counts.

frontend/src/components/settings/CustomersSettingsTab.tsx

InvoiceDesigner.tsxAdd visual thermal invoice layout editor +401/-0

Add visual thermal invoice layout editor

• Uses the existing print-template API to reorder sections, set visibility and labels, preview a sample, and save or activate layouts.

frontend/src/components/settings/InvoiceDesigner.tsx

PrintersSettingsTab.tsxLink printer settings to invoice design +14/-0

Link printer settings to invoice design

• Adds a Design invoice button when the caller grants template-management access.

frontend/src/components/settings/PrintersSettingsTab.tsx

enums.tsName the invoice-management permission +1/-0

Name the invoice-management permission

• Maps bills.delete to its localized permissions label.

frontend/src/lib/i18n/enums.ts

settings-search.tsMake customer import discoverable in settings search +14/-0

Make customer import discoverable in settings search

• Adds a permission-aware Customers tab entry and Google Contacts search keywords.

frontend/src/lib/settings-search.ts

theme-palette.d.mtsType the accent palette module +3/-0

Type the accent palette module

• Declares preset, normalization, and CSS-token exports for TypeScript consumers.

frontend/src/lib/theme-palette.d.mts

theme-palette.mjsDefine contrast-aware accent tokens +39/-0

Define contrast-aware accent tokens

• Provides color presets, hex validation, and CSS variables derived from a selected accent.

frontend/src/lib/theme-palette.mjs

db.tsMigrate invoice retention storage and retire deleted numbers +22/-2

Migrate invoice retention storage and retire deleted numbers

• Adds invoice archive and cashback-reversal timestamps plus a retired-number table. Number allocation now excludes permanently deleted invoice numbers.

main/db.ts

customer-csv.tsParse customer and Google Contacts columns +53/-0

Parse customer and Google Contacts columns

• Extracts names, contact details, addresses, and notes from bounded CSV input with supported contact-export headers.

main/lib/customer-csv.ts

menu-import-categories.tsResolve and create reviewed menu categories +224/-0

Resolve and create reviewed menu categories

• Normalizes category matching, validates mappings and active ancestry, and creates eligible root or child categories during import.

main/lib/menu-import-categories.ts

bill-retention.tsImplement guarded invoice retention API +254/-0

Implement guarded invoice retention API

• Assesses linked-record impact and eligibility, then transactionally archives, restores, or deletes invoices. Supports constrained customer deactivation and cashback reversal with order-audit entries.

main/routes/bill-retention.ts

bills.tsExpose retention and filter archived invoices +30/-2

Expose retention and filter archived invoices

• Mounts retention routes, adds archived and invoice-number list filters, and blocks bill generation for cancelled orders.

main/routes/bills.ts

customers.tsImport customer contacts from CSV +88/-5

Import customer contacts from CSV

• Adds a permission-gated, transactional import with contact validation and duplicate skipping. Excludes compensating cashback debits from redeemed-points totals.

main/routes/customers.ts

menu-csv.tsSupport transactional menu preview and confirmation +141/-294

Support transactional menu preview and confirmation

• Reuses shared CSV parsing and category resolution. A rolled-back preview returns proposed changes; confirmation requires a matching review token and commits valid rows and categories together.

main/routes/menu-csv.ts

prepare-release.cjsRelease wrapped country tax packs +22/-4

Release wrapped country tax packs

• Validates wrapped artifacts, derives catalog identity from their inner tax pack, and signs the complete package bytes.

scripts/tax-packs/prepare-release.cjs

bill-retention.tsDefine invoice retention impact contract +19/-0

Define invoice retention impact contract

• Shares eligibility, customer options, reversible points, and linked-record count types with the UI.

shared/bill-retention.ts

customer-csv.tsShare customer import limits and results +7/-0

Share customer import limits and results

• Defines the 2 MB CSV limit and created, skipped, and invalid result counts.

shared/customer-csv.ts

menu-import.tsDefine menu review contracts +35/-0

Define menu review contracts

• Shares category edits, grouped issues, preview counts, category proposals, and review tokens.

shared/menu-import.ts

Refactor (1) +121 / -0
csv.tsShare bounded CSV parsing +121/-0

Share bounded CSV parsing

• Moves reusable CSV error and parser behavior into the common library for both menu and customer imports.

main/lib/csv.ts

Tests (14) +857 / -115
accent-theme.spec.tsExercise preset and custom accent preferences +54/-0

Exercise preset and custom accent preferences

• Checks accent application, persistence after reload, reset, and selection from a staff account menu.

frontend/e2e/accent-theme.spec.ts

customer-csv-import.spec.tsExercise Google Contacts import in settings +27/-0

Exercise Google Contacts import in settings

• Imports a contact through the UI and verifies a repeated upload is skipped.

frontend/e2e/customer-csv-import.spec.ts

database-export-import.spec.tsUse the exported schema version in backup tests +8/-1

Use the exported schema version in backup tests

• Reads the live export version instead of hard-coding the pre-migration schema version.

frontend/e2e/database-export-import.spec.ts

invoice-management.spec.tsExercise invoice retention and layout design +75/-0

Exercise invoice retention and layout design

• Covers owner archive, restore, and confirmed deletion, plus saving and activating an edited print layout.

frontend/e2e/invoice-management.spec.ts

menu-csv-import.spec.tsExercise reviewed menu CSV import +64/-0

Exercise reviewed menu CSV import

• Checks category proposals, renaming, confirmation, imported products, and fixture cleanup.

frontend/e2e/menu-csv-import.spec.ts

backup-restore-production.test.tsAvoid a fixed schema version in restore assertions +2/-2

Avoid a fixed schema version in restore assertions

• Checks recovery against the current migration version rather than version 126.

tests/backup-restore-production.test.ts

customer-auth.test.tsTest customer CSV validation and authorization +81/-18

Test customer CSV validation and authorization

• Covers Google Contacts headers, duplicate detection, malformed CSV rollback, repeated import, and access control.

tests/customer-auth.test.ts

issue-248-menu-csv.test.tsTest reviewed menu import behavior +176/-0

Test reviewed menu import behavior

• Covers preview rollback, category proposals and mapping, stale-token rejection, confirmation, duplicates, and grouped errors.

tests/issue-248-menu-csv.test.ts

issue-258-bill-pagination.test.tsTest invoice retention and list filtering +150/-19

Test invoice retention and list filtering

• Extends pagination coverage with permissions, archival, cashback reversal, restoration, deletion guards, audit entries, and retired-number non-reuse.

tests/issue-258-bill-pagination.test.ts

orders-search.test.tsStub retention dialog in Orders tests +3/-0

Stub retention dialog in Orders tests

• Keeps existing Orders page tests isolated after the dialog is imported.

tests/orders-search.test.ts

settings-search.test.tsCheck permission-aware customer import search +7/-0

Check permission-aware customer import search

• Verifies Google Contacts queries find the Customers tab only when customer import is permitted.

tests/settings-search.test.ts

tax-pack-catalog.test.tsExtend tax-pack release test coverage +158/-65

Extend tax-pack release test coverage

• Exercises release preparation for wrapped tax-pack artifacts and adjusts catalog test formatting.

tests/tax-pack-catalog.test.ts

ui-regressions-621-623-626.test.tsAssert accent-aware brand CSS fallbacks +20/-10

Assert accent-aware brand CSS fallbacks

• Updates theme regression checks for dynamic brand colors and light and dark surface defaults.

tests/ui-regressions-621-623-626.test.ts

upgrade-path.test.tsVerify migration from the pre-retention schema +32/-0

Verify migration from the pre-retention schema

• Checks existing bills retain their values while new retention columns and retired-number storage initialize cleanly.

tests/upgrade-path.test.ts

Documentation (36) +787 / -3
adding-a-tax-pack.mdDocument wrapped tax-pack releases +5/-2

Document wrapped tax-pack releases

• Explains how to publish country-tax-pack wrappers containing billing templates and sign the complete artifact.

docs/guides/adding-a-tax-pack.md

api.mdDocument retention and reviewed import APIs +40/-1

Document retention and reviewed import APIs

• Describes archived invoice listing, retention eligibility and actions, and the menu preview, review-token, and confirmation contract.

docs/reference/api.md

merchant-print-templates.mdDocument the invoice designer +5/-0

Document the invoice designer

• Explains the settings workflow for editing, previewing, saving, and activating thermal layouts.

docs/reference/merchant-print-templates.md

roles-and-permissions.mdList owner invoice-management permission +1/-0

List owner invoice-management permission

• Adds invoice management to the owner-only permissions reference.

docs/reference/roles-and-permissions.md

ar.jsonLocalize new workflows in Arabic +23/-0

Localize new workflows in Arabic

• Adds strings for invoice management, CSV review, customer import, invoice design, funding, and permissions.

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

bn.jsonLocalize new workflows in Bengali +23/-0

Localize new workflows in Bengali

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

de.jsonLocalize new workflows in German +23/-0

Localize new workflows in German

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

en.jsonAdd English copy for new workflows +23/-0

Add English copy for new workflows

• Defines labels and guidance for retention, reviewed menu import, customer import, invoice design, funding, and permissions.

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

es.jsonLocalize new workflows in Spanish +23/-0

Localize new workflows in Spanish

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

fa.jsonLocalize new workflows in Persian +23/-0

Localize new workflows in Persian

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

fil.jsonLocalize new workflows in Filipino +23/-0

Localize new workflows in Filipino

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

fr.jsonLocalize new workflows in French +23/-0

Localize new workflows in French

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

ha.jsonLocalize new workflows in Hausa +23/-0

Localize new workflows in Hausa

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

hi.jsonLocalize new workflows in Hindi +23/-0

Localize new workflows in Hindi

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

id.jsonLocalize new workflows in Indonesian +23/-0

Localize new workflows in Indonesian

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

it.jsonLocalize new workflows in Italian +23/-0

Localize new workflows in Italian

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

ja.jsonLocalize new workflows in Japanese +23/-0

Localize new workflows in Japanese

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

jv.jsonLocalize new workflows in Javanese +23/-0

Localize new workflows in Javanese

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

ko.jsonLocalize new workflows in Korean +23/-0

Localize new workflows in Korean

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

mr.jsonLocalize new workflows in Marathi +23/-0

Localize new workflows in Marathi

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

ne.jsonLocalize new workflows in Nepali +23/-0

Localize new workflows in Nepali

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

nl.jsonLocalize new workflows in Dutch +23/-0

Localize new workflows in Dutch

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

pa.jsonLocalize new workflows in Punjabi +23/-0

Localize new workflows in Punjabi

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

pt.jsonLocalize new workflows in Portuguese +23/-0

Localize new workflows in Portuguese

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

ru.jsonLocalize new workflows in Russian +23/-0

Localize new workflows in Russian

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

sq.jsonLocalize new workflows in Albanian +23/-0

Localize new workflows in Albanian

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

sw.jsonLocalize new workflows in Swahili +23/-0

Localize new workflows in Swahili

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

ta.jsonLocalize new workflows in Tamil +23/-0

Localize new workflows in Tamil

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

te.jsonLocalize new workflows in Telugu +23/-0

Localize new workflows in Telugu

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

th.jsonLocalize new workflows in Thai +23/-0

Localize new workflows in Thai

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

tr.jsonLocalize new workflows in Turkish +23/-0

Localize new workflows in Turkish

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

uk.jsonLocalize new workflows in Ukrainian +23/-0

Localize new workflows in Ukrainian

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

ur.jsonLocalize new workflows in Urdu +23/-0

Localize new workflows in Urdu

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

vi.jsonLocalize new workflows in Vietnamese +23/-0

Localize new workflows in Vietnamese

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

zh-tw.jsonLocalize new workflows in Traditional Chinese +23/-0

Localize new workflows in Traditional Chinese

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

zh.jsonLocalize new workflows in Chinese +23/-0

Localize new workflows in Chinese

• Adds interface strings for invoice management, imports, design, funding, and permissions.

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

Other (6) +3526 / -1
official-be.jsonAdd Belgium official tax-pack artifact +1353/-0

Add Belgium official tax-pack artifact

• Defines Belgium tax categories and rules in a country-tax-pack wrapper with billing templates.

main/tax-packs/official-be.json

official-co.jsonAdd Colombia official tax-pack artifact +731/-0

Add Colombia official tax-pack artifact

• Defines Colombia tax categories and rules in a country-tax-pack wrapper with billing templates.

main/tax-packs/official-co.json

official-id.jsonAdd Indonesia official tax-pack artifact +719/-0

Add Indonesia official tax-pack artifact

• Defines Indonesia tax categories and rules in a country-tax-pack wrapper with billing templates.

main/tax-packs/official-id.json

official-ye.jsonAdd Yemen official tax-pack artifact +715/-0

Add Yemen official tax-pack artifact

• Defines Yemen tax categories and rules in a country-tax-pack wrapper with billing templates.

main/tax-packs/official-ye.json

package.jsonSet desktop release version to 3.14.14 +1/-1

Set desktop release version to 3.14.14

• Changes the package version from 3.14.12 to 3.14.14.

package.json

permissions.tsReserve destructive invoice management for owners +7/-0

Reserve destructive invoice management for owners

• Adds the fixed, owner-default bills.delete permission.

shared/permissions.ts

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

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

Copy link
Copy Markdown

Code Review by Qodo

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

Grey Divider


Action required

1. Release ships before checks finish 📘 Rule violation ☼ Reliability
Description
The PR description says only documentation checks and one theme regression test passed locally,
while CI and release checks are still in progress. The release adds migration 127 in main/db.ts,
bill retention and customer import backend routes, and four tax packs, which need the full
validation set and a full npm test pass before a stable tag.
Code

package.json[3]

+  "version": "3.14.14",
Evidence
The version bump is the release gate, but the PR description records only partial local validation
while the diff adds a migration and backend routes that the checklist requires to pass
fresh-database, upgrade-path, and full test runs.

AGENTS.md: Run Applicable Code, Test, Documentation, and Release Checks: AGENTS.md: Run Applicable Code, Test, Documentation, and Release Checks: AGENTS.md: Run Applicable Code, Test, Documentation, and Release Checks: AGENTS.md: Run Applicable Code, Test, Documentation, and Release Checks
main/db.ts[10408-10423]

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

The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
Issue description
The PR bumps the desktop package to 3.14.14 and adds a database migration (version 127), bill retention and customer import backend routes, and four tax packs. The PR description says only documentation checks and one theme test were run locally, and CI and release checks are still in progress. The checklist requires full validation for releases.
Fix Focus Areas
- package.json[3-3]
- main/db.ts[10408-10423]
- tests/upgrade-path.test.ts[1501-1531]
Recommended Fix
Run `npm run lint`, `npm run build:frontend`, `npm run i18n:check`, and the full `npm test` suite, including the fresh-database and upgrade-path tests for migration 127 and the tax-pack catalog tests. Run the target-platform packaging and release checks. Only tag 3.14.14 after these pass, and record the results in the PR description.

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


2. Renaming an invoice changes its layout 🐞 Bug ≡ Correctness
Description
editableBlocks() appends missing blocks and makes required blocks visible when load() reads an
existing template. If a user changes only the template name and saves, save() persists those
expanded blocks even though the template contract treats omitted blocks as sections that must not
render.
Code

frontend/src/components/settings/InvoiceDesigner.tsx[R83-89]

+    ...blocks.map((block) =>
+      REQUIRED_BLOCKS.includes(block.kind) ? { ...block, visible: true } : block,
+    ),
+    ...MERCHANT_TEMPLATE_BLOCK_KINDS.filter((kind) => !existing.has(kind)).map((kind) => ({
+      kind,
+      visible: REQUIRED_BLOCKS.includes(kind),
+    })),
Evidence
The editor expands the loaded payload, marks a name change dirty and saves the expanded blocks; the
shared template contract and thermal renderer use the persisted block list to determine output.

frontend/src/components/settings/InvoiceDesigner.tsx[80-90]
frontend/src/components/settings/InvoiceDesigner.tsx[148-154]
frontend/src/components/settings/InvoiceDesigner.tsx[181-195]
frontend/src/components/settings/InvoiceDesigner.tsx[288-299]
shared/print/merchant-template.ts[267-274]

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

## Issue description
Opening an existing template changes its in-memory block list, so a name-only save changes printed output.
## Fix Focus Areas
- frontend/src/components/settings/InvoiceDesigner.tsx[80-90]
- frontend/src/components/settings/InvoiceDesigner.tsx[148-154]
- frontend/src/components/settings/InvoiceDesigner.tsx[181-195]
## Recommended Fix
Keep the stored block list unchanged on load. If the editor needs controls for absent blocks, represent those separately and add them to the payload only when the user explicitly enables them; do not force existing hidden blocks visible during a name-only edit.

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



Remediation recommended

3. Release PR bundles unrelated features 📘 Rule violation ⚙ Maintainability
Description
The PR is titled as a version-bump release, but its diff adds invoice soft and permanent deletion, a
thermal invoice layout editor, customer and menu CSV import, accent color theming, and four tax
packs. These new behaviors span backend routes, a schema migration, and many frontend components, so
the version bump cannot be reviewed or rolled back in isolation.
Code

package.json[3]

+  "version": "3.14.14",
Evidence
The PR title and commit describe a release preparation, yet the changed files include new routes, a
migration, and new UI features unrelated to bumping the package version.

Rule 8: Keep Implementation Changes Within the Task Scope
main/routes/bill-retention.ts[1-26]

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

The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
Issue description
The PR titled `chore(release): prepare 3.14.14` also adds invoice retention (new bill-retention routes and migration 127), customer and menu CSV import, accent color theming, a thermal invoice layout editor, and four tax packs. These features are outside a release-preparation change and make the release hard to review and roll back.
Fix Focus Areas
- package.json[3-3]
- main/routes/bill-retention.ts[1-26]
- main/db.ts[10408-10423]
Recommended Fix
Move the feature work into its own feature PRs merged before this one, leaving only the version bump in the release PR. If the features must ship in 3.14.14, retitle the PR to describe the feature set and list each feature's verification in the description.

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


4. Bill reports omit cashback reversals 🐞 Bug ≡ Correctness
Description
The retention action inserts its cashback reversal into loyalty_ledger without a bill_id. When
an invoice is archived with reversePoints, the customer balance falls, but bill and order loyalty
calculations that select ledger entries by bill ID cannot attribute that debit to the invoice.
Code

main/routes/bill-retention.ts[R194-196]

+        db.prepare(`
+        INSERT INTO loyalty_ledger (customer_id, type, amount, description, created_at, updated_at)
+        VALUES (?, 'debit', ?, ?, ?, ?)
Evidence
Normal cashback entries carry a bill ID, whereas the new debit does not; both bill detail and order
loyalty aggregation filter or group ledger entries by bill ID.

main/routes/bill-retention.ts[193-204]
main/routes/bills.ts[3174-3183]
main/routes/bills.ts[438-446]
main/routes/orders.ts[1454-1467]
main/routes/customers.ts[492-496]

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

## Issue description
Cashback reversals affect the customer balance but are absent from bill-scoped loyalty results.
## Fix Focus Areas
- main/routes/bill-retention.ts[193-204]
- main/routes/customers.ts[492-496]
## Recommended Fix
Insert the reversal with its bill ID, and adjust the customer loyalty summary's reversal exclusion so it continues to distinguish cashback reversals from ordinary points redemption after they become bill-linked.

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


5. Import approval can overwrite recent edits 🐞 Bug ≡ Correctness
Description
The menu-import review token hashes row actions that contain an existing product's ID but not its
current editable values. If another user edits that product between preview and confirmation, the
token can still match while confirmation writes the CSV values over the intervening edit.
Code

main/routes/menu-csv.ts[R1445-1448]

+                catalog.entries,
+                regionalSnapshot,
+                actions,
+                result,
Evidence
The actions contain only row number and product ID, while the update writes numerous product fields;
changes to those fields need not affect the aggregate result or token.

main/routes/menu-csv.ts[1107-1113]
main/routes/menu-csv.ts[1343-1347]
main/routes/menu-csv.ts[1361-1389]
main/routes/menu-csv.ts[1440-1454]

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

## Issue description
The review token detects category and action changes but not edits to a product that the import will update.
## Fix Focus Areas
- main/routes/menu-csv.ts[1343-1347]
- main/routes/menu-csv.ts[1440-1454]
## Recommended Fix
Include a stable snapshot or revision of each existing product field the import will overwrite in the preview token, and recompute it at confirmation. Return the existing review-changed response when those values differ.

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


View review recommended (4)
6. Customer importers cannot find settings 🐞 Bug ≡ Correctness
Description
The new Customers settings tab is available to users with customers.create, but the sidebar's
Settings visibility list does not include that permission. A user granted customer creation without
another settings permission can use the import endpoint yet has no Settings navigation entry through
which to open the import UI.
Code

frontend/src/app/(dashboard)/settings/page.tsx[R4745-4748]

+            {canImportCustomers && (
+              <SettingsNavItem
+                label={t('navGroupCustomers')}
+                value="customers"
Evidence
The tab and endpoint both use customers.create, while the sidebar checks a separate hard-coded
permission list that omits it.

frontend/src/app/(dashboard)/settings/page.tsx[451-454]
frontend/src/app/(dashboard)/settings/page.tsx[4745-4752]
frontend/src/components/layout/Sidebar.tsx[209-225]
main/routes/customers.ts[543-549]

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

## Issue description
The customer-import tab has an independent permission, but the Settings sidebar entry cannot be reached with that permission alone.
## Fix Focus Areas
- frontend/src/app/(dashboard)/settings/page.tsx[4745-4752]
- frontend/src/components/layout/Sidebar.tsx[209-225]
## Recommended Fix
Include `customers.create` in the sidebar's Settings visibility permissions so users eligible for the new tab can navigate to it.

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


7. Google contacts with several phones are rejected 🐞 Bug ≡ Correctness
Description
parseCustomerCsv returns the whole raw Phone 1 - Value / E-mail 1 - Value cell as the phone
and email. Google Contacts puts several values of one type into that single cell, separated by ` :::
. parsePhoneE164 and isValidEmail` then reject the joined string, so any contact with two mobile
numbers or two work emails is counted as invalid and never imported, even though the help text
promises Google Contacts CSV support.
Code

main/lib/customer-csv.ts[R45-48]

+    return {
+      name,
+      phone: first(...phoneColumns),
+      email: first(...emailColumns),
Evidence
The parser picks the first non-empty column value as-is, with no splitting. The import route treats
a phone that does not parse, or an email that fails validation, as invalid and skips the whole
contact. The UI says Google Contacts exports are supported.

main/lib/customer-csv.ts[24-52]
main/routes/customers.ts[564-574]
frontend/src/lib/i18n/messages/en.json[2352-2352]

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

## Issue description
Google Contacts CSV exports put several phones or emails of the same type into one cell, separated by ` ::: `. `parseCustomerCsv` passes the whole cell through, so `parsePhoneE164` and `isValidEmail` reject it and the contact is counted as invalid.
## Fix Focus Areas
- main/lib/customer-csv.ts[24-52]
## Recommended Fix
In `value()` or `first()` for the phone and email columns, split each cell on `:::`, trim the parts, and take the first non-empty part (for example `cell.split(':::').map(s => s.trim()).find(Boolean)`). Add a unit test with a Google-style row like `"+1 555 0100 ::: +1 555 0101"`.

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


8. Customer import failures leave no trace 🐞 Bug ◔ Observability
Description
The /customers/import-csv catch block returns a generic 500 for non-CsvImportError exceptions
without calling console.error or setting res.locals.postHogError. Unexpected address-validation,
phone-parsing, insert, or transaction failures therefore leave operators without a log entry or
error telemetry to diagnose the failed import.
Code

main/routes/customers.ts[R613-615]

+    } catch (error: unknown) {
+      if (error instanceof CsvImportError) return res.status(400).json({ error: error.message });
+      return res.status(500).json({ error: 'Failed to import customers' });
Evidence
The import handler performs validation and transactional database writes, but its catch block
returns a generic 500 for non-CSV exceptions without logging or forwarding them. Other handlers in
customers.ts record errors before returning 500, making the missing reporting in this handler the
source of the diagnostic gap.

main/routes/customers.ts[613-616]
main/routes/customers.ts[513-518]
main/routes/customers.ts[553-611]
main/routes/customers.ts[613-615]

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

## Issue description
Unexpected customer CSV import failures return a generic 500 without preserving exception details in logs or error telemetry.
## Fix Focus Areas
- main/routes/customers.ts[613-616]
## Recommended Fix
Keep `CsvImportError` responses as 400s. Before returning the sanitized 500 for any other error, set `res.locals.postHogError = error` and call `console.error('[Customers] CSV import failed:', error)`, matching the other handlers in this router.

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


9. Soft-deleted invoices can still be paid or refunded 🐞 Bug ≡ Correctness
Description
archive sets archived_at, but only GET /bills filters on it; bill-by-ID reads and mutation
paths do not check it. After an owner archives an invoice for a cancelled order, ordinary bill
permissions can still reach payment preparation, refunds, printing, WhatsApp sending and bill
synchronization, changing or using a record hidden from the invoice list.
Code

main/routes/bill-retention.ts[R217-222]

+      } else {
+        db.prepare('UPDATE bills SET archived_at = ?, updated_at = ? WHERE id = ?').run(
+          action === 'archive' ? timestamp : null,
+          timestamp,
+          bill.id,
+        );
Evidence
The archive action updates the archive timestamp, while the list query filters on that field.
Payment preparation and the other identified paths select bills by ID without an archive check, so
archiving does not prevent those paths from reaching the bill.

main/routes/bill-retention.ts[110-113]
main/routes/bill-retention.ts[217-222]
main/routes/bills.ts[561-563]
main/routes/bills.ts[2599-2613]
main/services/refund.ts[200-212]
main/routes/bills.ts[551-563]
main/routes/bills.ts[5168-5184]
main/routes/bills.ts[3117-3139]

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

## Issue description
Archived bills are hidden from `GET /bills`, but bill-by-ID reads and ordinary mutation paths can still reach them, including payments, refunds, printing, WhatsApp sending and bill synchronization.
## Fix Focus Areas
- main/routes/bill-retention.ts[217-222]
- main/routes/bills.ts[2599-2613]
- main/routes/bills.ts[3530-3540]
- main/routes/bills.ts[5168-5184]
- main/services/refund.ts[200-212]
## Recommended Fix
Add a shared `archived_at` guard to bill mutation paths, including payment preparation, refund validation, split checks, charges and discount updates, and bill synchronization. Reject changes to archived bills with 409 and tell the user to restore the bill first; preserve the explicit retention restore path. Decide explicitly whether printing or sending an archived bill is allowed, and apply the guard there if it is not.

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



Informational

10. Customer points-earned total ignores reversals 🐞 Bug ≡ Correctness
Description
The customer stats query now leaves Cashback reversal on bill … debits out of
total_points_redeemed. total_points_earned still includes the original cashback credit that was
reversed. After an archive with reversal, the customer profile shows points earned that the customer
no longer has, and earned minus redeemed no longer matches the wallet balance.
Code

main/routes/customers.ts[R495-496]

+        COALESCE((SELECT SUM(amount) FROM loyalty_ledger WHERE customer_id = ? AND type = 'debit'
+          AND NOT (bill_id IS NULL AND COALESCE(description, '') LIKE 'Cashback reversal on bill %')), 0) as total_points_redeemed
Evidence
The reversal debit has bill_id NULL and is removed from the redeemed total, while the matching
credit stays in the earned total. balance comes from getWalletBalance, which still counts the
debit.

main/routes/customers.ts[489-511]
main/routes/bill-retention.ts[193-205]

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

## Issue description
Reversed cashback is left out of points redeemed but still counted in points earned, so the summary overstates earnings.
## Fix Focus Areas
- main/routes/customers.ts[489-499]
## Recommended Fix
Compute `total_points_earned` as credits minus the `Cashback reversal on bill %` debits that have `bill_id IS NULL`. Better still, record reversals with a dedicated ledger type or a link back to the original bill so they are identified reliably rather than by matching the description text.

ⓘ 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 switch off images and animations for a plain-text comment

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Stub the invoice management dialog in the additional Orders harness and keep the printer settings action independent of Radix.
@itsbkm
itsbkm merged commit d5c7fd9 into main Nov 29, 2026
23 checks passed
@itsbkm
itsbkm deleted the codex/release-3.14.14 branch November 29, 2026 16:13
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