@@ -11,6 +11,27 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
final class ExpenseAllocationController extends Controller
|
||||
{
|
||||
public function commonShow(Request $request, int $allocation, 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, $allocation, 'common_allocation'))->toResponse($request);
|
||||
$response->headers->set('Cache-Control', 'private, no-store, max-age=0');
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
public function commonStore(Request $request, int $allocation, ExpenseAllocations $service): Response
|
||||
{
|
||||
$actor = $request->user('web');
|
||||
abort_unless($actor instanceof User, 403);
|
||||
$service->save($actor, $allocation, $request->all(), 'common_allocation');
|
||||
|
||||
return back()->with('success', 'Imputação da despesa por categoria preservada.');
|
||||
}
|
||||
|
||||
public function show(Request $request, ExternalPayment $payment, ExpenseAllocations $service): Response
|
||||
{
|
||||
$actor = $request->user('web');
|
||||
|
||||
Reference in New Issue
Block a user