# Phase 1: Foundation & Schema — DONE

**Completed:** 2026-03-13

## What was delivered

### New Enums (7)
- `app/Enums/RestaurantServicePeriod.php` — BREAKFAST, BRUNCH, LUNCH, AFTERNOON_TEA, DINNER, LATE_NIGHT
- `app/Enums/RestaurantReservationStatus.php` — PENDING, CONFIRMED, SEATED, COMPLETED, CANCELLED, NO_SHOW
- `app/Enums/RestaurantTableZone.php` — INDOOR, OUTDOOR, TERRACE, VIP, BAR, PRIVATE
- `app/Enums/RestaurantTableStatus.php` — AVAILABLE, OCCUPIED, RESERVED, MAINTENANCE
- `app/Enums/Allergen.php` — 14 EU regulatory allergens
- `app/Enums/DietaryLabel.php` — VEGETARIAN, VEGAN, GLUTEN_FREE, HALAL, KOSHER, etc.
- `app/Enums/RestaurantMenuCategoryType.php` — FOOD, DRINK

### Modified Enums (2)
- `app/Enums/AdminRole.php` — Added RESTAURANT_MANAGER
- `app/Enums/OrderableType.php` — Added RESTAURANT_MENU_ITEM, RESTAURANT_RESERVATION

### New Models (7)
- `app/Models/Restaurant.php` — Main restaurant entity with opening hours, service periods, media
- `app/Models/RestaurantTable.php` — Table with number, zone, seats, status
- `app/Models/RestaurantMenuCategory.php` — Hierarchical categories (food/drink), translatable
- `app/Models/RestaurantMenuItem.php` — Implements Orderable, 3-tier pricing, allergens, dietary labels
- `app/Models/RestaurantMenu.php` — Date-bound daily menus with service period scoping
- `app/Models/RestaurantMenuSection.php` — Menu sections with items pivot (sort_order, price override)
- `app/Models/RestaurantReservation.php` — Implements Orderable, status transitions, multi-table support

### New Migrations (11)
- `2026_08_01_000001` through `000011` — All tables, order fields, role seeding

### New Middleware
- `app/Http/Middleware/EnsureRestaurantManagerMiddleware.php` — Validates role + place + restaurant access

### New Factories (7)
- Restaurant, RestaurantTable, RestaurantMenuCategory, RestaurantMenuItem, RestaurantMenu, RestaurantMenuSection, RestaurantReservation

### Modified Files
- `app/Models/Employee.php` — Added `isRestaurantManager` accessor, updated getEmployeeType/getEmployeeTypes
- `app/Models/User.php` — Added `isRestaurantManager` accessor, updated currentProfile/defaultProfile/currentProfileModel
- `app/Models/Place.php` — Added `restaurants()` HasMany relation
- `app/Models/Order.php` — Added restaurant_id, restaurant_table_ids, tip casts, restaurant() relation
- `app/Models/RestaurantRevenue.php` — Added @deprecated annotation
- `app/Providers/AppServiceProvider.php` — Added 6 new morph map entries
- `app/Filament/Resources/PlaceResource.php` — Removed RestaurantRevenuesRelationManager and ManageRestaurantRevenues page
- `routes/api.php` — Added restaurant manager + customer route groups (empty, ready for next phases)

### Deleted Files
- `app/Filament/Resources/PlaceResource/RelationManagers/RestaurantRevenuesRelationManager.php`
- `app/Filament/Resources/PlaceResource/Pages/Management/ManageRestaurantRevenues.php`

## Quality Checks
- `vendor/bin/pint` — PASS (43 files)
- `vendor/bin/phpstan --level=7` — PASS (0 errors)

## Notes
- Migrations not yet run (user will run manually)
- Tests not yet created (deferred — the middleware authorization test requires route endpoints to exist, which come in Phase 2+)
- Route groups are registered but empty — endpoints will be added in subsequent phases
