44 lines
1.7 KiB
Markdown
44 lines
1.7 KiB
Markdown
## Integration notes
|
|
|
|
1) Copy files into an existing Laravel project.
|
|
2) Add `config/pxg.php`.
|
|
3) Register `App\Providers\PxgServiceProvider` in `config/app.php` providers array (Laravel 10) if not auto-discovered.
|
|
|
|
4) Register command:
|
|
- Ensure `app/Console/Kernel.php` loads commands folder (default).
|
|
- Command: `php artisan pxg:seed-flights --event=1`
|
|
|
|
5) CORS:
|
|
- Ensure your Laravel CORS allows the Vue origin (e.g., localhost:5173).
|
|
|
|
|
|
7) Scheduler pairing (recommended):
|
|
- Add Laravel scheduler cron on server:
|
|
* * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1
|
|
- Scheduler will run `pxg:pairing-tick` every minute.
|
|
- You can also run manually: `php artisan pxg:pairing-tick --event=1`
|
|
|
|
|
|
8) Pairing heuristics (v3):
|
|
- Semi-hard course preference: tries preferred course first (A/B) and only falls back if preferred course has no seats.
|
|
- Hole bottleneck mitigation: distributes HIGH/BEGINNER across start holes.
|
|
- Tune via config/pxg.php -> pairing.*
|
|
|
|
|
|
9) Admin auth (Sanctum):
|
|
- Register middleware alias in `app/Http/Kernel.php`:
|
|
'role' => \App\Http\Middleware\EnsureAdminRole::class
|
|
|
|
- Install Sanctum if not present: `composer require laravel/sanctum` then `php artisan sanctum:install`
|
|
- Ensure `api` middleware includes `EnsureFrontendRequestsAreStateful` only if you need cookie auth; this project uses bearer tokens.
|
|
- Seed admin user: `php artisan db:seed --class=AdminUserSeeder`
|
|
|
|
|
|
10) Exports (Excel friendly CSV):
|
|
- Start sheet: GET /api/v1/admin/events/{event}/exports/start-sheet.csv
|
|
- Pairing list: GET /api/v1/admin/events/{event}/exports/pairing-list.csv
|
|
|
|
11) Flight ops:
|
|
- Lock/unlock flights for sponsor/VIP so pairing engine won't use them.
|
|
- Manual assign/move/remove members via admin endpoints.
|