Compare commits

..

28 Commits

Author SHA1 Message Date
github-actions[bot]
0aa31fde49 Merge pull request #11178 from firefly-iii/release-1762406581
🤖 Automatically merge the PR into the develop branch.
2025-11-06 06:23:09 +01:00
JC5
cf1c7262cd 🤖 Auto commit for release 'develop' on 2025-11-06 2025-11-06 06:23:01 +01:00
James Cole
d2b15734cc Fix account list filter. 2025-11-06 06:18:07 +01:00
James Cole
e0153dd33f Fix https://github.com/firefly-iii/firefly-iii/issues/11177 2025-11-06 06:17:59 +01:00
James Cole
0bc2d40d9b Don't throw error, report it. 2025-11-04 20:48:58 +01:00
github-actions[bot]
a3eb3bb1a4 Merge pull request #11174 from firefly-iii/release-1762232070
🤖 Automatically merge the PR into the develop branch.
2025-11-04 05:54:39 +01:00
JC5
bc5d52435e 🤖 Auto commit for release 'develop' on 2025-11-04 2025-11-04 05:54:30 +01:00
James Cole
eda81ef7b5 Rename the variable so there is no doubt what it does. 2025-11-04 05:50:06 +01:00
github-actions[bot]
5be32b1675 Merge pull request #11173 from firefly-iii/release-1762229827
🤖 Automatically merge the PR into the develop branch.
2025-11-04 05:17:13 +01:00
JC5
917b919503 🤖 Auto commit for release 'develop' on 2025-11-04 2025-11-04 05:17:07 +01:00
github-actions[bot]
43c38be0ed Merge pull request #11170 from firefly-iii/release-1762200216
🤖 Automatically merge the PR into the develop branch.
2025-11-03 21:03:45 +01:00
JC5
35e4ece205 🤖 Auto commit for release 'develop' on 2025-11-03 2025-11-03 21:03:36 +01:00
James Cole
b3421faf25 Fix #11168 2025-11-03 20:58:04 +01:00
github-actions[bot]
8d927a76d5 Merge pull request #11169 from firefly-iii/release-1762199642
🤖 Automatically merge the PR into the develop branch.
2025-11-03 20:54:14 +01:00
JC5
f000f96b00 🤖 Auto commit for release 'develop' on 2025-11-03 2025-11-03 20:54:02 +01:00
James Cole
9bd294257b Whoops. 2025-11-03 20:49:42 +01:00
github-actions[bot]
6d430c5d29 Merge pull request #11167 from firefly-iii/release-1762197221
🤖 Automatically merge the PR into the develop branch.
2025-11-03 20:13:49 +01:00
JC5
774e020177 🤖 Auto commit for release 'develop' on 2025-11-03 2025-11-03 20:13:41 +01:00
James Cole
47f938c71b Merge branch 'develop' of github.com:firefly-iii/firefly-iii into develop 2025-11-03 20:08:37 +01:00
James Cole
d66f03d538 Add support for sentry. 2025-11-03 20:08:31 +01:00
github-actions[bot]
fe926ae23e Merge pull request #11165 from firefly-iii/release-1762140612
🤖 Automatically merge the PR into the develop branch.
2025-11-03 04:30:23 +01:00
JC5
2852a36712 🤖 Auto commit for release 'develop' on 2025-11-03 2025-11-03 04:30:12 +01:00
James Cole
7743d16ea1 Replace references to log service. 2025-11-02 14:48:36 +01:00
James Cole
ae767fc90d Replace references to log service. 2025-11-02 14:45:39 +01:00
James Cole
b49575db8b Replace reference. 2025-11-02 14:42:34 +01:00
James Cole
69b816d957 Clean up a variety of requests. 2025-11-02 14:39:34 +01:00
James Cole
e9cf5111c9 Add required parameter. 2025-11-02 14:03:59 +01:00
James Cole
a57cf4e9be Clean up some classes, extend API validation. 2025-11-02 14:00:55 +01:00
83 changed files with 1308 additions and 515 deletions

View File

@@ -275,6 +275,16 @@ DISABLE_CSP_HEADER=false
TRACKER_SITE_ID= TRACKER_SITE_ID=
TRACKER_URL= TRACKER_URL=
#
# You can automatically submit errors to the Firefly III developer using sentry.io
#
# This is entirely optional of course. If you run into errors, I will gladly accept GitHub
# issues or a forwared email message.
#
# If you set this to true, your installation will try to contact sentry.io when it runs into errors.
#
REPORT_ERRORS_ONLINE=false
# #
# Firefly III supports webhooks. These are security sensitive and must be enabled manually first. # Firefly III supports webhooks. These are security sensitive and must be enabled manually first.
# #

View File

@@ -26,6 +26,7 @@ namespace FireflyIII\Api\V1\Controllers\Autocomplete;
use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Autocomplete\AutocompleteApiRequest; use FireflyIII\Api\V1\Requests\Autocomplete\AutocompleteApiRequest;
use FireflyIII\Api\V1\Requests\Autocomplete\AutocompleteTransactionApiRequest;
use FireflyIII\Enums\UserRoleEnum; use FireflyIII\Enums\UserRoleEnum;
use FireflyIII\Models\TransactionGroup; use FireflyIII\Models\TransactionGroup;
use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionJournal;
@@ -64,7 +65,7 @@ class TransactionController extends Controller
); );
} }
public function transactions(AutocompleteApiRequest $request): JsonResponse public function transactions(AutocompleteTransactionApiRequest $request): JsonResponse
{ {
$result = $this->repository->searchJournalDescriptions($request->attributes->get('query'), $request->attributes->get('limit')); $result = $this->repository->searchJournalDescriptions($request->attributes->get('query'), $request->attributes->get('limit'));

View File

@@ -25,6 +25,7 @@ declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\Account; namespace FireflyIII\Api\V1\Controllers\Models\Account;
use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Generic\PaginationDateRangeRequest;
use FireflyIII\Api\V1\Requests\PaginationRequest; use FireflyIII\Api\V1\Requests\PaginationRequest;
use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Models\Account; use FireflyIII\Models\Account;
@@ -37,7 +38,6 @@ use FireflyIII\Transformers\PiggyBankTransformer;
use FireflyIII\Transformers\TransactionGroupTransformer; use FireflyIII\Transformers\TransactionGroupTransformer;
use FireflyIII\User; use FireflyIII\User;
use Illuminate\Http\JsonResponse; use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use League\Fractal\Pagination\IlluminatePaginatorAdapter; use League\Fractal\Pagination\IlluminatePaginatorAdapter;
@@ -110,7 +110,7 @@ class ListController extends Controller
// get list of piggy banks. Count it and split it. // get list of piggy banks. Count it and split it.
$collection = $this->repository->getPiggyBanks($account); $collection = $this->repository->getPiggyBanks($account);
$count = $collection->count(); $count = $collection->count();
$piggyBanks = $collection->slice(($page - 1) * $limit, $limit); $piggyBanks = $collection->slice($offset, $limit);
// enrich // enrich
/** @var User $admin */ /** @var User $admin */
@@ -136,12 +136,15 @@ class ListController extends Controller
/** /**
* Show all transaction groups related to the account. * Show all transaction groups related to the account.
*/ */
public function transactions(Request $request, Account $account): JsonResponse public function transactions(PaginationDateRangeRequest $request, Account $account): JsonResponse
{ {
$pageSize = $this->parameters->get('limit'); [
$type = $request->get('type') ?? 'default'; 'limit' => $limit,
$this->parameters->set('type', $type); 'page' => $page,
$types = $this->mapTransactionTypes($this->parameters->get('type')); 'start' => $start,
'end' => $end,
'types' => $types,
] = $request->attributes->all();
$manager = $this->getManager(); $manager = $this->getManager();
/** @var User $admin */ /** @var User $admin */
@@ -150,15 +153,12 @@ class ListController extends Controller
// use new group collector: // use new group collector:
/** @var GroupCollectorInterface $collector */ /** @var GroupCollectorInterface $collector */
$collector = app(GroupCollectorInterface::class); $collector = app(GroupCollectorInterface::class);
$collector->setUser($admin)->setAccounts(new Collection()->push($account)) $collector->setUser($admin)->setAccounts(new Collection()->push($account))->withAPIInformation()->setLimit($limit)->setPage($page)->setTypes($types);
->withAPIInformation()->setLimit($pageSize)->setPage($this->parameters->get('page'))->setTypes($types) if (null !== $start) {
; $collector->setStart($start);
if (null !== $this->parameters->get('start')) {
$collector->setStart($this->parameters->get('start'));
} }
if (null !== $this->parameters->get('end')) { if (null !== $end) {
$collector->setEnd($this->parameters->get('end')); $collector->setEnd($end);
} }
$paginator = $collector->getPaginatedGroups(); $paginator = $collector->getPaginatedGroups();
@@ -171,7 +171,6 @@ class ListController extends Controller
/** @var TransactionGroupTransformer $transformer */ /** @var TransactionGroupTransformer $transformer */
$transformer = app(TransactionGroupTransformer::class); $transformer = app(TransactionGroupTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($transactions, $transformer, 'transactions'); $resource = new FractalCollection($transactions, $transformer, 'transactions');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator)); $resource->setPaginator(new IlluminatePaginatorAdapter($paginator));

View File

@@ -82,7 +82,6 @@ class ShowController extends Controller
'date' => $date, 'date' => $date,
] ]
= $request->attributes->all(); = $request->attributes->all();
// get list of accounts. Count it and split it. // get list of accounts. Count it and split it.
$this->repository->resetAccountOrder(); $this->repository->resetAccountOrder();
$collection = $this->repository->getAccountsByType($types, $sort); $collection = $this->repository->getAccountsByType($types, $sort);

View File

@@ -81,7 +81,6 @@ class StoreController extends Controller
/** @var AccountTransformer $transformer */ /** @var AccountTransformer $transformer */
$transformer = app(AccountTransformer::class); $transformer = app(AccountTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($account, $transformer, self::RESOURCE_KEY); $resource = new Item($account, $transformer, self::RESOURCE_KEY);

View File

@@ -87,7 +87,6 @@ class UpdateController extends Controller
/** @var AccountTransformer $transformer */ /** @var AccountTransformer $transformer */
$transformer = app(AccountTransformer::class); $transformer = app(AccountTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($account, $transformer, self::RESOURCE_KEY); $resource = new Item($account, $transformer, self::RESOURCE_KEY);
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE); return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);

View File

@@ -26,6 +26,7 @@ namespace FireflyIII\Api\V1\Controllers\Models\Attachment;
use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Middleware\ApiDemoUser; use FireflyIII\Api\V1\Middleware\ApiDemoUser;
use FireflyIII\Api\V1\Requests\PaginationRequest;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\Attachment; use FireflyIII\Models\Attachment;
use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface; use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface;
@@ -120,8 +121,14 @@ class ShowController extends Controller
* *
* Display a listing of the resource. * Display a listing of the resource.
*/ */
public function index(): JsonResponse public function index(PaginationRequest $request): JsonResponse
{ {
[
'limit' => $limit,
'offset' => $offset,
'page' => $page,
] = $request->attributes->all();
if (true === auth()->user()->hasRole('demo')) { if (true === auth()->user()->hasRole('demo')) {
Log::channel('audit')->warning(sprintf('Demo user tries to access attachment API in %s', __METHOD__)); Log::channel('audit')->warning(sprintf('Demo user tries to access attachment API in %s', __METHOD__));
@@ -130,21 +137,17 @@ class ShowController extends Controller
$manager = $this->getManager(); $manager = $this->getManager();
// types to get, page size:
$pageSize = $this->parameters->get('limit');
// get list of attachments. Count it and split it. // get list of attachments. Count it and split it.
$collection = $this->repository->get(); $collection = $this->repository->get();
$count = $collection->count(); $count = $collection->count();
$attachments = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize); $attachments = $collection->slice($offset, $limit);
// make paginator: // make paginator:
$paginator = new LengthAwarePaginator($attachments, $count, $pageSize, $this->parameters->get('page')); $paginator = new LengthAwarePaginator($attachments, $count, $limit, $page);
$paginator->setPath(route('api.v1.attachments.index').$this->buildParams()); $paginator->setPath(route('api.v1.attachments.index').$this->buildParams());
/** @var AttachmentTransformer $transformer */ /** @var AttachmentTransformer $transformer */
$transformer = app(AttachmentTransformer::class); $transformer = app(AttachmentTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($attachments, $transformer, 'attachments'); $resource = new FractalCollection($attachments, $transformer, 'attachments');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator)); $resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
@@ -169,7 +172,6 @@ class ShowController extends Controller
/** @var AttachmentTransformer $transformer */ /** @var AttachmentTransformer $transformer */
$transformer = app(AttachmentTransformer::class); $transformer = app(AttachmentTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($attachment, $transformer, 'attachments'); $resource = new Item($attachment, $transformer, 'attachments');

View File

@@ -87,7 +87,6 @@ class StoreController extends Controller
/** @var AttachmentTransformer $transformer */ /** @var AttachmentTransformer $transformer */
$transformer = app(AttachmentTransformer::class); $transformer = app(AttachmentTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($attachment, $transformer, 'attachments'); $resource = new Item($attachment, $transformer, 'attachments');

View File

@@ -81,7 +81,6 @@ class UpdateController extends Controller
/** @var AttachmentTransformer $transformer */ /** @var AttachmentTransformer $transformer */
$transformer = app(AttachmentTransformer::class); $transformer = app(AttachmentTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($attachment, $transformer, 'attachments'); $resource = new Item($attachment, $transformer, 'attachments');

View File

@@ -25,6 +25,7 @@ declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\AvailableBudget; namespace FireflyIII\Api\V1\Controllers\Models\AvailableBudget;
use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Generic\PaginationDateRangeRequest;
use FireflyIII\Models\AvailableBudget; use FireflyIII\Models\AvailableBudget;
use FireflyIII\Repositories\Budget\AvailableBudgetRepositoryInterface; use FireflyIII\Repositories\Budget\AvailableBudgetRepositoryInterface;
use FireflyIII\Support\JsonApi\Enrichments\AvailableBudgetEnrichment; use FireflyIII\Support\JsonApi\Enrichments\AvailableBudgetEnrichment;
@@ -67,19 +68,21 @@ class ShowController extends Controller
* *
* Display a listing of the resource. * Display a listing of the resource.
*/ */
public function index(): JsonResponse public function index(PaginationDateRangeRequest $request): JsonResponse
{ {
$manager = $this->getManager(); $manager = $this->getManager();
[
// types to get, page size: 'limit' => $limit,
$pageSize = $this->parameters->get('limit'); 'offset' => $offset,
$start = $this->parameters->get('start'); 'page' => $page,
$end = $this->parameters->get('end'); 'start' => $start,
'end' => $end,
] = $request->attributes->all();
// get list of available budgets. Count it and split it. // get list of available budgets. Count it and split it.
$collection = $this->abRepository->getAvailableBudgetsByDate($start, $end); $collection = $this->abRepository->getAvailableBudgetsByDate($start, $end);
$count = $collection->count(); $count = $collection->count();
$availableBudgets = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize); $availableBudgets = $collection->slice($offset, $limit);
// enrich // enrich
/** @var User $admin */ /** @var User $admin */
@@ -89,12 +92,11 @@ class ShowController extends Controller
$availableBudgets = $enrichment->enrich($availableBudgets); $availableBudgets = $enrichment->enrich($availableBudgets);
// make paginator: // make paginator:
$paginator = new LengthAwarePaginator($availableBudgets, $count, $pageSize, $this->parameters->get('page')); $paginator = new LengthAwarePaginator($availableBudgets, $count, $limit, $page);
$paginator->setPath(route('api.v1.available-budgets.index').$this->buildParams()); $paginator->setPath(route('api.v1.available-budgets.index').$this->buildParams());
/** @var AvailableBudgetTransformer $transformer */ /** @var AvailableBudgetTransformer $transformer */
$transformer = app(AvailableBudgetTransformer::class); $transformer = app(AvailableBudgetTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($availableBudgets, $transformer, 'available_budgets'); $resource = new FractalCollection($availableBudgets, $transformer, 'available_budgets');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator)); $resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
@@ -116,15 +118,12 @@ class ShowController extends Controller
/** @var AvailableBudgetTransformer $transformer */ /** @var AvailableBudgetTransformer $transformer */
$transformer = app(AvailableBudgetTransformer::class); $transformer = app(AvailableBudgetTransformer::class);
$transformer->setParameters($this->parameters);
// enrich // enrich
/** @var User $admin */ /** @var User $admin */
$admin = auth()->user(); $admin = auth()->user();
$enrichment = new AvailableBudgetEnrichment(); $enrichment = new AvailableBudgetEnrichment();
$enrichment->setUser($admin); $enrichment->setUser($admin);
// $enrichment->setStart($start);
// $enrichment->setEnd($end);
$availableBudget = $enrichment->enrichSingle($availableBudget); $availableBudget = $enrichment->enrichSingle($availableBudget);

View File

@@ -25,6 +25,8 @@ declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\Bill; namespace FireflyIII\Api\V1\Controllers\Models\Bill;
use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Generic\PaginationDateRangeRequest;
use FireflyIII\Api\V1\Requests\PaginationRequest;
use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use FireflyIII\Models\Bill; use FireflyIII\Models\Bill;
use FireflyIII\Repositories\Bill\BillRepositoryInterface; use FireflyIII\Repositories\Bill\BillRepositoryInterface;
@@ -35,7 +37,6 @@ use FireflyIII\Transformers\RuleTransformer;
use FireflyIII\Transformers\TransactionGroupTransformer; use FireflyIII\Transformers\TransactionGroupTransformer;
use FireflyIII\User; use FireflyIII\User;
use Illuminate\Http\JsonResponse; use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Pagination\LengthAwarePaginator;
use League\Fractal\Pagination\IlluminatePaginatorAdapter; use League\Fractal\Pagination\IlluminatePaginatorAdapter;
use League\Fractal\Resource\Collection as FractalCollection; use League\Fractal\Resource\Collection as FractalCollection;
@@ -71,22 +72,25 @@ class ListController extends Controller
* *
* Display a listing of the resource. * Display a listing of the resource.
*/ */
public function attachments(Bill $bill): JsonResponse public function attachments(PaginationRequest $request, Bill $bill): JsonResponse
{ {
[
'limit' => $limit,
'offset' => $offset,
'page' => $page,
] = $request->attributes->all();
$manager = $this->getManager(); $manager = $this->getManager();
$pageSize = $this->parameters->get('limit');
$collection = $this->repository->getAttachments($bill); $collection = $this->repository->getAttachments($bill);
$count = $collection->count(); $count = $collection->count();
$attachments = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize); $attachments = $collection->slice($offset, $limit);
// make paginator: // make paginator:
$paginator = new LengthAwarePaginator($attachments, $count, $pageSize, $this->parameters->get('page')); $paginator = new LengthAwarePaginator($attachments, $count, $limit, $page);
$paginator->setPath(route('api.v1.bills.attachments', [$bill->id]).$this->buildParams()); $paginator->setPath(route('api.v1.bills.attachments', [$bill->id]).$this->buildParams());
/** @var AttachmentTransformer $transformer */ /** @var AttachmentTransformer $transformer */
$transformer = app(AttachmentTransformer::class); $transformer = app(AttachmentTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($attachments, $transformer, 'attachments'); $resource = new FractalCollection($attachments, $transformer, 'attachments');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator)); $resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
@@ -100,25 +104,25 @@ class ListController extends Controller
* *
* List all of them. * List all of them.
*/ */
public function rules(Bill $bill): JsonResponse public function rules(PaginationRequest $request, Bill $bill): JsonResponse
{ {
[
'limit' => $limit,
'offset' => $offset,
'page' => $page,
] = $request->attributes->all();
$manager = $this->getManager(); $manager = $this->getManager();
// types to get, page size:
$pageSize = $this->parameters->get('limit');
// get list of budgets. Count it and split it.
$collection = $this->repository->getRulesForBill($bill); $collection = $this->repository->getRulesForBill($bill);
$count = $collection->count(); $count = $collection->count();
$rules = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize); $rules = $collection->slice($offset, $limit);
// make paginator: // make paginator:
$paginator = new LengthAwarePaginator($rules, $count, $pageSize, $this->parameters->get('page')); $paginator = new LengthAwarePaginator($rules, $count, $limit, $page);
$paginator->setPath(route('api.v1.bills.rules', [$bill->id]).$this->buildParams()); $paginator->setPath(route('api.v1.bills.rules', [$bill->id]).$this->buildParams());
/** @var RuleTransformer $transformer */ /** @var RuleTransformer $transformer */
$transformer = app(RuleTransformer::class); $transformer = app(RuleTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($rules, $transformer, 'rules'); $resource = new FractalCollection($rules, $transformer, 'rules');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator)); $resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
@@ -131,13 +135,16 @@ class ListController extends Controller
* *
* Show all transactions. * Show all transactions.
*/ */
public function transactions(Request $request, Bill $bill): JsonResponse public function transactions(PaginationDateRangeRequest $request, Bill $bill): JsonResponse
{ {
$pageSize = $this->parameters->get('limit'); [
$type = $request->get('type') ?? 'default'; 'limit' => $limit,
$this->parameters->set('type', $type); 'page' => $page,
'types' => $types,
'start' => $start,
'end' => $end,
] = $request->attributes->all();
$types = $this->mapTransactionTypes($this->parameters->get('type'));
$manager = $this->getManager(); $manager = $this->getManager();
/** @var User $admin */ /** @var User $admin */
@@ -153,18 +160,18 @@ class ListController extends Controller
// all info needed for the API: // all info needed for the API:
->withAPIInformation() ->withAPIInformation()
// set page size: // set page size:
->setLimit($pageSize) ->setLimit($limit)
// set page to retrieve // set page to retrieve
->setPage($this->parameters->get('page')) ->setPage($page)
// set types of transactions to return. // set types of transactions to return.
->setTypes($types) ->setTypes($types)
; ;
if (null !== $this->parameters->get('start')) { if (null !== $start) {
$collector->setStart($this->parameters->get('start')); $collector->setStart($start);
} }
if (null !== $this->parameters->get('end')) { if (null !== $end) {
$collector->setEnd($this->parameters->get('end')); $collector->setEnd($end);
} }
// get paginator. // get paginator.
@@ -178,7 +185,6 @@ class ListController extends Controller
/** @var TransactionGroupTransformer $transformer */ /** @var TransactionGroupTransformer $transformer */
$transformer = app(TransactionGroupTransformer::class); $transformer = app(TransactionGroupTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($transactions, $transformer, 'transactions'); $resource = new FractalCollection($transactions, $transformer, 'transactions');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator)); $resource->setPaginator(new IlluminatePaginatorAdapter($paginator));

View File

@@ -25,6 +25,8 @@ declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\Bill; namespace FireflyIII\Api\V1\Controllers\Models\Bill;
use FireflyIII\Api\V1\Controllers\Controller; use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\DateRangeRequest;
use FireflyIII\Api\V1\Requests\Generic\PaginationDateRangeRequest;
use FireflyIII\Models\Bill; use FireflyIII\Models\Bill;
use FireflyIII\Repositories\Bill\BillRepositoryInterface; use FireflyIII\Repositories\Bill\BillRepositoryInterface;
use FireflyIII\Support\JsonApi\Enrichments\SubscriptionEnrichment; use FireflyIII\Support\JsonApi\Enrichments\SubscriptionEnrichment;
@@ -65,28 +67,34 @@ class ShowController extends Controller
* *
* Display a listing of the resource. * Display a listing of the resource.
*/ */
public function index(): JsonResponse public function index(PaginationDateRangeRequest $request): JsonResponse
{ {
[
'limit' => $limit,
'offset' => $offset,
'start' => $start,
'end' => $end,
'page' => $page,
] = $request->attributes->all();
$this->repository->correctOrder(); $this->repository->correctOrder();
$bills = $this->repository->getBills(); $bills = $this->repository->getBills();
$manager = $this->getManager(); $manager = $this->getManager();
$pageSize = $this->parameters->get('limit');
$count = $bills->count(); $count = $bills->count();
$bills = $bills->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize); $bills = $bills->slice($offset, $limit);
$paginator = new LengthAwarePaginator($bills, $count, $pageSize, $this->parameters->get('page')); $paginator = new LengthAwarePaginator($bills, $count, $limit, $page);
// enrich // enrich
/** @var User $admin */ /** @var User $admin */
$admin = auth()->user(); $admin = auth()->user();
$enrichment = new SubscriptionEnrichment(); $enrichment = new SubscriptionEnrichment();
$enrichment->setUser($admin); $enrichment->setUser($admin);
$enrichment->setStart($this->parameters->get('start')); $enrichment->setStart($start);
$enrichment->setEnd($this->parameters->get('end')); $enrichment->setEnd($end);
$bills = $enrichment->enrich($bills); $bills = $enrichment->enrich($bills);
/** @var BillTransformer $transformer */ /** @var BillTransformer $transformer */
$transformer = app(BillTransformer::class); $transformer = app(BillTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new FractalCollection($bills, $transformer, 'bills'); $resource = new FractalCollection($bills, $transformer, 'bills');
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator)); $resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
@@ -100,8 +108,13 @@ class ShowController extends Controller
* *
* Show the specified bill. * Show the specified bill.
*/ */
public function show(Bill $bill): JsonResponse public function show(DateRangeRequest $request, Bill $bill): JsonResponse
{ {
[
'start' => $start,
'end' => $end,
] = $request->attributes->all();
$manager = $this->getManager(); $manager = $this->getManager();
// enrich // enrich
@@ -109,13 +122,12 @@ class ShowController extends Controller
$admin = auth()->user(); $admin = auth()->user();
$enrichment = new SubscriptionEnrichment(); $enrichment = new SubscriptionEnrichment();
$enrichment->setUser($admin); $enrichment->setUser($admin);
$enrichment->setStart($this->parameters->get('start')); $enrichment->setStart($start);
$enrichment->setEnd($this->parameters->get('end')); $enrichment->setEnd($end);
$bill = $enrichment->enrichSingle($bill); $bill = $enrichment->enrichSingle($bill);
/** @var BillTransformer $transformer */ /** @var BillTransformer $transformer */
$transformer = app(BillTransformer::class); $transformer = app(BillTransformer::class);
$transformer->setParameters($this->parameters);
$resource = new Item($bill, $transformer, 'bills'); $resource = new Item($bill, $transformer, 'bills');

View File

@@ -36,7 +36,7 @@ abstract class AggregateFormRequest extends ApiRequest
*/ */
protected array $requests = []; protected array $requests = [];
/** @return class-string[] */ /** @return array<array|string> */
abstract protected function getRequests(): array; abstract protected function getRequests(): array;
public function initialize(array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], $content = null): void public function initialize(array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], $content = null): void
@@ -45,6 +45,8 @@ abstract class AggregateFormRequest extends ApiRequest
// instantiate all subrequests and share current requests' bags with them // instantiate all subrequests and share current requests' bags with them
Log::debug('Initializing AggregateFormRequest.'); Log::debug('Initializing AggregateFormRequest.');
/** @var array|string $config */
foreach ($this->getRequests() as $config) { foreach ($this->getRequests() as $config) {
$requestClass = is_array($config) ? array_shift($config) : $config; $requestClass = is_array($config) ? array_shift($config) : $config;

View File

@@ -25,8 +25,8 @@ namespace FireflyIII\Api\V1\Requests\Autocomplete;
use FireflyIII\Api\V1\Requests\AggregateFormRequest; use FireflyIII\Api\V1\Requests\AggregateFormRequest;
use FireflyIII\Api\V1\Requests\DateRequest; use FireflyIII\Api\V1\Requests\DateRequest;
use FireflyIII\Api\V1\Requests\Generic\ObjectTypeApiRequest;
use FireflyIII\Api\V1\Requests\Generic\QueryRequest; use FireflyIII\Api\V1\Requests\Generic\QueryRequest;
use FireflyIII\Api\V1\Requests\Models\Account\AccountTypesApiRequest;
use FireflyIII\Api\V1\Requests\PaginationRequest; use FireflyIII\Api\V1\Requests\PaginationRequest;
use FireflyIII\Models\Account; use FireflyIII\Models\Account;
use Override; use Override;
@@ -39,7 +39,7 @@ class AutocompleteApiRequest extends AggregateFormRequest
return [ return [
DateRequest::class, DateRequest::class,
[PaginationRequest::class, 'sort_class' => Account::class], [PaginationRequest::class, 'sort_class' => Account::class],
AccountTypesApiRequest::class, [ObjectTypeApiRequest::class, 'object_type' => Account::class],
QueryRequest::class, QueryRequest::class,
]; ];
} }

View File

@@ -0,0 +1,47 @@
<?php
declare(strict_types=1);
/*
* AutocompleteApiRequest.php
* Copyright (c) 2025 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace FireflyIII\Api\V1\Requests\Autocomplete;
use FireflyIII\Api\V1\Requests\AggregateFormRequest;
use FireflyIII\Api\V1\Requests\DateRequest;
use FireflyIII\Api\V1\Requests\Generic\ObjectTypeApiRequest;
use FireflyIII\Api\V1\Requests\Generic\QueryRequest;
use FireflyIII\Api\V1\Requests\PaginationRequest;
use FireflyIII\Models\Account;
use FireflyIII\Models\Transaction;
use Override;
class AutocompleteTransactionApiRequest extends AggregateFormRequest
{
#[Override]
protected function getRequests(): array
{
return [
DateRequest::class,
[PaginationRequest::class, 'sort_class' => Account::class],
[ObjectTypeApiRequest::class, 'object_type' => Transaction::class],
QueryRequest::class,
];
}
}

View File

@@ -0,0 +1,101 @@
<?php
declare(strict_types=1);
/*
* AccountTypeApiRequest.php
* Copyright (c) 2025 https://github.com/ctrl-f5
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace FireflyIII\Api\V1\Requests\Generic;
use FireflyIII\Api\V1\Requests\ApiRequest;
use FireflyIII\Models\Account;
use FireflyIII\Models\Transaction;
use FireflyIII\Rules\Account\IsValidAccountTypeList;
use FireflyIII\Rules\TransactionType\IsValidTransactionTypeList;
use FireflyIII\Support\Http\Api\AccountFilter;
use FireflyIII\Support\Http\Api\TransactionFilter;
use Illuminate\Validation\Validator;
use RuntimeException;
class ObjectTypeApiRequest extends ApiRequest
{
use AccountFilter;
use TransactionFilter;
private ?string $objectType = null;
public function handleConfig(array $config): void
{
parent::handleConfig($config);
$this->objectType = $config['object_type'] ?? null;
if (!$this->objectType) {
throw new RuntimeException('ObjectTypeApiRequest requires a object_type config');
}
}
public function rules(): array
{
$rule = null;
if (Account::class === $this->objectType) {
$rule = new IsValidAccountTypeList();
}
if (Transaction::class === $this->objectType) {
$rule = new IsValidTransactionTypeList();
}
$rules = [
'types' => [$rule],
];
if ('' !== $this->required) {
$rules['types'][] = $this->required;
}
return $rules;
}
public function withValidator(Validator $validator): void
{
$validator->after(
function (Validator $validator): void {
if ($validator->failed()) {
return;
}
$type = $this->convertString('types', 'all');
$this->attributes->set('type', $type);
switch ($this->objectType) {
default:
$this->attributes->set('types', []);
// no break
case Account::class:
$this->attributes->set('types', $this->mapAccountTypes($type));
break;
case Transaction::class:
$this->attributes->set('types', $this->mapTransactionTypes($type));
break;
}
}
);
}
}

View File

@@ -0,0 +1,45 @@
<?php
declare(strict_types=1);
/*
* PaginationDateRangeRequest.php
* Copyright (c) 2025 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace FireflyIII\Api\V1\Requests\Generic;
use FireflyIII\Api\V1\Requests\AggregateFormRequest;
use FireflyIII\Api\V1\Requests\DateRangeRequest;
use FireflyIII\Api\V1\Requests\PaginationRequest;
use FireflyIII\Models\Transaction;
/**
* TODO this class includes an object type filter which should be moved to its own thing.
*/
class PaginationDateRangeRequest extends AggregateFormRequest
{
#[Override]
protected function getRequests(): array
{
return [
DateRangeRequest::class,
[ObjectTypeApiRequest::class, 'object_type' => Transaction::class],
[PaginationRequest::class, 'sort_class' => Transaction::class],
];
}
}

View File

@@ -36,7 +36,7 @@ class QueryRequest extends ApiRequest
public function rules(): array public function rules(): array
{ {
return [ return [
'query' => sprintf('min:1|max:50|%s', $this->required), 'query' => sprintf('min:0|max:50|%s', $this->required),
]; ];
} }

View File

@@ -26,6 +26,7 @@ namespace FireflyIII\Api\V1\Requests\Models\Account;
use FireflyIII\Api\V1\Requests\AggregateFormRequest; use FireflyIII\Api\V1\Requests\AggregateFormRequest;
use FireflyIII\Api\V1\Requests\DateRangeRequest; use FireflyIII\Api\V1\Requests\DateRangeRequest;
use FireflyIII\Api\V1\Requests\DateRequest; use FireflyIII\Api\V1\Requests\DateRequest;
use FireflyIII\Api\V1\Requests\Generic\ObjectTypeApiRequest;
use FireflyIII\Api\V1\Requests\PaginationRequest; use FireflyIII\Api\V1\Requests\PaginationRequest;
use FireflyIII\Models\Account; use FireflyIII\Models\Account;
@@ -38,6 +39,7 @@ class ShowRequest extends AggregateFormRequest
DateRangeRequest::class, DateRangeRequest::class,
DateRequest::class, DateRequest::class,
AccountTypeApiRequest::class, AccountTypeApiRequest::class,
// [ObjectTypeApiRequest::class, 'object_type' => Account::class],
]; ];
} }
} }

View File

@@ -42,6 +42,7 @@ use Illuminate\Validation\ValidationException as LaravelValidationException;
use Laravel\Passport\Exceptions\OAuthServerException as LaravelOAuthException; use Laravel\Passport\Exceptions\OAuthServerException as LaravelOAuthException;
use League\OAuth2\Server\Exception\OAuthServerException; use League\OAuth2\Server\Exception\OAuthServerException;
use Override; use Override;
use Sentry\Laravel\Integration;
use Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException; use Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
@@ -54,6 +55,7 @@ use function Safe\json_encode;
use function Safe\parse_url; use function Safe\parse_url;
// temp // temp
/** /**
* Class Handler * Class Handler
*/ */
@@ -81,7 +83,14 @@ class Handler extends ExceptionHandler
* Register the exception handling callbacks for the application. * Register the exception handling callbacks for the application.
*/ */
#[Override] #[Override]
public function register(): void {} public function register(): void
{
if (true === config('firefly.report_errors_online')) {
$this->reportable(function (Throwable $e): void {
Integration::captureUnhandledException($e);
});
}
}
/** /**
* Render an exception into an HTTP response. It's complex but lucky for us, we never use it because * Render an exception into an HTTP response. It's complex but lucky for us, we never use it because
@@ -160,7 +169,7 @@ class Handler extends ExceptionHandler
$errorCode = 500; $errorCode = 500;
$errorCode = $e instanceof MethodNotAllowedHttpException ? 405 : $errorCode; $errorCode = $e instanceof MethodNotAllowedHttpException ? 405 : $errorCode;
$isDebug = (bool) config('app.debug', false); $isDebug = (bool)config('app.debug', false);
if ($isDebug) { if ($isDebug) {
Log::debug(sprintf('Return JSON %s with debug.', $e::class)); Log::debug(sprintf('Return JSON %s with debug.', $e::class));
@@ -219,7 +228,7 @@ class Handler extends ExceptionHandler
public function report(Throwable $e): void public function report(Throwable $e): void
{ {
self::$lastError = $e; self::$lastError = $e;
$doMailError = (bool) config('firefly.send_error_message'); $doMailError = (bool)config('firefly.send_error_message');
if ($this->shouldntReportLocal($e) || !$doMailError) { if ($this->shouldntReportLocal($e) || !$doMailError) {
parent::report($e); parent::report($e);
@@ -255,7 +264,7 @@ class Handler extends ExceptionHandler
// create job that will mail. // create job that will mail.
$ipAddress = request()->ip() ?? '0.0.0.0'; $ipAddress = request()->ip() ?? '0.0.0.0';
$job = new MailError($userData, (string) config('firefly.site_owner'), $ipAddress, $data); $job = new MailError($userData, (string)config('firefly.site_owner'), $ipAddress, $data);
dispatch($job); dispatch($job);
parent::report($e); parent::report($e);

View File

@@ -31,6 +31,7 @@ use FireflyIII\Repositories\ObjectGroup\CreatesObjectGroups;
use FireflyIII\Services\Internal\Support\BillServiceTrait; use FireflyIII\Services\Internal\Support\BillServiceTrait;
use FireflyIII\User; use FireflyIII\User;
use Illuminate\Database\QueryException; use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\Log;
/** /**
* Class BillFactory * Class BillFactory
@@ -47,7 +48,7 @@ class BillFactory
*/ */
public function create(array $data): ?Bill public function create(array $data): ?Bill
{ {
app('log')->debug(sprintf('Now in %s', __METHOD__), $data); Log::debug(sprintf('Now in %s', __METHOD__), $data);
$factory = app(TransactionCurrencyFactory::class); $factory = app(TransactionCurrencyFactory::class);
$currency = $factory->find((int) ($data['currency_id'] ?? null), (string) ($data['currency_code'] ?? null)) $currency = $factory->find((int) ($data['currency_id'] ?? null), (string) ($data['currency_code'] ?? null))
?? app('amount')->getPrimaryCurrencyByUserGroup($this->user->userGroup); ?? app('amount')->getPrimaryCurrencyByUserGroup($this->user->userGroup);
@@ -82,8 +83,8 @@ class BillFactory
] ]
); );
} catch (QueryException $e) { } catch (QueryException $e) {
app('log')->error($e->getMessage()); Log::error($e->getMessage());
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
throw new FireflyException('400000: Could not store bill.', 0, $e); throw new FireflyException('400000: Could not store bill.', 0, $e);
} }

