From 39fbf3ce20599aba6c6a9e394470cf80f35bf430 Mon Sep 17 00:00:00 2001 From: charlesteets <71031886+charlesteets@users.noreply.github.com> Date: Fri, 4 Nov 2022 22:57:43 -0400 Subject: [PATCH 01/32] typo fix --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.example b/.env.example index a00366cee9..7d52539c30 100644 --- a/.env.example +++ b/.env.example @@ -236,7 +236,7 @@ ALLOW_WEBHOOKS=false STATIC_CRON_TOKEN= # You can fine tune the start-up of a Docker container by editing these environment variables. -# Use this at your own risk. Disabling certain checks and features may result in lost of inconsistent data. +# Use this at your own risk. Disabling certain checks and features may result in lots of inconsistent data. # However if you know what you're doing you can significantly speed up container start times. # Set each value to true to enable, or false to disable. From 90c9fdaf55390653dd6410151e1710cd4f57f342 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 6 Nov 2022 18:15:53 +0100 Subject: [PATCH 02/32] Fix https://github.com/firefly-iii/firefly-iii/issues/6610 --- app/Helpers/Collector/Extensions/AttachmentCollection.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Helpers/Collector/Extensions/AttachmentCollection.php b/app/Helpers/Collector/Extensions/AttachmentCollection.php index 50d1b5738b..e9ce1bbd4a 100644 --- a/app/Helpers/Collector/Extensions/AttachmentCollection.php +++ b/app/Helpers/Collector/Extensions/AttachmentCollection.php @@ -72,6 +72,7 @@ trait AttachmentCollection Log::debug('Add filter on attachment ID.'); $this->joinAttachmentTables(); $this->query->whereNotNull('attachments.attachable_id'); + $this->query->whereNull('attachments.deleted_at'); return $this; } From 0a7210729fe5a027b813699865e4d686b8d3f99e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Nov 2022 03:00:23 +0000 Subject: [PATCH 03/32] Bump league/commonmark from 2.3.6 to 2.3.7 Bumps [league/commonmark](https://github.com/thephpleague/commonmark) from 2.3.6 to 2.3.7. - [Release notes](https://github.com/thephpleague/commonmark/releases) - [Changelog](https://github.com/thephpleague/commonmark/blob/2.3/CHANGELOG.md) - [Commits](https://github.com/thephpleague/commonmark/compare/2.3.6...2.3.7) --- updated-dependencies: - dependency-name: league/commonmark dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- composer.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.lock b/composer.lock index 82218beeea..dd1d83f008 100644 --- a/composer.lock +++ b/composer.lock @@ -2512,16 +2512,16 @@ }, { "name": "league/commonmark", - "version": "2.3.6", + "version": "2.3.7", "source": { "type": "git", "url": "https://github.com/thephpleague/commonmark.git", - "reference": "857afc47ce113454bd629037213378ba3219dd40" + "reference": "a36bd2be4f5387c0f3a8792a0d76b7d68865abbf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/857afc47ce113454bd629037213378ba3219dd40", - "reference": "857afc47ce113454bd629037213378ba3219dd40", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/a36bd2be4f5387c0f3a8792a0d76b7d68865abbf", + "reference": "a36bd2be4f5387c0f3a8792a0d76b7d68865abbf", "shasum": "" }, "require": { @@ -2614,7 +2614,7 @@ "type": "tidelift" } ], - "time": "2022-10-30T16:45:38+00:00" + "time": "2022-11-03T17:29:46+00:00" }, { "name": "league/config", From 7666960a863abb7785143838409a6b1e519772ec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Nov 2022 03:00:29 +0000 Subject: [PATCH 04/32] Bump ramsey/uuid from 4.5.1 to 4.6.0 Bumps [ramsey/uuid](https://github.com/ramsey/uuid) from 4.5.1 to 4.6.0. - [Release notes](https://github.com/ramsey/uuid/releases) - [Changelog](https://github.com/ramsey/uuid/blob/4.x/CHANGELOG.md) - [Commits](https://github.com/ramsey/uuid/compare/4.5.1...4.6.0) --- updated-dependencies: - dependency-name: ramsey/uuid dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- composer.json | 2 +- composer.lock | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index 765997ef9c..34ae4bdd4d 100644 --- a/composer.json +++ b/composer.json @@ -100,7 +100,7 @@ "pragmarx/google2fa": "^8.0", "predis/predis": "^2.0", "psr/log": "<4", - "ramsey/uuid": "^4.5", + "ramsey/uuid": "^4.6", "rcrowe/twigbridge": "^0.14", "spatie/data-transfer-object": "^3.9", "spatie/laravel-ignition": "^1.5", diff --git a/composer.lock b/composer.lock index 82218beeea..0c1e2a6f58 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "628ed087c46f7638f75cd4cfafdd694d", + "content-hash": "b385ce67db1e86b306e8115c58828584", "packages": [ { "name": "bacon/bacon-qr-code", @@ -5059,21 +5059,20 @@ }, { "name": "ramsey/uuid", - "version": "4.5.1", + "version": "4.6.0", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "a161a26d917604dc6d3aa25100fddf2556e9f35d" + "reference": "ad63bc700e7d021039e30ce464eba384c4a1d40f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/a161a26d917604dc6d3aa25100fddf2556e9f35d", - "reference": "a161a26d917604dc6d3aa25100fddf2556e9f35d", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/ad63bc700e7d021039e30ce464eba384c4a1d40f", + "reference": "ad63bc700e7d021039e30ce464eba384c4a1d40f", "shasum": "" }, "require": { "brick/math": "^0.8.8 || ^0.9 || ^0.10", - "ext-ctype": "*", "ext-json": "*", "php": "^8.0", "ramsey/collection": "^1.0" @@ -5105,7 +5104,6 @@ }, "suggest": { "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", - "ext-ctype": "Enables faster processing of character classification using ctype functions.", "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", @@ -5137,7 +5135,7 @@ ], "support": { "issues": "https://github.com/ramsey/uuid/issues", - "source": "https://github.com/ramsey/uuid/tree/4.5.1" + "source": "https://github.com/ramsey/uuid/tree/4.6.0" }, "funding": [ { @@ -5149,7 +5147,7 @@ "type": "tidelift" } ], - "time": "2022-09-16T03:22:46+00:00" + "time": "2022-11-05T23:03:38+00:00" }, { "name": "rcrowe/twigbridge", From f650dd94631e2cac8c6934bbf03cfac790d899b4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Nov 2022 01:08:56 +0000 Subject: [PATCH 05/32] Bump loader-utils from 1.4.0 to 1.4.1 in /frontend Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.4.0 to 1.4.1. - [Release notes](https://github.com/webpack/loader-utils/releases) - [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.1/CHANGELOG.md) - [Commits](https://github.com/webpack/loader-utils/compare/v1.4.0...v1.4.1) --- updated-dependencies: - dependency-name: loader-utils dependency-type: indirect ... Signed-off-by: dependabot[bot] --- frontend/yarn.lock | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/frontend/yarn.lock b/frontend/yarn.lock index efd5caa657..fe91214129 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -4015,9 +4015,9 @@ loader-runner@^4.2.0: integrity sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg== loader-utils@^1.0.2: - version "1.4.0" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613" - integrity sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA== + version "1.4.1" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.1.tgz#278ad7006660bccc4d2c0c1578e17c5c78d5c0e0" + integrity sha512-1Qo97Y2oKaU+Ro2xnDMR26g1BwMT29jNbem1EvcujW2jqt+j5COXyscjM7bLQkM9HaxI7pkWeW7gnI072yMI9Q== dependencies: big.js "^5.2.2" emojis-list "^3.0.0" @@ -4302,11 +4302,16 @@ minimatch@^5.0.1: dependencies: brace-expansion "^2.0.1" -minimist@1.2.6, minimist@^1.2.0, minimist@^1.2.6: +minimist@1.2.6, minimist@^1.2.6: version "1.2.6" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== +minimist@^1.2.0: + version "1.2.7" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18" + integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g== + mkdirp@^0.5.5: version "0.5.6" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" From 704c6055b386999c1cc74b53e622ef0564828e3f Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 9 Nov 2022 06:35:42 +0100 Subject: [PATCH 06/32] Update link and policy. --- .github/security.md | 2 +- readme.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/security.md b/.github/security.md index 47ff2ced99..f7ca20f761 100644 --- a/.github/security.md +++ b/.github/security.md @@ -40,7 +40,7 @@ The Firefly III developer will respond to vulnerability reports as follows: 9. Once the fix is confirmed, the developer will patch the vulnerability in the next patch or minor release. Upon release of the patched version of Firefly III, we will follow the **Public Disclosure Process**. ### Public Disclosure Process -The developer publishes a public [advisory](https://github.com/firefly-iii/firefly-iii/security/advisories) to the Firefly III community via GitHub. In most cases, additional communication via Twitter, reddit and other channels will assist in educating Firefly III users and rolling out the patched release to affected users. +The developer publishes a public [advisory](https://github.com/firefly-iii/firefly-iii/security/advisories) to the Firefly III community via GitHub. In most cases, additional communication via Mastodon, Gitter and other channels will assist in educating Firefly III users and rolling out the patched release to affected users. The develop will also publish any mitigating steps users can take until the fix can be applied to their Firefly III instances. diff --git a/readme.md b/readme.md index 9e52f67869..4ce6453aaf 100644 --- a/readme.md +++ b/readme.md @@ -77,7 +77,7 @@ If you need support using Firefly III or the associated tools, come find us! - [GitHub Discussions for questions and support](https://github.com/firefly-iii/firefly-iii/discussions/) - [Gitter.im for a good chat and a quick answer](https://gitter.im/firefly-iii/firefly-iii) - [GitHub Issues for bugs and issues](https://github.com/firefly-iii/firefly-iii/issues) -- [Follow me around for news and updates on Twitter](https://twitter.com/Firefly_iii) +- Follow me around for news and updates on Mastodon @@ -138,7 +138,7 @@ There are many ways to run Firefly III ## Contributing -You can contact me at [james@firefly-iii.org](mailto:james@firefly-iii.org), you may open an issue in the [main repository](https://github.com/firefly-iii/firefly-iii) or contact me through [gitter](https://gitter.im/firefly-iii/firefly-iii) and [Twitter](https://twitter.com/Firefly_III). +You can contact me at [james@firefly-iii.org](mailto:james@firefly-iii.org), you may open an issue in the [main repository](https://github.com/firefly-iii/firefly-iii) or contact me through [gitter](https://gitter.im/firefly-iii/firefly-iii) and [Mastodon](https://fosstodon.org/@ff3). Of course, there are some [contributing guidelines](https://docs.firefly-iii.org/firefly-iii/other-pages/contributing) and a [code of conduct](https://github.com/firefly-iii/firefly-iii/blob/main/.github/code_of_conduct.md), which I invite you to check out. From 7fcdf85dee248200cec0b1f4926c771ea6f1d0c0 Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 9 Nov 2022 20:49:27 +0100 Subject: [PATCH 07/32] Fix https://github.com/firefly-iii/firefly-iii/issues/6625 --- app/Support/Twig/TransactionGroupTwig.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Support/Twig/TransactionGroupTwig.php b/app/Support/Twig/TransactionGroupTwig.php index 2c0a38fbb4..83f6051eca 100644 --- a/app/Support/Twig/TransactionGroupTwig.php +++ b/app/Support/Twig/TransactionGroupTwig.php @@ -221,7 +221,7 @@ class TransactionGroupTwig extends AbstractExtension /** @var Transaction $first */ $first = $journal->transactions()->where('amount', '<', 0)->first(); - return null !== $first->foreign_amount; + return '' !== $first->foreign_amount; } /** @@ -237,7 +237,7 @@ class TransactionGroupTwig extends AbstractExtension /** @var Transaction $first */ $first = $journal->transactions()->where('amount', '<', 0)->first(); $currency = $first->foreignCurrency; - $amount = $first->foreign_amount ?? '0'; + $amount = '' === $first->foreign_amount ? '0' : $first->foreign_amount; $colored = true; $sourceType = $first->account()->first()->accountType()->first()->type; From d6d53cc59854aa92d1f0a181676eee3d552eb913 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Nov 2022 20:02:21 +0000 Subject: [PATCH 08/32] Bump loader-utils from 1.4.0 to 1.4.1 Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.4.0 to 1.4.1. - [Release notes](https://github.com/webpack/loader-utils/releases) - [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.1/CHANGELOG.md) - [Commits](https://github.com/webpack/loader-utils/compare/v1.4.0...v1.4.1) --- updated-dependencies: - dependency-name: loader-utils dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index c3776321aa..ec85b87a6c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3432,9 +3432,9 @@ loader-runner@^4.2.0: integrity sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg== loader-utils@^1.0.2, loader-utils@^1.1.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613" - integrity sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA== + version "1.4.1" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.1.tgz#278ad7006660bccc4d2c0c1578e17c5c78d5c0e0" + integrity sha512-1Qo97Y2oKaU+Ro2xnDMR26g1BwMT29jNbem1EvcujW2jqt+j5COXyscjM7bLQkM9HaxI7pkWeW7gnI072yMI9Q== dependencies: big.js "^5.2.2" emojis-list "^3.0.0" From 5aa8793e3395844e2e23eda40ee25cac77baf747 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Nov 2022 03:00:27 +0000 Subject: [PATCH 09/32] Bump laravel/framework from 9.38.0 to 9.39.0 Bumps [laravel/framework](https://github.com/laravel/framework) from 9.38.0 to 9.39.0. - [Release notes](https://github.com/laravel/framework/releases) - [Changelog](https://github.com/laravel/framework/blob/9.x/CHANGELOG.md) - [Commits](https://github.com/laravel/framework/compare/v9.38.0...v9.39.0) --- updated-dependencies: - dependency-name: laravel/framework dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- composer.lock | 146 +++++++++++++++++++++++++------------------------- 1 file changed, 73 insertions(+), 73 deletions(-) diff --git a/composer.lock b/composer.lock index 17059c68a7..d7d9d1df33 100644 --- a/composer.lock +++ b/composer.lock @@ -1856,16 +1856,16 @@ }, { "name": "laravel/framework", - "version": "v9.38.0", + "version": "v9.39.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "abf198e443e06696af3f356b44de67c0fa516107" + "reference": "67e674709e1e7db14f304a871481f310822d68c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/abf198e443e06696af3f356b44de67c0fa516107", - "reference": "abf198e443e06696af3f356b44de67c0fa516107", + "url": "https://api.github.com/repos/laravel/framework/zipball/67e674709e1e7db14f304a871481f310822d68c5", + "reference": "67e674709e1e7db14f304a871481f310822d68c5", "shasum": "" }, "require": { @@ -2038,7 +2038,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-11-01T14:05:55+00:00" + "time": "2022-11-08T14:47:39+00:00" }, { "name": "laravel/passport", @@ -3415,16 +3415,16 @@ }, { "name": "nesbot/carbon", - "version": "2.62.1", + "version": "2.63.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "01bc4cdefe98ef58d1f9cb31bdbbddddf2a88f7a" + "reference": "ad35dd71a6a212b98e4b87e97389b6fa85f0e347" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/01bc4cdefe98ef58d1f9cb31bdbbddddf2a88f7a", - "reference": "01bc4cdefe98ef58d1f9cb31bdbbddddf2a88f7a", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/ad35dd71a6a212b98e4b87e97389b6fa85f0e347", + "reference": "ad35dd71a6a212b98e4b87e97389b6fa85f0e347", "shasum": "" }, "require": { @@ -3513,7 +3513,7 @@ "type": "tidelift" } ], - "time": "2022-09-02T07:48:13+00:00" + "time": "2022-10-30T18:34:28+00:00" }, { "name": "nette/schema", @@ -6722,16 +6722,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4" + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", "shasum": "" }, "require": { @@ -6746,7 +6746,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -6784,7 +6784,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" }, "funding": [ { @@ -6800,20 +6800,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "433d05519ce6990bf3530fba6957499d327395c2" + "reference": "511a08c03c1960e08a883f4cffcacd219b758354" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/433d05519ce6990bf3530fba6957499d327395c2", - "reference": "433d05519ce6990bf3530fba6957499d327395c2", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", + "reference": "511a08c03c1960e08a883f4cffcacd219b758354", "shasum": "" }, "require": { @@ -6825,7 +6825,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -6865,7 +6865,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.0" }, "funding": [ { @@ -6881,20 +6881,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "59a8d271f00dd0e4c2e518104cc7963f655a1aa8" + "reference": "639084e360537a19f9ee352433b84ce831f3d2da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/59a8d271f00dd0e4c2e518104cc7963f655a1aa8", - "reference": "59a8d271f00dd0e4c2e518104cc7963f655a1aa8", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/639084e360537a19f9ee352433b84ce831f3d2da", + "reference": "639084e360537a19f9ee352433b84ce831f3d2da", "shasum": "" }, "require": { @@ -6908,7 +6908,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -6952,7 +6952,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.27.0" }, "funding": [ { @@ -6968,20 +6968,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "219aa369ceff116e673852dce47c3a41794c14bd" + "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/219aa369ceff116e673852dce47c3a41794c14bd", - "reference": "219aa369ceff116e673852dce47c3a41794c14bd", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", "shasum": "" }, "require": { @@ -6993,7 +6993,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -7036,7 +7036,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" }, "funding": [ { @@ -7052,20 +7052,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", "shasum": "" }, "require": { @@ -7080,7 +7080,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -7119,7 +7119,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" }, "funding": [ { @@ -7135,20 +7135,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "bf44a9fd41feaac72b074de600314a93e2ae78e2" + "reference": "869329b1e9894268a8a61dabb69153029b7a8c97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/bf44a9fd41feaac72b074de600314a93e2ae78e2", - "reference": "bf44a9fd41feaac72b074de600314a93e2ae78e2", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/869329b1e9894268a8a61dabb69153029b7a8c97", + "reference": "869329b1e9894268a8a61dabb69153029b7a8c97", "shasum": "" }, "require": { @@ -7157,7 +7157,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -7195,7 +7195,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.27.0" }, "funding": [ { @@ -7211,20 +7211,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", "shasum": "" }, "require": { @@ -7233,7 +7233,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -7278,7 +7278,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" }, "funding": [ { @@ -7294,20 +7294,20 @@ "type": "tidelift" } ], - "time": "2022-05-10T07:21:04+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1" + "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/13f6d1271c663dc5ae9fb843a8f16521db7687a1", - "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a", + "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a", "shasum": "" }, "require": { @@ -7316,7 +7316,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -7357,7 +7357,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.27.0" }, "funding": [ { @@ -7373,20 +7373,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-uuid", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-uuid.git", - "reference": "a41886c1c81dc075a09c71fe6db5b9d68c79de23" + "reference": "f3cf1a645c2734236ed1e2e671e273eeb3586166" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/a41886c1c81dc075a09c71fe6db5b9d68c79de23", - "reference": "a41886c1c81dc075a09c71fe6db5b9d68c79de23", + "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/f3cf1a645c2734236ed1e2e671e273eeb3586166", + "reference": "f3cf1a645c2734236ed1e2e671e273eeb3586166", "shasum": "" }, "require": { @@ -7401,7 +7401,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -7439,7 +7439,7 @@ "uuid" ], "support": { - "source": "https://github.com/symfony/polyfill-uuid/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-uuid/tree/v1.27.0" }, "funding": [ { @@ -7455,7 +7455,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/process", From c9ba5f08c4669bc9d6fc5a8354aaac1281c820e2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Nov 2022 03:12:30 +0000 Subject: [PATCH 10/32] Bump vue from 2.7.13 to 2.7.14 Bumps [vue](https://github.com/vuejs/core) from 2.7.13 to 2.7.14. - [Release notes](https://github.com/vuejs/core/releases) - [Changelog](https://github.com/vuejs/core/blob/main/CHANGELOG.md) - [Commits](https://github.com/vuejs/core/commits) --- updated-dependencies: - dependency-name: vue dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index c3776321aa..f73e5d45c0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1267,10 +1267,10 @@ "@vue/compiler-core" "3.2.41" "@vue/shared" "3.2.41" -"@vue/compiler-sfc@2.7.13": - version "2.7.13" - resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-2.7.13.tgz#818944f4a9616b752d48dac6a56bffe2db88bdff" - integrity sha512-zzu2rLRZlgIU+OT3Atbr7Y6PG+LW4wVQpPfNRrGDH3dM9PsrcVfa+1pKb8bW467bGM3aDOvAnsYLWVpYIv3GRg== +"@vue/compiler-sfc@2.7.14": + version "2.7.14" + resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-2.7.14.tgz#3446fd2fbb670d709277fc3ffa88efc5e10284fd" + integrity sha512-aNmNHyLPsw+sVvlQFQ2/8sjNuLtK54TC6cuKnVzAY93ks4ZBrvwQSnkkIh7bsbNhum5hJBS00wSDipQ937f5DA== dependencies: "@babel/parser" "^7.18.4" postcss "^8.4.14" @@ -5156,11 +5156,11 @@ vue-template-es2015-compiler@^1.9.0: integrity sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw== vue@^2.6.10, vue@^2.7: - version "2.7.13" - resolved "https://registry.yarnpkg.com/vue/-/vue-2.7.13.tgz#e9e499cc6da46dc7941c2510193b15aa6a84a79f" - integrity sha512-QnM6ULTNnPmn71eUO+4hdjfBIA3H0GLsBnchnI/kS678tjI45GOUZhXd0oP/gX9isikXz1PAzSnkPspp9EUNfQ== + version "2.7.14" + resolved "https://registry.yarnpkg.com/vue/-/vue-2.7.14.tgz#3743dcd248fd3a34d421ae456b864a0246bafb17" + integrity sha512-b2qkFyOM0kwqWFuQmgd4o+uHGU7T+2z3T+WQp8UBjADfEv2n4FEMffzBmCKNP0IGzOEEfYjvtcC62xaSKeQDrQ== dependencies: - "@vue/compiler-sfc" "2.7.13" + "@vue/compiler-sfc" "2.7.14" csstype "^3.1.0" watchpack@^2.4.0: From b49e7d6b21e70f05d9c4e78392943cd90269610a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Nov 2022 03:13:50 +0000 Subject: [PATCH 11/32] Bump @vue/compiler-sfc from 3.2.41 to 3.2.45 Bumps [@vue/compiler-sfc](https://github.com/vuejs/core/tree/HEAD/packages/compiler-sfc) from 3.2.41 to 3.2.45. - [Release notes](https://github.com/vuejs/core/releases) - [Changelog](https://github.com/vuejs/core/blob/main/CHANGELOG.md) - [Commits](https://github.com/vuejs/core/commits/v3.2.45/packages/compiler-sfc) --- updated-dependencies: - dependency-name: "@vue/compiler-sfc" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 72 ++++++++++++++++++++++++++-------------------------- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/package.json b/package.json index 5c6bb4d976..d741ac3488 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ }, "devDependencies": { "@johmun/vue-tags-input": "^2", - "@vue/compiler-sfc": "^3.2.40", + "@vue/compiler-sfc": "^3.2.45", "axios": "^1.1", "bootstrap-sass": "^3", "cross-env": "^7.0", diff --git a/yarn.lock b/yarn.lock index c3776321aa..cfd249b1df 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1249,23 +1249,23 @@ dependencies: "@types/node" "*" -"@vue/compiler-core@3.2.41": - version "3.2.41" - resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.2.41.tgz#fb5b25f23817400f44377d878a0cdead808453ef" - integrity sha512-oA4mH6SA78DT+96/nsi4p9DX97PHcNROxs51lYk7gb9Z4BPKQ3Mh+BLn6CQZBw857Iuhu28BfMSRHAlPvD4vlw== +"@vue/compiler-core@3.2.45": + version "3.2.45" + resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.2.45.tgz#d9311207d96f6ebd5f4660be129fb99f01ddb41b" + integrity sha512-rcMj7H+PYe5wBV3iYeUgbCglC+pbpN8hBLTJvRiK2eKQiWqu+fG9F+8sW99JdL4LQi7Re178UOxn09puSXvn4A== dependencies: "@babel/parser" "^7.16.4" - "@vue/shared" "3.2.41" + "@vue/shared" "3.2.45" estree-walker "^2.0.2" source-map "^0.6.1" -"@vue/compiler-dom@3.2.41": - version "3.2.41" - resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.2.41.tgz#dc63dcd3ce8ca8a8721f14009d498a7a54380299" - integrity sha512-xe5TbbIsonjENxJsYRbDJvthzqxLNk+tb3d/c47zgREDa/PCp6/Y4gC/skM4H6PIuX5DAxm7fFJdbjjUH2QTMw== +"@vue/compiler-dom@3.2.45": + version "3.2.45" + resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.2.45.tgz#c43cc15e50da62ecc16a42f2622d25dc5fd97dce" + integrity sha512-tyYeUEuKqqZO137WrZkpwfPCdiiIeXYCcJ8L4gWz9vqaxzIQRccTSwSWZ/Axx5YR2z+LvpUbmPNXxuBU45lyRw== dependencies: - "@vue/compiler-core" "3.2.41" - "@vue/shared" "3.2.41" + "@vue/compiler-core" "3.2.45" + "@vue/shared" "3.2.45" "@vue/compiler-sfc@2.7.13": version "2.7.13" @@ -1276,29 +1276,29 @@ postcss "^8.4.14" source-map "^0.6.1" -"@vue/compiler-sfc@^3.2.40": - version "3.2.41" - resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.2.41.tgz#238fb8c48318408c856748f4116aff8cc1dc2a73" - integrity sha512-+1P2m5kxOeaxVmJNXnBskAn3BenbTmbxBxWOtBq3mQTCokIreuMULFantBUclP0+KnzNCMOvcnKinqQZmiOF8w== +"@vue/compiler-sfc@^3.2.45": + version "3.2.45" + resolved "https://registry.yarnpkg.com/@vue/compiler-sfc/-/compiler-sfc-3.2.45.tgz#7f7989cc04ec9e7c55acd406827a2c4e96872c70" + integrity sha512-1jXDuWah1ggsnSAOGsec8cFjT/K6TMZ0sPL3o3d84Ft2AYZi2jWJgRMjw4iaK0rBfA89L5gw427H4n1RZQBu6Q== dependencies: "@babel/parser" "^7.16.4" - "@vue/compiler-core" "3.2.41" - "@vue/compiler-dom" "3.2.41" - "@vue/compiler-ssr" "3.2.41" - "@vue/reactivity-transform" "3.2.41" - "@vue/shared" "3.2.41" + "@vue/compiler-core" "3.2.45" + "@vue/compiler-dom" "3.2.45" + "@vue/compiler-ssr" "3.2.45" + "@vue/reactivity-transform" "3.2.45" + "@vue/shared" "3.2.45" estree-walker "^2.0.2" magic-string "^0.25.7" postcss "^8.1.10" source-map "^0.6.1" -"@vue/compiler-ssr@3.2.41": - version "3.2.41" - resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.2.41.tgz#344f564d68584b33367731c04ffc949784611fcb" - integrity sha512-Y5wPiNIiaMz/sps8+DmhaKfDm1xgj6GrH99z4gq2LQenfVQcYXmHIOBcs5qPwl7jaW3SUQWjkAPKMfQemEQZwQ== +"@vue/compiler-ssr@3.2.45": + version "3.2.45" + resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.2.45.tgz#bd20604b6e64ea15344d5b6278c4141191c983b2" + integrity sha512-6BRaggEGqhWht3lt24CrIbQSRD5O07MTmd+LjAn5fJj568+R9eUD2F7wMQJjX859seSlrYog7sUtrZSd7feqrQ== dependencies: - "@vue/compiler-dom" "3.2.41" - "@vue/shared" "3.2.41" + "@vue/compiler-dom" "3.2.45" + "@vue/shared" "3.2.45" "@vue/component-compiler-utils@^3.1.0": version "3.3.0" @@ -1316,21 +1316,21 @@ optionalDependencies: prettier "^1.18.2 || ^2.0.0" -"@vue/reactivity-transform@3.2.41": - version "3.2.41" - resolved "https://registry.yarnpkg.com/@vue/reactivity-transform/-/reactivity-transform-3.2.41.tgz#9ff938877600c97f646e09ac1959b5150fb11a0c" - integrity sha512-mK5+BNMsL4hHi+IR3Ft/ho6Za+L3FA5j8WvreJ7XzHrqkPq8jtF/SMo7tuc9gHjLDwKZX1nP1JQOKo9IEAn54A== +"@vue/reactivity-transform@3.2.45": + version "3.2.45" + resolved "https://registry.yarnpkg.com/@vue/reactivity-transform/-/reactivity-transform-3.2.45.tgz#07ac83b8138550c83dfb50db43cde1e0e5e8124d" + integrity sha512-BHVmzYAvM7vcU5WmuYqXpwaBHjsS8T63jlKGWVtHxAHIoMIlmaMyurUSEs1Zcg46M4AYT5MtB1U274/2aNzjJQ== dependencies: "@babel/parser" "^7.16.4" - "@vue/compiler-core" "3.2.41" - "@vue/shared" "3.2.41" + "@vue/compiler-core" "3.2.45" + "@vue/shared" "3.2.45" estree-walker "^2.0.2" magic-string "^0.25.7" -"@vue/shared@3.2.41": - version "3.2.41" - resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.2.41.tgz#fbc95422df654ea64e8428eced96ba6ad555d2bb" - integrity sha512-W9mfWLHmJhkfAmV+7gDjcHeAWALQtgGT3JErxULl0oz6R6+3ug91I7IErs93eCFhPCZPHBs4QJS7YWEV7A3sxw== +"@vue/shared@3.2.45": + version "3.2.45" + resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.2.45.tgz#a3fffa7489eafff38d984e23d0236e230c818bc2" + integrity sha512-Ewzq5Yhimg7pSztDV+RH1UDKBzmtqieXQlpTVm2AwraoRL/Rks96mvd8Vgi7Lj+h+TH8dv7mXD3FRZR3TUvbSg== "@webassemblyjs/ast@1.11.1": version "1.11.1" From e1114f720ddb599980dc6a576f67351b4a86bced Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Nov 2022 03:15:04 +0000 Subject: [PATCH 12/32] Bump postcss from 8.4.18 to 8.4.19 Bumps [postcss](https://github.com/postcss/postcss) from 8.4.18 to 8.4.19. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](https://github.com/postcss/postcss/compare/8.4.18...8.4.19) --- updated-dependencies: - dependency-name: postcss dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index c3776321aa..8da56aa0c8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4247,9 +4247,9 @@ postcss@^7.0.36: source-map "^0.6.1" postcss@^8.1.10, postcss@^8.2.15, postcss@^8.4, postcss@^8.4.14: - version "8.4.18" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.18.tgz#6d50046ea7d3d66a85e0e782074e7203bc7fbca2" - integrity sha512-Wi8mWhncLJm11GATDaQKobXSNEYGUHeQLiQqDFG1qQ5UTDPTEvKw0Xt5NsTpktGTwLps3ByrWsBrG0rB8YQ9oA== + version "8.4.19" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.19.tgz#61178e2add236b17351897c8bcc0b4c8ecab56fc" + integrity sha512-h+pbPsyhlYj6N2ozBmHhHrs9DzGmbaarbLvWipMRO7RLS+v4onj26MPFXA5OBYFxyqYhUJK456SwDcY9H2/zsA== dependencies: nanoid "^3.3.4" picocolors "^1.0.0" From 21d18acabcc3ded920a791507d0fd4fd03056ed9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 17 Nov 2022 04:44:02 +0000 Subject: [PATCH 13/32] Bump loader-utils from 1.4.1 to 1.4.2 in /frontend Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.4.1 to 1.4.2. - [Release notes](https://github.com/webpack/loader-utils/releases) - [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.2/CHANGELOG.md) - [Commits](https://github.com/webpack/loader-utils/compare/v1.4.1...v1.4.2) --- updated-dependencies: - dependency-name: loader-utils dependency-type: indirect ... Signed-off-by: dependabot[bot] --- frontend/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/yarn.lock b/frontend/yarn.lock index fe91214129..8dc61f2c46 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -4015,9 +4015,9 @@ loader-runner@^4.2.0: integrity sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg== loader-utils@^1.0.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.1.tgz#278ad7006660bccc4d2c0c1578e17c5c78d5c0e0" - integrity sha512-1Qo97Y2oKaU+Ro2xnDMR26g1BwMT29jNbem1EvcujW2jqt+j5COXyscjM7bLQkM9HaxI7pkWeW7gnI072yMI9Q== + version "1.4.2" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.2.tgz#29a957f3a63973883eb684f10ffd3d151fec01a3" + integrity sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg== dependencies: big.js "^5.2.2" emojis-list "^3.0.0" From b13bcec61a1ed0bcdd228469a31ddfd2f47b4873 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 17 Nov 2022 23:56:20 +0000 Subject: [PATCH 14/32] Bump loader-utils from 1.4.1 to 1.4.2 Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.4.1 to 1.4.2. - [Release notes](https://github.com/webpack/loader-utils/releases) - [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.2/CHANGELOG.md) - [Commits](https://github.com/webpack/loader-utils/compare/v1.4.1...v1.4.2) --- updated-dependencies: - dependency-name: loader-utils dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index ec85b87a6c..660b291b1e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3432,9 +3432,9 @@ loader-runner@^4.2.0: integrity sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg== loader-utils@^1.0.2, loader-utils@^1.1.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.1.tgz#278ad7006660bccc4d2c0c1578e17c5c78d5c0e0" - integrity sha512-1Qo97Y2oKaU+Ro2xnDMR26g1BwMT29jNbem1EvcujW2jqt+j5COXyscjM7bLQkM9HaxI7pkWeW7gnI072yMI9Q== + version "1.4.2" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.2.tgz#29a957f3a63973883eb684f10ffd3d151fec01a3" + integrity sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg== dependencies: big.js "^5.2.2" emojis-list "^3.0.0" From 3278d9850e5d42a09bf8a069ef3ec9b719c9b3fe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Nov 2022 03:01:02 +0000 Subject: [PATCH 15/32] Bump laravel/ui from 4.0.2 to 4.1.0 Bumps [laravel/ui](https://github.com/laravel/ui) from 4.0.2 to 4.1.0. - [Release notes](https://github.com/laravel/ui/releases) - [Changelog](https://github.com/laravel/ui/blob/4.x/CHANGELOG.md) - [Commits](https://github.com/laravel/ui/compare/v4.0.2...v4.1.0) --- updated-dependencies: - dependency-name: laravel/ui dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- composer.json | 2 +- composer.lock | 52 +++++++++++++++++++++++++-------------------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/composer.json b/composer.json index 34ae4bdd4d..8047f4709c 100644 --- a/composer.json +++ b/composer.json @@ -91,7 +91,7 @@ "laravel/framework": "^9", "laravel/passport": "11.*", "laravel/sanctum": "^3.0", - "laravel/ui": "^4.0", + "laravel/ui": "^4.1", "laravelcollective/html": "6.*", "league/commonmark": "2.*", "league/csv": "^9.7", diff --git a/composer.lock b/composer.lock index d7d9d1df33..2854bc038d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b385ce67db1e86b306e8115c58828584", + "content-hash": "886b33fcd05646c0a07a1e03ef929365", "packages": [ { "name": "bacon/bacon-qr-code", @@ -1856,16 +1856,16 @@ }, { "name": "laravel/framework", - "version": "v9.39.0", + "version": "v9.40.1", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "67e674709e1e7db14f304a871481f310822d68c5" + "reference": "9611fdaf2db5759b8299802d7185bcdbee0340bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/67e674709e1e7db14f304a871481f310822d68c5", - "reference": "67e674709e1e7db14f304a871481f310822d68c5", + "url": "https://api.github.com/repos/laravel/framework/zipball/9611fdaf2db5759b8299802d7185bcdbee0340bb", + "reference": "9611fdaf2db5759b8299802d7185bcdbee0340bb", "shasum": "" }, "require": { @@ -2038,7 +2038,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-11-08T14:47:39+00:00" + "time": "2022-11-15T16:13:22+00:00" }, { "name": "laravel/passport", @@ -2244,16 +2244,16 @@ }, { "name": "laravel/ui", - "version": "v4.0.2", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/laravel/ui.git", - "reference": "9aa6930c8ae98b2465594d7f14f4ac131bfd6a99" + "reference": "f2f879e9f0947a1ede12b0ff7446ce4e249479cd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/ui/zipball/9aa6930c8ae98b2465594d7f14f4ac131bfd6a99", - "reference": "9aa6930c8ae98b2465594d7f14f4ac131bfd6a99", + "url": "https://api.github.com/repos/laravel/ui/zipball/f2f879e9f0947a1ede12b0ff7446ce4e249479cd", + "reference": "f2f879e9f0947a1ede12b0ff7446ce4e249479cd", "shasum": "" }, "require": { @@ -2299,9 +2299,9 @@ "ui" ], "support": { - "source": "https://github.com/laravel/ui/tree/v4.0.2" + "source": "https://github.com/laravel/ui/tree/v4.1.0" }, - "time": "2022-09-09T18:20:35+00:00" + "time": "2022-11-15T14:36:57+00:00" }, { "name": "laravelcollective/html", @@ -2838,16 +2838,16 @@ }, { "name": "league/flysystem", - "version": "3.10.2", + "version": "3.10.3", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "b9bd194b016114d6ff6765c09d40c7d427e4e3f6" + "reference": "8013fb046c6a244b2b1b75cc95d732ed6bcdeb8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/b9bd194b016114d6ff6765c09d40c7d427e4e3f6", - "reference": "b9bd194b016114d6ff6765c09d40c7d427e4e3f6", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/8013fb046c6a244b2b1b75cc95d732ed6bcdeb8a", + "reference": "8013fb046c6a244b2b1b75cc95d732ed6bcdeb8a", "shasum": "" }, "require": { @@ -2909,7 +2909,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/3.10.2" + "source": "https://github.com/thephpleague/flysystem/tree/3.10.3" }, "funding": [ { @@ -2925,7 +2925,7 @@ "type": "tidelift" } ], - "time": "2022-10-25T07:01:47+00:00" + "time": "2022-11-14T10:42:43+00:00" }, { "name": "league/fractal", @@ -3517,25 +3517,25 @@ }, { "name": "nette/schema", - "version": "v1.2.2", + "version": "v1.2.3", "source": { "type": "git", "url": "https://github.com/nette/schema.git", - "reference": "9a39cef03a5b34c7de64f551538cbba05c2be5df" + "reference": "abbdbb70e0245d5f3bf77874cea1dfb0c930d06f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/schema/zipball/9a39cef03a5b34c7de64f551538cbba05c2be5df", - "reference": "9a39cef03a5b34c7de64f551538cbba05c2be5df", + "url": "https://api.github.com/repos/nette/schema/zipball/abbdbb70e0245d5f3bf77874cea1dfb0c930d06f", + "reference": "abbdbb70e0245d5f3bf77874cea1dfb0c930d06f", "shasum": "" }, "require": { "nette/utils": "^2.5.7 || ^3.1.5 || ^4.0", - "php": ">=7.1 <8.2" + "php": ">=7.1 <8.3" }, "require-dev": { "nette/tester": "^2.3 || ^2.4", - "phpstan/phpstan-nette": "^0.12", + "phpstan/phpstan-nette": "^1.0", "tracy/tracy": "^2.7" }, "type": "library", @@ -3573,9 +3573,9 @@ ], "support": { "issues": "https://github.com/nette/schema/issues", - "source": "https://github.com/nette/schema/tree/v1.2.2" + "source": "https://github.com/nette/schema/tree/v1.2.3" }, - "time": "2021-10-15T11:40:02+00:00" + "time": "2022-10-13T01:24:26+00:00" }, { "name": "nette/utils", From 81b0b048db634e4b436f9ce4fe086682d0992ffd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Nov 2022 03:01:10 +0000 Subject: [PATCH 16/32] Bump laravel/framework from 9.39.0 to 9.40.1 Bumps [laravel/framework](https://github.com/laravel/framework) from 9.39.0 to 9.40.1. - [Release notes](https://github.com/laravel/framework/releases) - [Changelog](https://github.com/laravel/framework/blob/9.x/CHANGELOG.md) - [Commits](https://github.com/laravel/framework/compare/v9.39.0...v9.40.1) --- updated-dependencies: - dependency-name: laravel/framework dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- composer.lock | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/composer.lock b/composer.lock index d7d9d1df33..ed010ea98e 100644 --- a/composer.lock +++ b/composer.lock @@ -1856,16 +1856,16 @@ }, { "name": "laravel/framework", - "version": "v9.39.0", + "version": "v9.40.1", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "67e674709e1e7db14f304a871481f310822d68c5" + "reference": "9611fdaf2db5759b8299802d7185bcdbee0340bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/67e674709e1e7db14f304a871481f310822d68c5", - "reference": "67e674709e1e7db14f304a871481f310822d68c5", + "url": "https://api.github.com/repos/laravel/framework/zipball/9611fdaf2db5759b8299802d7185bcdbee0340bb", + "reference": "9611fdaf2db5759b8299802d7185bcdbee0340bb", "shasum": "" }, "require": { @@ -2038,7 +2038,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-11-08T14:47:39+00:00" + "time": "2022-11-15T16:13:22+00:00" }, { "name": "laravel/passport", @@ -2838,16 +2838,16 @@ }, { "name": "league/flysystem", - "version": "3.10.2", + "version": "3.10.3", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "b9bd194b016114d6ff6765c09d40c7d427e4e3f6" + "reference": "8013fb046c6a244b2b1b75cc95d732ed6bcdeb8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/b9bd194b016114d6ff6765c09d40c7d427e4e3f6", - "reference": "b9bd194b016114d6ff6765c09d40c7d427e4e3f6", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/8013fb046c6a244b2b1b75cc95d732ed6bcdeb8a", + "reference": "8013fb046c6a244b2b1b75cc95d732ed6bcdeb8a", "shasum": "" }, "require": { @@ -2909,7 +2909,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/3.10.2" + "source": "https://github.com/thephpleague/flysystem/tree/3.10.3" }, "funding": [ { @@ -2925,7 +2925,7 @@ "type": "tidelift" } ], - "time": "2022-10-25T07:01:47+00:00" + "time": "2022-11-14T10:42:43+00:00" }, { "name": "league/fractal", @@ -3517,25 +3517,25 @@ }, { "name": "nette/schema", - "version": "v1.2.2", + "version": "v1.2.3", "source": { "type": "git", "url": "https://github.com/nette/schema.git", - "reference": "9a39cef03a5b34c7de64f551538cbba05c2be5df" + "reference": "abbdbb70e0245d5f3bf77874cea1dfb0c930d06f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/schema/zipball/9a39cef03a5b34c7de64f551538cbba05c2be5df", - "reference": "9a39cef03a5b34c7de64f551538cbba05c2be5df", + "url": "https://api.github.com/repos/nette/schema/zipball/abbdbb70e0245d5f3bf77874cea1dfb0c930d06f", + "reference": "abbdbb70e0245d5f3bf77874cea1dfb0c930d06f", "shasum": "" }, "require": { "nette/utils": "^2.5.7 || ^3.1.5 || ^4.0", - "php": ">=7.1 <8.2" + "php": ">=7.1 <8.3" }, "require-dev": { "nette/tester": "^2.3 || ^2.4", - "phpstan/phpstan-nette": "^0.12", + "phpstan/phpstan-nette": "^1.0", "tracy/tracy": "^2.7" }, "type": "library", @@ -3573,9 +3573,9 @@ ], "support": { "issues": "https://github.com/nette/schema/issues", - "source": "https://github.com/nette/schema/tree/v1.2.2" + "source": "https://github.com/nette/schema/tree/v1.2.3" }, - "time": "2021-10-15T11:40:02+00:00" + "time": "2022-10-13T01:24:26+00:00" }, { "name": "nette/utils", From 43960a5b603e441ebfeeaf7196e73fc49ef44b95 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Nov 2022 03:01:12 +0000 Subject: [PATCH 17/32] Bump vue-template-compiler from 2.7.13 to 2.7.14 Bumps [vue-template-compiler](https://github.com/vuejs/vue) from 2.7.13 to 2.7.14. - [Release notes](https://github.com/vuejs/vue/releases) - [Changelog](https://github.com/vuejs/vue/blob/main/CHANGELOG.md) - [Commits](https://github.com/vuejs/vue/compare/v2.7.13...v2.7.14) --- updated-dependencies: - dependency-name: vue-template-compiler dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 25d10216b8..eb1d6d463a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5143,9 +5143,9 @@ vue-style-loader@^4.1.0, vue-style-loader@^4.1.3: loader-utils "^1.0.2" vue-template-compiler@^2.7: - version "2.7.13" - resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.7.13.tgz#1520a5aa6d1af51dd0622824e79814f6e8cb7058" - integrity sha512-jYM6TClwDS9YqP48gYrtAtaOhRKkbYmbzE+Q51gX5YDr777n7tNI/IZk4QV4l/PjQPNh/FVa/E92sh/RqKMrog== + version "2.7.14" + resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.7.14.tgz#4545b7dfb88090744c1577ae5ac3f964e61634b1" + integrity sha512-zyA5Y3ArvVG0NacJDkkzJuPQDF8RFeRlzV2vLeSnhSpieO6LK2OVbdLPi5MPPs09Ii+gMO8nY4S3iKQxBxDmWQ== dependencies: de-indent "^1.0.2" he "^1.2.0" From f52044e794a890a6ae300761c9fe5c3ac818aa11 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Nov 2022 03:01:27 +0000 Subject: [PATCH 18/32] Bump vue-loader from 15.10.0 to 15.10.1 Bumps [vue-loader](https://github.com/vuejs/vue-loader) from 15.10.0 to 15.10.1. - [Release notes](https://github.com/vuejs/vue-loader/releases) - [Changelog](https://github.com/vuejs/vue-loader/blob/next/CHANGELOG.md) - [Commits](https://github.com/vuejs/vue-loader/compare/v15.10.0...v15.10.1) --- updated-dependencies: - dependency-name: vue-loader dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 25d10216b8..7b1bf5b1d0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5124,9 +5124,9 @@ vue-i18n@^8: integrity sha512-C5GZjs1tYlAqjwymaaCPDjCyGo10ajUphiwA922jKt9n7KPpqR7oM1PCwYzhB/E7+nT3wfdG3oRre5raIT1rKA== vue-loader@^15: - version "15.10.0" - resolved "https://registry.yarnpkg.com/vue-loader/-/vue-loader-15.10.0.tgz#2a12695c421a2a2cc2138f05a949d04ed086e38b" - integrity sha512-VU6tuO8eKajrFeBzMssFUP9SvakEeeSi1BxdTH5o3+1yUyrldp8IERkSdXlMI2t4kxF2sqYUDsQY+WJBxzBmZg== + version "15.10.1" + resolved "https://registry.yarnpkg.com/vue-loader/-/vue-loader-15.10.1.tgz#c451c4cd05a911aae7b5dbbbc09fb913fb3cca18" + integrity sha512-SaPHK1A01VrNthlix6h1hq4uJu7S/z0kdLUb6klubo738NeQoLbS6V9/d8Pv19tU0XdQKju3D1HSKuI8wJ5wMA== dependencies: "@vue/component-compiler-utils" "^3.1.0" hash-sum "^1.0.2" From dcfcbfd9b5e3fa61ca41ccd3b7f385cfc2971b6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Janne=20He=C3=9F?= Date: Sun, 27 Nov 2022 16:48:47 +0100 Subject: [PATCH 19/32] Add search support for SEPA CT --- app/Helpers/Collector/Extensions/MetaCollection.php | 13 +++++++++++++ app/Support/Search/OperatorQuerySearch.php | 3 +++ config/search.php | 1 + resources/lang/en_US/firefly.php | 3 +++ 4 files changed, 20 insertions(+) diff --git a/app/Helpers/Collector/Extensions/MetaCollection.php b/app/Helpers/Collector/Extensions/MetaCollection.php index dadb4067f7..99bb44d16a 100644 --- a/app/Helpers/Collector/Extensions/MetaCollection.php +++ b/app/Helpers/Collector/Extensions/MetaCollection.php @@ -699,4 +699,17 @@ trait MetaCollection return $this; } + + /** + * @inheritDoc + */ + public function setSepaCT(string $sepaCT): GroupCollectorInterface + { + $this->joinMetaDataTables(); + $this->query->where('journal_meta.name', '=', 'sepa_ct_id'); + $this->query->where('journal_meta.data', '=', sprintf('%s', json_encode($sepaCT))); + $this->query->whereNull('journal_meta.deleted_at'); + + return $this; + } } diff --git a/app/Support/Search/OperatorQuerySearch.php b/app/Support/Search/OperatorQuerySearch.php index 2004c46515..3978c9caec 100644 --- a/app/Support/Search/OperatorQuerySearch.php +++ b/app/Support/Search/OperatorQuerySearch.php @@ -863,6 +863,9 @@ class OperatorQuerySearch implements SearchInterface case 'attachment_notes_ends': $this->collector->attachmentNotesEnds($value); break; + case 'sepa_ct_is': + $this->collector->setSepaCT($value); + break; } diff --git a/config/search.php b/config/search.php index a81cd55eaa..45c9a8991c 100644 --- a/config/search.php +++ b/config/search.php @@ -229,5 +229,6 @@ return [ 'attachment_notes_start' => ['alias' => true, 'alias_for' => 'attachment_notes_starts', 'needs_context' => true], 'attachment_notes_ends' => ['alias' => false, 'needs_context' => true], 'attachment_notes_end' => ['alias' => true, 'alias_for' => 'attachment_notes_ends', 'needs_context' => true], + 'sepa_ct_is' => ['alias' => false, 'needs_context' => true], ], ]; diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index 556974be70..2d051bcffa 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -501,6 +501,7 @@ return [ 'search_modifier_attachment_notes_contains' => 'Any attachment\'s notes contain ":value"', 'search_modifier_attachment_notes_starts' => 'Any attachment\'s notes start with ":value"', 'search_modifier_attachment_notes_ends' => 'Any attachment\'s notes end is ":value"', + 'search_modifier_sepa_ct_is' => 'SEPA CT is ":value"', 'update_rule_from_query' => 'Update rule ":rule" from search query', 'create_rule_from_query' => 'Create new rule from search query', 'rule_from_search_words' => 'The rule engine has a hard time handling ":string". The suggested rule that fits your search query may give different results. Please verify the rule triggers carefully.', @@ -723,6 +724,8 @@ return [ 'rule_trigger_no_external_url_choice' => 'Transaction has no external URL', 'rule_trigger_id_choice' => 'Transaction ID is..', 'rule_trigger_id' => 'Transaction ID is ":trigger_value"', + 'rule_trigger_sepa_ct_is_choice' => 'SEPA CT is..', + 'rule_trigger_sepa_ct_is' => 'SEPA CT is ":trigger_value"', // new values: 'rule_trigger_user_action_choice' => 'User action is ":trigger_value"', From 3a8c0074b73fa6958831132c8c2687744fd1f4e2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Nov 2022 03:00:31 +0000 Subject: [PATCH 20/32] Bump laravel/framework from 9.40.1 to 9.41.0 Bumps [laravel/framework](https://github.com/laravel/framework) from 9.40.1 to 9.41.0. - [Release notes](https://github.com/laravel/framework/releases) - [Changelog](https://github.com/laravel/framework/blob/9.x/CHANGELOG.md) - [Commits](https://github.com/laravel/framework/compare/v9.40.1...v9.41.0) --- updated-dependencies: - dependency-name: laravel/framework dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- composer.lock | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/composer.lock b/composer.lock index 2854bc038d..25415894b4 100644 --- a/composer.lock +++ b/composer.lock @@ -1856,16 +1856,16 @@ }, { "name": "laravel/framework", - "version": "v9.40.1", + "version": "v9.41.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "9611fdaf2db5759b8299802d7185bcdbee0340bb" + "reference": "cc902ce61b4ca08ca7449664cfab2fa96a1d1e28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/9611fdaf2db5759b8299802d7185bcdbee0340bb", - "reference": "9611fdaf2db5759b8299802d7185bcdbee0340bb", + "url": "https://api.github.com/repos/laravel/framework/zipball/cc902ce61b4ca08ca7449664cfab2fa96a1d1e28", + "reference": "cc902ce61b4ca08ca7449664cfab2fa96a1d1e28", "shasum": "" }, "require": { @@ -2038,7 +2038,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-11-15T16:13:22+00:00" + "time": "2022-11-22T15:10:46+00:00" }, { "name": "laravel/passport", @@ -2838,16 +2838,16 @@ }, { "name": "league/flysystem", - "version": "3.10.3", + "version": "3.10.4", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "8013fb046c6a244b2b1b75cc95d732ed6bcdeb8a" + "reference": "a7790f3dd1b27af81d380e6b2afa77c16ab7e181" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/8013fb046c6a244b2b1b75cc95d732ed6bcdeb8a", - "reference": "8013fb046c6a244b2b1b75cc95d732ed6bcdeb8a", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/a7790f3dd1b27af81d380e6b2afa77c16ab7e181", + "reference": "a7790f3dd1b27af81d380e6b2afa77c16ab7e181", "shasum": "" }, "require": { @@ -2909,7 +2909,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/3.10.3" + "source": "https://github.com/thephpleague/flysystem/tree/3.10.4" }, "funding": [ { @@ -2925,7 +2925,7 @@ "type": "tidelift" } ], - "time": "2022-11-14T10:42:43+00:00" + "time": "2022-11-26T19:48:01+00:00" }, { "name": "league/fractal", From f3c89e805511929a22e825abd6fbeb5f89023849 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Nov 2022 03:00:58 +0000 Subject: [PATCH 21/32] Bump axios from 1.1.3 to 1.2.0 Bumps [axios](https://github.com/axios/axios) from 1.1.3 to 1.2.0. - [Release notes](https://github.com/axios/axios/releases) - [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md) - [Commits](https://github.com/axios/axios/compare/v1.1.3...v1.2.0) --- updated-dependencies: - dependency-name: axios dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index d741ac3488..b998e90d75 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "devDependencies": { "@johmun/vue-tags-input": "^2", "@vue/compiler-sfc": "^3.2.45", - "axios": "^1.1", + "axios": "^1.2", "bootstrap-sass": "^3", "cross-env": "^7.0", "font-awesome": "^4.7.0", diff --git a/yarn.lock b/yarn.lock index 88328846e7..92b95cb61b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1619,10 +1619,10 @@ autoprefixer@^10.4.0: picocolors "^1.0.0" postcss-value-parser "^4.2.0" -axios@^1.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.1.3.tgz#8274250dada2edf53814ed7db644b9c2866c1e35" - integrity sha512-00tXVRwKx/FZr/IDVFt4C+f9FYairX517WoGCL6dpOntqLkZofjhu43F/Xl44UOpqa+9sLFDrG/XAnFsUYgkDA== +axios@^1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.2.0.tgz#1cb65bd75162c70e9f8d118a905126c4a201d383" + integrity sha512-zT7wZyNYu3N5Bu0wuZ6QccIf93Qk1eV8LOewxgjOZFd2DenOs98cJ7+Y6703d0wkaXGY6/nZd4EweJaHz9uzQw== dependencies: follow-redirects "^1.15.0" form-data "^4.0.0" From 702f2c3146d58fbd963fe1dca1d38695679d39ae Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Wed, 30 Nov 2022 17:05:39 +0100 Subject: [PATCH 22/32] Also pick email address from apache filtered headers --- app/Support/Authentication/RemoteUserGuard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Support/Authentication/RemoteUserGuard.php b/app/Support/Authentication/RemoteUserGuard.php index c77435c832..08b85e5c25 100644 --- a/app/Support/Authentication/RemoteUserGuard.php +++ b/app/Support/Authentication/RemoteUserGuard.php @@ -81,7 +81,7 @@ class RemoteUserGuard implements Guard $header = config('auth.guard_email'); if (null !== $header) { - $emailAddress = (string) (request()->server($header) ?? null); + $emailAddress = (string) (request()->server($header) ?? apache_request_headers()[$header] ?? null); $preference = app('preferences')->getForUser($retrievedUser, 'remote_guard_alt_email'); if (null !== $emailAddress && null === $preference && $emailAddress !== $userID) { From 2743359a4ec4511074cdf2132427ed1074bf041c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Dec 2022 03:00:27 +0000 Subject: [PATCH 23/32] Bump symfony/http-client from 6.0.15 to 6.0.16 Bumps [symfony/http-client](https://github.com/symfony/http-client) from 6.0.15 to 6.0.16. - [Release notes](https://github.com/symfony/http-client/releases) - [Changelog](https://github.com/symfony/http-client/blob/6.2/CHANGELOG.md) - [Commits](https://github.com/symfony/http-client/compare/v6.0.15...v6.0.16) --- updated-dependencies: - dependency-name: symfony/http-client dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index 25415894b4..1eec4ef78b 100644 --- a/composer.lock +++ b/composer.lock @@ -6155,16 +6155,16 @@ }, { "name": "symfony/http-client", - "version": "v6.0.15", + "version": "v6.0.16", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "af84893895ce7637a4b60fd3de87fe9e44286a21" + "reference": "5db1221826d5f841f443d434358d5f82c862c5a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/af84893895ce7637a4b60fd3de87fe9e44286a21", - "reference": "af84893895ce7637a4b60fd3de87fe9e44286a21", + "url": "https://api.github.com/repos/symfony/http-client/zipball/5db1221826d5f841f443d434358d5f82c862c5a9", + "reference": "5db1221826d5f841f443d434358d5f82c862c5a9", "shasum": "" }, "require": { @@ -6219,7 +6219,7 @@ "description": "Provides powerful methods to fetch HTTP resources synchronously or asynchronously", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-client/tree/v6.0.15" + "source": "https://github.com/symfony/http-client/tree/v6.0.16" }, "funding": [ { @@ -6235,7 +6235,7 @@ "type": "tidelift" } ], - "time": "2022-10-28T16:22:58+00:00" + "time": "2022-11-14T10:09:52+00:00" }, { "name": "symfony/http-client-contracts", From 516653d007ed0dbf0597a05e94964c38d74d28b2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Dec 2022 03:00:37 +0000 Subject: [PATCH 24/32] Bump laravel/framework from 9.41.0 to 9.42.2 Bumps [laravel/framework](https://github.com/laravel/framework) from 9.41.0 to 9.42.2. - [Release notes](https://github.com/laravel/framework/releases) - [Changelog](https://github.com/laravel/framework/blob/9.x/CHANGELOG.md) - [Commits](https://github.com/laravel/framework/compare/v9.41.0...v9.42.2) --- updated-dependencies: - dependency-name: laravel/framework dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- composer.lock | 94 +++++++++++++++++++++++++-------------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/composer.lock b/composer.lock index 25415894b4..24ff016669 100644 --- a/composer.lock +++ b/composer.lock @@ -1856,16 +1856,16 @@ }, { "name": "laravel/framework", - "version": "v9.41.0", + "version": "v9.42.2", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "cc902ce61b4ca08ca7449664cfab2fa96a1d1e28" + "reference": "607d7867c93706eae20e28e46679f8a66e2a23ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/cc902ce61b4ca08ca7449664cfab2fa96a1d1e28", - "reference": "cc902ce61b4ca08ca7449664cfab2fa96a1d1e28", + "url": "https://api.github.com/repos/laravel/framework/zipball/607d7867c93706eae20e28e46679f8a66e2a23ec", + "reference": "607d7867c93706eae20e28e46679f8a66e2a23ec", "shasum": "" }, "require": { @@ -2038,7 +2038,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2022-11-22T15:10:46+00:00" + "time": "2022-11-30T16:23:52+00:00" }, { "name": "laravel/passport", @@ -2838,16 +2838,16 @@ }, { "name": "league/flysystem", - "version": "3.10.4", + "version": "3.11.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "a7790f3dd1b27af81d380e6b2afa77c16ab7e181" + "reference": "7e423e5dd240a60adfab9bde058d7668863b7731" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/a7790f3dd1b27af81d380e6b2afa77c16ab7e181", - "reference": "a7790f3dd1b27af81d380e6b2afa77c16ab7e181", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/7e423e5dd240a60adfab9bde058d7668863b7731", + "reference": "7e423e5dd240a60adfab9bde058d7668863b7731", "shasum": "" }, "require": { @@ -2909,7 +2909,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/3.10.4" + "source": "https://github.com/thephpleague/flysystem/tree/3.11.0" }, "funding": [ { @@ -2925,7 +2925,7 @@ "type": "tidelift" } ], - "time": "2022-11-26T19:48:01+00:00" + "time": "2022-12-02T14:39:57+00:00" }, { "name": "league/fractal", @@ -3415,16 +3415,16 @@ }, { "name": "nesbot/carbon", - "version": "2.63.0", + "version": "2.64.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "ad35dd71a6a212b98e4b87e97389b6fa85f0e347" + "reference": "889546413c97de2d05063b8cb7b193c2531ea211" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/ad35dd71a6a212b98e4b87e97389b6fa85f0e347", - "reference": "ad35dd71a6a212b98e4b87e97389b6fa85f0e347", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/889546413c97de2d05063b8cb7b193c2531ea211", + "reference": "889546413c97de2d05063b8cb7b193c2531ea211", "shasum": "" }, "require": { @@ -3435,7 +3435,7 @@ "symfony/translation": "^3.4 || ^4.0 || ^5.0 || ^6.0" }, "require-dev": { - "doctrine/dbal": "^2.0 || ^3.0", + "doctrine/dbal": "^2.0 || ^3.1.4", "doctrine/orm": "^2.7", "friendsofphp/php-cs-fixer": "^3.0", "kylekatarnls/multi-tester": "^2.0", @@ -3513,7 +3513,7 @@ "type": "tidelift" } ], - "time": "2022-10-30T18:34:28+00:00" + "time": "2022-11-26T17:36:00+00:00" }, { "name": "nette/schema", @@ -5634,16 +5634,16 @@ }, { "name": "symfony/console", - "version": "v6.0.15", + "version": "v6.0.16", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "b0b910724a0a0326b4481e4f8a30abb2dd442efb" + "reference": "be294423f337dda97c810733138c0caec1bb0575" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/b0b910724a0a0326b4481e4f8a30abb2dd442efb", - "reference": "b0b910724a0a0326b4481e4f8a30abb2dd442efb", + "url": "https://api.github.com/repos/symfony/console/zipball/be294423f337dda97c810733138c0caec1bb0575", + "reference": "be294423f337dda97c810733138c0caec1bb0575", "shasum": "" }, "require": { @@ -5709,7 +5709,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.0.15" + "source": "https://github.com/symfony/console/tree/v6.0.16" }, "funding": [ { @@ -5725,7 +5725,7 @@ "type": "tidelift" } ], - "time": "2022-10-26T21:42:20+00:00" + "time": "2022-11-25T18:58:46+00:00" }, { "name": "symfony/css-selector", @@ -6317,16 +6317,16 @@ }, { "name": "symfony/http-foundation", - "version": "v6.0.15", + "version": "v6.0.16", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "a93829f4043fdcddebabd8433bdb46c2dcaefe06" + "reference": "86eec2c66d00a2dd03d84352cd10b12df73101ec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/a93829f4043fdcddebabd8433bdb46c2dcaefe06", - "reference": "a93829f4043fdcddebabd8433bdb46c2dcaefe06", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/86eec2c66d00a2dd03d84352cd10b12df73101ec", + "reference": "86eec2c66d00a2dd03d84352cd10b12df73101ec", "shasum": "" }, "require": { @@ -6372,7 +6372,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v6.0.15" + "source": "https://github.com/symfony/http-foundation/tree/v6.0.16" }, "funding": [ { @@ -6388,20 +6388,20 @@ "type": "tidelift" } ], - "time": "2022-10-12T09:44:26+00:00" + "time": "2022-11-07T08:07:05+00:00" }, { "name": "symfony/http-kernel", - "version": "v6.0.15", + "version": "v6.0.16", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "22c820abe601e7328b56cec86626617139266f48" + "reference": "8ba1344821807ad51f230f0d01e0fa8f366e4abb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/22c820abe601e7328b56cec86626617139266f48", - "reference": "22c820abe601e7328b56cec86626617139266f48", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/8ba1344821807ad51f230f0d01e0fa8f366e4abb", + "reference": "8ba1344821807ad51f230f0d01e0fa8f366e4abb", "shasum": "" }, "require": { @@ -6481,7 +6481,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v6.0.15" + "source": "https://github.com/symfony/http-kernel/tree/v6.0.16" }, "funding": [ { @@ -6497,20 +6497,20 @@ "type": "tidelift" } ], - "time": "2022-10-28T18:00:40+00:00" + "time": "2022-11-28T18:15:44+00:00" }, { "name": "symfony/mailer", - "version": "v6.0.15", + "version": "v6.0.16", "source": { "type": "git", "url": "https://github.com/symfony/mailer.git", - "reference": "5eaa3f1404cafa842e953ae16c35757b7356fb32" + "reference": "aa47b34ab09fa03106d9e156632e4c6176b962da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mailer/zipball/5eaa3f1404cafa842e953ae16c35757b7356fb32", - "reference": "5eaa3f1404cafa842e953ae16c35757b7356fb32", + "url": "https://api.github.com/repos/symfony/mailer/zipball/aa47b34ab09fa03106d9e156632e4c6176b962da", + "reference": "aa47b34ab09fa03106d9e156632e4c6176b962da", "shasum": "" }, "require": { @@ -6555,7 +6555,7 @@ "description": "Helps sending emails", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/mailer/tree/v6.0.15" + "source": "https://github.com/symfony/mailer/tree/v6.0.16" }, "funding": [ { @@ -6571,7 +6571,7 @@ "type": "tidelift" } ], - "time": "2022-10-28T16:22:58+00:00" + "time": "2022-11-04T07:39:59+00:00" }, { "name": "symfony/mailgun-mailer", @@ -6640,16 +6640,16 @@ }, { "name": "symfony/mime", - "version": "v6.0.14", + "version": "v6.0.16", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "c01b88b63418131daf2edd0bdc17fc8a6d1c939a" + "reference": "ad9878bede5707cdf5ff7f5c86d82a921bbbfe1c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/c01b88b63418131daf2edd0bdc17fc8a6d1c939a", - "reference": "c01b88b63418131daf2edd0bdc17fc8a6d1c939a", + "url": "https://api.github.com/repos/symfony/mime/zipball/ad9878bede5707cdf5ff7f5c86d82a921bbbfe1c", + "reference": "ad9878bede5707cdf5ff7f5c86d82a921bbbfe1c", "shasum": "" }, "require": { @@ -6702,7 +6702,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v6.0.14" + "source": "https://github.com/symfony/mime/tree/v6.0.16" }, "funding": [ { @@ -6718,7 +6718,7 @@ "type": "tidelift" } ], - "time": "2022-10-07T08:02:12+00:00" + "time": "2022-11-28T12:25:56+00:00" }, { "name": "symfony/polyfill-ctype", From 363c849c50c7a7111f050db48f51ad52c59106e4 Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 7 Dec 2022 20:25:27 +0100 Subject: [PATCH 25/32] Update stale.yml --- .github/workflows/stale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 2581619f8c..2ef9b6297b 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -13,7 +13,7 @@ jobs: pull-requests: write # for actions/stale to close stale PRs runs-on: ubuntu-latest steps: - - uses: actions/stale@v3 + - uses: actions/stale@v6 with: repo-token: ${{ secrets.GITHUB_TOKEN }} stale-issue-message: > From a60c3165f1251612baff00ff66fc2bd4755a1fb9 Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 7 Dec 2022 20:26:14 +0100 Subject: [PATCH 26/32] Update stale.yml --- .github/workflows/stale.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 2ef9b6297b..142b371703 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -2,6 +2,7 @@ name: "Close stale issues" on: schedule: - cron: "30 1 * * *" + workflow_dispatch: permissions: contents: read From c125984d550e6fa9f81d0fc3c04759c22cd8a986 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 11 Dec 2022 06:20:18 +0100 Subject: [PATCH 27/32] Remove cache. --- app/Support/Steam.php | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/app/Support/Steam.php b/app/Support/Steam.php index a74f16a2b9..d567323b79 100644 --- a/app/Support/Steam.php +++ b/app/Support/Steam.php @@ -52,14 +52,6 @@ class Steam */ public function balanceIgnoreVirtual(Account $account, Carbon $date): string { - // abuse chart properties: - $cache = new CacheProperties; - $cache->addProperty($account->id); - $cache->addProperty('balance-no-virtual'); - $cache->addProperty($date); - if ($cache->has()) { - return $cache->get(); - } /** @var AccountRepositoryInterface $repository */ $repository = app(AccountRepositoryInterface::class); $repository->setUser($account->user); @@ -81,11 +73,7 @@ class Steam ->get(['transactions.foreign_amount'])->toArray(); $foreignBalance = $this->sumTransactions($transactions, 'foreign_amount'); - $balance = bcadd($nativeBalance, $foreignBalance); - - $cache->store($balance); - - return $balance; + return bcadd($nativeBalance, $foreignBalance); } /** From 922a5fa9c7450720bbf9b8b9a08003957adc86a8 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 11 Dec 2022 06:20:27 +0100 Subject: [PATCH 28/32] Fix https://github.com/firefly-iii/firefly-iii/pull/6701 --- app/Support/Authentication/RemoteUserGuard.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/Support/Authentication/RemoteUserGuard.php b/app/Support/Authentication/RemoteUserGuard.php index c77435c832..d3fd571b85 100644 --- a/app/Support/Authentication/RemoteUserGuard.php +++ b/app/Support/Authentication/RemoteUserGuard.php @@ -69,6 +69,9 @@ class RemoteUserGuard implements Guard // Get the user identifier from $_SERVER or apache filtered headers $header = config('auth.guard_header', 'REMOTE_USER'); $userID = request()->server($header) ?? apache_request_headers()[$header] ?? null; + + $userID = 'james@firefly'; + if (null === $userID) { Log::error(sprintf('No user in header "%s".', $header)); throw new FireflyException('The guard header was unexpectedly empty. See the logs.'); @@ -79,12 +82,18 @@ class RemoteUserGuard implements Guard // store email address if present in header and not already set. $header = config('auth.guard_email'); + $header = 'abc'; if (null !== $header) { $emailAddress = (string) (request()->server($header) ?? null); $preference = app('preferences')->getForUser($retrievedUser, 'remote_guard_alt_email'); + $emailAddress = 'test2@nder.be'; - if (null !== $emailAddress && null === $preference && $emailAddress !== $userID) { + if ('' !== $emailAddress && null === $preference && $emailAddress !== $userID) { + app('preferences')->setForUser($retrievedUser, 'remote_guard_alt_email', $emailAddress); + } + // if the pref isn't null and the object returned isn't null, update the email address. + if ('' !== $emailAddress && null !== $preference && $emailAddress !== $preference->data) { app('preferences')->setForUser($retrievedUser, 'remote_guard_alt_email', $emailAddress); } } From c8d6ef3782c74ee6d91139f7925a62a9fd2d6992 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 11 Dec 2022 06:20:45 +0100 Subject: [PATCH 29/32] Fix https://github.com/firefly-iii/firefly-iii/pull/6701 --- app/Support/Authentication/RemoteUserGuard.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/Support/Authentication/RemoteUserGuard.php b/app/Support/Authentication/RemoteUserGuard.php index d3fd571b85..97c44c953e 100644 --- a/app/Support/Authentication/RemoteUserGuard.php +++ b/app/Support/Authentication/RemoteUserGuard.php @@ -82,12 +82,10 @@ class RemoteUserGuard implements Guard // store email address if present in header and not already set. $header = config('auth.guard_email'); - $header = 'abc'; if (null !== $header) { $emailAddress = (string) (request()->server($header) ?? null); $preference = app('preferences')->getForUser($retrievedUser, 'remote_guard_alt_email'); - $emailAddress = 'test2@nder.be'; if ('' !== $emailAddress && null === $preference && $emailAddress !== $userID) { app('preferences')->setForUser($retrievedUser, 'remote_guard_alt_email', $emailAddress); From 352eedb13607d9e48cc118ec7777f1c56a9eddc7 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 11 Dec 2022 06:21:08 +0100 Subject: [PATCH 30/32] Fix https://github.com/firefly-iii/firefly-iii/pull/6701 --- app/Support/Authentication/RemoteUserGuard.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/Support/Authentication/RemoteUserGuard.php b/app/Support/Authentication/RemoteUserGuard.php index 97c44c953e..df0315cffd 100644 --- a/app/Support/Authentication/RemoteUserGuard.php +++ b/app/Support/Authentication/RemoteUserGuard.php @@ -70,8 +70,6 @@ class RemoteUserGuard implements Guard $header = config('auth.guard_header', 'REMOTE_USER'); $userID = request()->server($header) ?? apache_request_headers()[$header] ?? null; - $userID = 'james@firefly'; - if (null === $userID) { Log::error(sprintf('No user in header "%s".', $header)); throw new FireflyException('The guard header was unexpectedly empty. See the logs.'); From 44af5473a8b639b697ef0b34e670bd0195a0a24a Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 11 Dec 2022 07:17:59 +0100 Subject: [PATCH 31/32] Unify piggy bank events. Does not save a link to the journal (yet) --- app/Events/ChangedPiggyBankAmount.php | 58 +++++++ app/Factory/PiggyBankEventFactory.php | 18 +-- app/Factory/TransactionJournalFactory.php | 90 +++++------ app/Handlers/Events/PiggyBankEventHandler.php | 55 +++++++ .../PiggyBank/AmountController.php | 1 - app/Providers/EventServiceProvider.php | 6 + .../PiggyBank/ModifiesPiggyBanks.php | 150 ++++++++---------- .../PiggyBankRepositoryInterface.php | 23 +-- .../Destroy/JournalDestroyService.php | 1 + .../Internal/Update/GroupCloneService.php | 2 +- .../Actions/UpdatePiggybank.php | 2 - resources/lang/en_US/firefly.php | 1 + resources/views/piggy-banks/show.twig | 2 +- 13 files changed, 237 insertions(+), 172 deletions(-) create mode 100644 app/Events/ChangedPiggyBankAmount.php create mode 100644 app/Handlers/Events/PiggyBankEventHandler.php diff --git a/app/Events/ChangedPiggyBankAmount.php b/app/Events/ChangedPiggyBankAmount.php new file mode 100644 index 0000000000..fd3462c5f0 --- /dev/null +++ b/app/Events/ChangedPiggyBankAmount.php @@ -0,0 +1,58 @@ +. + */ + +namespace FireflyIII\Events; + +use FireflyIII\Models\PiggyBank; +use FireflyIII\Models\TransactionGroup; +use FireflyIII\Models\TransactionJournal; +use Illuminate\Queue\SerializesModels; +use Illuminate\Support\Facades\Log; + +/** + * Class ChangedPiggyBankAmount + */ +class ChangedPiggyBankAmount extends Event +{ + use SerializesModels; + + public PiggyBank $piggyBank; + public ?TransactionJournal $transactionJournal; + public ?TransactionGroup $transactionGroup; + public string $amount; + + /** + * Create a new event instance. + * + * @param PiggyBank $piggyBank + * @param string $amount + * @param TransactionJournal|null $transactionJournal + * @param TransactionGroup|null $transactionGroup + */ + public function __construct(PiggyBank $piggyBank, string $amount, ?TransactionJournal $transactionJournal, ?TransactionGroup $transactionGroup) + { + Log::debug(sprintf('Created piggy bank event for piggy bank #%d with amount %s', $piggyBank->id, $amount)); + $this->piggyBank = $piggyBank; + $this->transactionJournal = $transactionJournal; + $this->transactionGroup = $transactionGroup; + $this->amount = $amount; + } +} diff --git a/app/Factory/PiggyBankEventFactory.php b/app/Factory/PiggyBankEventFactory.php index 727be78405..158bd3801b 100644 --- a/app/Factory/PiggyBankEventFactory.php +++ b/app/Factory/PiggyBankEventFactory.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace FireflyIII\Factory; +use FireflyIII\Events\ChangedPiggyBankAmount; use FireflyIII\Models\PiggyBank; use FireflyIII\Models\PiggyBankEvent; use FireflyIII\Models\TransactionJournal; @@ -40,22 +41,20 @@ class PiggyBankEventFactory /** * @param TransactionJournal $journal * @param PiggyBank|null $piggyBank - * - * @return PiggyBankEvent|null */ - public function create(TransactionJournal $journal, ?PiggyBank $piggyBank): ?PiggyBankEvent + public function create(TransactionJournal $journal, ?PiggyBank $piggyBank): void { Log::debug(sprintf('Now in PiggyBankEventCreate for a %s', $journal->transactionType->type)); if (null === $piggyBank) { Log::debug('Piggy bank is null'); - return null; + return; } if (TransactionType::TRANSFER !== $journal->transactionType->type) { Log::info(sprintf('Will not connect %s #%d to a piggy bank.', $journal->transactionType->type, $journal->id)); - return null; + return; } /** @var PiggyBankRepositoryInterface $piggyRepos */ @@ -66,20 +65,17 @@ class PiggyBankEventFactory if (null === $repetition) { Log::error(sprintf('No piggy bank repetition on %s!', $journal->date->format('Y-m-d'))); - return null; + return; } Log::debug('Found repetition'); $amount = $piggyRepos->getExactAmount($piggyBank, $repetition, $journal); if (0 === bccomp($amount, '0')) { Log::debug('Amount is zero, will not create event.'); - return null; + return; } + // amount can be negative. $piggyRepos->addAmountToRepetition($repetition, $amount); - $event = $piggyRepos->createEventWithJournal($piggyBank, $amount, $journal); - Log::debug(sprintf('Created piggy bank event #%d', $event->id)); - - return $event; } } diff --git a/app/Factory/TransactionJournalFactory.php b/app/Factory/TransactionJournalFactory.php index d44a48bd66..8cf056b3ee 100644 --- a/app/Factory/TransactionJournalFactory.php +++ b/app/Factory/TransactionJournalFactory.php @@ -92,7 +92,7 @@ class TransactionJournalFactory /** * Store a new (set of) transaction journals. * - * @param array $data + * @param array $data * * @return Collection * @throws DuplicateTransactionException @@ -143,7 +143,7 @@ class TransactionJournalFactory } /** - * @param NullArrayObject $row + * @param NullArrayObject $row * * @return TransactionJournal|null * @throws DuplicateTransactionException @@ -160,11 +160,11 @@ class TransactionJournalFactory $type = $this->typeRepository->findTransactionType(null, $row['type']); $carbon = $row['date'] ?? today(config('app.timezone')); $order = $row['order'] ?? 0; - $currency = $this->currencyRepository->findCurrency((int) $row['currency_id'], $row['currency_code']); + $currency = $this->currencyRepository->findCurrency((int)$row['currency_id'], $row['currency_code']); $foreignCurrency = $this->currencyRepository->findCurrencyNull($row['foreign_currency_id'], $row['foreign_currency_code']); - $bill = $this->billRepository->findBill((int) $row['bill_id'], $row['bill_name']); + $bill = $this->billRepository->findBill((int)$row['bill_id'], $row['bill_name']); $billId = TransactionType::WITHDRAWAL === $type->type && null !== $bill ? $bill->id : null; - $description = (string) $row['description']; + $description = (string)$row['description']; /** Manipulate basic fields */ $carbon->setTimezone(config('app.timezone')); @@ -237,7 +237,7 @@ class TransactionJournalFactory $transactionFactory->setForeignCurrency($foreignCurrency); $transactionFactory->setReconciled($row['reconciled'] ?? false); try { - $negative = $transactionFactory->createNegative((string) $row['amount'], (string) $row['foreign_amount']); + $negative = $transactionFactory->createNegative((string)$row['amount'], (string)$row['foreign_amount']); } catch (FireflyException $e) { Log::error('Exception creating negative transaction.'); Log::error($e->getMessage()); @@ -256,7 +256,7 @@ class TransactionJournalFactory $transactionFactory->setForeignCurrency($foreignCurrency); $transactionFactory->setReconciled($row['reconciled'] ?? false); try { - $transactionFactory->createPositive((string) $row['amount'], (string) $row['foreign_amount']); + $transactionFactory->createPositive((string)$row['amount'], (string)$row['foreign_amount']); } catch (FireflyException $e) { Log::error('Exception creating positive transaction.'); Log::error($e->getMessage()); @@ -294,7 +294,7 @@ class TransactionJournalFactory } /** - * @param NullArrayObject $row + * @param NullArrayObject $row * * @return string * @throws JsonException @@ -306,10 +306,8 @@ class TransactionJournalFactory unset($dataRow['import_hash_v2'], $dataRow['original_source']); $json = json_encode($dataRow, JSON_THROW_ON_ERROR); if (false === $json) { - - $json = json_encode((string) microtime(), JSON_THROW_ON_ERROR); + $json = json_encode((string)microtime(), JSON_THROW_ON_ERROR); Log::error(sprintf('Could not hash the original row! %s', json_last_error_msg()), $dataRow); - } $hash = hash('sha256', $json); Log::debug(sprintf('The hash is: %s', $hash), $dataRow); @@ -320,7 +318,7 @@ class TransactionJournalFactory /** * If this transaction already exists, throw an error. * - * @param string $hash + * @param string $hash * * @throws DuplicateTransactionException * @throws JsonException @@ -353,7 +351,7 @@ class TransactionJournalFactory } /** - * @param NullArrayObject $data + * @param NullArrayObject $data * * @throws FireflyException */ @@ -366,10 +364,10 @@ class TransactionJournalFactory // validate source account. $array = [ - 'id' => $data['source_id'] ? (int) $data['source_id'] : null, - 'name' => $data['source_name'] ? (string) $data['source_name'] : null, - 'iban' => $data['source_iban'] ? (string) $data['source_iban'] : null, - 'number' => $data['source_number'] ? (string) $data['source_number'] : null, + 'id' => $data['source_id'] ? (int)$data['source_id'] : null, + 'name' => $data['source_name'] ? (string)$data['source_name'] : null, + 'iban' => $data['source_iban'] ? (string)$data['source_iban'] : null, + 'number' => $data['source_number'] ? (string)$data['source_number'] : null, ]; $validSource = $this->accountValidator->validateSource($array); @@ -381,10 +379,10 @@ class TransactionJournalFactory // validate destination account $array = [ - 'id' => $data['destination_id'] ? (int) $data['destination_id'] : null, - 'name' => $data['destination_name'] ? (string) $data['destination_name'] : null, - 'iban' => $data['destination_iban'] ? (string) $data['destination_iban'] : null, - 'number' => $data['destination_number'] ? (string) $data['destination_number'] : null, + 'id' => $data['destination_id'] ? (int)$data['destination_id'] : null, + 'name' => $data['destination_name'] ? (string)$data['destination_name'] : null, + 'iban' => $data['destination_iban'] ? (string)$data['destination_iban'] : null, + 'number' => $data['destination_number'] ? (string)$data['destination_number'] : null, ]; $validDestination = $this->accountValidator->validateDestination($array); @@ -395,10 +393,10 @@ class TransactionJournalFactory } /** - * @param string $type - * @param TransactionCurrency|null $currency - * @param Account $source - * @param Account $destination + * @param string $type + * @param TransactionCurrency|null $currency + * @param Account $source + * @param Account $destination * * @return TransactionCurrency */ @@ -413,8 +411,8 @@ class TransactionJournalFactory } /** - * @param TransactionCurrency|null $currency - * @param Account $account + * @param TransactionCurrency|null $currency + * @param Account $account * * @return TransactionCurrency * @throws FireflyException @@ -437,8 +435,8 @@ class TransactionJournalFactory /** * Set foreign currency to NULL if it's the same as the normal currency: * - * @param TransactionCurrency|null $currency - * @param TransactionCurrency|null $foreignCurrency + * @param TransactionCurrency|null $currency + * @param TransactionCurrency|null $foreignCurrency * * @return TransactionCurrency|null */ @@ -455,9 +453,9 @@ class TransactionJournalFactory } /** - * @param string $type - * @param TransactionCurrency|null $foreignCurrency - * @param Account $destination + * @param string $type + * @param TransactionCurrency|null $foreignCurrency + * @param Account $destination * * @return TransactionCurrency|null */ @@ -471,7 +469,7 @@ class TransactionJournalFactory } /** - * @param string $description + * @param string $description * * @return string */ @@ -486,7 +484,7 @@ class TransactionJournalFactory * Force the deletion of an entire set of transaction journals and their meta object in case of * an error creating a group. * - * @param Collection $collection + * @param Collection $collection */ private function forceDeleteOnError(Collection $collection): void { @@ -500,7 +498,7 @@ class TransactionJournalFactory } /** - * @param Transaction $transaction + * @param Transaction $transaction */ private function forceTrDelete(Transaction $transaction): void { @@ -516,8 +514,8 @@ class TransactionJournalFactory /** * Link a piggy bank to this journal. * - * @param TransactionJournal $journal - * @param NullArrayObject $data + * @param TransactionJournal $journal + * @param NullArrayObject $data */ private function storePiggyEvent(TransactionJournal $journal, NullArrayObject $data): void { @@ -528,7 +526,7 @@ class TransactionJournalFactory return; } - $piggyBank = $this->piggyRepository->findPiggyBank((int) $data['piggy_bank_id'], $data['piggy_bank_name']); + $piggyBank = $this->piggyRepository->findPiggyBank((int)$data['piggy_bank_id'], $data['piggy_bank_name']); if (null !== $piggyBank) { $this->piggyEventFactory->create($journal, $piggyBank); @@ -540,8 +538,8 @@ class TransactionJournalFactory } /** - * @param TransactionJournal $journal - * @param NullArrayObject $transaction + * @param TransactionJournal $journal + * @param NullArrayObject $transaction */ private function storeMetaFields(TransactionJournal $journal, NullArrayObject $transaction): void { @@ -551,16 +549,16 @@ class TransactionJournalFactory } /** - * @param TransactionJournal $journal - * @param NullArrayObject $data - * @param string $field + * @param TransactionJournal $journal + * @param NullArrayObject $data + * @param string $field */ protected function storeMeta(TransactionJournal $journal, NullArrayObject $data, string $field): void { $set = [ 'journal' => $journal, 'name' => $field, - 'data' => (string) ($data[$field] ?? ''), + 'data' => (string)($data[$field] ?? ''), ]; //Log::debug(sprintf('Going to store meta-field "%s", with value "%s".', $set['name'], $set['data'])); @@ -571,7 +569,7 @@ class TransactionJournalFactory } /** - * @param bool $errorOnHash + * @param bool $errorOnHash */ public function setErrorOnHash(bool $errorOnHash): void { @@ -584,7 +582,7 @@ class TransactionJournalFactory /** * Set the user. * - * @param User $user + * @param User $user */ public function setUser(User $user): void { diff --git a/app/Handlers/Events/PiggyBankEventHandler.php b/app/Handlers/Events/PiggyBankEventHandler.php new file mode 100644 index 0000000000..646d363198 --- /dev/null +++ b/app/Handlers/Events/PiggyBankEventHandler.php @@ -0,0 +1,55 @@ +. + */ + +namespace FireflyIII\Handlers\Events; + +use Carbon\Carbon; +use FireflyIII\Events\ChangedPiggyBankAmount; +use FireflyIII\Models\PiggyBankEvent; + +/** + * Class PiggyBankEventHandler + */ +class PiggyBankEventHandler +{ + /** + * @param ChangedPiggyBankAmount $event + * @return void + */ + public function changePiggyAmount(ChangedPiggyBankAmount $event): void + { + // find journal if group is present. + $journal = $event->transactionJournal; + if (null !== $event->transactionGroup) { + $journal = $event->transactionGroup->transactionJournals()->first(); + } + $date = $journal?->date ?? Carbon::now(); + PiggyBankEvent::create( + [ + 'piggy_bank_id' => $event->piggyBank->id, + 'transaction_journal_id' => $journal?->id, + 'date' => $date->format('Y-m-d'), + 'amount' => $event->amount, + ] + ); + } + +} diff --git a/app/Http/Controllers/PiggyBank/AmountController.php b/app/Http/Controllers/PiggyBank/AmountController.php index 0489c76a12..46802f9f4c 100644 --- a/app/Http/Controllers/PiggyBank/AmountController.php +++ b/app/Http/Controllers/PiggyBank/AmountController.php @@ -129,7 +129,6 @@ class AmountController extends Controller } if ($this->piggyRepos->canAddAmount($piggyBank, $amount)) { $this->piggyRepos->addAmount($piggyBank, $amount); - $this->piggyRepos->createEvent($piggyBank, $amount); session()->flash( 'success', (string) trans( diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index c8f9302154..04f7084e0b 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -25,6 +25,7 @@ namespace FireflyIII\Providers; use Exception; use FireflyIII\Events\ActuallyLoggedIn; use FireflyIII\Events\AdminRequestedTestMessage; +use FireflyIII\Events\ChangedPiggyBankAmount; use FireflyIII\Events\DestroyedTransactionGroup; use FireflyIII\Events\DetectedNewIPAddress; use FireflyIII\Events\RegisteredUser; @@ -140,6 +141,11 @@ class EventServiceProvider extends ServiceProvider WarnUserAboutBill::class => [ 'FireflyIII\Handlers\Events\BillEventHandler@warnAboutBill', ], + + // piggy bank related events: + ChangedPiggyBankAmount::class => [ + 'FireflyIII\Handlers\Events\PiggyBankEventHandler@changePiggyAmount', + ], ]; /** diff --git a/app/Repositories/PiggyBank/ModifiesPiggyBanks.php b/app/Repositories/PiggyBank/ModifiesPiggyBanks.php index 01a2ca0cc7..f68e6d3b44 100644 --- a/app/Repositories/PiggyBank/ModifiesPiggyBanks.php +++ b/app/Repositories/PiggyBank/ModifiesPiggyBanks.php @@ -24,17 +24,15 @@ declare(strict_types=1); namespace FireflyIII\Repositories\PiggyBank; -use Carbon\Carbon; use Exception; +use FireflyIII\Events\ChangedPiggyBankAmount; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Note; use FireflyIII\Models\PiggyBank; -use FireflyIII\Models\PiggyBankEvent; use FireflyIII\Models\PiggyBankRepetition; -use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\ObjectGroup\CreatesObjectGroups; use Illuminate\Database\QueryException; -use Log; +use Illuminate\Support\Facades\Log; /** * Trait ModifiesPiggyBanks @@ -44,8 +42,8 @@ trait ModifiesPiggyBanks use CreatesObjectGroups; /** - * @param PiggyBank $piggyBank - * @param string $amount + * @param PiggyBank $piggyBank + * @param string $amount * * @return bool */ @@ -59,30 +57,34 @@ trait ModifiesPiggyBanks $repetition->currentamount = bcadd($currentAmount, $amount); $repetition->save(); - // create event - //$this->createEvent($piggyBank, $amount); + Log::debug('addAmount: Trigger change for positive amount.'); + event(new ChangedPiggyBankAmount($piggyBank, $amount, null, null)); return true; } /** - * @param PiggyBankRepetition $repetition - * @param string $amount + * @param PiggyBankRepetition $repetition + * @param string $amount * - * @return string + * @return void */ - public function addAmountToRepetition(PiggyBankRepetition $repetition, string $amount): string + public function addAmountToRepetition(PiggyBankRepetition $repetition, string $amount): void { - $newAmount = bcadd($repetition->currentamount, $amount); - $repetition->currentamount = $newAmount; - $repetition->save(); - - return $newAmount; + Log::debug(sprintf('addAmountToRepetition: %s', $amount)); + if (-1 === bccomp($amount, '0')) { + Log::debug('Remove amount.'); + $this->removeAmount($repetition->piggyBank, bcmul($amount, '-1')); + } + if (1 === bccomp($amount, '0')) { + Log::debug('Add amount.'); + $this->addAmount($repetition->piggyBank, $amount); + } } /** - * @param PiggyBank $piggyBank - * @param string $amount + * @param PiggyBank $piggyBank + * @param string $amount * * @return bool */ @@ -90,10 +92,10 @@ trait ModifiesPiggyBanks { $today = today(config('app.timezone')); $leftOnAccount = $this->leftOnAccount($piggyBank, $today); - $savedSoFar = (string) $this->getRepetition($piggyBank)->currentamount; + $savedSoFar = (string)$this->getRepetition($piggyBank)->currentamount; $maxAmount = $leftOnAccount; $leftToSave = null; - if (0.0 !== (float) $piggyBank->targetamount) { + if (0.0 !== (float)$piggyBank->targetamount) { $leftToSave = bcsub($piggyBank->targetamount, $savedSoFar); $maxAmount = 1 === bccomp($leftOnAccount, $leftToSave) ? $leftToSave : $leftOnAccount; } @@ -111,8 +113,8 @@ trait ModifiesPiggyBanks } /** - * @param PiggyBank $piggyBank - * @param string $amount + * @param PiggyBank $piggyBank + * @param string $amount * * @return bool */ @@ -128,25 +130,7 @@ trait ModifiesPiggyBanks } /** - * @param PiggyBank $piggyBank - * @param string $amount - * @param TransactionJournal $journal - * - * @return PiggyBankEvent - */ - public function createEventWithJournal(PiggyBank $piggyBank, string $amount, TransactionJournal $journal): PiggyBankEvent - { - return PiggyBankEvent::create( - [ - 'piggy_bank_id' => $piggyBank->id, - 'transaction_journal_id' => $journal->id, - 'date' => $journal->date->format('Y-m-d'), - 'amount' => $amount] - ); - } - - /** - * @param PiggyBank $piggyBank + * @param PiggyBank $piggyBank * * @return bool * @throws Exception @@ -160,8 +144,8 @@ trait ModifiesPiggyBanks } /** - * @param PiggyBank $piggyBank - * @param string $amount + * @param PiggyBank $piggyBank + * @param string $amount * * @return bool */ @@ -174,27 +158,12 @@ trait ModifiesPiggyBanks $repetition->currentamount = bcsub($repetition->currentamount, $amount); $repetition->save(); - // create event - $this->createEvent($piggyBank, bcmul($amount, '-1')); + Log::debug('addAmount: Trigger change for negative amount.'); + event(new ChangedPiggyBankAmount($piggyBank, bcmul($amount, '-1'), null, null)); return true; } - /** - * @param PiggyBank $piggyBank - * @param string $amount - * - * @return PiggyBankEvent - */ - public function createEvent(PiggyBank $piggyBank, string $amount): PiggyBankEvent - { - if (0 === bccomp('0', $amount)) { - return new PiggyBankEvent; - } - - return PiggyBankEvent::create(['date' => Carbon::now(), 'amount' => $amount, 'piggy_bank_id' => $piggyBank->id]); - } - /** * @inheritDoc */ @@ -206,8 +175,8 @@ trait ModifiesPiggyBanks } /** - * @param PiggyBank $piggyBank - * @param string $amount + * @param PiggyBank $piggyBank + * @param string $amount * * @return PiggyBank */ @@ -225,8 +194,14 @@ trait ModifiesPiggyBanks $repetition->currentamount = $amount; $repetition->save(); - // create event - $this->createEvent($piggyBank, $difference); + if (-1 === bccomp($difference, '0')) { + Log::debug('addAmount: Trigger change for negative amount.'); + event(new ChangedPiggyBankAmount($piggyBank, bcmul($amount, '-1'), null, null)); + } + if (1 === bccomp($difference, '0')) { + Log::debug('addAmount: Trigger change for positive amount.'); + event(new ChangedPiggyBankAmount($piggyBank, $amount, null, null)); + } return $piggyBank; } @@ -242,11 +217,10 @@ trait ModifiesPiggyBanks } return $piggyBank; - } /** - * @param array $data + * @param array $data * * @return PiggyBank * @throws FireflyException @@ -263,7 +237,7 @@ trait ModifiesPiggyBanks unset($piggyData['object_group_title'], $piggyData['object_group_id'], $piggyData['notes'], $piggyData['current_amount']); // validate amount: - if (array_key_exists('targetamount', $piggyData) && '' === (string) $piggyData['targetamount']) { + if (array_key_exists('targetamount', $piggyData) && '' === (string)$piggyData['targetamount']) { $piggyData['targetamount'] = '0'; } @@ -295,10 +269,9 @@ trait ModifiesPiggyBanks $piggyBank->objectGroups()->sync([$objectGroup->id]); $piggyBank->save(); } - } // try also with ID - $objectGroupId = (int) ($data['object_group_id'] ?? 0); + $objectGroupId = (int)($data['object_group_id'] ?? 0); if (0 !== $objectGroupId) { $objectGroup = $this->findObjectGroupById($objectGroupId); if (null !== $objectGroup) { @@ -318,7 +291,7 @@ trait ModifiesPiggyBanks $set = $this->user->piggyBanks()->orderBy('piggy_banks.order', 'ASC')->get(['piggy_banks.*']); $current = 1; foreach ($set as $piggyBank) { - if ((int) $piggyBank->order !== $current) { + if ((int)$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->save(); @@ -332,7 +305,7 @@ trait ModifiesPiggyBanks */ public function setOrder(PiggyBank $piggyBank, int $newOrder): bool { - $oldOrder = (int) $piggyBank->order; + $oldOrder = (int)$piggyBank->order; Log::debug(sprintf('Will move piggy bank #%d ("%s") from %d to %d', $piggyBank->id, $piggyBank->name, $oldOrder, $newOrder)); if ($newOrder > $oldOrder) { $this->user->piggyBanks()->where('piggy_banks.order', '<=', $newOrder)->where('piggy_banks.order', '>', $oldOrder) @@ -356,8 +329,8 @@ trait ModifiesPiggyBanks } /** - * @param PiggyBank $piggyBank - * @param string $note + * @param PiggyBank $piggyBank + * @param string $note * * @return bool */ @@ -387,8 +360,8 @@ trait ModifiesPiggyBanks } /** - * @param PiggyBank $piggyBank - * @param array $data + * @param PiggyBank $piggyBank + * @param array $data * * @return PiggyBank */ @@ -396,12 +369,12 @@ trait ModifiesPiggyBanks { $piggyBank = $this->updateProperties($piggyBank, $data); if (array_key_exists('notes', $data)) { - $this->updateNote($piggyBank, (string) $data['notes']); + $this->updateNote($piggyBank, (string)$data['notes']); } // update the order of the piggy bank: - $oldOrder = (int) $piggyBank->order; - $newOrder = (int) ($data['order'] ?? $oldOrder); + $oldOrder = (int)$piggyBank->order; + $newOrder = (int)($data['order'] ?? $oldOrder); if ($oldOrder !== $newOrder) { $this->setOrder($piggyBank, $newOrder); } @@ -409,9 +382,11 @@ trait ModifiesPiggyBanks // if the piggy bank is now smaller than the current relevant rep, // remove money from the rep. $repetition = $this->getRepetition($piggyBank); - if (null !== $repetition && $repetition->currentamount > $piggyBank->targetamount && 0.0 !== (float) $piggyBank->targetamount) { - $diff = bcsub($piggyBank->targetamount, $repetition->currentamount); - $this->createEvent($piggyBank, $diff); + if (null !== $repetition && $repetition->currentamount > $piggyBank->targetamount && 0.0 !== (float)$piggyBank->targetamount) { + $difference = bcsub($piggyBank->targetamount, $repetition->currentamount); + + // an amount will be removed, create "negative" event: + event(new ChangedPiggyBankAmount($piggyBank, $difference, null, null)); $repetition->currentamount = $piggyBank->targetamount; $repetition->save(); @@ -419,7 +394,7 @@ trait ModifiesPiggyBanks // update using name: if (array_key_exists('object_group_title', $data)) { - $objectGroupTitle = (string) $data['object_group_title']; + $objectGroupTitle = (string)$data['object_group_title']; if ('' !== $objectGroupTitle) { $objectGroup = $this->findOrCreateObjectGroup($objectGroupTitle); if (null !== $objectGroup) { @@ -438,7 +413,7 @@ trait ModifiesPiggyBanks // try also with ID: if (array_key_exists('object_group_id', $data)) { - $objectGroupId = (int) ($data['object_group_id'] ?? 0); + $objectGroupId = (int)($data['object_group_id'] ?? 0); if (0 !== $objectGroupId) { $objectGroup = $this->findObjectGroupById($objectGroupId); if (null !== $objectGroup) { @@ -454,8 +429,8 @@ trait ModifiesPiggyBanks } /** - * @param PiggyBank $piggyBank - * @param array $data + * @param PiggyBank $piggyBank + * @param array $data * * @return PiggyBank */ @@ -465,7 +440,7 @@ trait ModifiesPiggyBanks $piggyBank->name = $data['name']; } if (array_key_exists('account_id', $data) && 0 !== $data['account_id']) { - $piggyBank->account_id = (int) $data['account_id']; + $piggyBank->account_id = (int)$data['account_id']; } if (array_key_exists('targetamount', $data) && '' !== $data['targetamount']) { $piggyBank->targetamount = $data['targetamount']; @@ -475,7 +450,6 @@ trait ModifiesPiggyBanks } if (array_key_exists('startdate', $data)) { $piggyBank->startdate = $data['startdate']; - } $piggyBank->save(); diff --git a/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php b/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php index cc0f494b7e..63e2743a71 100644 --- a/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php +++ b/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php @@ -47,10 +47,8 @@ interface PiggyBankRepositoryInterface /** * @param PiggyBankRepetition $repetition * @param string $amount - * - * @return string */ - public function addAmountToRepetition(PiggyBankRepetition $repetition, string $amount): string; + public function addAmountToRepetition(PiggyBankRepetition $repetition, string $amount): void; /** * @param PiggyBank $piggyBank @@ -68,25 +66,6 @@ interface PiggyBankRepositoryInterface */ public function canRemoveAmount(PiggyBank $piggyBank, string $amount): bool; - /** - * Create a new event. - * - * @param PiggyBank $piggyBank - * @param string $amount - * - * @return PiggyBankEvent - */ - public function createEvent(PiggyBank $piggyBank, string $amount): PiggyBankEvent; - - /** - * @param PiggyBank $piggyBank - * @param string $amount - * @param TransactionJournal $journal - * - * @return PiggyBankEvent - */ - public function createEventWithJournal(PiggyBank $piggyBank, string $amount, TransactionJournal $journal): PiggyBankEvent; - /** * Destroy piggy bank. * diff --git a/app/Services/Internal/Destroy/JournalDestroyService.php b/app/Services/Internal/Destroy/JournalDestroyService.php index 841f39a89b..a005d2d061 100644 --- a/app/Services/Internal/Destroy/JournalDestroyService.php +++ b/app/Services/Internal/Destroy/JournalDestroyService.php @@ -83,6 +83,7 @@ class JournalDestroyService $journal->notes()->delete(); // update events + // TODO move to repository $journal->piggyBankEvents()->update(['transaction_journal_id' => null]); $journal->delete(); diff --git a/app/Services/Internal/Update/GroupCloneService.php b/app/Services/Internal/Update/GroupCloneService.php index 1b5746e51f..5950f62095 100644 --- a/app/Services/Internal/Update/GroupCloneService.php +++ b/app/Services/Internal/Update/GroupCloneService.php @@ -105,7 +105,7 @@ class GroupCloneService // add note saying "cloned". // add relation. - // clone linked piggy banks + // TODO clone ALL linked piggy banks /** @var PiggyBankEvent $event */ $event = $journal->piggyBankEvents()->first(); if(null !== $event) { diff --git a/app/TransactionRules/Actions/UpdatePiggybank.php b/app/TransactionRules/Actions/UpdatePiggybank.php index 614c771b0f..26c232362c 100644 --- a/app/TransactionRules/Actions/UpdatePiggybank.php +++ b/app/TransactionRules/Actions/UpdatePiggybank.php @@ -152,7 +152,6 @@ class UpdatePiggybank implements ActionInterface Log::debug(sprintf('Will now remove %s from piggy bank.', $amount)); $repository->removeAmount($piggyBank, $amount); - $repository->createEventWithJournal($piggyBank, app('steam')->negative($amount), $journal); } /** @@ -191,6 +190,5 @@ class UpdatePiggybank implements ActionInterface Log::debug(sprintf('Will now add %s to piggy bank.', $amount)); $repository->addAmount($piggyBank, $amount); - $repository->createEventWithJournal($piggyBank, app('steam')->positive($amount), $journal); } } diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php index 2d051bcffa..d698c19c43 100644 --- a/resources/lang/en_US/firefly.php +++ b/resources/lang/en_US/firefly.php @@ -1851,6 +1851,7 @@ return [ 'no_tags' => '(no tags)', // piggy banks: + 'event_history' => 'Event history', 'add_money_to_piggy' => 'Add money to piggy bank ":name"', 'piggy_bank' => 'Piggy bank', 'new_piggy_bank' => 'New piggy bank', diff --git a/resources/views/piggy-banks/show.twig b/resources/views/piggy-banks/show.twig index c3ba9a0b10..0c0ef544bb 100644 --- a/resources/views/piggy-banks/show.twig +++ b/resources/views/piggy-banks/show.twig @@ -98,7 +98,7 @@
-

