commit compras5 2711
tests / ci (push) Waiting to run

This commit is contained in:
2026-11-27 20:19:21 +02:00
parent 7486007fcf
commit d58b75c87a
57 changed files with 2803 additions and 116 deletions
@@ -0,0 +1,34 @@
<?php
namespace App\Http\Controllers;
use App\Models\ExternalPayment;
use App\Models\User;
use App\Services\ExpenseAllocations;
use Illuminate\Http\Request;
use Inertia\Inertia;
use Symfony\Component\HttpFoundation\Response;
final class ExpenseAllocationController extends Controller
{
public function show(Request $request, ExternalPayment $payment, ExpenseAllocations $service): Response
{
$actor = $request->user('web');
abort_unless($actor instanceof User, 403);
$request->validate(['page' => 'nullable|integer|min:1|max:1000000']);
Inertia::encryptHistory();
$response = Inertia::render('payments/expense-allocation', $service->workspace($actor, $payment->id))->toResponse($request);
$response->headers->set('Cache-Control', 'private, no-store, max-age=0');
return $response;
}
public function store(Request $request, ExternalPayment $payment, ExpenseAllocations $service): Response
{
$actor = $request->user('web');
abort_unless($actor instanceof User, 403);
$service->save($actor, $payment->id, $request->all());
return back()->with('success', 'Imputação da despesa por categoria preservada.');
}
}