feat(work-order-dashboard): PDF download in Docs tab + gate chat by config
- Documente tab: link to a new /app/work-orders/{id}/pdf route that
streams the invoice PDF via WorkOrderPdfService; also lists any
files uploaded to the 'signed_documents' media collection.
- Chat client card: only show the input form when telegram_bot or
whatsapp_business is enabled AND credentialed in the tenant's
Integrations page. Otherwise render an empty state with a shortcut
to /app/integrations.
RU + EN translations added for the new strings (RO source).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -47,6 +47,15 @@ Route::post('/payments/paypal/webhook', [\App\Http\Controllers\PaymentController
|
||||
Route::post('/payments/paynet/webhook', [\App\Http\Controllers\PaymentController::class, 'paynetWebhook'])
|
||||
->withoutMiddleware([\Illuminate\Foundation\Http\Middleware\VerifyCsrfToken::class]);
|
||||
|
||||
// PDF download for a work order (used from dashboard's Documents tab).
|
||||
Route::get('/app/work-orders/{workOrder}/pdf', function (int $workOrder) {
|
||||
abort_unless(auth('web')->check(), 403);
|
||||
$wo = \App\Models\Tenant\WorkOrder::findOrFail($workOrder);
|
||||
$svc = app(\App\Services\WorkOrderPdfService::class);
|
||||
$pdf = $svc->generate($wo);
|
||||
return response()->streamDownload(fn () => print($pdf->output()), $svc->filename($wo));
|
||||
})->name('work-orders.pdf');
|
||||
|
||||
// User invitation accept flow (no auth required — token is the credential).
|
||||
Route::get('/invitations/{token}', [\App\Http\Controllers\InvitationController::class, 'show'])
|
||||
->name('invitation.show');
|
||||
|
||||
Reference in New Issue
Block a user