Menu and Bar Item Deletion Bug

Problem

Menu items and bar items could not be deleted when they were already associated with existing restaurant or bar orders. The system returned a foreign key constraint error because the order items still referenced the records being deleted.

Cause

The restaurant_order_items.menu_id and bar_order_items.item_id foreign keys prevented deletion of menu and bar items that had existing order records.

Solution

The foreign key constraints were updated to use ON DELETE SET NULL. The corresponding columns were also changed to allow NULL values, and the Rust models were updated to use Option<Uuid>.

Result

The bug was resolved. Menu and bar items can now be deleted without removing historical order records. Existing orders retain the item name, quantity, unit price, and total price while the deleted item's foreign key is set to NULL.

Status: Resolved

Update release 1.0.2

Bugs solved

Delete error on the related reservation and invoice table

Logical error patch using OR instead of AND which would not detect role.

Status: Resolved

Update release 1.0.3

Added back manual receipt generation, incase of re-print

Update release 1.0.4

Added delete functions on items and resolved view invoice error