- MacroImportController + LabelImportController: POST endpoints accepting uploaded .bin files,
delegating to MacrosImportService / LabelsImportService and returning import stats / warnings as JSON.
Generic German 422 error if parser rejects the file.
- MacroAssignmentController: index renders Settings Inertia page with assignments / macros / labels /
collections / last-import metadata. store/update/destroy/reorder for global MacroAssignment rows.
- ServiceMacroOverrideController: store snapshots all matching global MacroAssignments into
service-specific rows when a service opts to override; destroy removes both override and
service-specific assignments. storeAssignment / updateAssignment / destroyAssignment manage the
per-service rows directly.
- routes/web.php: 12 new named routes inside the auth middleware group; reorder route placed before
{macroAssignment} parameter route to avoid capture conflict.
- Tests: 19 new Pest tests across 4 feature files (54 assertions). Full suite 376 passed.
128 lines
7.5 KiB
PHP
128 lines
7.5 KiB
PHP
<?php
|
|
|
|
use App\Http\Controllers\ApiLogController;
|
|
use App\Http\Controllers\AuthController;
|
|
use App\Http\Controllers\LabelImportController;
|
|
use App\Http\Controllers\MacroAssignmentController;
|
|
use App\Http\Controllers\MacroImportController;
|
|
use App\Http\Controllers\ServiceController;
|
|
use App\Http\Controllers\ServiceMacroOverrideController;
|
|
use App\Http\Controllers\SettingsController;
|
|
use App\Http\Controllers\SongPdfController;
|
|
use App\Http\Controllers\SyncController;
|
|
use App\Http\Controllers\TranslationController;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Illuminate\Support\Facades\Route;
|
|
use Inertia\Inertia;
|
|
|
|
Route::middleware('guest')->group(function () {
|
|
Route::get('/login', [AuthController::class, 'showLogin'])->name('login');
|
|
Route::get('/auth/churchtools', [AuthController::class, 'redirect'])->name('auth.churchtools');
|
|
Route::get('/auth/churchtools/callback', [AuthController::class, 'callback'])->name('auth.churchtools.callback');
|
|
});
|
|
|
|
if (app()->environment('local', 'testing')) {
|
|
Route::middleware('guest')->group(function () {
|
|
Route::post('/dev-login', function () {
|
|
$user = \App\Models\User::updateOrCreate(
|
|
['email' => 'test@local.dev'],
|
|
[
|
|
'name' => 'Test Benutzer',
|
|
'churchtools_id' => 99999,
|
|
'password' => '',
|
|
'avatar' => null,
|
|
'churchtools_groups' => [],
|
|
'churchtools_roles' => [],
|
|
]
|
|
);
|
|
Auth::login($user);
|
|
|
|
return redirect()->route('dashboard');
|
|
})->name('dev-login');
|
|
});
|
|
}
|
|
|
|
Route::post('/logout', [AuthController::class, 'logout'])
|
|
->middleware('auth')
|
|
->name('logout');
|
|
|
|
Route::middleware('auth')->group(function () {
|
|
Route::get('/', function () {
|
|
return redirect()->route('dashboard');
|
|
});
|
|
|
|
Route::get('/dashboard', function () {
|
|
return Inertia::render('Dashboard');
|
|
})->name('dashboard');
|
|
|
|
Route::get('/services', [ServiceController::class, 'index'])->name('services.index');
|
|
Route::post('/services/{service}/finalize', [ServiceController::class, 'finalize'])->name('services.finalize');
|
|
Route::post('/services/{service}/reopen', [ServiceController::class, 'reopen'])->name('services.reopen');
|
|
Route::delete('/services/{service}', [ServiceController::class, 'destroy'])->name('services.destroy');
|
|
Route::get('/services/{service}/download', [ServiceController::class, 'download'])->name('services.download');
|
|
Route::get('/services/{service}/download-bundle/{blockType}', [ServiceController::class, 'downloadBundle'])->name('services.download-bundle');
|
|
Route::get('/services/{service}/agenda-items/{agendaItem}/download', [ServiceController::class, 'downloadAgendaItem'])->name('services.agenda-item.download');
|
|
Route::get('/services/{service}/edit', [ServiceController::class, 'edit'])->name('services.edit');
|
|
Route::get('/songs/{song}/translate', [TranslationController::class, 'page'])->name('songs.translate');
|
|
|
|
Route::get('/songs', function () {
|
|
return Inertia::render('Songs/Index');
|
|
})->name('songs.index');
|
|
|
|
Route::get('/api-logs', [ApiLogController::class, 'index'])->name('api-logs.index');
|
|
Route::get('/api-logs/{log}/response-body', [ApiLogController::class, 'responseBody'])->name('api-logs.response-body');
|
|
|
|
Route::get('/settings', [SettingsController::class, 'index'])->name('settings.index');
|
|
Route::patch('/settings', [SettingsController::class, 'update'])->name('settings.update');
|
|
|
|
Route::post('/songs/{song}/arrangements', '\\App\\Http\\Controllers\\ArrangementController@store')->name('arrangements.store');
|
|
Route::post('/arrangements/{arrangement}/clone', '\\App\\Http\\Controllers\\ArrangementController@clone')->name('arrangements.clone');
|
|
Route::put('/arrangements/{arrangement}', '\\App\\Http\\Controllers\\ArrangementController@update')->name('arrangements.update');
|
|
Route::delete('/arrangements/{arrangement}', '\\App\\Http\\Controllers\\ArrangementController@destroy')->name('arrangements.destroy');
|
|
|
|
Route::get('/songs/{song}/arrangements/{arrangement}/pdf', [SongPdfController::class, 'download'])->name('songs.pdf');
|
|
Route::get('/songs/{song}/arrangements/{arrangement}/preview', [SongPdfController::class, 'preview'])->name('songs.preview');
|
|
Route::post('/sync', [SyncController::class, 'sync'])->name('sync');
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Folien-Verwaltung
|
|
|--------------------------------------------------------------------------
|
|
*/
|
|
Route::post('/slides', '\\App\\Http\\Controllers\\SlideController@store')->name('slides.store');
|
|
Route::delete('/slides/bulk', '\\App\\Http\\Controllers\\SlideController@destroyBulk')->name('slides.bulk-destroy');
|
|
Route::post('/slides/reorder', '\\App\\Http\\Controllers\\SlideController@reorder')->name('slides.reorder');
|
|
Route::delete('/slides/{slide}', '\\App\\Http\\Controllers\\SlideController@destroy')->name('slides.destroy');
|
|
Route::patch('/slides/{slide}/expire-date', '\\App\\Http\\Controllers\\SlideController@updateExpireDate')->name('slides.update-expire-date');
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Makro- und Label-Import (ProPresenter)
|
|
|--------------------------------------------------------------------------
|
|
*/
|
|
Route::post('/settings/macros/import', [MacroImportController::class, 'store'])->name('settings.macros.import');
|
|
Route::post('/settings/labels/import', [LabelImportController::class, 'store'])->name('settings.labels.import');
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Globale Makro-Zuweisungen
|
|
|--------------------------------------------------------------------------
|
|
*/
|
|
Route::get('/settings/macro-assignments', [MacroAssignmentController::class, 'index'])->name('settings.macro-assignments.index');
|
|
Route::post('/settings/macro-assignments/reorder', [MacroAssignmentController::class, 'reorder'])->name('settings.macro-assignments.reorder');
|
|
Route::post('/settings/macro-assignments', [MacroAssignmentController::class, 'store'])->name('settings.macro-assignments.store');
|
|
Route::patch('/settings/macro-assignments/{macroAssignment}', [MacroAssignmentController::class, 'update'])->name('settings.macro-assignments.update');
|
|
Route::delete('/settings/macro-assignments/{macroAssignment}', [MacroAssignmentController::class, 'destroy'])->name('settings.macro-assignments.destroy');
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Service-spezifische Makro-Overrides
|
|
|--------------------------------------------------------------------------
|
|
*/
|
|
Route::post('/services/{service}/macro-overrides', [ServiceMacroOverrideController::class, 'store'])->name('services.macro-overrides.store');
|
|
Route::delete('/services/{service}/macro-overrides', [ServiceMacroOverrideController::class, 'destroy'])->name('services.macro-overrides.destroy');
|
|
Route::post('/services/{service}/macro-assignments', [ServiceMacroOverrideController::class, 'storeAssignment'])->name('services.macro-assignments.store');
|
|
Route::patch('/services/{service}/macro-assignments/{serviceMacroAssignment}', [ServiceMacroOverrideController::class, 'updateAssignment'])->name('services.macro-assignments.update');
|
|
Route::delete('/services/{service}/macro-assignments/{serviceMacroAssignment}', [ServiceMacroOverrideController::class, 'destroyAssignment'])->name('services.macro-assignments.destroy');
|
|
});
|