View File

@@ -27,6 +27,7 @@ use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\Category; use FireflyIII\Models\Category;
use FireflyIII\User; use FireflyIII\User;
use Illuminate\Database\QueryException; use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\Log;
/** /**
* Class CategoryFactory * Class CategoryFactory
@@ -43,7 +44,7 @@ class CategoryFactory
$categoryId = (int) $categoryId; $categoryId = (int) $categoryId;
$categoryName = (string) $categoryName; $categoryName = (string) $categoryName;
app('log')->debug(sprintf('Going to find category with ID %d and name "%s"', $categoryId, $categoryName)); Log::debug(sprintf('Going to find category with ID %d and name "%s"', $categoryId, $categoryName));
if ('' === $categoryName && 0 === $categoryId) { if ('' === $categoryName && 0 === $categoryId) {
return null; return null;
@@ -72,8 +73,8 @@ class CategoryFactory
] ]
); );
} catch (QueryException $e) { } catch (QueryException $e) {
app('log')->error($e->getMessage()); Log::error($e->getMessage());
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
throw new FireflyException('400003: Could not store new category.', 0, $e); throw new FireflyException('400003: Could not store new category.', 0, $e);
} }

View File

@@ -92,7 +92,7 @@ class PiggyBankFactory
/** @var PiggyBank $piggyBank */ /** @var PiggyBank $piggyBank */
$piggyBank = PiggyBank::createQuietly($piggyBankData); $piggyBank = PiggyBank::createQuietly($piggyBankData);
} catch (QueryException $e) { } catch (QueryException $e) {
app('log')->error(sprintf('Could not store piggy bank: %s', $e->getMessage()), $piggyBankData); Log::error(sprintf('Could not store piggy bank: %s', $e->getMessage()), $piggyBankData);
throw new FireflyException('400005: Could not store new piggy bank.', 0, $e); throw new FireflyException('400005: Could not store new piggy bank.', 0, $e);
} }
@@ -211,7 +211,7 @@ class PiggyBankFactory
$current = 1; $current = 1;
foreach ($set as $piggyBank) { foreach ($set as $piggyBank) {
if ($piggyBank->order !== $current) { if ($piggyBank->order !== $current) {
app('log')->debug(sprintf('Piggy bank #%d ("%s") was at place %d but should be on %d', $piggyBank->id, $piggyBank->name, $piggyBank->order, $current)); Log::debug(sprintf('Piggy bank #%d ("%s") was at place %d but should be on %d', $piggyBank->id, $piggyBank->name, $piggyBank->order, $current));
$piggyBank->order = $current; $piggyBank->order = $current;
$piggyBank->save(); $piggyBank->save();
} }

View File

@@ -28,6 +28,7 @@ use FireflyIII\Models\Location;
use FireflyIII\Models\Tag; use FireflyIII\Models\Tag;
use FireflyIII\Models\UserGroup; use FireflyIII\Models\UserGroup;
use FireflyIII\User; use FireflyIII\User;
use Illuminate\Support\Facades\Log;
/** /**
* Class TagFactory * Class TagFactory
@@ -40,12 +41,12 @@ class TagFactory
public function findOrCreate(string $tag): ?Tag public function findOrCreate(string $tag): ?Tag
{ {
$tag = trim($tag); $tag = trim($tag);
app('log')->debug(sprintf('Now in TagFactory::findOrCreate("%s")', $tag)); Log::debug(sprintf('Now in TagFactory::findOrCreate("%s")', $tag));
/** @var null|Tag $dbTag */ /** @var null|Tag $dbTag */
$dbTag = $this->user->tags()->where('tag', $tag)->first(); $dbTag = $this->user->tags()->where('tag', $tag)->first();
if (null !== $dbTag) { if (null !== $dbTag) {
app('log')->debug(sprintf('Tag exists (#%d), return it.', $dbTag->id)); Log::debug(sprintf('Tag exists (#%d), return it.', $dbTag->id));
return $dbTag; return $dbTag;
} }
@@ -60,11 +61,11 @@ class TagFactory
] ]
); );
if (!$newTag instanceof Tag) { if (!$newTag instanceof Tag) {
app('log')->error(sprintf('TagFactory::findOrCreate("%s") but tag is unexpectedly NULL!', $tag)); Log::error(sprintf('TagFactory::findOrCreate("%s") but tag is unexpectedly NULL!', $tag));
return null; return null;
} }
app('log')->debug(sprintf('Created new tag #%d ("%s")', $newTag->id, $newTag->tag)); Log::debug(sprintf('Created new tag #%d ("%s")', $newTag->id, $newTag->tag));
return $newTag; return $newTag;
} }

View File

@@ -33,6 +33,7 @@ use FireflyIII\Rules\UniqueIban;
use FireflyIII\Services\Internal\Update\AccountUpdateService; use FireflyIII\Services\Internal\Update\AccountUpdateService;
use Illuminate\Database\QueryException; use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\Validator; use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Log;
/** /**
* Class TransactionFactory * Class TransactionFactory
@@ -96,9 +97,9 @@ class TransactionFactory
/** @var null|Transaction $result */ /** @var null|Transaction $result */
$result = Transaction::create($data); $result = Transaction::create($data);
} catch (QueryException $e) { } catch (QueryException $e) {
app('log')->error(sprintf('Could not create transaction: %s', $e->getMessage()), $data); Log::error(sprintf('Could not create transaction: %s', $e->getMessage()), $data);
app('log')->error($e->getMessage()); Log::error($e->getMessage());
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
throw new FireflyException(sprintf('Query exception when creating transaction: %s', $e->getMessage()), 0, $e); throw new FireflyException(sprintf('Query exception when creating transaction: %s', $e->getMessage()), 0, $e);
} }
@@ -106,7 +107,7 @@ class TransactionFactory
throw new FireflyException('Transaction is NULL.'); throw new FireflyException('Transaction is NULL.');
} }
app('log')->debug( Log::debug(
sprintf( sprintf(
'Created transaction #%d (%s %s, account %s), part of journal #%d', 'Created transaction #%d (%s %s, account %s), part of journal #%d',
$result->id, $result->id,
@@ -138,17 +139,17 @@ class TransactionFactory
private function updateAccountInformation(): void private function updateAccountInformation(): void
{ {
if (!array_key_exists('iban', $this->accountInformation)) { if (!array_key_exists('iban', $this->accountInformation)) {
app('log')->debug('No IBAN information in array, will not update.'); Log::debug('No IBAN information in array, will not update.');
return; return;
} }
if ('' !== (string) $this->account->iban) { if ('' !== (string) $this->account->iban) {
app('log')->debug('Account already has IBAN information, will not update.'); Log::debug('Account already has IBAN information, will not update.');
return; return;
} }
if ($this->account->iban === $this->accountInformation['iban']) { if ($this->account->iban === $this->accountInformation['iban']) {
app('log')->debug('Account already has this IBAN, will not update.'); Log::debug('Account already has this IBAN, will not update.');
return; return;
} }
@@ -157,12 +158,12 @@ class TransactionFactory
'iban' => ['required', new UniqueIban($this->account, $this->account->accountType->type)], 'iban' => ['required', new UniqueIban($this->account, $this->account->accountType->type)],
]); ]);
if ($validator->fails()) { if ($validator->fails()) {
app('log')->debug('Invalid or non-unique IBAN, will not update.'); Log::debug('Invalid or non-unique IBAN, will not update.');
return; return;
} }
app('log')->debug('Will update account with IBAN information.'); Log::debug('Will update account with IBAN information.');
$service = app(AccountUpdateService::class); $service = app(AccountUpdateService::class);
$service->update($this->account, ['iban' => $this->accountInformation['iban']]); $service->update($this->account, ['iban' => $this->accountInformation['iban']]);
} }

View File

