Skip to content

Fix/order delete - #304

Open
shipeast-beep wants to merge 3 commits into
FreeOpenSourcePOS:mainfrom
shipeast-beep:fix/order-delete
Open

Fix/order delete#304
shipeast-beep wants to merge 3 commits into
FreeOpenSourcePOS:mainfrom
shipeast-beep:fix/order-delete

Conversation

@shipeast-beep

Copy link
Copy Markdown

Summary

Fixes #

Changes

Checklist

  • Tests added/updated for new functionality
  • npm run build passes (no TypeScript errors)
  • npm run lint passes
  • Database migrations are non-destructive (UPDATE, not DROP)
  • Breaking changes documented (if any)
  • Related issue linked above

Screenshots

@shipeast-beep
shipeast-beep requested a review from itsbkm as a code owner August 15, 2026 13:42

@itsbkm itsbkm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. I can’t approve this as-is.

This mixes two unrelated changes: Czech receipt currency formatting and restoring an order deletion endpoint. Please split those into separate PRs.

The DELETE /api/orders/:id endpoint is risky as implemented:

  • It hard-deletes orders, bills, print logs, WhatsApp records, and order items instead of using the existing cancellation lifecycle.
  • It can bypass inventory restoration rules for active/pending order items, causing stock drift.
  • It deletes transaction/audit history, which conflicts with the project’s data-safety expectations for POS records.
  • It does not emit a cloud sync deletion/tombstone event, only notifyOrderUpdated().
  • It has no regression tests or API docs.
  • Several comments in main/routes/orders.ts are mojibake/garbled encoded text.

If order deletion is still needed, please define the intended policy first: hard delete only draft/unpaid orders, or soft-delete/void/archive behavior with inventory, bills, audit, cloud sync, and tests covered.

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.

2 participants