feat(tables): implement real table management APIs#225
Conversation
There was a problem hiding this comment.
Pull request overview
Implements backend table-management endpoints (branch-scoped listing + create/update/soft-delete/restore with duplicate-number checks) and wires the Admin Tables UI to use these APIs instead of fallback/mock data, including support for capacity/status and QR preview URLs based on persisted table IDs/numbers.
Changes:
- Added Table DTOs, service layer, controller endpoints, and service-level unit tests for table workflows.
- Extended
Tablespersistence withcapacity,status, andcreatedDate/updatedDatetimestamps; updated branch mapping to include these fields and count only active tables. - Updated Admin Tables UI to fetch/mutate real backend tables, including edit + soft delete/restore flows and updated QR preview URL parameters.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| RestroHub/src/test/java/com/restroly/qrmenu/table/service/TableServiceImplTest.java | Adds unit tests covering create/update/delete/restore and duplicate/404 cases. |
| RestroHub/src/main/java/com/restroly/qrmenu/table/service/TableServiceImpl.java | Implements table CRUD/restore logic with branch-scoped duplicate validation and DTO mapping. |
| RestroHub/src/main/java/com/restroly/qrmenu/table/service/TableService.java | Introduces the table service interface used by the controller. |
| RestroHub/src/main/java/com/restroly/qrmenu/table/repository/TablesRepository.java | Extends repository with branch-scoped lookups and duplicate checks. |
| RestroHub/src/main/java/com/restroly/qrmenu/table/entity/Tables.java | Adds capacity/status + created/updated timestamps and lifecycle hooks. |
| RestroHub/src/main/java/com/restroly/qrmenu/table/dto/TableResponseDTO.java | Defines the table API response payload including timestamps. |
| RestroHub/src/main/java/com/restroly/qrmenu/table/dto/TableRequestDTO.java | Defines the table create/update request payload with validation. |
| RestroHub/src/main/java/com/restroly/qrmenu/table/controller/TableController.java | Adds secured endpoints for branch tables and table update/delete/restore. |
| RestroHub/src/main/java/com/restroly/qrmenu/branch/mapper/BranchMapper.java | Includes capacity/status in branch table DTOs and counts only active tables. |
| RestroHub/src/main/java/com/restroly/qrmenu/branch/dto/BranchResponseDTO.java | Extends nested table DTO with capacity/status fields. |
| RestroHub-FrontEnd/src/components/admin/store/tables/TablesStatusLegend.jsx | Updates legend counts to exclude inactive tables. |
| RestroHub-FrontEnd/src/components/admin/store/tables/TablesGrid.jsx | Replaces fallback tables with backend fetch + supports refresh/edit and state updates on delete/restore. |
| RestroHub-FrontEnd/src/components/admin/store/tables/Tables.jsx | Adds edit modal support and refresh key to re-fetch after mutations. |
| RestroHub-FrontEnd/src/components/admin/store/tables/TableQRModal.jsx | Updates QR URL to include persisted tableId and table number params. |
| RestroHub-FrontEnd/src/components/admin/store/tables/TableFormModal.jsx | Connects add/edit modal to real POST/PUT endpoints with error handling. |
| RestroHub-FrontEnd/src/components/admin/store/tables/TableCard.jsx | Connects delete/restore actions to backend APIs and adds inactive-table UI state. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Addressed all Copilot review comments in the latest commit:
@rdodiya Please review. |
|
Hi @Divv1524 ,
|
|
@rdodiya Please reveiw. |

Issue Link
Closes #219
Changes Made
Type of Change
Testing Performed
Backend Testing
Note: Backend tests could not be executed locally because JAVA_HOME is invalid and no Java executable is available on PATH.
Frontend Testing
npm.cmd run build.Note:
npm.cmd run lintcould not run because ESLint v9 requireseslint.config.js, which is not present on this branch.Additional Notes
git diff --checkpassed.