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.
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.
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>.
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
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
Added back manual receipt generation, incase of re-print
Added delete functions on items and resolved view invoice error