Skip to content

feat: owner-only manual item price override with price exceptions report - #1284

Merged
itsbkm merged 3 commits into
mainfrom
feat/item-price-override
Oct 22, 2026
Merged

itsbkm merged 3 commits into
mainfrom
feat/item-price-override

Conversation

@itsbkm

@itsbkm itsbkm commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Override: PATCH /api/orders/:id/items/:itemId/price (price, required reason) lets the owner sell one line at any non-negative price, including 0 for a complimentary item. Works on lines already sent to the kitchen; the kitchen ticket and KDS are unaffected. The same price_override object is accepted on lines when an order is created or items are added.
  • Access: new owner-only, non-configurable permission orders.item.price_override. Other roles get 403; the control is hidden for them in the Orders screen.
  • Data: migration 116 adds price_overridden, original_unit_price, price_override_reason, price_overridden_by, price_overridden_at to order_items (forward-only, existing rows untouched). The first menu price is kept across repeated overrides, and a quantity edit carries the flag to the replacement line.
  • Backend-authoritative: item tax, order totals, and an open bill are recomputed on the backend from the override. An existing item discount stays, capped at the new line total. Receipts and bills read unit_price, so they show the selling price.
  • Guardrails (open questions from the issue): reason required; price above the menu price allowed; overrides blocked once a bill has payments, a split, or a refund (409), and on completed or cancelled orders.
  • Audit and report: every override writes an item_price_overridden audit entry. GET /api/reports/price-exceptions and a dashboard card list order, item, menu price, billed price, difference, who, when, and reason for the selected store-timezone date range.
  • i18n: 24 new strings translated across all 23 locales.

Not included

  • A POS cart-line control for overriding before the order is submitted. The API already accepts price_override at create time; the cart UI touches held orders and retry-attempt persistence and is better as its own PR.
  • Shift filter on the report (date range only).

Closes #1281

Test plan

  • New tests/item-price-override.test.ts (42 checks): owner/manager/cashier access, validation, totals, audit, quantity-edit carry-over, create-time override, paid/cancelled blocking, report contents and permission.
  • Existing suites for orders, item edit, totals, payments, refunds, migrations (fresh + upgrade path), schema health, translations, and authorization pass locally.
  • Needs CI: Playwright E2E.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Oct 22, 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

Comment @coderabbitai help to get the list of available commands.

@itsbkm
itsbkm enabled auto-merge (squash) October 22, 2026 12:58
@itsbkm
itsbkm merged commit 1f11bc4 into main Oct 22, 2026
22 of 23 checks passed
@itsbkm
itsbkm deleted the feat/item-price-override branch October 22, 2026 13:06
@itsbkm

itsbkm commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Pull request is closed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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.

feat: owner-only manual item price override with end-of-day price exceptions report

1 participant