Skip to content

Issue: Duplicate Menu name not checked on Restore #149

@iRahmanG

Description

@iRahmanG

Currently, when restoring a soft‑deleted menu (PATCH /menus/{menuId}/restore),
the system does not check whether another active menu with the same name already
exists in the same branch. This can lead to duplicate menu names within a branch,
breaking the uniqueness constraint enforced during creation and update.

Steps to Reproduce:

  1. Create a menu named "Lunch Specials" under branch 1
  2. Soft delete the menu
  3. Create another menu with the same name "Lunch Specials" under branch 1
  4. Restore the previously deleted menu
  5. Branch 1 now has two active menus with identical names

Expected Behavior:

  • Restore operation should validate uniqueness of the menu name within the branch.
  • If a duplicate exists, return a 409 Conflict error with a clear message.

Actual Behavior:

  • Restore operation succeeds without validation
  • Duplicate menu names are allowed, causing confusion in search, listing, and existence checks.

Proposed Fix:

  • Add duplicate name check in MenuServiceImpl.restoreMenu() similar to createMenu() and updateMenu()
  • Throw DuplicateResourceException if a conflict is detected

Impact:

  • Ensures data integrity and consistency across menu operations
  • Prevents unexpected behavior in client applications relying on unique menu names

I would like to work on this issue under GSSoC 2026
@rdodiya Please assing me this issue

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions