76 lines
2.2 KiB
Markdown
76 lines
2.2 KiB
Markdown
|
|
# Reservair
|
||
|
|
|
||
|
|
A WordPress plugin for managing reservations and bookings. Visitors submit reservation requests through a Gutenberg block; administrators manage everything through a dedicated admin panel.
|
||
|
|
|
||
|
|
## Requirements
|
||
|
|
|
||
|
|
- WordPress 6.7+
|
||
|
|
- PHP 7.4+
|
||
|
|
- Composer
|
||
|
|
- Node.js / npm
|
||
|
|
|
||
|
|
## Admin Menu
|
||
|
|
|
||
|
|
| Page | Slug | Description |
|
||
|
|
|---|---|---|
|
||
|
|
| Reservations (root) | `reservations-settings` | Services — the reservable resources |
|
||
|
|
| Timetables | `timetable-settings` | Time-block schedules with capacity and repeating windows |
|
||
|
|
| Forms | `forms-settings` | Custom reservation form definitions |
|
||
|
|
| Reservations | `reservations-list` | All submissions with accept / reject actions |
|
||
|
|
| Google Calendar | `rsv-google-calendar` | OAuth2 connect and webhook configuration |
|
||
|
|
|
||
|
|
## REST API
|
||
|
|
|
||
|
|
All routes are registered under the `reservations/v1` namespace.
|
||
|
|
|
||
|
|
| Resource | Controller |
|
||
|
|
|---|---|
|
||
|
|
| `/service` | `RsvServicesController` |
|
||
|
|
| `/service-type` | `RsvServiceTypeController` |
|
||
|
|
| `/reservation` | `RsvReservationController` |
|
||
|
|
| `/timetable` | `RsvTimetableDefinitionController` |
|
||
|
|
| `/timetable/availability` | `RsvTimetableAvailabilityController` |
|
||
|
|
| `/timetable/capacity` | `RsvTimetableCapacityController` |
|
||
|
|
| `/timetable/reservation` | `RsvTimetableReservationController` |
|
||
|
|
| `/form` | `RsvFormController` |
|
||
|
|
| `/form-definition` | `RsvFormDefinitionController` |
|
||
|
|
| `/google-callback` | OAuth2 redirect handler |
|
||
|
|
| `/google-calendar-hook` | Google Calendar push notification webhook |
|
||
|
|
|
||
|
|
## Linting
|
||
|
|
|
||
|
|
Static analysis is handled by [Psalm](https://psalm.dev/) and covers both `src/` (frontend PHP) and `includes/` (plugin PHP).
|
||
|
|
|
||
|
|
```bash
|
||
|
|
vendor/bin/psalm
|
||
|
|
```
|
||
|
|
|
||
|
|
Pre-existing issues are suppressed in `psalm-baseline.xml`. New code must introduce no new errors — any issue not in the baseline will cause a non-zero exit.
|
||
|
|
|
||
|
|
**Updating the baseline** — after intentionally fixing pre-existing issues, shrink the baseline so they don't regress:
|
||
|
|
|
||
|
|
```bash
|
||
|
|
vendor/bin/psalm --update-baseline
|
||
|
|
```
|
||
|
|
|
||
|
|
**Psalm is part of the `lint` Composer script**, alongside `phpcs` and `phpstan` (those require separate installation):
|
||
|
|
|
||
|
|
```bash
|
||
|
|
composer run lint
|
||
|
|
```
|
||
|
|
|
||
|
|
## Running Tests
|
||
|
|
|
||
|
|
See [`tests/README.md`](tests/README.md) for setup and usage.
|
||
|
|
|
||
|
|
## Build
|
||
|
|
|
||
|
|
```bash
|
||
|
|
npm install
|
||
|
|
npm run build
|
||
|
|
```
|
||
|
|
|
||
|
|
```bash
|
||
|
|
composer install
|
||
|
|
```
|