{{ 'transactions'|_ }}

+

{{ 'event_history'|_ }}

{% include 'list/piggy-bank-events' %} From 344cbe4fb7434e74ebf8262985750908a4bb8f43 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 11 Dec 2022 07:29:06 +0100 Subject: [PATCH 32/32] Pass on the journal and update rules. --- app/Factory/PiggyBankEventFactory.php | 5 +- app/Handlers/Events/PiggyBankEventHandler.php | 14 ++++ .../PiggyBank/ModifiesPiggyBanks.php | 17 ++--- .../PiggyBankRepositoryInterface.php | 18 ++--- .../Actions/UpdatePiggybank.php | 65 ++++++++++--------- 5 files changed, 67 insertions(+), 52 deletions(-) diff --git a/app/Factory/PiggyBankEventFactory.php b/app/Factory/PiggyBankEventFactory.php index 158bd3801b..008f5348ed 100644 --- a/app/Factory/PiggyBankEventFactory.php +++ b/app/Factory/PiggyBankEventFactory.php @@ -74,8 +74,7 @@ class PiggyBankEventFactory return; } - // amount can be negative. - - $piggyRepos->addAmountToRepetition($repetition, $amount); + // amount can be negative here + $piggyRepos->addAmountToRepetition($repetition, $amount, $journal); } } diff --git a/app/Handlers/Events/PiggyBankEventHandler.php b/app/Handlers/Events/PiggyBankEventHandler.php index 646d363198..7c97c29b19 100644 --- a/app/Handlers/Events/PiggyBankEventHandler.php +++ b/app/Handlers/Events/PiggyBankEventHandler.php @@ -24,6 +24,8 @@ namespace FireflyIII\Handlers\Events; use Carbon\Carbon; use FireflyIII\Events\ChangedPiggyBankAmount; use FireflyIII\Models\PiggyBankEvent; +use Illuminate\Support\Facades\Log; + /** * Class PiggyBankEventHandler @@ -42,6 +44,18 @@ class PiggyBankEventHandler $journal = $event->transactionGroup->transactionJournals()->first(); } $date = $journal?->date ?? Carbon::now(); + + // sanity check: event must not already exist for this journal and piggy bank. + if (null !== $journal) { + $exists = PiggyBankEvent::where('piggy_bank_id', $event->piggyBank->id) + ->where('transaction_journal_id', $journal->id) + ->exists(); + if($exists) { + Log::warning('Already have event for this journal and piggy, will not create another.'); + return; + } + } + PiggyBankEvent::create( [ 'piggy_bank_id' => $event->piggyBank->id, diff --git a/app/Repositories/PiggyBank/ModifiesPiggyBanks.php b/app/Repositories/PiggyBank/ModifiesPiggyBanks.php index f68e6d3b44..0c2be397a5 100644 --- a/app/Repositories/PiggyBank/ModifiesPiggyBanks.php +++ b/app/Repositories/PiggyBank/ModifiesPiggyBanks.php @@ -30,6 +30,7 @@ use FireflyIII\Exceptions\FireflyException; use FireflyIII\Models\Note; use FireflyIII\Models\PiggyBank; use FireflyIII\Models\PiggyBankRepetition; +use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\ObjectGroup\CreatesObjectGroups; use Illuminate\Database\QueryException; use Illuminate\Support\Facades\Log; @@ -44,10 +45,10 @@ trait ModifiesPiggyBanks /** * @param PiggyBank $piggyBank * @param string $amount - * + * @param TransactionJournal|null $journal * @return bool */ - public function addAmount(PiggyBank $piggyBank, string $amount): bool + public function addAmount(PiggyBank $piggyBank, string $amount, ?TransactionJournal $journal = null): bool { $repetition = $this->getRepetition($piggyBank); if (null === $repetition) { @@ -58,7 +59,7 @@ trait ModifiesPiggyBanks $repetition->save(); Log::debug('addAmount: Trigger change for positive amount.'); - event(new ChangedPiggyBankAmount($piggyBank, $amount, null, null)); + event(new ChangedPiggyBankAmount($piggyBank, $amount, $journal, null)); return true; } @@ -69,16 +70,16 @@ trait ModifiesPiggyBanks * * @return void */ - public function addAmountToRepetition(PiggyBankRepetition $repetition, string $amount): void + public function addAmountToRepetition(PiggyBankRepetition $repetition, string $amount, TransactionJournal $journal): void { Log::debug(sprintf('addAmountToRepetition: %s', $amount)); if (-1 === bccomp($amount, '0')) { Log::debug('Remove amount.'); - $this->removeAmount($repetition->piggyBank, bcmul($amount, '-1')); + $this->removeAmount($repetition->piggyBank, bcmul($amount, '-1'), $journal); } if (1 === bccomp($amount, '0')) { Log::debug('Add amount.'); - $this->addAmount($repetition->piggyBank, $amount); + $this->addAmount($repetition->piggyBank, $amount, $journal); } } @@ -149,7 +150,7 @@ trait ModifiesPiggyBanks * * @return bool */ - public function removeAmount(PiggyBank $piggyBank, string $amount): bool + public function removeAmount(PiggyBank $piggyBank, string $amount, ?TransactionJournal $journal = null): bool { $repetition = $this->getRepetition($piggyBank); if (null === $repetition) { @@ -159,7 +160,7 @@ trait ModifiesPiggyBanks $repetition->save(); Log::debug('addAmount: Trigger change for negative amount.'); - event(new ChangedPiggyBankAmount($piggyBank, bcmul($amount, '-1'), null, null)); + event(new ChangedPiggyBankAmount($piggyBank, bcmul($amount, '-1'), $journal, null)); return true; } diff --git a/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php b/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php index 63e2743a71..e3b83132b2 100644 --- a/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php +++ b/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php @@ -37,18 +37,18 @@ use Illuminate\Support\Collection; interface PiggyBankRepositoryInterface { /** - * @param PiggyBank $piggyBank - * @param string $amount - * + * @param PiggyBank $piggyBank + * @param string $amount + * @param TransactionJournal|null $journal * @return bool */ - public function addAmount(PiggyBank $piggyBank, string $amount): bool; + public function addAmount(PiggyBank $piggyBank, string $amount, ?TransactionJournal $journal = null): bool; /** * @param PiggyBankRepetition $repetition * @param string $amount */ - public function addAmountToRepetition(PiggyBankRepetition $repetition, string $amount): void; + public function addAmountToRepetition(PiggyBankRepetition $repetition, string $amount, TransactionJournal $journal): void; /** * @param PiggyBank $piggyBank @@ -197,12 +197,12 @@ interface PiggyBankRepositoryInterface public function leftOnAccount(PiggyBank $piggyBank, Carbon $date): string; /** - * @param PiggyBank $piggyBank - * @param string $amount - * + * @param PiggyBank $piggyBank + * @param string $amount + * @param TransactionJournal|null $journal * @return bool */ - public function removeAmount(PiggyBank $piggyBank, string $amount): bool; + public function removeAmount(PiggyBank $piggyBank, string $amount, ?TransactionJournal $journal = null): bool; /** * @param PiggyBank $piggyBank diff --git a/app/TransactionRules/Actions/UpdatePiggybank.php b/app/TransactionRules/Actions/UpdatePiggybank.php index 26c232362c..f11220d799 100644 --- a/app/TransactionRules/Actions/UpdatePiggybank.php +++ b/app/TransactionRules/Actions/UpdatePiggybank.php @@ -27,6 +27,7 @@ namespace FireflyIII\TransactionRules\Actions; use FireflyIII\Models\PiggyBank; use FireflyIII\Models\RuleAction; use FireflyIII\Models\Transaction; +use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionType; use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; use FireflyIII\User; @@ -37,14 +38,12 @@ use Log; */ class UpdatePiggybank implements ActionInterface { - - /** @var RuleAction The rule action */ - private $action; + private RuleAction $action; /** * TriggerInterface constructor. * - * @param RuleAction $action + * @param RuleAction $action */ public function __construct(RuleAction $action) { @@ -59,9 +58,10 @@ class UpdatePiggybank implements ActionInterface Log::debug(sprintf('Triggered rule action UpdatePiggybank on journal #%d', $journal['transaction_journal_id'])); // refresh the transaction type. - $user = User::find($journal['user_id']); + $user = User::find($journal['user_id']); + /** @var TransactionJournal $journalObj */ $journalObj = $user->transactionJournals()->find($journal['transaction_journal_id']); - $type = TransactionType::find((int) $journalObj->transaction_type_id); + $type = TransactionType::find((int)$journalObj->transaction_type_id); $journal['transaction_type_type'] = $type->type; if (TransactionType::TRANSFER !== $journal['transaction_type_type']) { @@ -70,10 +70,10 @@ class UpdatePiggybank implements ActionInterface return false; } - $piggyBank = $this->findPiggybank($user); + $piggyBank = $this->findPiggyBank($user); if (null === $piggyBank) { Log::info( - sprintf('No piggy bank names "%s", cant execute action #%d of rule #%d', $this->action->action_value, $this->action->id, $this->action->rule_id) + sprintf('No piggy bank named "%s", cant execute action #%d of rule #%d', $this->action->action_value, $this->action->id, $this->action->rule_id) ); return false; @@ -82,25 +82,27 @@ class UpdatePiggybank implements ActionInterface Log::debug(sprintf('Found piggy bank #%d ("%s")', $piggyBank->id, $piggyBank->name)); /** @var Transaction $source */ - $source = Transaction::where('transaction_journal_id', $journal['transaction_journal_id'])->where('amount', '<', 0)->first(); /** @var Transaction $destination */ - $destination = Transaction::where('transaction_journal_id', $journal['transaction_journal_id'])->where('amount', '>', 0)->first(); + $source = $journalObj->transactions()->where('amount', '<', 0)->first(); + $destination = $journalObj->transactions()->where('amount', '>', 0)->first(); - if ((int) $source->account_id === (int) $piggyBank->account_id) { - Log::debug('Piggy bank account is linked to source, so remove amount.'); + if ((int)$source->account_id === (int)$piggyBank->account_id) { + Log::debug('Piggy bank account is linked to source, so remove amount from piggy bank.'); $this->removeAmount($journal, $piggyBank, $destination->amount); return true; } - if ((int) $destination->account_id === (int) $piggyBank->account_id) { - Log::debug('Piggy bank account is linked to source, so add amount.'); + if ((int)$destination->account_id === (int)$piggyBank->account_id) { + Log::debug('Piggy bank account is linked to source, so add amount to piggy bank.'); $this->addAmount($journal, $piggyBank, $destination->amount); return true; } Log::info( sprintf( - 'Piggy bank is not linked to source ("#%d") or destination ("#%d"), so no action will be taken.', $source->account_id, $destination->account_id + 'Piggy bank is not linked to source ("#%d") or destination ("#%d"), so no action will be taken.', + $source->account_id, + $destination->account_id ) ); @@ -108,30 +110,30 @@ class UpdatePiggybank implements ActionInterface } /** - * @param User $user + * @param User $user * * @return PiggyBank|null */ - private function findPiggybank(User $user): ?PiggyBank + private function findPiggyBank(User $user): ?PiggyBank { return $user->piggyBanks()->where('piggy_banks.name', $this->action->action_value)->first(); } /** - * @param array $journalArray - * @param PiggyBank $piggyBank - * @param string $amount + * @param PiggyBank $piggyBank + * @param TransactionJournal $journal + * @param string $amount + * @return void */ - private function removeAmount(array $journalArray, PiggyBank $piggyBank, string $amount): void + private function removeAmount(PiggyBank $piggyBank, TransactionJournal $journal, string $amount): void { - $user = User::find($journalArray['user_id']); - $journal = $user->transactionJournals()->find($journalArray['transaction_journal_id']); $repository = app(PiggyBankRepositoryInterface::class); $repository->setUser($journal->user); - // how much can we remove from piggy bank? + // how much can we remove from this piggy bank? $toRemove = $repository->getCurrentAmount($piggyBank); Log::debug(sprintf('Amount is %s, max to remove is %s', $amount, $toRemove)); + // if $amount is bigger than $toRemove, shrink it. $amount = -1 === bccomp($amount, $toRemove) ? $amount : $toRemove; Log::debug(sprintf('Amount is now %s', $amount)); @@ -151,18 +153,17 @@ class UpdatePiggybank implements ActionInterface } Log::debug(sprintf('Will now remove %s from piggy bank.', $amount)); - $repository->removeAmount($piggyBank, $amount); + $repository->removeAmount($piggyBank, $amount, $journal); } /** - * @param array $journalArray - * @param PiggyBank $piggyBank - * @param string $amount + * @param PiggyBank $piggyBank + * @param TransactionJournal $journal + * @param string $amount + * @return void */ - private function addAmount(array $journalArray, PiggyBank $piggyBank, string $amount): void + private function addAmount(PiggyBank $piggyBank, TransactionJournal $journal, string $amount): void { - $user = User::find($journalArray['user_id']); - $journal = $user->transactionJournals()->find($journalArray['transaction_journal_id']); $repository = app(PiggyBankRepositoryInterface::class); $repository->setUser($journal->user); @@ -189,6 +190,6 @@ class UpdatePiggybank implements ActionInterface } Log::debug(sprintf('Will now add %s to piggy bank.', $amount)); - $repository->addAmount($piggyBank, $amount); + $repository->addAmount($piggyBank, $amount, $journal); } }