@@ -29,6 +29,7 @@ use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\TransactionGroup; use FireflyIII\Models\TransactionGroup;
use FireflyIII\Models\UserGroup; use FireflyIII\Models\UserGroup;
use FireflyIII\User; use FireflyIII\User;
use Illuminate\Support\Facades\Log;
/** /**
* Class TransactionGroupFactory * Class TransactionGroupFactory
@@ -55,7 +56,7 @@ class TransactionGroupFactory
*/ */
public function create(array $data): TransactionGroup public function create(array $data): TransactionGroup
{ {
app('log')->debug('Now in TransactionGroupFactory::create()'); Log::debug('Now in TransactionGroupFactory::create()');
$this->journalFactory->setUser($data['user']); $this->journalFactory->setUser($data['user']);
$this->journalFactory->setUserGroup($data['user_group']); $this->journalFactory->setUserGroup($data['user_group']);
$this->journalFactory->setErrorOnHash($data['error_if_duplicate_hash'] ?? false); $this->journalFactory->setErrorOnHash($data['error_if_duplicate_hash'] ?? false);
@@ -63,7 +64,7 @@ class TransactionGroupFactory
try { try {
$collection = $this->journalFactory->create($data); $collection = $this->journalFactory->create($data);
} catch (DuplicateTransactionException $e) { } catch (DuplicateTransactionException $e) {
app('log')->warning('GroupFactory::create() caught journalFactory::create() with a duplicate!'); Log::warning('GroupFactory::create() caught journalFactory::create() with a duplicate!');
throw new DuplicateTransactionException($e->getMessage(), 0, $e); throw new DuplicateTransactionException($e->getMessage(), 0, $e);
} }

View File

@@ -26,6 +26,7 @@ namespace FireflyIII\Factory;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Models\TransactionJournalMeta; use FireflyIII\Models\TransactionJournalMeta;
use Illuminate\Support\Facades\Log;
/** /**
* Class TransactionJournalMetaFactory * Class TransactionJournalMetaFactory
@@ -34,27 +35,27 @@ class TransactionJournalMetaFactory
{ {
public function updateOrCreate(array $data): ?TransactionJournalMeta public function updateOrCreate(array $data): ?TransactionJournalMeta
{ {
// app('log')->debug('In updateOrCreate()'); // Log::debug('In updateOrCreate()');
$value = $data['data']; $value = $data['data'];
/** @var null|TransactionJournalMeta $entry */ /** @var null|TransactionJournalMeta $entry */
$entry = $data['journal']->transactionJournalMeta()->where('name', $data['name'])->first(); $entry = $data['journal']->transactionJournalMeta()->where('name', $data['name'])->first();
if (null === $value && null !== $entry) { if (null === $value && null !== $entry) {
// app('log')->debug('Value is empty, delete meta value.'); // Log::debug('Value is empty, delete meta value.');
$entry->delete(); $entry->delete();
return null; return null;
} }
if ($data['data'] instanceof Carbon) { if ($data['data'] instanceof Carbon) {
app('log')->debug('Is a carbon object.'); Log::debug('Is a carbon object.');
$value = $data['data']->toW3cString(); $value = $data['data']->toW3cString();
} }
if ('' === (string) $value) { if ('' === (string) $value) {
// app('log')->debug('Is an empty string.'); // Log::debug('Is an empty string.');
// don't store blank strings. // don't store blank strings.
if (null !== $entry) { if (null !== $entry) {
app('log')->debug('Will not store empty strings, delete meta value'); Log::debug('Will not store empty strings, delete meta value');
$entry->delete(); $entry->delete();
} }
@@ -62,13 +63,13 @@ class TransactionJournalMetaFactory
} }
if (null === $entry) { if (null === $entry) {
// app('log')->debug('Will create new object.'); // Log::debug('Will create new object.');
app('log')->debug(sprintf('Going to create new meta-data entry to store "%s".', $data['name'])); Log::debug(sprintf('Going to create new meta-data entry to store "%s".', $data['name']));
$entry = new TransactionJournalMeta(); $entry = new TransactionJournalMeta();
$entry->transactionJournal()->associate($data['journal']); $entry->transactionJournal()->associate($data['journal']);
$entry->name = $data['name']; $entry->name = $data['name'];
} }
app('log')->debug('Will update value and return.'); Log::debug('Will update value and return.');
$entry->data = $value; $entry->data = $value;
$entry->save(); $entry->save();

View File

@@ -28,6 +28,7 @@ use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Generator\Report\ReportGeneratorInterface; use FireflyIII\Generator\Report\ReportGeneratorInterface;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Throwable; use Throwable;
use Illuminate\Support\Facades\Log;
/** /**
* Class MonthReportGenerator. * Class MonthReportGenerator.
@@ -58,8 +59,8 @@ class MonthReportGenerator implements ReportGeneratorInterface
->render() ->render()
; ;
} catch (Throwable $e) { } catch (Throwable $e) {
app('log')->error(sprintf('Cannot render reports.double.report: %s', $e->getMessage())); Log::error(sprintf('Cannot render reports.double.report: %s', $e->getMessage()));
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
$result = sprintf('Could not render report view: %s', $e->getMessage()); $result = sprintf('Could not render report view: %s', $e->getMessage());
throw new FireflyException($result, 0, $e); throw new FireflyException($result, 0, $e);

View File

@@ -105,8 +105,8 @@ class MonthReportGenerator implements ReportGeneratorInterface
->render() ->render()
; ;
} catch (Throwable $e) { } catch (Throwable $e) {
app('log')->error(sprintf('Cannot render reports.audit.report: %s', $e->getMessage())); Log::error(sprintf('Cannot render reports.audit.report: %s', $e->getMessage()));
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
$result = sprintf('Could not render report view: %s', $e->getMessage()); $result = sprintf('Could not render report view: %s', $e->getMessage());
throw new FireflyException($result, 0, $e); throw new FireflyException($result, 0, $e);

View File

@@ -30,6 +30,7 @@ use FireflyIII\Generator\Report\ReportGeneratorInterface;
use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Throwable; use Throwable;
use Illuminate\Support\Facades\Log;
/** /**
* Class MonthReportGenerator. * Class MonthReportGenerator.
@@ -72,8 +73,8 @@ class MonthReportGenerator implements ReportGeneratorInterface
->render() ->render()
; ;
} catch (Throwable $e) { } catch (Throwable $e) {
app('log')->error(sprintf('Cannot render reports.account.report: %s', $e->getMessage())); Log::error(sprintf('Cannot render reports.account.report: %s', $e->getMessage()));
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
$result = sprintf('Could not render report view: %s', $e->getMessage()); $result = sprintf('Could not render report view: %s', $e->getMessage());
throw new FireflyException($result, 0, $e); throw new FireflyException($result, 0, $e);
@@ -132,7 +133,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
protected function getExpenses(): array protected function getExpenses(): array
{ {
if (0 !== count($this->expenses)) { if (0 !== count($this->expenses)) {
app('log')->debug('Return previous set of expenses.'); Log::debug('Return previous set of expenses.');
return $this->expenses; return $this->expenses;
} }

View File

@@ -30,6 +30,7 @@ use FireflyIII\Generator\Report\ReportGeneratorInterface;
use FireflyIII\Helpers\Collector\GroupCollectorInterface; use FireflyIII\Helpers\Collector\GroupCollectorInterface;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Throwable; use Throwable;
use Illuminate\Support\Facades\Log;
/** /**
* Class MonthReportGenerator. * Class MonthReportGenerator.
@@ -73,8 +74,8 @@ class MonthReportGenerator implements ReportGeneratorInterface
->render() ->render()
; ;
} catch (Throwable $e) { } catch (Throwable $e) {
app('log')->error(sprintf('Cannot render reports.category.month: %s', $e->getMessage())); Log::error(sprintf('Cannot render reports.category.month: %s', $e->getMessage()));
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
$result = sprintf('Could not render report view: %s', $e->getMessage()); $result = sprintf('Could not render report view: %s', $e->getMessage());
throw new FireflyException($result, 0, $e); throw new FireflyException($result, 0, $e);
@@ -131,7 +132,7 @@ class MonthReportGenerator implements ReportGeneratorInterface
protected function getExpenses(): array protected function getExpenses(): array
{ {
if (0 !== count($this->expenses)) { if (0 !== count($this->expenses)) {
app('log')->debug('Return previous set of expenses.'); Log::debug('Return previous set of expenses.');
return $this->expenses; return $this->expenses;
} }

View File

@@ -28,6 +28,7 @@ use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Generator\Report\ReportGeneratorInterface; use FireflyIII\Generator\Report\ReportGeneratorInterface;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Throwable; use Throwable;
use Illuminate\Support\Facades\Log;
/** /**
* Class MonthReportGenerator. * Class MonthReportGenerator.
@@ -56,8 +57,8 @@ class MonthReportGenerator implements ReportGeneratorInterface
try { try {
return view('reports.default.month', compact('accountIds', 'reportType'))->with('start', $this->start)->with('end', $this->end)->render(); return view('reports.default.month', compact('accountIds', 'reportType'))->with('start', $this->start)->with('end', $this->end)->render();
} catch (Throwable $e) { } catch (Throwable $e) {
app('log')->error(sprintf('Cannot render reports.default.month: %s', $e->getMessage())); Log::error(sprintf('Cannot render reports.default.month: %s', $e->getMessage()));
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
$result = 'Could not render report view.'; $result = 'Could not render report view.';
throw new FireflyException($result, 0, $e); throw new FireflyException($result, 0, $e);

View File

@@ -28,6 +28,7 @@ use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Generator\Report\ReportGeneratorInterface; use FireflyIII\Generator\Report\ReportGeneratorInterface;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Throwable; use Throwable;
use Illuminate\Support\Facades\Log;
/** /**
* Class MonthReportGenerator. * Class MonthReportGenerator.
@@ -60,8 +61,8 @@ class MultiYearReportGenerator implements ReportGeneratorInterface
compact('accountIds', 'reportType') compact('accountIds', 'reportType')
)->with('start', $this->start)->with('end', $this->end)->render(); )->with('start', $this->start)->with('end', $this->end)->render();
} catch (Throwable $e) { } catch (Throwable $e) {
app('log')->error(sprintf('Cannot render reports.default.multi-year: %s', $e->getMessage())); Log::error(sprintf('Cannot render reports.default.multi-year: %s', $e->getMessage()));
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
$result = sprintf('Could not render report view: %s', $e->getMessage()); $result = sprintf('Could not render report view: %s', $e->getMessage());
throw new FireflyException($result, 0, $e); throw new FireflyException($result, 0, $e);

View File

@@ -28,6 +28,7 @@ use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Generator\Report\ReportGeneratorInterface; use FireflyIII\Generator\Report\ReportGeneratorInterface;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Throwable; use Throwable;
use Illuminate\Support\Facades\Log;
/** /**
* Class MonthReportGenerator. * Class MonthReportGenerator.
@@ -60,8 +61,8 @@ class YearReportGenerator implements ReportGeneratorInterface
compact('accountIds', 'reportType') compact('accountIds', 'reportType')
)->with('start', $this->start)->with('end', $this->end)->render(); )->with('start', $this->start)->with('end', $this->end)->render();
} catch (Throwable $e) { } catch (Throwable $e) {
app('log')->error(sprintf('Cannot render reports.account.report: %s', $e->getMessage())); Log::error(sprintf('Cannot render reports.account.report: %s', $e->getMessage()));
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
$result = 'Could not render report view.'; $result = 'Could not render report view.';
throw new FireflyException($result, 0, $e); throw new FireflyException($result, 0, $e);

View File

@@ -29,6 +29,7 @@ use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Generator\Report\ReportGeneratorInterface; use FireflyIII\Generator\Report\ReportGeneratorInterface;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
use Throwable; use Throwable;
use Illuminate\Support\Facades\Log;
/** /**
* Class MonthReportGenerator. * Class MonthReportGenerator.
@@ -67,8 +68,8 @@ class MonthReportGenerator implements ReportGeneratorInterface
compact('accountIds', 'reportType', 'tagIds') compact('accountIds', 'reportType', 'tagIds')
)->with('start', $this->start)->with('end', $this->end)->with('tags', $this->tags)->with('accounts', $this->accounts)->render(); )->with('start', $this->start)->with('end', $this->end)->with('tags', $this->tags)->with('accounts', $this->accounts)->render();
} catch (Throwable $e) { } catch (Throwable $e) {
app('log')->error(sprintf('Cannot render reports.tag.month: %s', $e->getMessage())); Log::error(sprintf('Cannot render reports.tag.month: %s', $e->getMessage()));
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
$result = sprintf('Could not render report view: %s', $e->getMessage()); $result = sprintf('Could not render report view: %s', $e->getMessage());
throw new FireflyException($result, 0, $e); throw new FireflyException($result, 0, $e);

View File

@@ -29,6 +29,7 @@ use FireflyIII\Notifications\User\NewAccessToken;
use FireflyIII\Repositories\User\UserRepositoryInterface; use FireflyIII\Repositories\User\UserRepositoryInterface;
use Illuminate\Support\Facades\Notification; use Illuminate\Support\Facades\Notification;
use Laravel\Passport\Events\AccessTokenCreated; use Laravel\Passport\Events\AccessTokenCreated;
use Illuminate\Support\Facades\Log;
/** /**
* Class APIEventHandler * Class APIEventHandler
@@ -40,7 +41,7 @@ class APIEventHandler
*/ */
public function accessTokenCreated(AccessTokenCreated $event): void public function accessTokenCreated(AccessTokenCreated $event): void
{ {
app('log')->debug(__METHOD__); Log::debug(__METHOD__);
/** @var UserRepositoryInterface $repository */ /** @var UserRepositoryInterface $repository */
$repository = app(UserRepositoryInterface::class); $repository = app(UserRepositoryInterface::class);
@@ -52,17 +53,17 @@ class APIEventHandler
} catch (Exception $e) { } catch (Exception $e) {
$message = $e->getMessage(); $message = $e->getMessage();
if (str_contains($message, 'Bcc')) { if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
if (str_contains($message, 'RFC 2822')) { if (str_contains($message, 'RFC 2822')) {
app('log')->warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
app('log')->error($e->getMessage()); Log::error($e->getMessage());
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
} }
} }
} }

View File

@@ -55,17 +55,17 @@ class AdminEventHandler
} catch (Exception $e) { } catch (Exception $e) {
$message = $e->getMessage(); $message = $e->getMessage();
if (str_contains($message, 'Bcc')) { if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
if (str_contains($message, 'RFC 2822')) { if (str_contains($message, 'RFC 2822')) {
app('log')->warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
app('log')->error($e->getMessage()); Log::error($e->getMessage());
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
} }
} }
@@ -77,17 +77,17 @@ class AdminEventHandler
} catch (Exception $e) { } catch (Exception $e) {
$message = $e->getMessage(); $message = $e->getMessage();
if (str_contains($message, 'Bcc')) { if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
if (str_contains($message, 'RFC 2822')) { if (str_contains($message, 'RFC 2822')) {
app('log')->warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
app('log')->error($e->getMessage()); Log::error($e->getMessage());
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
} }
} }
@@ -107,17 +107,17 @@ class AdminEventHandler
} catch (Exception $e) { } catch (Exception $e) {
$message = $e->getMessage(); $message = $e->getMessage();
if (str_contains($message, 'Bcc')) { if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
if (str_contains($message, 'RFC 2822')) { if (str_contains($message, 'RFC 2822')) {
app('log')->warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
app('log')->error($e->getMessage()); Log::error($e->getMessage());
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
} }
} }
@@ -150,7 +150,7 @@ class AdminEventHandler
break; break;
default: default:
app('log')->error(sprintf('Unknown channel "%s" in sendTestNotification method.', $event->channel)); Log::error(sprintf('Unknown channel "%s" in sendTestNotification method.', $event->channel));
return; return;
} }
@@ -161,17 +161,17 @@ class AdminEventHandler
} catch (Exception $e) { } catch (Exception $e) {
$message = $e->getMessage(); $message = $e->getMessage();
if (str_contains($message, 'Bcc')) { if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
if (str_contains($message, 'RFC 2822')) { if (str_contains($message, 'RFC 2822')) {
app('log')->warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
app('log')->error($e->getMessage()); Log::error($e->getMessage());
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
} }
Log::debug(sprintf('If you see no errors above this line, test notification was sent over channel "%s"', $event->channel)); Log::debug(sprintf('If you see no errors above this line, test notification was sent over channel "%s"', $event->channel));
} }

View File

@@ -27,6 +27,7 @@ namespace FireflyIII\Handlers\Events;
use Carbon\Carbon; use Carbon\Carbon;
use FireflyIII\Events\TriggeredAuditLog; use FireflyIII\Events\TriggeredAuditLog;
use FireflyIII\Repositories\AuditLogEntry\ALERepositoryInterface; use FireflyIII\Repositories\AuditLogEntry\ALERepositoryInterface;
use Illuminate\Support\Facades\Log;
/** /**
* Class AuditEventHandler * Class AuditEventHandler
@@ -44,20 +45,20 @@ class AuditEventHandler
]; ];
if ($event->before === $event->after) { if ($event->before === $event->after) {
app('log')->debug('Will not store event log because before and after are the same.'); Log::debug('Will not store event log because before and after are the same.');
return; return;
} }
if ($event->before instanceof Carbon && $event->after instanceof Carbon && $event->before->eq($event->after)) { if ($event->before instanceof Carbon && $event->after instanceof Carbon && $event->before->eq($event->after)) {
app('log')->debug('Will not store event log because before and after Carbon values are the same.'); Log::debug('Will not store event log because before and after Carbon values are the same.');
return; return;
} }
if ($event->before instanceof Carbon && $event->after instanceof Carbon) { if ($event->before instanceof Carbon && $event->after instanceof Carbon) {
$array['before'] = $event->before->toIso8601String(); $array['before'] = $event->before->toIso8601String();
$array['after'] = $event->after->toIso8601String(); $array['after'] = $event->after->toIso8601String();
app('log')->debug(sprintf('Converted "before" to "%s".', $event->before)); Log::debug(sprintf('Converted "before" to "%s".', $event->before));
app('log')->debug(sprintf('Converted "after" to "%s".', $event->after)); Log::debug(sprintf('Converted "after" to "%s".', $event->after));
} }
/** @var ALERepositoryInterface $repository */ /** @var ALERepositoryInterface $repository */

View File

@@ -33,6 +33,7 @@ use FireflyIII\Repositories\User\UserRepositoryInterface;
use FireflyIII\Support\Facades\Preferences; use FireflyIII\Support\Facades\Preferences;
use FireflyIII\Transformers\TransactionGroupTransformer; use FireflyIII\Transformers\TransactionGroupTransformer;
use Illuminate\Support\Facades\Notification; use Illuminate\Support\Facades\Notification;
use Illuminate\Support\Facades\Log;
/** /**
* Class AutomationHandler * Class AutomationHandler
@@ -46,7 +47,7 @@ class AutomationHandler
*/ */
public function reportJournals(RequestedReportOnJournals $event): void public function reportJournals(RequestedReportOnJournals $event): void
{ {
app('log')->debug('In reportJournals.'); Log::debug('In reportJournals.');
/** @var UserRepositoryInterface $repository */ /** @var UserRepositoryInterface $repository */
$repository = app(UserRepositoryInterface::class); $repository = app(UserRepositoryInterface::class);
@@ -56,17 +57,17 @@ class AutomationHandler
$sendReport = Preferences::getForUser($user, 'notification_transaction_creation', false)->data; $sendReport = Preferences::getForUser($user, 'notification_transaction_creation', false)->data;
if (false === $sendReport) { if (false === $sendReport) {
app('log')->debug('Not sending report, because config says so.'); Log::debug('Not sending report, because config says so.');
return; return;
} }
if (null === $user || 0 === $event->groups->count()) { if (null === $user || 0 === $event->groups->count()) {
app('log')->debug('No transaction groups in event, nothing to email about.'); Log::debug('No transaction groups in event, nothing to email about.');
return; return;
} }
app('log')->debug('Continue with message!'); Log::debug('Continue with message!');
// transform groups into array: // transform groups into array:
/** @var TransactionGroupTransformer $transformer */ /** @var TransactionGroupTransformer $transformer */
@@ -83,18 +84,18 @@ class AutomationHandler
} catch (Exception $e) { } catch (Exception $e) {
$message = $e->getMessage(); $message = $e->getMessage();
if (str_contains($message, 'Bcc')) { if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
if (str_contains($message, 'RFC 2822')) { if (str_contains($message, 'RFC 2822')) {
app('log')->warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
app('log')->error($e->getMessage()); Log::error($e->getMessage());
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
} }
app('log')->debug('If there is no error above this line, message was sent.'); Log::debug('If there is no error above this line, message was sent.');
} }
} }

View File

