feat: add endpoint to retrieve selected bank account for a tenant and update routes with authentication

This commit is contained in:
2026-07-03 13:54:31 -03:00
parent b1e40b3430
commit c1b7b12fe1
5 changed files with 60 additions and 5 deletions

View File

@@ -64,4 +64,13 @@ class BankAccountController extends Controller
return TenantResource::make($tenant->loadMissing(['headerLogo', 'footerLogo', 'selectedBankAccount']));
}
public function selected(Tenant $tenant): JsonResponse
{
$account = $tenant->selectedBankAccount;
abort_if(!$account, 404, 'No bank account is currently selected for this tenant.');
return BankAccountResource::make($account)->response();
}
}