## Overview

RMS is a Laravel-based restaurant management system with role-based APIs for admin, manager, cashier, chef, and public customer flows. The project covers front-of-house operations, ordering, reservations, payments, inventory, customer management, reporting, notifications, and system settings.

## Technology Stack

Laravel PHP Eloquent ORM Sanctum REST JSON API Vite Broadcasting PHPUnit

## User Roles and Access Model

Role | Primary Access
--- | ---
Public | Login, language endpoints, customer reservations, public push subscription endpoints.
Admin | Full system access including branches, users, settings, dashboards, reports, and notification administration.
Manager | Operational control over menu, tables, reservations, inventory, suppliers, purchases, reports, uploads, and payments.
Cashier | Orders, customers, reservations, payments, invoices, loyalty, split bills, and offers.
Chef | Order workflow and kitchen display system endpoints.

## Authentication and Identity

- User login with active-status validation.
- Authenticated user profile endpoint.
- Token refresh and logout.
- Role and permission lookup for authenticated users.
- Role-based route protection throughout the API.
- Admin RBAC management endpoints for listing roles, viewing role details, listing permissions, and syncing permissions to roles.

## Localization and Language Support

- Public language listing.
- Current language retrieval.
- Authenticated language selection.
- Translation resources for en_US, en_GB, fr, it, de, es, and nl.

## Notifications and Event-Driven Features

### Events

- Order created
- Order ready
- Payment received
- Reservation confirmed

### Delivery Channels

- Email notifications
- SMS provider hooks
- Push notifications

### Push Notification Management

- Public subscribe and unsubscribe.
- Authenticated subscription listing, update, and delete.
- Test notification endpoint.
- Admin notification logs, statistics, and bulk send.

## Operations Modules

### Branches and Users

- Branch CRUD with soft delete, restore, and branch-specific user listing.
- User CRUD, role assignment/removal, status changes, and filtering by branch or role.

### Roles and Permissions

- List roles with their assigned permissions.
- View a single role with its current permissions.
- List all permissions.
- Sync permissions to a role through admin-only endpoints.
- Keep the system role-based without direct per-user permission overrides.

### Menu and Catalog

- Category CRUD with soft delete, restore, and category-with-items listing.
- Menu item CRUD with status toggle, category lookup, and variant management.

### Floors and Tables

- Floor CRUD with related table listing.
- Table CRUD, status updates, and filtered views for available, occupied, reserved, and floor-based listings.

### Orders and Kitchen

- Order CRUD, cancel, restore, status updates, and filters by customer, status, type, and date range.
- Kitchen display system dashboard with pending, preparing, ready queues and status transitions.

### Reservations

- Public reservation create, lookup, and cancel by reservation number and phone.
- Staff reservation CRUD, upcoming view, date and range filters, available table search, summary, confirm, check-in, cancel, and customer-specific lookup.
- Scoped manager/admin reservation routes plus admin-only delete and restore capabilities.

### Customers and Loyalty

- Customer CRUD, search, lookup by phone, repeat/top/tier views, order history, payment history, and analytics.
- Loyalty detail views, per-customer summaries, type filtering, point redemption, and manual adjustment.

### Offers, Inventory, Suppliers, and Purchases

- Offer CRUD, validation, apply flow, statistics, and active/ongoing/expiring views.
- Inventory CRUD with low-stock, out-of-stock, and summary endpoints.
- Supplier CRUD and active supplier listing.
- Purchase CRUD with pending view, supplier/date filtering, and confirmation workflow.

## Commerce and Finance

### Payment Methods and Payments

- Payment method listing and active-only listing.
- Payment listing with filters, full and partial payment creation, lookup, status updates, refunds, restore/delete, and branch-scoped validation.
- Payment summaries for order, daily, date-range, and monthly views.

### Split Bills and Invoices

- Split bill creation, lookup by id/order, and partial payer settlement.
- Invoice CRUD with status filtering, overdue view, date-range filtering, summary, mark-sent, cancel, restore, and delete.

### Expenses and Financial Reports

- Expense CRUD with summary, daily totals, category filtering, restore, and delete.
- Financial dashboard, profit and loss, revenue by payment method, daily/monthly summaries, expense summary, total revenue, and admin branch comparison.

## Admin Dashboard and Settings

### Admin Dashboard

- Overview dashboard.
- Revenue analysis.
- Operations analysis.
- Customer analysis.
- Inventory dashboard.
- Staff dashboard.
- System health endpoint.
- Dashboard export by format.

### System Settings

- Settings listing and grouped/category-based lookup.
- Setting lookup by key.
- Current localization lookup.
- Settings update and cache clear endpoint.

### File Upload Support

- Authenticated image upload endpoint for manager/admin workflows.

### Soft Delete and Restore Coverage

The codebase consistently supports soft delete and restore operations across branches, users, categories, menu items, floors, tables, orders, reservations, offers, inventory items, suppliers, purchases, customers, payments, invoices, and expenses.

## Testing Coverage Present in the Repository

- Reservation feature tests covering customer self-service and manager/admin access paths.
- Payment feature tests covering listing, filters, summaries, creation, branch safety, refunds, status updates, delete/restore, and authorization.

## Notes