@@ -45,7 +45,7 @@ class DestroyedGroupEventHandler
private function triggerWebhooks(DestroyedTransactionGroup $destroyedGroupEvent): void private function triggerWebhooks(DestroyedTransactionGroup $destroyedGroupEvent): void
{ {
app('log')->debug('DestroyedTransactionGroup:triggerWebhooks'); Log::debug('DestroyedTransactionGroup:triggerWebhooks');
$group = $destroyedGroupEvent->transactionGroup; $group = $destroyedGroupEvent->transactionGroup;
$user = $group->user; $user = $group->user;

View File

@@ -31,6 +31,7 @@ use FireflyIII\Models\PiggyBankEvent;
use FireflyIII\Models\Rule; use FireflyIII\Models\Rule;
use FireflyIII\Models\RuleAction; use FireflyIII\Models\RuleAction;
use FireflyIII\Models\TransactionGroup; use FireflyIII\Models\TransactionGroup;
use Illuminate\Support\Facades\Log;
/** /**
* Class PiggyBankEventHandler * Class PiggyBankEventHandler
@@ -70,7 +71,7 @@ class PiggyBankEventHandler
->exists() ->exists()
; ;
if ($exists) { if ($exists) {
app('log')->warning('Already have event for this journal and piggy, will not create another.'); Log::warning('Already have event for this journal and piggy, will not create another.');
return; return;
} }

View File

@@ -47,7 +47,7 @@ class RuleHandler
if (false === $preference) { if (false === $preference) {
return; return;
} }
app('log')->debug('Now in ruleActionFailedOnArray'); Log::debug('Now in ruleActionFailedOnArray');
$journal = $event->journal; $journal = $event->journal;
$error = $event->error; $error = $event->error;
$user = $ruleAction->rule->user; $user = $ruleAction->rule->user;
@@ -76,7 +76,7 @@ class RuleHandler
if (false === $preference) { if (false === $preference) {
return; return;
} }
app('log')->debug('Now in ruleActionFailedOnObject'); Log::debug('Now in ruleActionFailedOnObject');
$journal = $event->journal; $journal = $event->journal;
$error = $event->error; $error = $event->error;
$user = $ruleAction->rule->user; $user = $ruleAction->rule->user;

View File

@@ -40,12 +40,13 @@ use FireflyIII\Notifications\Security\MFAManyFailedAttemptsNotification;
use FireflyIII\Notifications\Security\MFAUsedBackupCodeNotification; use FireflyIII\Notifications\Security\MFAUsedBackupCodeNotification;
use FireflyIII\Notifications\Security\NewBackupCodesNotification; use FireflyIII\Notifications\Security\NewBackupCodesNotification;
use Illuminate\Support\Facades\Notification; use Illuminate\Support\Facades\Notification;
use Illuminate\Support\Facades\Log;
class MFAHandler class MFAHandler
{ {
public function sendBackupFewLeftMail(MFABackupFewLeft $event): void public function sendBackupFewLeftMail(MFABackupFewLeft $event): void
{ {
app('log')->debug(sprintf('Now in %s', __METHOD__)); Log::debug(sprintf('Now in %s', __METHOD__));
$user = $event->user; $user = $event->user;
$count = $event->count; $count = $event->count;
@@ -55,23 +56,23 @@ class MFAHandler
} catch (Exception $e) { } catch (Exception $e) {
$message = $e->getMessage(); $message = $e->getMessage();
if (str_contains($message, 'Bcc')) { if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
if (str_contains($message, 'RFC 2822')) { if (str_contains($message, 'RFC 2822')) {
app('log')->warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
app('log')->error($e->getMessage()); Log::error($e->getMessage());
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
} }
} }
public function sendBackupNoLeftMail(MFABackupNoLeft $event): void public function sendBackupNoLeftMail(MFABackupNoLeft $event): void
{ {
app('log')->debug(sprintf('Now in %s', __METHOD__)); Log::debug(sprintf('Now in %s', __METHOD__));
$user = $event->user; $user = $event->user;
@@ -80,23 +81,23 @@ class MFAHandler
} catch (Exception $e) { } catch (Exception $e) {
$message = $e->getMessage(); $message = $e->getMessage();
if (str_contains($message, 'Bcc')) { if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
if (str_contains($message, 'RFC 2822')) { if (str_contains($message, 'RFC 2822')) {
app('log')->warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
app('log')->error($e->getMessage()); Log::error($e->getMessage());
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
} }
} }
public function sendMFADisabledMail(DisabledMFA $event): void public function sendMFADisabledMail(DisabledMFA $event): void
{ {
app('log')->debug(sprintf('Now in %s', __METHOD__)); Log::debug(sprintf('Now in %s', __METHOD__));
$user = $event->user; $user = $event->user;
@@ -105,23 +106,23 @@ class MFAHandler
} catch (Exception $e) { } catch (Exception $e) {
$message = $e->getMessage(); $message = $e->getMessage();
if (str_contains($message, 'Bcc')) { if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
if (str_contains($message, 'RFC 2822')) { if (str_contains($message, 'RFC 2822')) {
app('log')->warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
app('log')->error($e->getMessage()); Log::error($e->getMessage());
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
} }
} }
public function sendMFAEnabledMail(EnabledMFA $event): void public function sendMFAEnabledMail(EnabledMFA $event): void
{ {
app('log')->debug(sprintf('Now in %s', __METHOD__)); Log::debug(sprintf('Now in %s', __METHOD__));
$user = $event->user; $user = $event->user;
@@ -130,23 +131,23 @@ class MFAHandler
} catch (Exception $e) { } catch (Exception $e) {
$message = $e->getMessage(); $message = $e->getMessage();
if (str_contains($message, 'Bcc')) { if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
if (str_contains($message, 'RFC 2822')) { if (str_contains($message, 'RFC 2822')) {
app('log')->warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
app('log')->error($e->getMessage()); Log::error($e->getMessage());
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
} }
} }
public function sendMFAFailedAttemptsMail(MFAManyFailedAttempts $event): void public function sendMFAFailedAttemptsMail(MFAManyFailedAttempts $event): void
{ {
app('log')->debug(sprintf('Now in %s', __METHOD__)); Log::debug(sprintf('Now in %s', __METHOD__));
$user = $event->user; $user = $event->user;
$count = $event->count; $count = $event->count;
@@ -156,23 +157,23 @@ class MFAHandler
} catch (Exception $e) { } catch (Exception $e) {
$message = $e->getMessage(); $message = $e->getMessage();
if (str_contains($message, 'Bcc')) { if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
if (str_contains($message, 'RFC 2822')) { if (str_contains($message, 'RFC 2822')) {
app('log')->warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
app('log')->error($e->getMessage()); Log::error($e->getMessage());
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
} }
} }
public function sendNewMFABackupCodesMail(MFANewBackupCodes $event): void public function sendNewMFABackupCodesMail(MFANewBackupCodes $event): void
{ {
app('log')->debug(sprintf('Now in %s', __METHOD__)); Log::debug(sprintf('Now in %s', __METHOD__));
$user = $event->user; $user = $event->user;
@@ -181,23 +182,23 @@ class MFAHandler
} catch (Exception $e) { } catch (Exception $e) {
$message = $e->getMessage(); $message = $e->getMessage();
if (str_contains($message, 'Bcc')) { if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
if (str_contains($message, 'RFC 2822')) { if (str_contains($message, 'RFC 2822')) {
app('log')->warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
app('log')->error($e->getMessage()); Log::error($e->getMessage());
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
} }
} }
public function sendUsedBackupCodeMail(MFAUsedBackupCode $event): void public function sendUsedBackupCodeMail(MFAUsedBackupCode $event): void
{ {
app('log')->debug(sprintf('Now in %s', __METHOD__)); Log::debug(sprintf('Now in %s', __METHOD__));
$user = $event->user; $user = $event->user;
@@ -206,17 +207,17 @@ class MFAHandler
} catch (Exception $e) { } catch (Exception $e) {
$message = $e->getMessage(); $message = $e->getMessage();
if (str_contains($message, 'Bcc')) { if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
if (str_contains($message, 'RFC 2822')) { if (str_contains($message, 'RFC 2822')) {
app('log')->warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
app('log')->error($e->getMessage()); Log::error($e->getMessage());
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
} }
} }
} }

View File

@@ -77,7 +77,7 @@ class UserEventHandler
// first user ever? // first user ever?
if (1 === $repository->count()) { if (1 === $repository->count()) {
app('log')->debug('User count is one, attach role.'); Log::debug('User count is one, attach role.');
$repository->attachRole($event->user, 'owner'); $repository->attachRole($event->user, 'owner');
} }
} }
@@ -101,10 +101,10 @@ class UserEventHandler
if (null === $role) { if (null === $role) {
// create role, does not exist. Very strange situation so let's raise a big fuss about it. // create role, does not exist. Very strange situation so let's raise a big fuss about it.
$role = $repository->createRole('owner', 'Site Owner', 'User runs this instance of FF3'); $role = $repository->createRole('owner', 'Site Owner', 'User runs this instance of FF3');
app('log')->error('Could not find role "owner". This is weird.'); Log::error('Could not find role "owner". This is weird.');
} }
app('log')->info(sprintf('Gave user #%d role #%d ("%s")', $user->id, $role->id, $role->name)); Log::info(sprintf('Gave user #%d role #%d ("%s")', $user->id, $role->id, $role->name));
// give user the role // give user the role
$repository->attachRole($user, 'owner'); $repository->attachRole($user, 'owner');
} }
@@ -203,17 +203,17 @@ class UserEventHandler
} catch (Exception $e) { } catch (Exception $e) {
$message = $e->getMessage(); $message = $e->getMessage();
if (str_contains($message, 'Bcc')) { if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
if (str_contains($message, 'RFC 2822')) { if (str_contains($message, 'RFC 2822')) {
app('log')->warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
app('log')->error($e->getMessage()); Log::error($e->getMessage());
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
} }
} }
$list[$index]['notified'] = true; $list[$index]['notified'] = true;
@@ -233,17 +233,17 @@ class UserEventHandler
} catch (Exception $e) { } catch (Exception $e) {
$message = $e->getMessage(); $message = $e->getMessage();
if (str_contains($message, 'Bcc')) { if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
if (str_contains($message, 'RFC 2822')) { if (str_contains($message, 'RFC 2822')) {
app('log')->warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
app('log')->error($e->getMessage()); Log::error($e->getMessage());
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
} }
} }
} }
@@ -265,8 +265,8 @@ class UserEventHandler
try { try {
Mail::to($newEmail)->send(new ConfirmEmailChangeMail($newEmail, $oldEmail, $url)); Mail::to($newEmail)->send(new ConfirmEmailChangeMail($newEmail, $oldEmail, $url));
} catch (Exception $e) { } catch (Exception $e) {
app('log')->error($e->getMessage()); Log::error($e->getMessage());
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
throw new FireflyException($e->getMessage(), 0, $e); throw new FireflyException($e->getMessage(), 0, $e);
} }
@@ -290,8 +290,8 @@ class UserEventHandler
try { try {
Mail::to($oldEmail)->send(new UndoEmailChangeMail($newEmail, $oldEmail, $url)); Mail::to($oldEmail)->send(new UndoEmailChangeMail($newEmail, $oldEmail, $url));
} catch (Exception $e) { } catch (Exception $e) {
app('log')->error($e->getMessage()); Log::error($e->getMessage());
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
throw new FireflyException($e->getMessage(), 0, $e); throw new FireflyException($e->getMessage(), 0, $e);
} }
@@ -304,17 +304,17 @@ class UserEventHandler
} catch (Exception $e) { } catch (Exception $e) {
$message = $e->getMessage(); $message = $e->getMessage();
if (str_contains($message, 'Bcc')) { if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
if (str_contains($message, 'RFC 2822')) { if (str_contains($message, 'RFC 2822')) {
app('log')->warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
app('log')->error($e->getMessage()); Log::error($e->getMessage());
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
} }
} }
@@ -328,17 +328,17 @@ class UserEventHandler
} catch (Exception $e) { } catch (Exception $e) {
$message = $e->getMessage(); $message = $e->getMessage();
if (str_contains($message, 'Bcc')) { if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
if (str_contains($message, 'RFC 2822')) { if (str_contains($message, 'RFC 2822')) {
app('log')->warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
app('log')->error($e->getMessage()); Log::error($e->getMessage());
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
} }
} }
@@ -354,8 +354,8 @@ class UserEventHandler
try { try {
Mail::to($invitee)->send(new InvitationMail($invitee, $admin, $url)); Mail::to($invitee)->send(new InvitationMail($invitee, $admin, $url));
} catch (Exception $e) { } catch (Exception $e) {
app('log')->error($e->getMessage()); Log::error($e->getMessage());
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
throw new FireflyException($e->getMessage(), 0, $e); throw new FireflyException($e->getMessage(), 0, $e);
} }
@@ -374,17 +374,17 @@ class UserEventHandler
} catch (Exception $e) { } catch (Exception $e) {
$message = $e->getMessage(); $message = $e->getMessage();
if (str_contains($message, 'Bcc')) { if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
if (str_contains($message, 'RFC 2822')) { if (str_contains($message, 'RFC 2822')) {
app('log')->warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
app('log')->error($e->getMessage()); Log::error($e->getMessage());
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
} }
} }
} }
@@ -418,7 +418,7 @@ class UserEventHandler
break; break;
default: default:
app('log')->error(sprintf('Unknown channel "%s" in (user) sendTestNotification method.', $event->channel)); Log::error(sprintf('Unknown channel "%s" in (user) sendTestNotification method.', $event->channel));
return; return;
} }
@@ -429,28 +429,28 @@ class UserEventHandler
} catch (Exception $e) { } catch (Exception $e) {
$message = $e->getMessage(); $message = $e->getMessage();
if (str_contains($message, 'Bcc')) { if (str_contains($message, 'Bcc')) {
app('log')->warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[Bcc] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
if (str_contains($message, 'RFC 2822')) { if (str_contains($message, 'RFC 2822')) {
app('log')->warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.'); Log::warning('[RFC] Could not send notification. Please validate your email settings, use the .env.example file as a guide.');
return; return;
} }
app('log')->error($e->getMessage()); Log::error($e->getMessage());
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
} }
Log::debug(sprintf('If you see no errors above this line, test notification was sent over channel "%s"', $event->channel)); Log::debug(sprintf('If you see no errors above this line, test notification was sent over channel "%s"', $event->channel));
} }
public function storeUserIPAddress(ActuallyLoggedIn $event): void public function storeUserIPAddress(ActuallyLoggedIn $event): void
{ {
app('log')->debug('Now in storeUserIPAddress'); Log::debug('Now in storeUserIPAddress');
$user = $event->user; $user = $event->user;
if ($user->hasRole('demo')) { if ($user->hasRole('demo')) {
app('log')->debug('Do not log demo user logins'); Log::debug('Do not log demo user logins');
return; return;
} }
@@ -460,25 +460,25 @@ class UserEventHandler
$preference = Preferences::getForUser($user, 'login_ip_history', [])->data; $preference = Preferences::getForUser($user, 'login_ip_history', [])->data;
} catch (FireflyException $e) { } catch (FireflyException $e) {
// don't care. // don't care.
app('log')->error($e->getMessage()); Log::error($e->getMessage());
return; return;
} }
$inArray = false; $inArray = false;
$ip = request()->ip(); $ip = request()->ip();
app('log')->debug(sprintf('User logging in from IP address %s', $ip)); Log::debug(sprintf('User logging in from IP address %s', $ip));
// update array if in array // update array if in array
foreach ($preference as $index => $row) { foreach ($preference as $index => $row) {
if ($row['ip'] === $ip) { if ($row['ip'] === $ip) {
app('log')->debug('Found IP in array, refresh time.'); Log::debug('Found IP in array, refresh time.');
$preference[$index]['time'] = now(config('app.timezone'))->format('Y-m-d H:i:s'); $preference[$index]['time'] = now(config('app.timezone'))->format('Y-m-d H:i:s');
$inArray = true; $inArray = true;
} }
// clean up old entries (6 months) // clean up old entries (6 months)
$carbon = Carbon::createFromFormat('Y-m-d H:i:s', $preference[$index]['time']); $carbon = Carbon::createFromFormat('Y-m-d H:i:s', $preference[$index]['time']);
if ($carbon instanceof Carbon && $carbon->diffInMonths(today(), true) > 6) { if ($carbon instanceof Carbon && $carbon->diffInMonths(today(), true) > 6) {
app('log')->debug(sprintf('Entry for %s is very old, remove it.', $row['ip'])); Log::debug(sprintf('Entry for %s is very old, remove it.', $row['ip']));
unset($preference[$index]); unset($preference[$index]);
} }
} }

View File

@@ -75,7 +75,7 @@ class AccountObserver
*/ */
public function deleting(Account $account): void public function deleting(Account $account): void
{ {
app('log')->debug('Observe "deleting" of an account.'); Log::debug('Observe "deleting" of an account.');
$repository = app(AttachmentRepositoryInterface::class); $repository = app(AttachmentRepositoryInterface::class);
$repository->setUser($account->user); $repository->setUser($account->user);

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Handlers\Observer; namespace FireflyIII\Handlers\Observer;
use FireflyIII\Models\Attachment; use FireflyIII\Models\Attachment;
use Illuminate\Support\Facades\Log;
/** /**
* Class AttachmentObserver * Class AttachmentObserver
@@ -32,7 +33,7 @@ class AttachmentObserver
{ {
public function deleting(Attachment $attachment): void public function deleting(Attachment $attachment): void
{ {
app('log')->debug('Observe "deleting" of an attachment.'); Log::debug('Observe "deleting" of an attachment.');
$attachment->notes()->delete(); $attachment->notes()->delete();
} }
} }

View File

@@ -65,7 +65,7 @@ class BillObserver
$repository = app(AttachmentRepositoryInterface::class); $repository = app(AttachmentRepositoryInterface::class);
$repository->setUser($bill->user); $repository->setUser($bill->user);
// app('log')->debug('Observe "deleting" of a bill.'); // Log::debug('Observe "deleting" of a bill.');
/** @var Attachment $attachment */ /** @var Attachment $attachment */
foreach ($bill->attachments()->get() as $attachment) { foreach ($bill->attachments()->get() as $attachment) {
$repository->destroy($attachment); $repository->destroy($attachment);

View File

@@ -26,6 +26,7 @@ namespace FireflyIII\Handlers\Observer;
use FireflyIII\Models\Attachment; use FireflyIII\Models\Attachment;
use FireflyIII\Models\Category; use FireflyIII\Models\Category;
use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface; use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface;
use Illuminate\Support\Facades\Log;
/** /**
* Class CategoryObserver * Class CategoryObserver
@@ -34,7 +35,7 @@ class CategoryObserver
{ {
public function deleting(Category $category): void public function deleting(Category $category): void
{ {
app('log')->debug('Observe "deleting" of a category.'); Log::debug('Observe "deleting" of a category.');
$repository = app(AttachmentRepositoryInterface::class); $repository = app(AttachmentRepositoryInterface::class);
$repository->setUser($category->user); $repository->setUser($category->user);

View File

@@ -66,7 +66,7 @@ class PiggyBankObserver
*/ */
public function deleting(PiggyBank $piggyBank): void public function deleting(PiggyBank $piggyBank): void
{ {
app('log')->debug('Observe "deleting" of a piggy bank.'); Log::debug('Observe "deleting" of a piggy bank.');
$repository = app(AttachmentRepositoryInterface::class); $repository = app(AttachmentRepositoryInterface::class);
$repository->setUser($piggyBank->accounts()->first()->user); $repository->setUser($piggyBank->accounts()->first()->user);

View File

@@ -26,6 +26,7 @@ namespace FireflyIII\Handlers\Observer;
use FireflyIII\Models\Attachment; use FireflyIII\Models\Attachment;
use FireflyIII\Models\Recurrence; use FireflyIII\Models\Recurrence;
use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface; use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface;
use Illuminate\Support\Facades\Log;
/** /**
* Class RecurrenceObserver * Class RecurrenceObserver
@@ -34,7 +35,7 @@ class RecurrenceObserver
{ {
public function deleting(Recurrence $recurrence): void public function deleting(Recurrence $recurrence): void
{ {
app('log')->debug('Observe "deleting" of a recurrence.'); Log::debug('Observe "deleting" of a recurrence.');
$repository = app(AttachmentRepositoryInterface::class); $repository = app(AttachmentRepositoryInterface::class);
$repository->setUser($recurrence->user); $repository->setUser($recurrence->user);

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Handlers\Observer; namespace FireflyIII\Handlers\Observer;
use FireflyIII\Models\RecurrenceTransaction; use FireflyIII\Models\RecurrenceTransaction;
use Illuminate\Support\Facades\Log;
/** /**
* Class RecurrenceTransactionObserver * Class RecurrenceTransactionObserver
@@ -32,7 +33,7 @@ class RecurrenceTransactionObserver
{ {
public function deleting(RecurrenceTransaction $transaction): void public function deleting(RecurrenceTransaction $transaction): void
{ {
app('log')->debug('Observe "deleting" of a recurrence transaction.'); Log::debug('Observe "deleting" of a recurrence transaction.');
$transaction->recurrenceTransactionMeta()->delete(); $transaction->recurrenceTransactionMeta()->delete();
} }
} }

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Handlers\Observer; namespace FireflyIII\Handlers\Observer;
use FireflyIII\Models\RuleGroup; use FireflyIII\Models\RuleGroup;
use Illuminate\Support\Facades\Log;
/** /**
* Class RuleGroupObserver * Class RuleGroupObserver
@@ -32,7 +33,7 @@ class RuleGroupObserver
{ {
public function deleting(RuleGroup $ruleGroup): void public function deleting(RuleGroup $ruleGroup): void
{ {
app('log')->debug('Observe "deleting" of a rule group.'); Log::debug('Observe "deleting" of a rule group.');
foreach ($ruleGroup->rules()->get() as $rule) { foreach ($ruleGroup->rules()->get() as $rule) {
$rule->delete(); $rule->delete();
} }

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Handlers\Observer; namespace FireflyIII\Handlers\Observer;
use FireflyIII\Models\Rule; use FireflyIII\Models\Rule;
use Illuminate\Support\Facades\Log;
/** /**
* Class RuleObserver * Class RuleObserver
@@ -32,7 +33,7 @@ class RuleObserver
{ {
public function deleting(Rule $rule): void public function deleting(Rule $rule): void
{ {
app('log')->debug('Observe "deleting" of a rule.'); Log::debug('Observe "deleting" of a rule.');
$rule->ruleActions()->delete(); $rule->ruleActions()->delete();
$rule->ruleTriggers()->delete(); $rule->ruleTriggers()->delete();
} }

View File

@@ -26,6 +26,7 @@ namespace FireflyIII\Handlers\Observer;
use FireflyIII\Models\Attachment; use FireflyIII\Models\Attachment;
use FireflyIII\Models\Tag; use FireflyIII\Models\Tag;
use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface; use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface;
use Illuminate\Support\Facades\Log;
/** /**
* Class TagObserver * Class TagObserver
@@ -34,7 +35,7 @@ class TagObserver
{ {
public function deleting(Tag $tag): void public function deleting(Tag $tag): void
{ {
app('log')->debug('Observe "deleting" of a tag.'); Log::debug('Observe "deleting" of a tag.');
$repository = app(AttachmentRepositoryInterface::class); $repository = app(AttachmentRepositoryInterface::class);
$repository->setUser($tag->user); $repository->setUser($tag->user);

View File

@@ -77,7 +77,7 @@ class TransactionObserver
public function deleting(?Transaction $transaction): void public function deleting(?Transaction $transaction): void
{ {
app('log')->debug('Observe "deleting" of a transaction.'); Log::debug('Observe "deleting" of a transaction.');
$transaction?->transactionJournal?->delete(); $transaction?->transactionJournal?->delete();
} }

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Handlers\Observer; namespace FireflyIII\Handlers\Observer;
use FireflyIII\Models\WebhookMessage; use FireflyIII\Models\WebhookMessage;
use Illuminate\Support\Facades\Log;
/** /**
* Class WebhookMessageObserver * Class WebhookMessageObserver
@@ -32,7 +33,7 @@ class WebhookMessageObserver
{ {
public function deleting(WebhookMessage $webhookMessage): void public function deleting(WebhookMessage $webhookMessage): void
{ {
app('log')->debug('Observe "deleting" of a webhook message.'); Log::debug('Observe "deleting" of a webhook message.');
$webhookMessage->webhookAttempts()->delete(); $webhookMessage->webhookAttempts()->delete();
} }
} }

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Handlers\Observer; namespace FireflyIII\Handlers\Observer;
use FireflyIII\Models\Webhook; use FireflyIII\Models\Webhook;
use Illuminate\Support\Facades\Log;
/** /**
* Class WebhookObserver * Class WebhookObserver
@@ -32,7 +33,7 @@ class WebhookObserver
{ {
public function deleting(Webhook $webhook): void public function deleting(Webhook $webhook): void
{ {
app('log')->debug('Observe "deleting" of a webhook.'); Log::debug('Observe "deleting" of a webhook.');
foreach ($webhook->webhookMessages()->get() as $message) { foreach ($webhook->webhookMessages()->get() as $message) {
$message->delete(); $message->delete();
} }

View File

@@ -130,7 +130,7 @@ trait AccountCollection
$this->query->whereNotIn('source.account_id', $accountIds); $this->query->whereNotIn('source.account_id', $accountIds);
$this->query->whereNotIn('destination.account_id', $accountIds); $this->query->whereNotIn('destination.account_id', $accountIds);
app('log')->debug(sprintf('GroupCollector: excludeAccounts: %s', implode(', ', $accountIds))); Log::debug(sprintf('GroupCollector: excludeAccounts: %s', implode(', ', $accountIds)));
} }
return $this; return $this;
@@ -145,7 +145,7 @@ trait AccountCollection
$accountIds = $accounts->pluck('id')->toArray(); $accountIds = $accounts->pluck('id')->toArray();
$this->query->whereNotIn('destination.account_id', $accountIds); $this->query->whereNotIn('destination.account_id', $accountIds);
app('log')->debug(sprintf('GroupCollector: excludeDestinationAccounts: %s', implode(', ', $accountIds))); Log::debug(sprintf('GroupCollector: excludeDestinationAccounts: %s', implode(', ', $accountIds)));
} }
return $this; return $this;
@@ -160,7 +160,7 @@ trait AccountCollection
$accountIds = $accounts->pluck('id')->toArray(); $accountIds = $accounts->pluck('id')->toArray();
$this->query->whereNotIn('source.account_id', $accountIds); $this->query->whereNotIn('source.account_id', $accountIds);
app('log')->debug(sprintf('GroupCollector: excludeSourceAccounts: %s', implode(', ', $accountIds))); Log::debug(sprintf('GroupCollector: excludeSourceAccounts: %s', implode(', ', $accountIds)));
} }
return $this; return $this;
@@ -179,7 +179,7 @@ trait AccountCollection
$query->orWhereIn('destination.account_id', $accountIds); $query->orWhereIn('destination.account_id', $accountIds);
} }
); );
// app('log')->debug(sprintf('GroupCollector: setAccounts: %s', implode(', ', $accountIds))); // Log::debug(sprintf('GroupCollector: setAccounts: %s', implode(', ', $accountIds)));
} }
return $this; return $this;
@@ -198,7 +198,7 @@ trait AccountCollection
$query->whereIn('destination.account_id', $accountIds); $query->whereIn('destination.account_id', $accountIds);
} }
); );
app('log')->debug(sprintf('GroupCollector: setBothAccounts: %s', implode(', ', $accountIds))); Log::debug(sprintf('GroupCollector: setBothAccounts: %s', implode(', ', $accountIds)));
} }
return $this; return $this;
@@ -213,7 +213,7 @@ trait AccountCollection
$accountIds = $accounts->pluck('id')->toArray(); $accountIds = $accounts->pluck('id')->toArray();
$this->query->whereIn('destination.account_id', $accountIds); $this->query->whereIn('destination.account_id', $accountIds);
app('log')->debug(sprintf('GroupCollector: setDestinationAccounts: %s', implode(', ', $accountIds))); Log::debug(sprintf('GroupCollector: setDestinationAccounts: %s', implode(', ', $accountIds)));
} }
return $this; return $this;
@@ -232,7 +232,7 @@ trait AccountCollection
$query->whereNotIn('destination.account_id', $accountIds); $query->whereNotIn('destination.account_id', $accountIds);
} }
); );
// app('log')->debug(sprintf('GroupCollector: setAccounts: %s', implode(', ', $accountIds))); // Log::debug(sprintf('GroupCollector: setAccounts: %s', implode(', ', $accountIds)));
} }
return $this; return $this;
@@ -247,7 +247,7 @@ trait AccountCollection
$accountIds = $accounts->pluck('id')->toArray(); $accountIds = $accounts->pluck('id')->toArray();
$this->query->whereIn('source.account_id', $accountIds); $this->query->whereIn('source.account_id', $accountIds);
app('log')->debug(sprintf('GroupCollector: setSourceAccounts: %s', implode(', ', $accountIds))); Log::debug(sprintf('GroupCollector: setSourceAccounts: %s', implode(', ', $accountIds)));
} }
return $this; return $this;
@@ -280,7 +280,7 @@ trait AccountCollection
} }
); );
app('log')->debug(sprintf('GroupCollector: setXorAccounts: %s', implode(', ', $accountIds))); Log::debug(sprintf('GroupCollector: setXorAccounts: %s', implode(', ', $accountIds)));
} }
return $this; return $this;

View File

@@ -29,6 +29,7 @@ use FireflyIII\Models\Attachment;
use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionJournal;
use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Builder as EloquentBuilder; use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use Illuminate\Support\Facades\Log;
/** /**
* Trait AttachmentCollection * Trait AttachmentCollection
@@ -72,7 +73,7 @@ trait AttachmentCollection
*/ */
public function hasAttachments(): GroupCollectorInterface public function hasAttachments(): GroupCollectorInterface
{ {
app('log')->debug('Add filter on attachment ID.'); Log::debug('Add filter on attachment ID.');
$this->joinAttachmentTables(); $this->joinAttachmentTables();
$this->query->whereNotNull('attachments.attachable_id'); $this->query->whereNotNull('attachments.attachable_id');
$this->query->whereNull('attachments.deleted_at'); $this->query->whereNull('attachments.deleted_at');
@@ -510,7 +511,7 @@ trait AttachmentCollection
*/ */
public function hasNoAttachments(): GroupCollectorInterface public function hasNoAttachments(): GroupCollectorInterface
{ {
app('log')->debug('Add filter on no attachments.'); Log::debug('Add filter on no attachments.');
$this->joinAttachmentTables(); $this->joinAttachmentTables();
$this->query->where(static function (Builder $q1): void { // @phpstan-ignore-line $this->query->where(static function (Builder $q1): void { // @phpstan-ignore-line

View File

@@ -320,8 +320,8 @@ class GroupCollector implements GroupCollectorInterface
public function dumpQueryInLogs(): void public function dumpQueryInLogs(): void
{ {
app('log')->debug($this->query->select($this->fields)->toSql()); Log::debug($this->query->select($this->fields)->toSql());
app('log')->debug('Bindings', $this->query->getBindings()); Log::debug('Bindings', $this->query->getBindings());
} }
/** /**
@@ -590,7 +590,7 @@ class GroupCollector implements GroupCollectorInterface
$result['created_at']->setTimezone(config('app.timezone')); $result['created_at']->setTimezone(config('app.timezone'));
$result['updated_at']->setTimezone(config('app.timezone')); $result['updated_at']->setTimezone(config('app.timezone'));
} catch (Exception $e) { // intentional generic exception } catch (Exception $e) { // intentional generic exception
app('log')->error($e->getMessage()); Log::error($e->getMessage());
throw new FireflyException($e->getMessage(), 0, $e); throw new FireflyException($e->getMessage(), 0, $e);
} }
@@ -621,7 +621,7 @@ class GroupCollector implements GroupCollectorInterface
try { try {
$tagDate = Carbon::parse($augumentedJournal['tag_date']); $tagDate = Carbon::parse($augumentedJournal['tag_date']);
} catch (InvalidFormatException $e) { } catch (InvalidFormatException $e) {
app('log')->debug(sprintf('Could not parse date: %s', $e->getMessage())); Log::debug(sprintf('Could not parse date: %s', $e->getMessage()));
} }
$result['tags'][$tagId] = [ $result['tags'][$tagId] = [
@@ -697,7 +697,7 @@ class GroupCollector implements GroupCollectorInterface
try { try {
$tagDate = Carbon::parse($newArray['tag_date']); $tagDate = Carbon::parse($newArray['tag_date']);
} catch (InvalidFormatException $e) { } catch (InvalidFormatException $e) {
app('log')->debug(sprintf('Could not parse date: %s', $e->getMessage())); Log::debug(sprintf('Could not parse date: %s', $e->getMessage()));
} }
$existingJournal['tags'][$tagId] = [ $existingJournal['tags'][$tagId] = [
@@ -783,13 +783,13 @@ class GroupCollector implements GroupCollectorInterface
if (0 === $countFilters) { if (0 === $countFilters) {
return $currentCollection; return $currentCollection;
} }
app('log')->debug(sprintf('GroupCollector: postFilterCollection has %d filter(s) and %d transaction(s).', count($this->postFilters), count($currentCollection))); Log::debug(sprintf('GroupCollector: postFilterCollection has %d filter(s) and %d transaction(s).', count($this->postFilters), count($currentCollection)));
/** /**
* @var Closure $function * @var Closure $function
*/ */
foreach ($this->postFilters as $function) { foreach ($this->postFilters as $function) {
app('log')->debug('Applying filter...'); Log::debug('Applying filter...');
$nextCollection = new Collection(); $nextCollection = new Collection();
// loop everything in the current collection // loop everything in the current collection
@@ -814,7 +814,7 @@ class GroupCollector implements GroupCollectorInterface
} }
} }
$currentCollection = $nextCollection; $currentCollection = $nextCollection;
app('log')->debug(sprintf('GroupCollector: postFilterCollection has %d transaction(s) left.', count($currentCollection))); Log::debug(sprintf('GroupCollector: postFilterCollection has %d transaction(s) left.', count($currentCollection)));
} }
return $currentCollection; return $currentCollection;
@@ -875,7 +875,7 @@ class GroupCollector implements GroupCollectorInterface
public function setLimit(int $limit): GroupCollectorInterface public function setLimit(int $limit): GroupCollectorInterface
{ {
$this->limit = $limit; $this->limit = $limit;
// app('log')->debug(sprintf('GroupCollector: The limit is now %d', $limit)); // Log::debug(sprintf('GroupCollector: The limit is now %d', $limit));
return $this; return $this;
} }
@@ -973,7 +973,7 @@ class GroupCollector implements GroupCollectorInterface
{ {
$page = 0 === $page ? 1 : $page; $page = 0 === $page ? 1 : $page;
$this->page = $page; $this->page = $page;
// app('log')->debug(sprintf('GroupCollector: page is now %d', $page)); // Log::debug(sprintf('GroupCollector: page is now %d', $page));
return $this; return $this;
} }
@@ -1066,7 +1066,7 @@ class GroupCollector implements GroupCollectorInterface
*/ */
private function startQuery(): void private function startQuery(): void
{ {
// app('log')->debug('GroupCollector::startQuery'); // Log::debug('GroupCollector::startQuery');
$this->query = $this->user $this->query = $this->user
// ->transactionGroups() // ->transactionGroups()
// ->leftJoin('transaction_journals', 'transaction_journals.transaction_group_id', 'transaction_groups.id') // ->leftJoin('transaction_journals', 'transaction_journals.transaction_group_id', 'transaction_groups.id')
@@ -1126,7 +1126,7 @@ class GroupCollector implements GroupCollectorInterface
*/ */
private function startQueryForGroup(): void private function startQueryForGroup(): void
{ {
// app('log')->debug('GroupCollector::startQuery'); // Log::debug('GroupCollector::startQuery');
$this->query = $this->userGroup $this->query = $this->userGroup
->transactionJournals() ->transactionJournals()
->leftJoin('transaction_groups', 'transaction_journals.transaction_group_id', 'transaction_groups.id') ->leftJoin('transaction_groups', 'transaction_journals.transaction_group_id', 'transaction_groups.id')

View File

@@ -27,6 +27,7 @@ use Carbon\Carbon;
use FireflyIII\Support\Facades\Preferences; use FireflyIII\Support\Facades\Preferences;
use Psr\Container\ContainerExceptionInterface; use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface; use Psr\Container\NotFoundExceptionInterface;
use Illuminate\Support\Facades\Log;
/** /**
* Class FiscalHelper. * Class FiscalHelper.
@@ -49,7 +50,7 @@ class FiscalHelper implements FiscalHelperInterface
*/ */
public function endOfFiscalYear(Carbon $date): Carbon public function endOfFiscalYear(Carbon $date): Carbon
{ {
// app('log')->debug(sprintf('Now in endOfFiscalYear(%s).', $date->format('Y-m-d'))); // Log::debug(sprintf('Now in endOfFiscalYear(%s).', $date->format('Y-m-d')));
$endDate = $this->startOfFiscalYear($date); $endDate = $this->startOfFiscalYear($date);
if (true === $this->useCustomFiscalYear) { if (true === $this->useCustomFiscalYear) {
// add 1 year and sub 1 day // add 1 year and sub 1 day
@@ -59,7 +60,7 @@ class FiscalHelper implements FiscalHelperInterface
if (false === $this->useCustomFiscalYear) { if (false === $this->useCustomFiscalYear) {
$endDate->endOfYear(); $endDate->endOfYear();
} }
// app('log')->debug(sprintf('Result of endOfFiscalYear(%s) = %s', $date->format('Y-m-d'), $endDate->format('Y-m-d'))); // Log::debug(sprintf('Result of endOfFiscalYear(%s) = %s', $date->format('Y-m-d'), $endDate->format('Y-m-d')));
return $endDate; return $endDate;
} }
@@ -92,7 +93,7 @@ class FiscalHelper implements FiscalHelperInterface
$startDate->startOfYear(); $startDate->startOfYear();
} }
// app('log')->debug(sprintf('Result of startOfFiscalYear(%s) = %s', $date->format('Y-m-d'), $startDate->format('Y-m-d'))); // Log::debug(sprintf('Result of startOfFiscalYear(%s) = %s', $date->format('Y-m-d'), $startDate->format('Y-m-d')));
return $startDate; return $startDate;
} }

View File

@@ -25,6 +25,7 @@ declare(strict_types=1);
namespace FireflyIII\Helpers\Update; namespace FireflyIII\Helpers\Update;
use FireflyIII\Services\FireflyIIIOrg\Update\UpdateRequestInterface; use FireflyIII\Services\FireflyIIIOrg\Update\UpdateRequestInterface;
use Illuminate\Support\Facades\Log;
/** /**
* Trait UpdateTrait * Trait UpdateTrait
@@ -38,7 +39,7 @@ trait UpdateTrait
*/ */
public function getLatestRelease(): array public function getLatestRelease(): array
{ {
app('log')->debug('Now in getLatestRelease()'); Log::debug('Now in getLatestRelease()');
/** @var UpdateRequestInterface $checker */ /** @var UpdateRequestInterface $checker */
$checker = app(UpdateRequestInterface::class); $checker = app(UpdateRequestInterface::class);

View File

@@ -28,6 +28,7 @@ use Carbon\Carbon;
use FireflyIII\Exceptions\FireflyException; use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\WebhookMessage; use FireflyIII\Models\WebhookMessage;
use JsonException; use JsonException;
use Illuminate\Support\Facades\Log;
use function Safe\json_encode; use function Safe\json_encode;
@@ -52,10 +53,10 @@ class Sha3SignatureGenerator implements SignatureGeneratorInterface
try { try {
$json = json_encode($message->message, JSON_THROW_ON_ERROR); $json = json_encode($message->message, JSON_THROW_ON_ERROR);
} catch (JsonException $e) { } catch (JsonException $e) {
app('log')->error('Could not generate hash.'); Log::error('Could not generate hash.');
app('log')->error(sprintf('JSON value: %s', $json)); Log::error(sprintf('JSON value: %s', $json));
app('log')->error($e->getMessage()); Log::error($e->getMessage());
app('log')->error($e->getTraceAsString()); Log::error($e->getTraceAsString());
throw new FireflyException('Could not generate JSON for SHA3 hash.', 0, $e); throw new FireflyException('Could not generate JSON for SHA3 hash.', 0, $e);
} }

View File

@@ -95,7 +95,7 @@ class AttachmentController extends Controller
/** /**
* Download attachment to PC. * Download attachment to PC.
* *
* @return LaravelResponse * @return LaravelResponse|View
* *
* @throws FireflyException * @throws FireflyException
*/ */
@@ -121,8 +121,9 @@ class AttachmentController extends Controller
return $response; return $response;
} }
$message = 'Could not find the indicated attachment. The file is no longer there.';
throw new FireflyException('Could not find the indicated attachment. The file is no longer there.'); return view('errors.error', compact('message'));
} }
/** /**
@@ -194,7 +195,7 @@ class AttachmentController extends Controller
* *
* @throws FireflyException * @throws FireflyException
*/ */
public function view(Attachment $attachment): LaravelResponse public function view(Attachment $attachment): LaravelResponse|View
{ {
if ($this->repository->exists($attachment)) { if ($this->repository->exists($attachment)) {
$content = $this->repository->getContent($attachment); $content = $this->repository->getContent($attachment);
@@ -223,6 +224,8 @@ class AttachmentController extends Controller
); );
} }
throw new FireflyException('Could not find the indicated attachment. The file is no longer there.'); $message = 'Could not find the indicated attachment. The file is no longer there.';
return view('errors.error', compact('message'));
} }
} }

View File

@@ -73,7 +73,7 @@ class ForgotPasswordController extends Controller
$message = sprintf('Cannot reset password when authenticating over "%s".', config('firefly.authentication_guard')); $message = sprintf('Cannot reset password when authenticating over "%s".', config('firefly.authentication_guard'));
Log::error($message); Log::error($message);
return view('error', compact('message')); return view('errors.error', compact('message'));
} }
// validate host header. // validate host header.
@@ -138,7 +138,7 @@ class ForgotPasswordController extends Controller
if ('web' !== config('firefly.authentication_guard')) { if ('web' !== config('firefly.authentication_guard')) {
$message = sprintf('Cannot reset password when authenticating over "%s".', config('firefly.authentication_guard')); $message = sprintf('Cannot reset password when authenticating over "%s".', config('firefly.authentication_guard'));
return view('error', compact('message')); return view('errors.error', compact('message'));
} }
// is allowed to? // is allowed to?

View File

@@ -158,12 +158,12 @@ class RegisterController extends Controller
if (true === $allowRegistration) { if (true === $allowRegistration) {
$message = 'You do not need an invite code on this installation.'; $message = 'You do not need an invite code on this installation.';
return view('error', compact('message')); return view('errors.error', compact('message'));
} }
if (false === $validCode) { if (false === $validCode) {
$message = 'Invalid code.'; $message = 'Invalid code.';
return view('error', compact('message')); return view('errors.error', compact('message'));
} }
$email = $request->old('email'); $email = $request->old('email');
@@ -189,7 +189,7 @@ class RegisterController extends Controller
if (false === $allowRegistration) { if (false === $allowRegistration) {
$message = 'Registration is currently not available. If you are the administrator, you can enable this in the administration.'; $message = 'Registration is currently not available. If you are the administrator, you can enable this in the administration.';
return view('error', compact('message')); return view('errors.error', compact('message'));
} }
$email = $request?->old('email'); $email = $request?->old('email');

View File

@@ -80,7 +80,7 @@ class ResetPasswordController extends Controller
if ('web' !== config('firefly.authentication_guard')) { if ('web' !== config('firefly.authentication_guard')) {
$message = sprintf('Cannot reset password when authenticating over "%s".', config('firefly.authentication_guard')); $message = sprintf('Cannot reset password when authenticating over "%s".', config('firefly.authentication_guard'));
return view('error', compact('message')); return view('errors.error', compact('message'));
} }
$rules = [ $rules = [
@@ -127,7 +127,7 @@ class ResetPasswordController extends Controller
if ('web' !== config('firefly.authentication_guard')) { if ('web' !== config('firefly.authentication_guard')) {
$message = sprintf('Cannot reset password when authenticating over "%s".', config('firefly.authentication_guard')); $message = sprintf('Cannot reset password when authenticating over "%s".', config('firefly.authentication_guard'));
return view('error', compact('message')); return view('errors.error', compact('message'));
} }
// is allowed to register? // is allowed to register?

View File

@@ -82,7 +82,7 @@ class ReportController extends Controller
public function auditReport(Collection $accounts, Carbon $start, Carbon $end) public function auditReport(Collection $accounts, Carbon $start, Carbon $end)
{ {
if ($end < $start) { if ($end < $start) {
return view('error')->with('message', (string) trans('firefly.end_after_start_date')); return view('errors.error')->with('message', (string) trans('firefly.end_after_start_date'));
} }
$this->repository->cleanupBudgets(); $this->repository->cleanupBudgets();
$start->endOfDay(); // end of day so the final balance is at the end of that day. $start->endOfDay(); // end of day so the final balance is at the end of that day.
@@ -115,7 +115,7 @@ class ReportController extends Controller
public function budgetReport(Collection $accounts, Collection $budgets, Carbon $start, Carbon $end) public function budgetReport(Collection $accounts, Collection $budgets, Carbon $start, Carbon $end)
{ {
if ($end < $start) { if ($end < $start) {
return view('error')->with('message', (string) trans('firefly.end_after_start_date')); return view('errors.error')->with('message', (string) trans('firefly.end_after_start_date'));
} }
$this->repository->cleanupBudgets(); $this->repository->cleanupBudgets();
$start->endOfDay(); // end of day so the final balance is at the end of that day. $start->endOfDay(); // end of day so the final balance is at the end of that day.
@@ -149,7 +149,7 @@ class ReportController extends Controller
public function categoryReport(Collection $accounts, Collection $categories, Carbon $start, Carbon $end) public function categoryReport(Collection $accounts, Collection $categories, Carbon $start, Carbon $end)
{ {
if ($end < $start) { if ($end < $start) {
return view('error')->with('message', (string) trans('firefly.end_after_start_date')); return view('errors.error')->with('message', (string) trans('firefly.end_after_start_date'));
} }
$this->repository->cleanupBudgets(); $this->repository->cleanupBudgets();
$start->endOfDay(); // end of day so the final balance is at the end of that day. $start->endOfDay(); // end of day so the final balance is at the end of that day.
@@ -183,7 +183,7 @@ class ReportController extends Controller
public function defaultReport(Collection $accounts, Carbon $start, Carbon $end) public function defaultReport(Collection $accounts, Carbon $start, Carbon $end)
{ {
if ($end < $start) { if ($end < $start) {
return view('error')->with('message', (string) trans('firefly.end_after_start_date')); return view('errors.error')->with('message', (string) trans('firefly.end_after_start_date'));
} }
$this->repository->cleanupBudgets(); $this->repository->cleanupBudgets();
@@ -336,7 +336,7 @@ class ReportController extends Controller
} }
if ($request->getEndDate() < $request->getStartDate()) { if ($request->getEndDate() < $request->getStartDate()) {
return view('error')->with('message', (string) trans('firefly.end_after_start_date')); return view('errors.error')->with('message', (string) trans('firefly.end_after_start_date'));
} }
$url = match ($reportType) { $url = match ($reportType) {
@@ -361,7 +361,7 @@ class ReportController extends Controller
public function tagReport(Collection $accounts, Collection $tags, Carbon $start, Carbon $end) public function tagReport(Collection $accounts, Collection $tags, Carbon $start, Carbon $end)
{ {
if ($end < $start) { if ($end < $start) {
return view('error')->with('message', (string) trans('firefly.end_after_start_date')); return view('errors.error')->with('message', (string) trans('firefly.end_after_start_date'));
} }
$this->repository->cleanupBudgets(); $this->repository->cleanupBudgets();
$start->endOfDay(); // end of day so the final balance is at the end of that day. $start->endOfDay(); // end of day so the final balance is at the end of that day.

View File

@@ -39,7 +39,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
* *
* @property TransactionCurrency $transactionCurrency * @property TransactionCurrency $transactionCurrency
* @property Carbon $start_date * @property Carbon $start_date
* @property Carbon $end_date * @property null|Carbon $end_date
*/ */
#[ObservedBy([BudgetLimitObserver::class])] #[ObservedBy([BudgetLimitObserver::class])]
class BudgetLimit extends Model class BudgetLimit extends Model

View File

@@ -33,10 +33,12 @@ use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Collection;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
/** /**
* @property User $user * @property User $user
* @property Collection $rules
*/ */
#[ObservedBy([RuleGroupObserver::class])] #[ObservedBy([RuleGroupObserver::class])]
class RuleGroup extends Model class RuleGroup extends Model

View File

@@ -263,7 +263,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface, UserGroupInte
[ // @phpstan-ignore-line [ // @phpstan-ignore-line
'rules' => static function (HasMany $query): void { 'rules' => static function (HasMany $query): void {
$query->orderBy('order', 'ASC'); $query->orderBy('order', 'ASC');
$query->where('rules.active', true); // $query->where('rules.active', true);
}, },
'rules.ruleTriggers' => static function (HasMany $query): void { 'rules.ruleTriggers' => static function (HasMany $query): void {
$query->orderBy('order', 'ASC'); $query->orderBy('order', 'ASC');

View File

@@ -26,6 +26,7 @@ namespace FireflyIII\Rules;
use Closure; use Closure;
use FireflyIII\Enums\UserRoleEnum; use FireflyIII\Enums\UserRoleEnum;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\Account; use FireflyIII\Models\Account;
use FireflyIII\Repositories\UserGroup\UserGroupRepositoryInterface; use FireflyIII\Repositories\UserGroup\UserGroupRepositoryInterface;
use FireflyIII\User; use FireflyIII\User;
@@ -68,11 +69,18 @@ class IsAllowedGroupAction implements ValidationRule
break; break;
} }
} }
$this->validateUserGroup((int) $value, $fail); $this->validateUserGroup((int)$value, $fail);
} }
private function validateUserGroup(int $userGroupId, Closure $fail): void private function validateUserGroup(int $userGroupId, Closure $fail): void
{ {
try {
throw new FireflyException('Here we are');
} catch (FireflyException $e) {
Log::error($e->getTraceAsString());
}
exit('here we are');
Log::debug(sprintf('validateUserGroup: %s', static::class)); Log::debug(sprintf('validateUserGroup: %s', static::class));
if (!auth()->check()) { if (!auth()->check()) {
Log::debug('validateUserGroup: user is not logged in, return NULL.'); Log::debug('validateUserGroup: user is not logged in, return NULL.');

View File

@@ -0,0 +1,56 @@
<?php
/*
* IsValidAccountType.php
* Copyright (c) 2024 james@firefly-iii.org.
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see https://www.gnu.org/licenses/.
*/
declare(strict_types=1);
namespace FireflyIII\Rules\TransactionType;
use Closure;
use FireflyIII\Support\Http\Api\TransactionFilter;
use Illuminate\Contracts\Validation\ValidationRule;
use Override;
class IsValidTransactionTypeList implements ValidationRule
{
use TransactionFilter;
#[Override]
public function validate(string $attribute, mixed $value, Closure $fail): void
{
// only check the type.
$values = [];
if (is_string($value)) {
$values = explode(',', $value);
}
if (!is_array($values)) {
$fail('validation.invalid_transaction_type_list')->translate();
}
$keys = array_keys($this->transactionTypes);
foreach ($values as $entry) {
$entry = (string)$entry;
if (!in_array($entry, $keys, true)) {
$fail('validation.invalid_transaction_type_list')->translate();
}
}
}
}

View File

@@ -31,39 +31,48 @@ use FireflyIII\Enums\TransactionTypeEnum;
*/ */
trait TransactionFilter trait TransactionFilter
{ {
/** protected $transactionTypes
* All the types you can request. = [
*/ 'all' => [
protected function mapTransactionTypes(string $type): array
{
$types = [
'all' => [
TransactionTypeEnum::WITHDRAWAL->value, TransactionTypeEnum::WITHDRAWAL->value,
TransactionTypeEnum::DEPOSIT->value, TransactionTypeEnum::DEPOSIT->value,
TransactionTypeEnum::TRANSFER->value, TransactionTypeEnum::TRANSFER->value,
TransactionTypeEnum::OPENING_BALANCE->value, TransactionTypeEnum::OPENING_BALANCE->value,
TransactionTypeEnum::RECONCILIATION->value, TransactionTypeEnum::RECONCILIATION->value,
], ],
'withdrawal' => [TransactionTypeEnum::WITHDRAWAL->value], TransactionTypeEnum::WITHDRAWAL->value => [TransactionTypeEnum::WITHDRAWAL->value],
'withdrawals' => [TransactionTypeEnum::WITHDRAWAL->value], 'withdrawal' => [TransactionTypeEnum::WITHDRAWAL->value],
'expense' => [TransactionTypeEnum::WITHDRAWAL->value], 'withdrawals' => [TransactionTypeEnum::WITHDRAWAL->value],
'expenses' => [TransactionTypeEnum::WITHDRAWAL->value], 'expense' => [TransactionTypeEnum::WITHDRAWAL->value],
'income' => [TransactionTypeEnum::DEPOSIT->value], 'expenses' => [TransactionTypeEnum::WITHDRAWAL->value],
'deposit' => [TransactionTypeEnum::DEPOSIT->value], TransactionTypeEnum::DEPOSIT->value => [TransactionTypeEnum::DEPOSIT->value],
'deposits' => [TransactionTypeEnum::DEPOSIT->value], 'income' => [TransactionTypeEnum::DEPOSIT->value],
'transfer' => [TransactionTypeEnum::TRANSFER->value], 'deposit' => [TransactionTypeEnum::DEPOSIT->value],
'transfers' => [TransactionTypeEnum::TRANSFER->value], 'deposits' => [TransactionTypeEnum::DEPOSIT->value],
'opening_balance' => [TransactionTypeEnum::OPENING_BALANCE->value], TransactionTypeEnum::TRANSFER->value => [TransactionTypeEnum::TRANSFER->value],
'reconciliation' => [TransactionTypeEnum::RECONCILIATION->value], 'transfer' => [TransactionTypeEnum::TRANSFER->value],
'reconciliations' => [TransactionTypeEnum::RECONCILIATION->value], 'transfers' => [TransactionTypeEnum::TRANSFER->value],
'special' => [TransactionTypeEnum::OPENING_BALANCE->value, TransactionTypeEnum::RECONCILIATION->value], TransactionTypeEnum::OPENING_BALANCE->value => [TransactionTypeEnum::OPENING_BALANCE->value],
'specials' => [TransactionTypeEnum::OPENING_BALANCE->value, TransactionTypeEnum::RECONCILIATION->value], 'opening_balance' => [TransactionTypeEnum::OPENING_BALANCE->value],
'default' => [TransactionTypeEnum::WITHDRAWAL->value, TransactionTypeEnum::DEPOSIT->value, TransactionTypeEnum::TRANSFER->value], TransactionTypeEnum::RECONCILIATION->value => [TransactionTypeEnum::RECONCILIATION->value],
'reconciliation' => [TransactionTypeEnum::RECONCILIATION->value],
'reconciliations' => [TransactionTypeEnum::RECONCILIATION->value],
'special' => [TransactionTypeEnum::OPENING_BALANCE->value, TransactionTypeEnum::RECONCILIATION->value],
'specials' => [TransactionTypeEnum::OPENING_BALANCE->value, TransactionTypeEnum::RECONCILIATION->value],
'default' => [TransactionTypeEnum::WITHDRAWAL->value, TransactionTypeEnum::DEPOSIT->value, TransactionTypeEnum::TRANSFER->value],
]; ];
/**
* All the types you can request.
*/
protected function mapTransactionTypes(string $type): array
{
$return = []; $return = [];
$parts = explode(',', $type); $parts = explode(',', $type);
foreach ($parts as $part) { foreach ($parts as $part) {
$return = array_merge($return, $types[$part] ?? $types['default']); if (array_key_exists($part, $this->transactionTypes)) {
$return = array_merge($return, $this->transactionTypes[$part]);
}
} }
return array_unique($return); return array_unique($return);

View File

@@ -31,6 +31,7 @@ use FireflyIII\Models\TransactionJournal;
use FireflyIII\Repositories\Bill\BillRepositoryInterface; use FireflyIII\Repositories\Bill\BillRepositoryInterface;
use FireflyIII\User; use FireflyIII\User;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
/** /**
* Class LinkToBill. * Class LinkToBill.
@@ -54,29 +55,16 @@ class LinkToBill implements ActionInterface
$bill = $repository->findByName($billName); $bill = $repository->findByName($billName);
if (null !== $bill && TransactionTypeEnum::WITHDRAWAL->value === $journal['transaction_type_type']) { if (null !== $bill && TransactionTypeEnum::WITHDRAWAL->value === $journal['transaction_type_type']) {
$count = DB::table('transaction_journals')->where('id', '=', $journal['transaction_journal_id']) $count = DB::table('transaction_journals')->where('id', '=', $journal['transaction_journal_id'])->where('bill_id', $bill->id)->count();
->where('bill_id', $bill->id)->count()
;
if (0 !== $count) { if (0 !== $count) {
app('log')->error( Log::error(sprintf('RuleAction LinkToBill could not set the bill of journal #%d to bill "%s": already set.', $journal['transaction_journal_id'], $billName));
sprintf( // event(new RuleActionFailedOnArray($this->action, $journal, trans('rules.already_linked_to_subscription', ['name' => $billName])));
'RuleAction LinkToBill could not set the bill of journal #%d to bill "%s": already set.',
$journal['transaction_journal_id'],
$billName
)
);
event(new RuleActionFailedOnArray($this->action, $journal, trans('rules.already_linked_to_subscription', ['name' => $billName])));
return false; return false;
} }
DB::table('transaction_journals') DB::table('transaction_journals')->where('id', '=', $journal['transaction_journal_id'])->update(['bill_id' => $bill->id]);
->where('id', '=', $journal['transaction_journal_id']) Log::debug(sprintf('RuleAction LinkToBill set the bill of journal #%d to bill #%d ("%s").', $journal['transaction_journal_id'], $bill->id, $bill->name));
->update(['bill_id' => $bill->id])
;
app('log')->debug(
sprintf('RuleAction LinkToBill set the bill of journal #%d to bill #%d ("%s").', $journal['transaction_journal_id'], $bill->id, $bill->name)
);
/** @var TransactionJournal $object */ /** @var TransactionJournal $object */
$object = TransactionJournal::where('user_id', $journal['user_id'])->find($journal['transaction_journal_id']); $object = TransactionJournal::where('user_id', $journal['user_id'])->find($journal['transaction_journal_id']);
@@ -85,13 +73,7 @@ class LinkToBill implements ActionInterface
return true; return true;
} }
app('log')->error( Log::error(sprintf('RuleAction LinkToBill could not set the bill of journal #%d to bill "%s": no such bill found or not a withdrawal.', $journal['transaction_journal_id'], $billName));
sprintf(
'RuleAction LinkToBill could not set the bill of journal #%d to bill "%s": no such bill found or not a withdrawal.',
$journal['transaction_journal_id'],
$billName
)
);
event(new RuleActionFailedOnArray($this->action, $journal, trans('rules.cannot_find_subscription', ['name' => $billName]))); event(new RuleActionFailedOnArray($this->action, $journal, trans('rules.cannot_find_subscription', ['name' => $billName])));
return false; return false;

View File

@@ -103,6 +103,7 @@
"psr/log": "<4", "psr/log": "<4",
"ramsey/uuid": "^4.7", "ramsey/uuid": "^4.7",
"rcrowe/twigbridge": "^0.14", "rcrowe/twigbridge": "^0.14",
"sentry/sentry-laravel": "^4.18",
"spatie/laravel-html": "^3.2", "spatie/laravel-html": "^3.2",
"spatie/laravel-ignition": "^2", "spatie/laravel-ignition": "^2",
"spatie/period": "^2.4", "spatie/period": "^2.4",

339
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "5c65637d2a997c3503e4922eb7647e2a", "content-hash": "946638fa99da77780e75953c338d9a55",
"packages": [ "packages": [
{ {
"name": "bacon/bacon-qr-code", "name": "bacon/bacon-qr-code",
@@ -1808,6 +1808,66 @@
}, },
"time": "2022-03-31T05:55:34+00:00" "time": "2022-03-31T05:55:34+00:00"
}, },
{
"name": "jean85/pretty-package-versions",
"version": "2.1.1",
"source": {
"type": "git",
"url": "https://github.com/Jean85/pretty-package-versions.git",
"reference": "4d7aa5dab42e2a76d99559706022885de0e18e1a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/4d7aa5dab42e2a76d99559706022885de0e18e1a",
"reference": "4d7aa5dab42e2a76d99559706022885de0e18e1a",
"shasum": ""
},
"require": {
"composer-runtime-api": "^2.1.0",
"php": "^7.4|^8.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.2",
"jean85/composer-provided-replaced-stub-package": "^1.0",
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^7.5|^8.5|^9.6",
"rector/rector": "^2.0",
"vimeo/psalm": "^4.3 || ^5.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
}
},
"autoload": {
"psr-4": {
"Jean85\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Alessandro Lai",
"email": "alessandro.lai85@gmail.com"
}
],
"description": "A library to get pretty versions strings of installed dependencies",
"keywords": [
"composer",
"package",
"release",
"versions"
],
"support": {
"issues": "https://github.com/Jean85/pretty-package-versions/issues",
"source": "https://github.com/Jean85/pretty-package-versions/tree/2.1.1"
},
"time": "2025-03-19T14:43:43+00:00"
},
{ {
"name": "laravel-notification-channels/pushover", "name": "laravel-notification-channels/pushover",
"version": "4.1.2", "version": "4.1.2",
@@ -1877,16 +1937,16 @@
}, },
{ {
"name": "laravel/framework", "name": "laravel/framework",
"version": "v12.36.1", "version": "v12.37.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laravel/framework.git", "url": "https://github.com/laravel/framework.git",
"reference": "cad110d7685fbab990a6bb8184d0cfd847d7c4d8" "reference": "3c3c4ad30f5b528b164a7c09aa4ad03118c4c125"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/cad110d7685fbab990a6bb8184d0cfd847d7c4d8", "url": "https://api.github.com/repos/laravel/framework/zipball/3c3c4ad30f5b528b164a7c09aa4ad03118c4c125",
"reference": "cad110d7685fbab990a6bb8184d0cfd847d7c4d8", "reference": "3c3c4ad30f5b528b164a7c09aa4ad03118c4c125",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2092,7 +2152,7 @@
"issues": "https://github.com/laravel/framework/issues", "issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework" "source": "https://github.com/laravel/framework"
}, },
"time": "2025-10-29T14:20:57+00:00" "time": "2025-11-04T15:39:33+00:00"
}, },
{ {
"name": "laravel/passport", "name": "laravel/passport",
@@ -5903,6 +5963,183 @@
}, },
"time": "2025-08-20T11:25:49+00:00" "time": "2025-08-20T11:25:49+00:00"
}, },
{
"name": "sentry/sentry",
"version": "4.18.0",
"source": {
"type": "git",
"url": "https://github.com/getsentry/sentry-php.git",
"reference": "75f7efb7d435d24767c93d0081b8edf228be5772"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/getsentry/sentry-php/zipball/75f7efb7d435d24767c93d0081b8edf228be5772",
"reference": "75f7efb7d435d24767c93d0081b8edf228be5772",
"shasum": ""
},
"require": {
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
"guzzlehttp/psr7": "^1.8.4|^2.1.1",
"jean85/pretty-package-versions": "^1.5|^2.0.4",
"php": "^7.2|^8.0",
"psr/log": "^1.0|^2.0|^3.0",
"symfony/options-resolver": "^4.4.30|^5.0.11|^6.0|^7.0|^8.0"
},
"conflict": {
"raven/raven": "*"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.4",
"guzzlehttp/promises": "^2.0.3",
"guzzlehttp/psr7": "^1.8.4|^2.1.1",
"monolog/monolog": "^1.6|^2.0|^3.0",
"phpbench/phpbench": "^1.0",
"phpstan/phpstan": "^1.3",
"phpunit/phpunit": "^8.5|^9.6",
"vimeo/psalm": "^4.17"
},
"suggest": {
"monolog/monolog": "Allow sending log messages to Sentry by using the included Monolog handler."
},
"type": "library",
"autoload": {
"files": [
"src/functions.php"
],
"psr-4": {
"Sentry\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Sentry",
"email": "accounts@sentry.io"
}
],
"description": "PHP SDK for Sentry (http://sentry.io)",
"homepage": "http://sentry.io",
"keywords": [
"crash-reporting",
"crash-reports",
"error-handler",
"error-monitoring",
"log",
"logging",
"profiling",
"sentry",
"tracing"
],
"support": {
"issues": "https://github.com/getsentry/sentry-php/issues",
"source": "https://github.com/getsentry/sentry-php/tree/4.18.0"
},
"funding": [
{
"url": "https://sentry.io/",
"type": "custom"
},
{
"url": "https://sentry.io/pricing/",
"type": "custom"
}
],
"time": "2025-11-05T14:37:07+00:00"
},
{
"name": "sentry/sentry-laravel",
"version": "4.18.0",
"source": {
"type": "git",
"url": "https://github.com/getsentry/sentry-laravel.git",
"reference": "b9a647f93f9a040eaf6f21d0684f2351310d3360"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/getsentry/sentry-laravel/zipball/b9a647f93f9a040eaf6f21d0684f2351310d3360",
"reference": "b9a647f93f9a040eaf6f21d0684f2351310d3360",
"shasum": ""
},
"require": {
"illuminate/support": "^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0 | ^11.0 | ^12.0",
"nyholm/psr7": "^1.0",
"php": "^7.2 | ^8.0",
"sentry/sentry": "^4.16.0",
"symfony/psr-http-message-bridge": "^1.0 | ^2.0 | ^6.0 | ^7.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.11",
"guzzlehttp/guzzle": "^7.2",
"laravel/folio": "^1.1",
"laravel/framework": "^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0 | ^11.0 | ^12.0",
"livewire/livewire": "^2.0 | ^3.0",
"mockery/mockery": "^1.3",
"orchestra/testbench": "^4.7 | ^5.1 | ^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^8.4 | ^9.3 | ^10.4 | ^11.5"
},
"type": "library",
"extra": {
"laravel": {
"aliases": {
"Sentry": "Sentry\\Laravel\\Facade"
},
"providers": [
"Sentry\\Laravel\\ServiceProvider",
"Sentry\\Laravel\\Tracing\\ServiceProvider"
]
}
},
"autoload": {
"psr-0": {
"Sentry\\Laravel\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Sentry",
"email": "accounts@sentry.io"
}
],
"description": "Laravel SDK for Sentry (https://sentry.io)",
"homepage": "https://sentry.io",
"keywords": [
"crash-reporting",
"crash-reports",
"error-handler",
"error-monitoring",
"laravel",
"log",
"logging",
"profiling",
"sentry",
"tracing"
],
"support": {
"issues": "https://github.com/getsentry/sentry-laravel/issues",
"source": "https://github.com/getsentry/sentry-laravel/tree/4.18.0"
},
"funding": [
{
"url": "https://sentry.io/",
"type": "custom"
},
{
"url": "https://sentry.io/pricing/",
"type": "custom"
}
],
"time": "2025-10-20T12:57:51+00:00"
},
{ {
"name": "spatie/backtrace", "name": "spatie/backtrace",
"version": "1.8.1", "version": "1.8.1",
@@ -10493,21 +10730,22 @@
}, },
{ {
"name": "driftingly/rector-laravel", "name": "driftingly/rector-laravel",
"version": "2.1.2", "version": "2.1.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/driftingly/rector-laravel.git", "url": "https://github.com/driftingly/rector-laravel.git",
"reference": "d7cd932cff9e398a43393f1a1a63b27d574e35ef" "reference": "2f1e9c3997bf45592d58916f0cedd775e844b9c6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/driftingly/rector-laravel/zipball/d7cd932cff9e398a43393f1a1a63b27d574e35ef", "url": "https://api.github.com/repos/driftingly/rector-laravel/zipball/2f1e9c3997bf45592d58916f0cedd775e844b9c6",
"reference": "d7cd932cff9e398a43393f1a1a63b27d574e35ef", "reference": "2f1e9c3997bf45592d58916f0cedd775e844b9c6",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.4 || ^8.0", "php": "^7.4 || ^8.0",
"rector/rector": "^2.2.7" "rector/rector": "^2.2.7",
"webmozart/assert": "^1.11"
}, },
"type": "rector-extension", "type": "rector-extension",
"autoload": { "autoload": {
@@ -10522,9 +10760,9 @@
"description": "Rector upgrades rules for Laravel Framework", "description": "Rector upgrades rules for Laravel Framework",
"support": { "support": {
"issues": "https://github.com/driftingly/rector-laravel/issues", "issues": "https://github.com/driftingly/rector-laravel/issues",
"source": "https://github.com/driftingly/rector-laravel/tree/2.1.2" "source": "https://github.com/driftingly/rector-laravel/tree/2.1.3"
}, },
"time": "2025-10-31T21:56:58+00:00" "time": "2025-11-04T18:32:57+00:00"
}, },
{ {
"name": "fakerphp/faker", "name": "fakerphp/faker",
@@ -10683,16 +10921,16 @@
}, },
{ {
"name": "larastan/larastan", "name": "larastan/larastan",
"version": "v3.7.2", "version": "v3.8.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/larastan/larastan.git", "url": "https://github.com/larastan/larastan.git",
"reference": "a761859a7487bd7d0cb8b662a7538a234d5bb5ae" "reference": "d13ef96d652d1b2a8f34f1760ba6bf5b9c98112e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/larastan/larastan/zipball/a761859a7487bd7d0cb8b662a7538a234d5bb5ae", "url": "https://api.github.com/repos/larastan/larastan/zipball/d13ef96d652d1b2a8f34f1760ba6bf5b9c98112e",
"reference": "a761859a7487bd7d0cb8b662a7538a234d5bb5ae", "reference": "d13ef96d652d1b2a8f34f1760ba6bf5b9c98112e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -10706,7 +10944,7 @@
"illuminate/pipeline": "^11.44.2 || ^12.4.1", "illuminate/pipeline": "^11.44.2 || ^12.4.1",
"illuminate/support": "^11.44.2 || ^12.4.1", "illuminate/support": "^11.44.2 || ^12.4.1",
"php": "^8.2", "php": "^8.2",
"phpstan/phpstan": "^2.1.28" "phpstan/phpstan": "^2.1.29"
}, },
"require-dev": { "require-dev": {
"doctrine/coding-standard": "^13", "doctrine/coding-standard": "^13",
@@ -10719,7 +10957,8 @@
"phpunit/phpunit": "^10.5.35 || ^11.5.15" "phpunit/phpunit": "^10.5.35 || ^11.5.15"
}, },
"suggest": { "suggest": {
"orchestra/testbench": "Using Larastan for analysing a package needs Testbench" "orchestra/testbench": "Using Larastan for analysing a package needs Testbench",
"phpmyadmin/sql-parser": "Install to enable Larastan's optional phpMyAdmin-based SQL parser automatically"
}, },
"type": "phpstan-extension", "type": "phpstan-extension",
"extra": { "extra": {
@@ -10760,7 +10999,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/larastan/larastan/issues", "issues": "https://github.com/larastan/larastan/issues",
"source": "https://github.com/larastan/larastan/tree/v3.7.2" "source": "https://github.com/larastan/larastan/tree/v3.8.0"
}, },
"funding": [ "funding": [
{ {
@@ -10768,7 +11007,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2025-09-19T09:03:05+00:00" "time": "2025-10-27T23:09:14+00:00"
}, },
{ {
"name": "laravel-json-api/testing", "name": "laravel-json-api/testing",
@@ -12978,6 +13217,64 @@
} }
], ],
"time": "2024-03-03T12:36:25+00:00" "time": "2024-03-03T12:36:25+00:00"
},
{
"name": "webmozart/assert",
"version": "1.12.1",
"source": {
"type": "git",
"url": "https://github.com/webmozarts/assert.git",
"reference": "9be6926d8b485f55b9229203f962b51ed377ba68"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webmozarts/assert/zipball/9be6926d8b485f55b9229203f962b51ed377ba68",
"reference": "9be6926d8b485f55b9229203f962b51ed377ba68",
"shasum": ""
},
"require": {
"ext-ctype": "*",
"ext-date": "*",
"ext-filter": "*",
"php": "^7.2 || ^8.0"
},
"suggest": {
"ext-intl": "",
"ext-simplexml": "",
"ext-spl": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.10-dev"
}
},
"autoload": {
"psr-4": {
"Webmozart\\Assert\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Bernhard Schussek",
"email": "bschussek@gmail.com"
}
],
"description": "Assertions to validate method input/output with nice error messages.",
"keywords": [
"assert",
"check",
"validate"
],
"support": {
"issues": "https://github.com/webmozarts/assert/issues",
"source": "https://github.com/webmozarts/assert/tree/1.12.1"
},
"time": "2025-10-29T15:56:20+00:00"
} }
], ],
"aliases": [], "aliases": [],

View File

@@ -64,12 +64,12 @@ use FireflyIII\TransactionRules\Actions\UpdatePiggyBank;
return [ return [
// default values for certain things: // default values for certain things:
'configuration' => [ 'configuration' => [
'single_user_mode' => true, 'single_user_mode' => true,
'is_demo_site' => false, 'is_demo_site' => false,
], ],
// some feature flags: // some feature flags:
'feature_flags' => [ 'feature_flags' => [
'export' => true, 'export' => true,
'telemetry' => false, 'telemetry' => false,
'webhooks' => true, 'webhooks' => true,
@@ -78,47 +78,48 @@ return [
'running_balance_column' => env('USE_RUNNING_BALANCE', false), 'running_balance_column' => env('USE_RUNNING_BALANCE', false),
// see cer.php for exchange rates feature flag. // see cer.php for exchange rates feature flag.
], ],
'version' => 'develop/2025-11-02', 'version' => 'develop/2025-11-06',
'build_time' => 1762056298, 'build_time' => 1762406472,
'api_version' => '2.1.0', // field is no longer used. 'api_version' => '2.1.0', // field is no longer used.
'db_version' => 28, // field is no longer used. 'db_version' => 28, // field is no longer used.
// generic settings // generic settings
'maxUploadSize' => 1073741824, // 1 GB 'maxUploadSize' => 1073741824, // 1 GB
'send_error_message' => env('SEND_ERROR_MESSAGE', true), 'send_error_message' => env('SEND_ERROR_MESSAGE', true),
'site_owner' => env('SITE_OWNER', ''), 'site_owner' => env('SITE_OWNER', ''),
// tokens and keys // tokens and keys
'fixer_api_key' => env('FIXER_API_KEY', ''), 'fixer_api_key' => env('FIXER_API_KEY', ''),
'ipinfo_token' => env('IPINFO_TOKEN', ''), 'ipinfo_token' => env('IPINFO_TOKEN', ''),
'static_cron_token' => envNonEmpty('STATIC_CRON_TOKEN'), 'static_cron_token' => envNonEmpty('STATIC_CRON_TOKEN'),
// flags // flags
'enable_external_map' => env('ENABLE_EXTERNAL_MAP', false), 'enable_external_map' => env('ENABLE_EXTERNAL_MAP', false),
'disable_frame_header' => env('DISABLE_FRAME_HEADER', false), 'disable_frame_header' => env('DISABLE_FRAME_HEADER', false),
'disable_csp_header' => env('DISABLE_CSP_HEADER', false), 'disable_csp_header' => env('DISABLE_CSP_HEADER', false),
'allow_webhooks' => env('ALLOW_WEBHOOKS', false), 'allow_webhooks' => env('ALLOW_WEBHOOKS', false),
// flags // flags
'send_report_journals' => envNonEmpty('SEND_REPORT_JOURNALS', true), 'send_report_journals' => envNonEmpty('SEND_REPORT_JOURNALS', true),
// info for demo site // info for demo site
'demo_username' => env('DEMO_USERNAME', ''), 'demo_username' => env('DEMO_USERNAME', ''),
'demo_password' => env('DEMO_PASSWORD', ''), 'demo_password' => env('DEMO_PASSWORD', ''),
'tracker_site_id' => env('TRACKER_SITE_ID', ''), 'tracker_site_id' => env('TRACKER_SITE_ID', ''),
'tracker_url' => env('TRACKER_URL', ''), 'tracker_url' => env('TRACKER_URL', ''),
'report_errors_online' => env('REPORT_ERRORS_ONLINE', false),
// authentication settings // authentication settings
'authentication_guard' => envNonEmpty('AUTHENTICATION_GUARD', 'web'), 'authentication_guard' => envNonEmpty('AUTHENTICATION_GUARD', 'web'),
'custom_logout_url' => envNonEmpty('CUSTOM_LOGOUT_URL', ''), 'custom_logout_url' => envNonEmpty('CUSTOM_LOGOUT_URL', ''),
// static config (cannot be changed by user) // static config (cannot be changed by user)
'update_endpoint' => 'https://version.firefly-iii.org/index.json', 'update_endpoint' => 'https://version.firefly-iii.org/index.json',
'update_minimum_age' => 7, 'update_minimum_age' => 7,
// enabled languages // enabled languages
'languages' => [ 'languages' => [
// currently enabled languages // currently enabled languages
// 'af_ZA' => ['name_locale' => 'Afrikaans', 'name_english' => 'Afrikaans'], // 'af_ZA' => ['name_locale' => 'Afrikaans', 'name_english' => 'Afrikaans'],
'ar_SA' => ['name_locale' => 'العربية', 'name_english' => 'Arabic'], 'ar_SA' => ['name_locale' => 'العربية', 'name_english' => 'Arabic'],
@@ -166,22 +167,22 @@ return [
], ],
// web configuration: // web configuration:
'trusted_proxies' => env('TRUSTED_PROXIES', ''), 'trusted_proxies' => env('TRUSTED_PROXIES', ''),
// map configuration // map configuration
'default_location' => [ 'default_location' => [
'longitude' => env('MAP_DEFAULT_LONG', '5.916667'), 'longitude' => env('MAP_DEFAULT_LONG', '5.916667'),
'latitude' => env('MAP_DEFAULT_LAT', '51.983333'), 'latitude' => env('MAP_DEFAULT_LAT', '51.983333'),
'zoom_level' => env('MAP_DEFAULT_ZOOM', '6'), 'zoom_level' => env('MAP_DEFAULT_ZOOM', '6'),
], ],
// administration specific preferences // administration specific preferences
'admin_specific_prefs' => [], 'admin_specific_prefs' => [],
// default user-related values // default user-related values
'darkMode' => 'browser', 'darkMode' => 'browser',
'list_length' => 10, // to be removed if v1 is cancelled. 'list_length' => 10, // to be removed if v1 is cancelled.
'default_preferences' => [ 'default_preferences' => [
'anonymous' => false, 'anonymous' => false,
'frontpageAccounts' => [], 'frontpageAccounts' => [],
'listPageSize' => 50, 'listPageSize' => 50,
@@ -190,12 +191,12 @@ return [
'locale' => 'equal', 'locale' => 'equal',
'convertToPrimary' => false, 'convertToPrimary' => false,
], ],
'default_currency' => 'EUR', 'default_currency' => 'EUR',
'default_language' => envNonEmpty('DEFAULT_LANGUAGE', 'en_US'), 'default_language' => envNonEmpty('DEFAULT_LANGUAGE', 'en_US'),
'default_locale' => envNonEmpty('DEFAULT_LOCALE', 'equal'), 'default_locale' => envNonEmpty('DEFAULT_LOCALE', 'equal'),
// account types that may have or set a currency // account types that may have or set a currency
'valid_currency_account_types' => [ 'valid_currency_account_types' => [
AccountTypeEnum::ASSET->value, AccountTypeEnum::ASSET->value,
AccountTypeEnum::LOAN->value, AccountTypeEnum::LOAN->value,
AccountTypeEnum::DEBT->value, AccountTypeEnum::DEBT->value,
@@ -207,7 +208,7 @@ return [
], ],
// "value must be in this list" values // "value must be in this list" values
'valid_attachment_models' => [ 'valid_attachment_models' => [
Account::class, Account::class,
Bill::class, Bill::class,
Budget::class, Budget::class,
@@ -218,11 +219,11 @@ return [
TransactionJournal::class, TransactionJournal::class,
Recurrence::class, Recurrence::class,
], ],
'available_dark_modes' => ['light', 'dark', 'browser'], 'available_dark_modes' => ['light', 'dark', 'browser'],
'bill_reminder_periods' => [90, 30, 14, 7, 0], 'bill_reminder_periods' => [90, 30, 14, 7, 0],
'valid_view_ranges' => ['1D', '1W', '1M', '3M', '6M', '1Y'], 'valid_view_ranges' => ['1D', '1W', '1M', '3M', '6M', '1Y'],
'valid_url_protocols' => envNonEmpty('VALID_URL_PROTOCOLS', 'http,https,ftp,ftps,mailto'), 'valid_url_protocols' => envNonEmpty('VALID_URL_PROTOCOLS', 'http,https,ftp,ftps,mailto'),
'allowedMimes' => [ 'allowedMimes' => [
// plain files // plain files
'text/plain', 'text/plain',
'text/html', 'text/html',
@@ -302,17 +303,17 @@ return [
// JSON // JSON
'application/json', 'application/json',
], ],
'accountRoles' => ['defaultAsset', 'sharedAsset', 'savingAsset', 'ccAsset', 'cashWalletAsset'], 'accountRoles' => ['defaultAsset', 'sharedAsset', 'savingAsset', 'ccAsset', 'cashWalletAsset'],
'valid_liabilities' => [AccountTypeEnum::DEBT->value, AccountTypeEnum::LOAN->value, AccountTypeEnum::MORTGAGE->value], 'valid_liabilities' => [AccountTypeEnum::DEBT->value, AccountTypeEnum::LOAN->value, AccountTypeEnum::MORTGAGE->value],
'ccTypes' => ['monthlyFull' => 'Full payment every month'], 'ccTypes' => ['monthlyFull' => 'Full payment every month'],
'credit_card_types' => ['monthlyFull'], 'credit_card_types' => ['monthlyFull'],
// "period must be in this list" values // "period must be in this list" values
'bill_periods' => ['daily', 'weekly', 'monthly', 'quarterly', 'half-year', 'yearly'], 'bill_periods' => ['daily', 'weekly', 'monthly', 'quarterly', 'half-year', 'yearly'],
'interest_periods' => ['daily', 'weekly', 'monthly', 'quarterly', 'half-year', 'yearly'], 'interest_periods' => ['daily', 'weekly', 'monthly', 'quarterly', 'half-year', 'yearly'],
// settings to translate X to Y // settings to translate X to Y
'range_to_repeat_freq' => [ 'range_to_repeat_freq' => [
'1D' => 'weekly', '1D' => 'weekly',
'1W' => 'weekly', '1W' => 'weekly',
'1M' => 'monthly', '1M' => 'monthly',
@@ -321,7 +322,7 @@ return [
'1Y' => 'yearly', '1Y' => 'yearly',
'custom' => 'custom', 'custom' => 'custom',
], ],
'subTitlesByIdentifier' => [ 'subTitlesByIdentifier' => [
'asset' => 'Asset accounts', 'asset' => 'Asset accounts',
'expense' => 'Expense accounts', 'expense' => 'Expense accounts',
'revenue' => 'Revenue accounts', 'revenue' => 'Revenue accounts',
@@ -329,7 +330,7 @@ return [
'liabilities' => 'Liabilities', 'liabilities' => 'Liabilities',
'liability' => 'Liabilities', 'liability' => 'Liabilities',
], ],
'subIconsByIdentifier' => [ 'subIconsByIdentifier' => [
'asset' => 'fa-money', 'asset' => 'fa-money',
AccountTypeEnum::ASSET->value => 'fa-money', AccountTypeEnum::ASSET->value => 'fa-money',
AccountTypeEnum::DEFAULT->value => 'fa-money', AccountTypeEnum::DEFAULT->value => 'fa-money',
@@ -343,14 +344,14 @@ return [
AccountTypeEnum::IMPORT->value => 'fa-download', AccountTypeEnum::IMPORT->value => 'fa-download',
'liabilities' => 'fa-ticket', 'liabilities' => 'fa-ticket',
], ],
'accountTypesByIdentifier' => [ 'accountTypesByIdentifier' => [
'asset' => [AccountTypeEnum::DEFAULT->value, AccountTypeEnum::ASSET->value], 'asset' => [AccountTypeEnum::DEFAULT->value, AccountTypeEnum::ASSET->value],
'expense' => [AccountTypeEnum::EXPENSE->value, AccountTypeEnum::BENEFICIARY->value], 'expense' => [AccountTypeEnum::EXPENSE->value, AccountTypeEnum::BENEFICIARY->value],
'revenue' => [AccountTypeEnum::REVENUE->value], 'revenue' => [AccountTypeEnum::REVENUE->value],
'import' => [AccountTypeEnum::IMPORT->value], 'import' => [AccountTypeEnum::IMPORT->value],
'liabilities' => [AccountTypeEnum::LOAN->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::CREDITCARD->value, AccountTypeEnum::MORTGAGE->value], 'liabilities' => [AccountTypeEnum::LOAN->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::CREDITCARD->value, AccountTypeEnum::MORTGAGE->value],
], ],
'accountTypeByIdentifier' => [ 'accountTypeByIdentifier' => [
'asset' => [AccountTypeEnum::ASSET->value], 'asset' => [AccountTypeEnum::ASSET->value],
'expense' => [AccountTypeEnum::EXPENSE->value], 'expense' => [AccountTypeEnum::EXPENSE->value],
'revenue' => [AccountTypeEnum::REVENUE->value], 'revenue' => [AccountTypeEnum::REVENUE->value],
@@ -364,7 +365,7 @@ return [
'liabilities' => [AccountTypeEnum::LOAN->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::MORTGAGE->value, AccountTypeEnum::CREDITCARD->value], 'liabilities' => [AccountTypeEnum::LOAN->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::MORTGAGE->value, AccountTypeEnum::CREDITCARD->value],
'liability' => [AccountTypeEnum::LOAN->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::MORTGAGE->value, AccountTypeEnum::CREDITCARD->value], 'liability' => [AccountTypeEnum::LOAN->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::MORTGAGE->value, AccountTypeEnum::CREDITCARD->value],
], ],
'shortNamesByFullName' => [ 'shortNamesByFullName' => [
AccountTypeEnum::DEFAULT->value => 'asset', AccountTypeEnum::DEFAULT->value => 'asset',
AccountTypeEnum::ASSET->value => 'asset', AccountTypeEnum::ASSET->value => 'asset',
AccountTypeEnum::IMPORT->value => 'import', AccountTypeEnum::IMPORT->value => 'import',
@@ -379,13 +380,13 @@ return [
AccountTypeEnum::DEBT->value => 'liabilities', AccountTypeEnum::DEBT->value => 'liabilities',
AccountTypeEnum::MORTGAGE->value => 'liabilities', AccountTypeEnum::MORTGAGE->value => 'liabilities',
], ],
'shortLiabilityNameByFullName' => [ 'shortLiabilityNameByFullName' => [
AccountTypeEnum::CREDITCARD->value => 'creditcard', AccountTypeEnum::CREDITCARD->value => 'creditcard',
AccountTypeEnum::LOAN->value => AccountTypeEnum::LOAN->value, AccountTypeEnum::LOAN->value => AccountTypeEnum::LOAN->value,
AccountTypeEnum::DEBT->value => AccountTypeEnum::DEBT->value, AccountTypeEnum::DEBT->value => AccountTypeEnum::DEBT->value,
AccountTypeEnum::MORTGAGE->value => AccountTypeEnum::MORTGAGE->value, AccountTypeEnum::MORTGAGE->value => AccountTypeEnum::MORTGAGE->value,
], ],
'transactionTypesByType' => [ 'transactionTypesByType' => [
'expenses' => ['Withdrawal'], 'expenses' => ['Withdrawal'],
'withdrawal' => ['Withdrawal'], 'withdrawal' => ['Withdrawal'],
'revenue' => ['Deposit'], 'revenue' => ['Deposit'],
@@ -393,14 +394,14 @@ return [
'transfer' => ['Transfer'], 'transfer' => ['Transfer'],
'transfers' => ['Transfer'], 'transfers' => ['Transfer'],
], ],
'transactionTypesToShort' => [ 'transactionTypesToShort' => [
'Withdrawal' => 'withdrawal', 'Withdrawal' => 'withdrawal',
'Deposit' => 'deposit', 'Deposit' => 'deposit',
'Transfer' => 'transfer', 'Transfer' => 'transfer',
'Opening balance' => 'opening-balance', 'Opening balance' => 'opening-balance',
'Reconciliation' => 'reconciliation', 'Reconciliation' => 'reconciliation',
], ],
'transactionIconsByType' => [ 'transactionIconsByType' => [
'expenses' => 'fa-long-arrow-left', 'expenses' => 'fa-long-arrow-left',
'withdrawal' => 'fa-long-arrow-left', 'withdrawal' => 'fa-long-arrow-left',
'revenue' => 'fa-long-arrow-right', 'revenue' => 'fa-long-arrow-right',
@@ -410,7 +411,7 @@ return [
], ],
'rule-actions' => [ 'rule-actions' => [
'set_category' => SetCategory::class, 'set_category' => SetCategory::class,
'clear_category' => ClearCategory::class, 'clear_category' => ClearCategory::class,
'set_budget' => SetBudget::class, 'set_budget' => SetBudget::class,
@@ -444,7 +445,7 @@ return [
// 'set_foreign_amount' => SetForeignAmount::class, // 'set_foreign_amount' => SetForeignAmount::class,
// 'set_foreign_currency' => SetForeignCurrency::class, // 'set_foreign_currency' => SetForeignCurrency::class,
], ],
'context-rule-actions' => [ 'context-rule-actions' => [
'set_category', 'set_category',
'set_budget', 'set_budget',
'add_tag', 'add_tag',
@@ -463,13 +464,13 @@ return [
'convert_transfer', 'convert_transfer',
], ],
'test-triggers' => [ 'test-triggers' => [
'limit' => 10, 'limit' => 10,
'range' => 200, 'range' => 200,
], ],
// expected source types for each transaction type, in order of preference. // expected source types for each transaction type, in order of preference.
'expected_source_types' => [ 'expected_source_types' => [
'source' => [ 'source' => [
TransactionTypeEnum::WITHDRAWAL->value => [AccountTypeEnum::ASSET->value, AccountTypeEnum::LOAN->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::MORTGAGE->value], TransactionTypeEnum::WITHDRAWAL->value => [AccountTypeEnum::ASSET->value, AccountTypeEnum::LOAN->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::MORTGAGE->value],
TransactionTypeEnum::DEPOSIT->value => [AccountTypeEnum::LOAN->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::MORTGAGE->value, AccountTypeEnum::REVENUE->value, AccountTypeEnum::CASH->value], TransactionTypeEnum::DEPOSIT->value => [AccountTypeEnum::LOAN->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::MORTGAGE->value, AccountTypeEnum::REVENUE->value, AccountTypeEnum::CASH->value],
@@ -514,7 +515,7 @@ return [
TransactionTypeEnum::LIABILITY_CREDIT->value => [AccountTypeEnum::LIABILITY_CREDIT->value, AccountTypeEnum::LOAN->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::MORTGAGE->value], TransactionTypeEnum::LIABILITY_CREDIT->value => [AccountTypeEnum::LIABILITY_CREDIT->value, AccountTypeEnum::LOAN->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::MORTGAGE->value],
], ],
], ],
'allowed_opposing_types' => [ 'allowed_opposing_types' => [
'source' => [ 'source' => [
AccountTypeEnum::ASSET->value => [ AccountTypeEnum::ASSET->value => [
AccountTypeEnum::ASSET->value, AccountTypeEnum::ASSET->value,
@@ -604,7 +605,7 @@ return [
], ],
], ],
// depending on the account type, return the allowed transaction types: // depending on the account type, return the allowed transaction types:
'allowed_transaction_types' => [ 'allowed_transaction_types' => [
'source' => [ 'source' => [
AccountTypeEnum::ASSET->value => [ AccountTypeEnum::ASSET->value => [
TransactionTypeEnum::WITHDRAWAL->value, TransactionTypeEnum::WITHDRAWAL->value,
@@ -673,7 +674,7 @@ return [
], ],
// having the source + dest will tell you the transaction type. // having the source + dest will tell you the transaction type.
'account_to_transaction' => [ 'account_to_transaction' => [
AccountTypeEnum::ASSET->value => [ AccountTypeEnum::ASSET->value => [
AccountTypeEnum::ASSET->value => TransactionTypeEnum::TRANSFER->value, AccountTypeEnum::ASSET->value => TransactionTypeEnum::TRANSFER->value,
AccountTypeEnum::CASH->value => TransactionTypeEnum::WITHDRAWAL->value, AccountTypeEnum::CASH->value => TransactionTypeEnum::WITHDRAWAL->value,
@@ -738,7 +739,7 @@ return [
], ],
// allowed source -> destination accounts. // allowed source -> destination accounts.
'source_dests' => [ 'source_dests' => [
TransactionTypeEnum::WITHDRAWAL->value => [ TransactionTypeEnum::WITHDRAWAL->value => [
AccountTypeEnum::ASSET->value => [AccountTypeEnum::EXPENSE->value, AccountTypeEnum::LOAN->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::MORTGAGE->value, AccountTypeEnum::CASH->value], AccountTypeEnum::ASSET->value => [AccountTypeEnum::EXPENSE->value, AccountTypeEnum::LOAN->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::MORTGAGE->value, AccountTypeEnum::CASH->value],
AccountTypeEnum::LOAN->value => [AccountTypeEnum::EXPENSE->value, AccountTypeEnum::CASH->value], AccountTypeEnum::LOAN->value => [AccountTypeEnum::EXPENSE->value, AccountTypeEnum::CASH->value],
@@ -777,7 +778,7 @@ return [
], ],
], ],
// if you add fields to this array, don't forget to update the export routine (ExportDataGenerator). // if you add fields to this array, don't forget to update the export routine (ExportDataGenerator).
'journal_meta_fields' => [ 'journal_meta_fields' => [
// sepa // sepa
'sepa_cc', 'sepa_cc',
'sepa_ct_op', 'sepa_ct_op',
@@ -811,26 +812,26 @@ return [
'recurrence_count', 'recurrence_count',
'recurrence_date', 'recurrence_date',
], ],
'webhooks' => [ 'webhooks' => [
'max_attempts' => env('WEBHOOK_MAX_ATTEMPTS', 3), 'max_attempts' => env('WEBHOOK_MAX_ATTEMPTS', 3),
], ],
'can_have_virtual_amounts' => [AccountTypeEnum::ASSET->value], 'can_have_virtual_amounts' => [AccountTypeEnum::ASSET->value],
'can_have_opening_balance' => [AccountTypeEnum::ASSET->value, AccountTypeEnum::LOAN->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::MORTGAGE->value], 'can_have_opening_balance' => [AccountTypeEnum::ASSET->value, AccountTypeEnum::LOAN->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::MORTGAGE->value],
'dynamic_creation_allowed' => [ 'dynamic_creation_allowed' => [
AccountTypeEnum::EXPENSE->value, AccountTypeEnum::EXPENSE->value,
AccountTypeEnum::REVENUE->value, AccountTypeEnum::REVENUE->value,
AccountTypeEnum::INITIAL_BALANCE->value, AccountTypeEnum::INITIAL_BALANCE->value,
AccountTypeEnum::RECONCILIATION->value, AccountTypeEnum::RECONCILIATION->value,
AccountTypeEnum::LIABILITY_CREDIT->value, AccountTypeEnum::LIABILITY_CREDIT->value,
], ],
'valid_asset_fields' => ['account_role', 'account_number', 'currency_id', 'BIC', 'include_net_worth'], 'valid_asset_fields' => ['account_role', 'account_number', 'currency_id', 'BIC', 'include_net_worth'],
'valid_cc_fields' => ['account_role', 'cc_monthly_payment_date', 'cc_type', 'account_number', 'currency_id', 'BIC', 'include_net_worth'], 'valid_cc_fields' => ['account_role', 'cc_monthly_payment_date', 'cc_type', 'account_number', 'currency_id', 'BIC', 'include_net_worth'],
'valid_account_fields' => ['account_number', 'currency_id', 'BIC', 'interest', 'interest_period', 'include_net_worth', 'liability_direction'], 'valid_account_fields' => ['account_number', 'currency_id', 'BIC', 'interest', 'interest_period', 'include_net_worth', 'liability_direction'],
// dynamic date ranges are as follows: // dynamic date ranges are as follows:
'dynamic_date_ranges' => ['last7', 'last30', 'last90', 'last365', 'MTD', 'QTD', 'YTD'], 'dynamic_date_ranges' => ['last7', 'last30', 'last90', 'last365', 'MTD', 'QTD', 'YTD'],
'allowed_sort_parameters' => [ 'allowed_sort_parameters' => [
'Account' => ['id', 'order', 'name', 'iban', 'active', 'account_type_id', 'Account' => ['id', 'order', 'name', 'iban', 'active', 'account_type_id',
'current_balance', 'current_balance',
'pc_current_balance', 'pc_current_balance',
@@ -844,14 +845,14 @@ return [
'pc_balance_difference', 'pc_balance_difference',
], ],
], ],
'allowed_db_sort_parameters' => [ 'allowed_db_sort_parameters' => [
'Account' => ['id', 'order', 'name', 'iban', 'active', 'account_type_id'], 'Account' => ['id', 'order', 'name', 'iban', 'active', 'account_type_id'],
], ],
// preselected account lists possibilities: // preselected account lists possibilities:
'preselected_accounts' => ['all', 'assets', 'liabilities'], 'preselected_accounts' => ['all', 'assets', 'liabilities'],
// allowed to store a piggy bank in: // allowed to store a piggy bank in:
'piggy_bank_account_types' => [AccountTypeEnum::ASSET->value, AccountTypeEnum::LOAN->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::MORTGAGE->value], 'piggy_bank_account_types' => [AccountTypeEnum::ASSET->value, AccountTypeEnum::LOAN->value, AccountTypeEnum::DEBT->value, AccountTypeEnum::MORTGAGE->value],
]; ];

130
config/sentry.php Normal file
View File

@@ -0,0 +1,130 @@
<?php
declare(strict_types=1);
use Illuminate\Auth\AuthenticationException;
/*
* Sentry Laravel SDK configuration file.
*
* @see https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/
*/
return [
'dsn' => 'https://cf9d7aea92537db1e97e3e758b88b0a3@o4510302583848960.ingest.de.sentry.io/4510302585290832',
'release' => env('SENTRY_RELEASE'),
// When left empty or `null` the Laravel environment will be used (usually discovered from `APP_ENV` in your `.env`)
'environment' => env('SENTRY_ENVIRONMENT'),
// @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#sample_rate
'sample_rate' => null === env('SENTRY_SAMPLE_RATE') ? 1.0 : (float)env('SENTRY_SAMPLE_RATE'),
// @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#traces_sample_rate
'traces_sample_rate' => null === env('SENTRY_TRACES_SAMPLE_RATE') ? null : (float)env('SENTRY_TRACES_SAMPLE_RATE'),
// @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#profiles-sample-rate
'profiles_sample_rate' => null === env('SENTRY_PROFILES_SAMPLE_RATE') ? null : (float)env('SENTRY_PROFILES_SAMPLE_RATE'),
// @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#enable_logs
'enable_logs' => env('SENTRY_ENABLE_LOGS', false),
// The minimum log level that will be sent to Sentry as logs using the `sentry_logs` logging channel
'logs_channel_level' => env('SENTRY_LOG_LEVEL', env('SENTRY_LOGS_LEVEL', env('LOG_LEVEL', 'debug'))),
// @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#send_default_pii
'send_default_pii' => env('SENTRY_SEND_DEFAULT_PII', false),
// @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#ignore_exceptions
'ignore_exceptions' => [
AuthenticationException::class,
],
// @see: https://docs.sentry.io/platforms/php/guides/laravel/configuration/options/#ignore_transactions
'ignore_transactions' => [
// Ignore Laravel's default health URL
'/up',
],
// Breadcrumb specific configuration
'breadcrumbs' => [
// Capture Laravel logs as breadcrumbs
'logs' => env('SENTRY_BREADCRUMBS_LOGS_ENABLED', true),
// Capture Laravel cache events (hits, writes etc.) as breadcrumbs
'cache' => env('SENTRY_BREADCRUMBS_CACHE_ENABLED', true),
// Capture Livewire components like routes as breadcrumbs
'livewire' => env('SENTRY_BREADCRUMBS_LIVEWIRE_ENABLED', true),
// Capture SQL queries as breadcrumbs
'sql_queries' => env('SENTRY_BREADCRUMBS_SQL_QUERIES_ENABLED', true),
// Capture SQL query bindings (parameters) in SQL query breadcrumbs
'sql_bindings' => env('SENTRY_BREADCRUMBS_SQL_BINDINGS_ENABLED', false),
// Capture queue job information as breadcrumbs
'queue_info' => env('SENTRY_BREADCRUMBS_QUEUE_INFO_ENABLED', true),
// Capture command information as breadcrumbs
'command_info' => env('SENTRY_BREADCRUMBS_COMMAND_JOBS_ENABLED', true),
// Capture HTTP client request information as breadcrumbs
'http_client_requests' => env('SENTRY_BREADCRUMBS_HTTP_CLIENT_REQUESTS_ENABLED', true),
// Capture send notifications as breadcrumbs
'notifications' => env('SENTRY_BREADCRUMBS_NOTIFICATIONS_ENABLED', true),
],
// Performance monitoring specific configuration
'tracing' => [
// Trace queue jobs as their own transactions (this enables tracing for queue jobs)
'queue_job_transactions' => env('SENTRY_TRACE_QUEUE_ENABLED', true),
// Capture queue jobs as spans when executed on the sync driver
'queue_jobs' => env('SENTRY_TRACE_QUEUE_JOBS_ENABLED', true),
// Capture SQL queries as spans
'sql_queries' => env('SENTRY_TRACE_SQL_QUERIES_ENABLED', true),
// Capture SQL query bindings (parameters) in SQL query spans
'sql_bindings' => env('SENTRY_TRACE_SQL_BINDINGS_ENABLED', false),
// Capture where the SQL query originated from on the SQL query spans
'sql_origin' => env('SENTRY_TRACE_SQL_ORIGIN_ENABLED', true),
// Define a threshold in milliseconds for SQL queries to resolve their origin
'sql_origin_threshold_ms' => env('SENTRY_TRACE_SQL_ORIGIN_THRESHOLD_MS', 100),
// Capture views rendered as spans
'views' => env('SENTRY_TRACE_VIEWS_ENABLED', true),
// Capture Livewire components as spans
'livewire' => env('SENTRY_TRACE_LIVEWIRE_ENABLED', true),
// Capture HTTP client requests as spans
'http_client_requests' => env('SENTRY_TRACE_HTTP_CLIENT_REQUESTS_ENABLED', true),
// Capture Laravel cache events (hits, writes etc.) as spans
'cache' => env('SENTRY_TRACE_CACHE_ENABLED', true),
// Capture Redis operations as spans (this enables Redis events in Laravel)
'redis_commands' => env('SENTRY_TRACE_REDIS_COMMANDS', false),
// Capture where the Redis command originated from on the Redis command spans
'redis_origin' => env('SENTRY_TRACE_REDIS_ORIGIN_ENABLED', true),
// Capture send notifications as spans
'notifications' => env('SENTRY_TRACE_NOTIFICATIONS_ENABLED', true),
// Enable tracing for requests without a matching route (404's)
'missing_routes' => env('SENTRY_TRACE_MISSING_ROUTES_ENABLED', false),
// Configures if the performance trace should continue after the response has been sent to the user until the application terminates
// This is required to capture any spans that are created after the response has been sent like queue jobs dispatched using `dispatch(...)->afterResponse()` for example
'continue_after_response' => env('SENTRY_TRACE_CONTINUE_AFTER_RESPONSE', true),
// Enable the tracing integrations supplied by Sentry (recommended)
'default_integrations' => env('SENTRY_TRACE_DEFAULT_INTEGRATIONS_ENABLED', true),
],
];

102
package-lock.json generated
View File

@@ -3173,9 +3173,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "24.9.2", "version": "24.10.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.9.2.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.0.tgz",
"integrity": "sha512-uWN8YqxXxqFMX2RqGOrumsKeti4LlmIMIyV0lgut4jx7KQBcBiW6vkDtIBvHnHIquwNfJhk8v2OtmO8zXWHfPA==", "integrity": "sha512-qzQZRBqkFsYyaSWXuEHc2WR9c0a0CXwiE5FWUvn7ZM+vdy1uZLfCunD38UzhuB7YN/J11ndbDBcTmOdxJo9Q7A==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -3291,57 +3291,57 @@
} }
}, },
"node_modules/@vue/compiler-core": { "node_modules/@vue/compiler-core": {
"version": "3.5.22", "version": "3.5.23",
"resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.22.tgz", "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.23.tgz",
"integrity": "sha512-jQ0pFPmZwTEiRNSb+i9Ow/I/cHv2tXYqsnHKKyCQ08irI2kdF5qmYedmF8si8mA7zepUFmJ2hqzS8CQmNOWOkQ==", "integrity": "sha512-nW7THWj5HOp085ROk65LwaoxuzDsjIxr485F4iu63BoxsXoSqKqmsUUoP4A7Gl67DgIgi0zJ8JFgHfvny/74MA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@babel/parser": "^7.28.4", "@babel/parser": "^7.28.5",
"@vue/shared": "3.5.22", "@vue/shared": "3.5.23",
"entities": "^4.5.0", "entities": "^4.5.0",
"estree-walker": "^2.0.2", "estree-walker": "^2.0.2",
"source-map-js": "^1.2.1" "source-map-js": "^1.2.1"
} }
}, },
"node_modules/@vue/compiler-dom": { "node_modules/@vue/compiler-dom": {
"version": "3.5.22", "version": "3.5.23",
"resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.22.tgz", "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.23.tgz",
"integrity": "sha512-W8RknzUM1BLkypvdz10OVsGxnMAuSIZs9Wdx1vzA3mL5fNMN15rhrSCLiTm6blWeACwUwizzPVqGJgOGBEN/hA==", "integrity": "sha512-AT8RMw0vEzzzO0JU5gY0F6iCzaWUIh/aaRVordzMBKXRpoTllTT4kocHDssByPsvodNCfump/Lkdow2mT/O5KQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@vue/compiler-core": "3.5.22", "@vue/compiler-core": "3.5.23",
"@vue/shared": "3.5.22" "@vue/shared": "3.5.23"
} }
}, },
"node_modules/@vue/compiler-sfc": { "node_modules/@vue/compiler-sfc": {
"version": "3.5.22", "version": "3.5.23",
"resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.22.tgz", "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.23.tgz",
"integrity": "sha512-tbTR1zKGce4Lj+JLzFXDq36K4vcSZbJ1RBu8FxcDv1IGRz//Dh2EBqksyGVypz3kXpshIfWKGOCcqpSbyGWRJQ==", "integrity": "sha512-3QTEUo4qg7FtQwaDJa8ou1CUikx5WTtZlY61rRRDu3lK2ZKrGoAGG8mvDgOpDsQ4A1bez9s+WtBB6DS2KuFCPw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@babel/parser": "^7.28.4", "@babel/parser": "^7.28.5",
"@vue/compiler-core": "3.5.22", "@vue/compiler-core": "3.5.23",
"@vue/compiler-dom": "3.5.22", "@vue/compiler-dom": "3.5.23",
"@vue/compiler-ssr": "3.5.22", "@vue/compiler-ssr": "3.5.23",
"@vue/shared": "3.5.22", "@vue/shared": "3.5.23",
"estree-walker": "^2.0.2", "estree-walker": "^2.0.2",
"magic-string": "^0.30.19", "magic-string": "^0.30.21",
"postcss": "^8.5.6", "postcss": "^8.5.6",
"source-map-js": "^1.2.1" "source-map-js": "^1.2.1"
} }
}, },
"node_modules/@vue/compiler-ssr": { "node_modules/@vue/compiler-ssr": {
"version": "3.5.22", "version": "3.5.23",
"resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.22.tgz", "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.23.tgz",
"integrity": "sha512-GdgyLvg4R+7T8Nk2Mlighx7XGxq/fJf9jaVofc3IL0EPesTE86cP/8DD1lT3h1JeZr2ySBvyqKQJgbS54IX1Ww==", "integrity": "sha512-Hld2xphbMjXs9Q9WKxPf2EqmE+Rq/FEDnK/wUBtmYq74HCV4XDdSCheAaB823OQXIIFGq9ig/RbAZkF9s4U0Ow==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@vue/compiler-dom": "3.5.22", "@vue/compiler-dom": "3.5.23",
"@vue/shared": "3.5.22" "@vue/shared": "3.5.23"
} }
}, },
"node_modules/@vue/component-compiler-utils": { "node_modules/@vue/component-compiler-utils": {
@@ -3423,9 +3423,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/@vue/shared": { "node_modules/@vue/shared": {
"version": "3.5.22", "version": "3.5.23",
"resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.22.tgz", "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.23.tgz",
"integrity": "sha512-F4yc6palwq3TT0u+FYf0Ns4Tfl9GRFURDN2gWG7L1ecIaS/4fCIuFOjMTnCyjsu/OK6vaDKLCrGAa+KvvH+h4w==", "integrity": "sha512-0YZ1DYuC5o/YJPf6pFdt2KYxVGDxkDbH/1NYJnVJWUkzr8ituBEmFVQRNX2gCaAsFEjEDnLkWpgqlZA7htgS/g==",
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
@@ -3963,9 +3963,9 @@
} }
}, },
"node_modules/axios": { "node_modules/axios": {
"version": "1.13.1", "version": "1.13.2",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.13.1.tgz", "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.2.tgz",
"integrity": "sha512-hU4EGxxt+j7TQijx1oYdAjw4xuIp1wRQSsbMFwSthCWeBQur1eF+qJ5iQ5sN3Tw8YRzQNKb8jszgBdMDVqwJcw==", "integrity": "sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -4075,9 +4075,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/baseline-browser-mapping": { "node_modules/baseline-browser-mapping": {
"version": "2.8.23", "version": "2.8.25",
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.23.tgz", "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.25.tgz",
"integrity": "sha512-616V5YX4bepJFzNyOfce5Fa8fDJMfoxzOIzDCZwaGL8MKVpFrXqfNUoIpRn9YMI5pXf/VKgzjB4htFMsFKKdiQ==", "integrity": "sha512-2NovHVesVF5TXefsGX1yzx1xgr7+m9JQenvz6FQY3qd+YXkKkYiv+vTCc7OriP9mcDZpTC5mAOYN4ocd29+erA==",
"dev": true, "dev": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"bin": { "bin": {
@@ -4521,9 +4521,9 @@
} }
}, },
"node_modules/caniuse-lite": { "node_modules/caniuse-lite": {
"version": "1.0.30001752", "version": "1.0.30001753",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001752.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001753.tgz",
"integrity": "sha512-vKUk7beoukxE47P5gcVNKkDRzXdVofotshHwfR9vmpeFKxmI5PBpgOMC18LUJUA/DvJ70Y7RveasIBraqsyO/g==", "integrity": "sha512-Bj5H35MD/ebaOV4iDLqPEtiliTN29qkGtEHCwawWn4cYm+bPJM2NsaP30vtZcnERClMzp52J4+aw2UNbK4o+zw==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
@@ -5736,9 +5736,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/electron-to-chromium": { "node_modules/electron-to-chromium": {
"version": "1.5.244", "version": "1.5.245",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.244.tgz", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.245.tgz",
"integrity": "sha512-OszpBN7xZX4vWMPJwB9illkN/znA8M36GQqQxi6MNy9axWxhOfJyZZJtSLQCpEFLHP2xK33BiWx9aIuIEXVCcw==", "integrity": "sha512-rdmGfW47ZhL/oWEJAY4qxRtdly2B98ooTJ0pdEI4jhVLZ6tNf8fPtov2wS1IRKwFJT92le3x4Knxiwzl7cPPpQ==",
"dev": true, "dev": true,
"license": "ISC" "license": "ISC"
}, },
@@ -5820,9 +5820,9 @@
} }
}, },
"node_modules/envinfo": { "node_modules/envinfo": {
"version": "7.19.0", "version": "7.20.0",
"resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.19.0.tgz", "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.20.0.tgz",
"integrity": "sha512-DoSM9VyG6O3vqBf+p3Gjgr/Q52HYBBtO3v+4koAxt1MnWr+zEnxE+nke/yXS4lt2P4SYCHQ4V3f1i88LQVOpAw==", "integrity": "sha512-+zUomDcLXsVkQ37vUqWBvQwLaLlj8eZPSi61llaEFAVBY5mhcXdaSw1pSJVl4yTYD5g/gEfpNl28YYk4IPvrrg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"bin": { "bin": {
@@ -11008,9 +11008,9 @@
} }
}, },
"node_modules/terser": { "node_modules/terser": {
"version": "5.44.0", "version": "5.44.1",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.44.0.tgz", "resolved": "https://registry.npmjs.org/terser/-/terser-5.44.1.tgz",
"integrity": "sha512-nIVck8DK+GM/0Frwd+nIhZ84pR/BX7rmXMfYwyg+Sri5oGVE99/E3KvXqpC2xHFxyqXyGHTKBSioxxplrO4I4w==", "integrity": "sha512-t/R3R/n0MSwnnazuPpPNVO60LX0SKL45pyl9YlvxIdkH0Of7D5qM2EVe+yASRIlY5pZ73nclYJfNANGWPwFDZw==",
"dev": true, "dev": true,
"license": "BSD-2-Clause", "license": "BSD-2-Clause",
"dependencies": { "dependencies": {
@@ -11517,9 +11517,9 @@
} }
}, },
"node_modules/vite": { "node_modules/vite": {
"version": "7.1.12", "version": "7.2.1",
"resolved": "https://registry.npmjs.org/vite/-/vite-7.1.12.tgz", "resolved": "https://registry.npmjs.org/vite/-/vite-7.2.1.tgz",
"integrity": "sha512-ZWyE8YXEXqJrrSLvYgrRP7p62OziLW7xI5HYGWFzOvupfAlrLvURSzv/FyGyy0eidogEM3ujU+kUG1zuHgb6Ug==", "integrity": "sha512-qTl3VF7BvOupTR85Zc561sPEgxyUSNSvTQ9fit7DEMP7yPgvvIGm5Zfa1dOM+kOwWGNviK9uFM9ra77+OjK7lQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {

View File

@@ -25,6 +25,7 @@ declare(strict_types=1);
return [ return [
'invalid_account_list' => 'Invalid account type list', 'invalid_account_list' => 'Invalid account type list',
'invalid_transaction_type_list' => 'Invalid transaction type list',
'limit_exists' => 'There is already a budget limit (amount) for this budget and currency in the given period.', 'limit_exists' => 'There is already a budget limit (amount) for this budget and currency in the given period.',
'invalid_sort_instruction' => 'The sort instruction is invalid for an object of type ":object".', 'invalid_sort_instruction' => 'The sort instruction is invalid for an object of type ":object".',
'invalid_sort_instruction_index' => 'The sort instruction at index #:index is invalid for an object of type ":object".', 'invalid_sort_instruction_index' => 'The sort instruction at index #:index is invalid for an object of type ":object".',

View File

@@ -0,0 +1,42 @@
@extends('layout.v2.error')
@section('status_code','')
@section('status','Error message')
@section('sub_title', trans('errors.error_occurred'))
@section('content')
<div class="row">
<div class="col">
<p>
{{ trans('errors.error_not_recoverable') }}
</p>
<p class="text-danger">
{{ $message }}
</p>
</div>
</div>
<div class="row">
<div class="col">
<h4>
{{ trans('errors.more_info') }}
</h4>
<p>
{!! trans('errors.collect_info') !!}
{!! trans('errors.collect_info_more') !!}
</p>
<h4>
{{ trans('errors.github_help') }}
</h4>
<p>
{!! trans('errors.github_instructions') !!}
</p>
<ol>
<li>{{ trans('errors.use_search') }}</li>
<li>{!! trans('errors.include_info', ['link' => route('debug') ]) !!}</li>
<li>{{ trans('errors.tell_more') }}</li>
<li>{{ trans('errors.include_logs') }}</li>
<li>{{ trans('errors.what_did_you_do') }}</li>
</ol>
</div>
</div>
@endsection