mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-06-15 12:07:09 +00:00
Compare commits
426 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 41a7890c7a | |||
| b8e07c1df4 | |||
| 2a3d9001d1 | |||
| bc7453e204 | |||
| 8c9ad9da83 | |||
| c8bd8d5113 | |||
| 8ce5429e06 | |||
| c1f8fb2f45 | |||
| 5fb4330c20 | |||
| 485eb224d2 | |||
| de7033ee63 | |||
| 4c20547863 | |||
| 3881cd3e39 | |||
| a3e7fa008d | |||
| 205b5bd3bf | |||
| 21c3dc3f56 | |||
| aa4f5d5a2e | |||
| 9c1f79110c | |||
| bd62957908 | |||
| a7e4252b46 | |||
| c18691d6b3 | |||
| b4dbcdcfba | |||
| b0a6acb334 | |||
| a0c423b9ed | |||
| 2844929351 | |||
| 7bfba6a239 | |||
| c0d4a70d46 | |||
| a62f8bbaff | |||
| b115b4ad92 | |||
| dc60025097 | |||
| d77769b2f4 | |||
| c6497960f8 | |||
| 4eee0c79cd | |||
| e333c3254b | |||
| 9d244883a1 | |||
| a17131c2f7 | |||
| 898459198d | |||
| 6466bc9272 | |||
| dd8a8dba85 | |||
| ee16888317 | |||
| 56a2580fd7 | |||
| 2ab0225223 | |||
| 83662415c3 | |||
| cf976b2ab1 | |||
| bf79c9db72 | |||
| 29f4c09a7b | |||
| 22ef456dca | |||
| 9c706465b2 | |||
| a40425fd75 | |||
| e9a37592ba | |||
| 0c598cb034 | |||
| f5dea9ac09 | |||
| 4ef7944147 | |||
| 4e1c84944c | |||
| f36da26cc3 | |||
| 5983a8eb6d | |||
| b4a8a219ff | |||
| 4190c4d243 | |||
| 70cbbc1523 | |||
| c724f13501 | |||
| 5f01a83b43 | |||
| 53c13d221d | |||
| 266cd7d8d0 | |||
| 7c09278c8e | |||
| 21af34c65a | |||
| 594c04b121 | |||
| c50408249b | |||
| b05a38c0e2 | |||
| 0bb1afdf6c | |||
| 547b83b36e | |||
| 134d8c8cf6 | |||
| 94144a407d | |||
| 15e29d133a | |||
| 889ba9f3e6 | |||
| 32fe62df03 | |||
| 21f9be6504 | |||
| d514792f4d | |||
| 5894695ad6 | |||
| 7004c9aaf5 | |||
| 1893a33d84 | |||
| d345b31cd4 | |||
| a27642024d | |||
| c23ad831d0 | |||
| d50c283973 | |||
| 9ea3519585 | |||
| ddb5bc6038 | |||
| b3d048eb67 | |||
| caadef7c64 | |||
| f7c01e6821 | |||
| 3a971d738c | |||
| 1eb4ae3a2c | |||
| 0f30eb59a4 | |||
| 9c10b01e8b | |||
| 7c4f80a360 | |||
| e5c19f6088 | |||
| b067215ba8 | |||
| a17d10b064 | |||
| 859fea532d | |||
| 75261a46d9 | |||
| a4a99310ea | |||
| 8de0844e55 | |||
| e7a6dd792f | |||
| 395ccf8f75 | |||
| dfbfdb6aa2 | |||
| a367ee96bd | |||
| b6b1261df5 | |||
| 52b611d7b3 | |||
| bbc96f457b | |||
| 974c84a877 | |||
| 490c421ae5 | |||
| 48e5adbbfd | |||
| b123f7e6f1 | |||
| bff351bad2 | |||
| 2f0a3238c3 | |||
| dc88781607 | |||
| d6c2698eae | |||
| aee804940b | |||
| b53a756e5a | |||
| ff5d83eba5 | |||
| 4c10c4a26f | |||
| f75817b44d | |||
| 9ad5dfd45b | |||
| 9e3b8e6232 | |||
| 6c3b4a77b5 | |||
| 34b5d9fcf6 | |||
| 12bbc91dca | |||
| a77ff6a51f | |||
| 62eb054c7f | |||
| 13536a2f65 | |||
| 19dece287e | |||
| 897e1f773e | |||
| 5788e18d6d | |||
| c8c4816fe8 | |||
| aa57252b11 | |||
| 58e4c26a87 | |||
| ac323f11c4 | |||
| a907f9b2f7 | |||
| 8abd2a6604 | |||
| 0780390ff6 | |||
| b9d1ed28a5 | |||
| b8ebcdf1a8 | |||
| ac8dbbff6c | |||
| fea89c5231 | |||
| 654f2ee489 | |||
| 5c18624cf9 | |||
| 27ba8e842a | |||
| e504ee204a | |||
| a3a332643c | |||
| 464a89f305 | |||
| 062c2323e3 | |||
| a37f995872 | |||
| a5b6315cb8 | |||
| ff568653c8 | |||
| 21447a9b2f | |||
| 238bfc819e | |||
| 3fab4668fc | |||
| 190050d6cf | |||
| 45d623e0c1 | |||
| 93fe8dbf42 | |||
| 63c49f740f | |||
| bc23bc0173 | |||
| 1611cb3819 | |||
| c520e79b85 | |||
| 51e005f305 | |||
| 133449640d | |||
| c5a126eb61 | |||
| 4222d8ffdd | |||
| 28ff0a8423 | |||
| 4c0e599b01 | |||
| 10d2137723 | |||
| f9b7149fc7 | |||
| 7c3fb7a95a | |||
| 91b7ee06d8 | |||
| 84ea19d14c | |||
| 9950f79a6b | |||
| e3df7675d3 | |||
| 15094097bc | |||
| a07dc4dbc8 | |||
| c86562554b | |||
| 19b548a417 | |||
| 71698b36e2 | |||
| f65ee4d419 | |||
| 535fd9777a | |||
| 5d1fde9cf7 | |||
| 922f1e7c1a | |||
| ef5c35c04d | |||
| 4dfbdc644c | |||
| 4a3f45e125 | |||
| a08f776ffa | |||
| e246c1f4b7 | |||
| f2d1e8e184 | |||
| 19d8f46f24 | |||
| 9ac991edd7 | |||
| e85f06792b | |||
| b66f95f1dc | |||
| 4d63146524 | |||
| 695f990236 | |||
| e882530a69 | |||
| 993a2491e9 | |||
| f6ea517b5d | |||
| 6f4143bb79 | |||
| 4a2c77c6b7 | |||
| 0e62f980b0 | |||
| 41533fd922 | |||
| d6b5fbe341 | |||
| 1047e3290b | |||
| 8ac4c535b4 | |||
| 2c997d8d95 | |||
| 419382f9e0 | |||
| 12f19c6c34 | |||
| 705138aa27 | |||
| 36d20137b2 | |||
| 7f08a3f594 | |||
| a897229958 | |||
| 1fa4632be5 | |||
| 221a00a23b | |||
| 09c3318408 | |||
| 25ba87babb | |||
| d7e9a42f58 | |||
| 8fd6d99c11 | |||
| 463ae00ec2 | |||
| 969460d271 | |||
| 8ecfa4b619 | |||
| 55ae86ad62 | |||
| 5e68d948f3 | |||
| 77cae13b95 | |||
| 49d8a3c32e | |||
| 0ad4db8a71 | |||
| ed9754c8d4 | |||
| 7315825475 | |||
| eea23ed756 | |||
| 04875728b4 | |||
| 1fa51a92c6 | |||
| f8687d4fc1 | |||
| 9b5cf09cc0 | |||
| 268377ad3a | |||
| 93500b8156 | |||
| 8a3fb50607 | |||
| 8a8567c3e4 | |||
| 7922671463 | |||
| 3baa1ccd78 | |||
| 4beef8be86 | |||
| 0aea8875d4 | |||
| 773e2ac262 | |||
| 912a9f1ea7 | |||
| 5a7cf58802 | |||
| 63ab0fba8d | |||
| 42f4eb448d | |||
| b07b0dc69a | |||
| 41ed650336 | |||
| 7d67fe52f9 | |||
| 48f039a275 | |||
| 8cace91ae1 | |||
| bf5eef61e4 | |||
| fdeffc2978 | |||
| f72fe58271 | |||
| 99c9123770 | |||
| 47b02b30ea | |||
| 5f171e36ab | |||
| a352ae54b6 | |||
| 72b746d437 | |||
| 18afac99af | |||
| 3c6e03dbb0 | |||
| ea8d98481f | |||
| afd0dd0758 | |||
| 0ba2cb5274 | |||
| 7d8dc21722 | |||
| 43ea2ab88a | |||
| ed472a17f5 | |||
| fe09f2a664 | |||
| 3469b0253b | |||
| b6e9db7339 | |||
| 374fdbe1d4 | |||
| e0b05b63ec | |||
| 342ca61fb6 | |||
| e9d21faf08 | |||
| 847800f81f | |||
| b1e6f6b264 | |||
| 91d282c9cf | |||
| c53ed44ea3 | |||
| 70b12354e8 | |||
| 6e8d204f00 | |||
| f1578b2c90 | |||
| 90e4ca78a4 | |||
| aae855ed16 | |||
| 2056ba5e08 | |||
| 2cd7983f51 | |||
| cd0c342131 | |||
| bb51baaa38 | |||
| 6bae8ab70a | |||
| 88030784a5 | |||
| 53b733fddb | |||
| ca89159ccd | |||
| a5db3dd2e9 | |||
| b299465fb2 | |||
| 12a877d489 | |||
| 7f64251a55 | |||
| c06d8263d8 | |||
| 5451328ea6 | |||
| 3e5ef0b431 | |||
| 87fb1fcc92 | |||
| 85da46243b | |||
| c44711e9bd | |||
| 18161450e4 | |||
| b48b2a411a | |||
| 453332eae0 | |||
| 4407456167 | |||
| 2842432204 | |||
| 842ec6da47 | |||
| ceb5873ba7 | |||
| 6cfd8273fe | |||
| bd14273201 | |||
| 2a6ba8f00f | |||
| 5986137bb0 | |||
| 1f5962cfbc | |||
| f40cb96906 | |||
| 92b1079eb1 | |||
| 555060ead9 | |||
| d88b728073 | |||
| 5255a17b38 | |||
| dad596dc26 | |||
| b357a5d5ea | |||
| 0c0736d336 | |||
| ae6adf90ee | |||
| 4f0b1c9914 | |||
| dc718d6b89 | |||
| 5252ceeaee | |||
| 56a1eb6515 | |||
| 62ef3966ed | |||
| 241d8fd921 | |||
| 9028898232 | |||
| bf12a5631d | |||
| 8852bb022b | |||
| 03d0d503b0 | |||
| 6b8c8c1b28 | |||
| e43a188af8 | |||
| a806bf3b10 | |||
| 9b05c777cd | |||
| 532d6b21f8 | |||
| 3238441315 | |||
| f75eff173b | |||
| b0af654c01 | |||
| f1515f6139 | |||
| 6e7758da05 | |||
| 29419cc514 | |||
| 370781b8ae | |||
| 5a638ba02e | |||
| cf3c836293 | |||
| 3cd3dafb7f | |||
| ed3f4f62ee | |||
| 80823cdfe3 | |||
| defaef171e | |||
| 81f6f22efb | |||
| 4ad2508675 | |||
| 35f997be45 | |||
| ad3fec1458 | |||
| 25eab80ec3 | |||
| c27e9873b2 | |||
| 84f4f63104 | |||
| 02d37998f9 | |||
| 39c72a60e1 | |||
| 1980f73694 | |||
| d135186149 | |||
| 3e36287374 | |||
| 37c4db2ce9 | |||
| 8e6ff3ceaf | |||
| 6e0e32dc6c | |||
| b0e21dd553 | |||
| 88291c5f63 | |||
| a87e10f734 | |||
| 75f42d57f1 | |||
| 3f60442281 | |||
| dd14bb1664 | |||
| 403a2ce2cd | |||
| e5366dbf6c | |||
| 091f264f3e | |||
| 3ad1420262 | |||
| 018f68b789 | |||
| e23d0de8f9 | |||
| 04c3bf966d | |||
| 681619f732 | |||
| cab298708c | |||
| c4392f89d1 | |||
| 36789a310a | |||
| e92a1b6dda | |||
| 1d687a632f | |||
| 1fa4a1bdc8 | |||
| aee53cffb9 | |||
| 828b965c98 | |||
| c008cd41db | |||
| accac89ffb | |||
| fb79e3b08c | |||
| db2f804b6a | |||
| 986e86ed51 | |||
| 9cbd0380d6 | |||
| f6cd45a44c | |||
| 0e321ad82a | |||
| c353a4de95 | |||
| 57f828a73c | |||
| 11385b208b | |||
| 5584866b96 | |||
| 0b124d875a | |||
| 177cfad862 | |||
| e929cf7cb0 | |||
| 528fda08e9 | |||
| 6f605e5fd2 | |||
| 7c76fc7721 | |||
| 474680dbbf | |||
| 8babc144fe | |||
| 6eb14f8a96 | |||
| c4786586fb | |||
| a22cc889b9 | |||
| 9ea7bd3b01 | |||
| 8d68cef8a5 | |||
| b383ac1a95 | |||
| d2bfb2e9df | |||
| 0afec28e5f | |||
| e60e0bb99e | |||
| 02064445bc | |||
| 386bb811a8 | |||
| 653fa53da2 | |||
| 63d4572863 | |||
| 9eb31fc777 | |||
| 7fd33035a6 | |||
| 5a87f6b2c0 | |||
| cbebd7928f |
@@ -43,6 +43,7 @@ return $config->setRules(
|
||||
// rule sets
|
||||
'@PHP8x3Migration' => true,
|
||||
'@PHP8x4Migration' => true,
|
||||
'@PHP8x5Migration' => true,
|
||||
'@PhpCsFixer' => true,
|
||||
'@PhpCsFixer:risky' => true,
|
||||
'@PSR12' => true,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"require": {
|
||||
"php": ">=8.5.0",
|
||||
"friendsofphp/php-cs-fixer": "^3.12"
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+34
-32
@@ -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": "f1e0b38af4ded66da271a99d2bff5be8",
|
||||
"content-hash": "35b5ad9b3c4e1ffe78ef9bec73987499",
|
||||
"packages": [
|
||||
{
|
||||
"name": "clue/ndjson-react",
|
||||
@@ -402,16 +402,16 @@
|
||||
},
|
||||
{
|
||||
"name": "friendsofphp/php-cs-fixer",
|
||||
"version": "v3.94.0",
|
||||
"version": "v3.94.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
|
||||
"reference": "883b20fb38c7866de9844ab6d0a205c423bde2d4"
|
||||
"reference": "7787ceff91365ba7d623ec410b8f429cdebb4f63"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/883b20fb38c7866de9844ab6d0a205c423bde2d4",
|
||||
"reference": "883b20fb38c7866de9844ab6d0a205c423bde2d4",
|
||||
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/7787ceff91365ba7d623ec410b8f429cdebb4f63",
|
||||
"reference": "7787ceff91365ba7d623ec410b8f429cdebb4f63",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -494,7 +494,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
|
||||
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.94.0"
|
||||
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.94.2"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -502,7 +502,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2026-02-11T16:44:33+00:00"
|
||||
"time": "2026-02-20T16:13:53+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/container",
|
||||
@@ -1264,16 +1264,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/console",
|
||||
"version": "v8.0.4",
|
||||
"version": "v8.0.7",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/console.git",
|
||||
"reference": "ace03c4cf9805080ff40cbeec69fca180c339a3b"
|
||||
"reference": "15ed9008a4ebe2d6a78e4937f74e0c13ef2e618a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/ace03c4cf9805080ff40cbeec69fca180c339a3b",
|
||||
"reference": "ace03c4cf9805080ff40cbeec69fca180c339a3b",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/15ed9008a4ebe2d6a78e4937f74e0c13ef2e618a",
|
||||
"reference": "15ed9008a4ebe2d6a78e4937f74e0c13ef2e618a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1330,7 +1330,7 @@
|
||||
"terminal"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/console/tree/v8.0.4"
|
||||
"source": "https://github.com/symfony/console/tree/v8.0.7"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1350,7 +1350,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2026-01-13T13:06:50+00:00"
|
||||
"time": "2026-03-06T14:06:22+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/deprecation-contracts",
|
||||
@@ -1582,16 +1582,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/filesystem",
|
||||
"version": "v8.0.1",
|
||||
"version": "v8.0.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/filesystem.git",
|
||||
"reference": "d937d400b980523dc9ee946bb69972b5e619058d"
|
||||
"reference": "7bf9162d7a0dff98d079b72948508fa48018a770"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/filesystem/zipball/d937d400b980523dc9ee946bb69972b5e619058d",
|
||||
"reference": "d937d400b980523dc9ee946bb69972b5e619058d",
|
||||
"url": "https://api.github.com/repos/symfony/filesystem/zipball/7bf9162d7a0dff98d079b72948508fa48018a770",
|
||||
"reference": "7bf9162d7a0dff98d079b72948508fa48018a770",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1628,7 +1628,7 @@
|
||||
"description": "Provides basic utilities for the filesystem",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/filesystem/tree/v8.0.1"
|
||||
"source": "https://github.com/symfony/filesystem/tree/v8.0.6"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1648,20 +1648,20 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-12-01T09:13:36+00:00"
|
||||
"time": "2026-02-25T16:59:43+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/finder",
|
||||
"version": "v8.0.5",
|
||||
"version": "v8.0.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/finder.git",
|
||||
"reference": "8bd576e97c67d45941365bf824e18dc8538e6eb0"
|
||||
"reference": "441404f09a54de6d1bd6ad219e088cdf4c91f97c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/finder/zipball/8bd576e97c67d45941365bf824e18dc8538e6eb0",
|
||||
"reference": "8bd576e97c67d45941365bf824e18dc8538e6eb0",
|
||||
"url": "https://api.github.com/repos/symfony/finder/zipball/441404f09a54de6d1bd6ad219e088cdf4c91f97c",
|
||||
"reference": "441404f09a54de6d1bd6ad219e088cdf4c91f97c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1696,7 +1696,7 @@
|
||||
"description": "Finds files and directories via an intuitive fluent interface",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/finder/tree/v8.0.5"
|
||||
"source": "https://github.com/symfony/finder/tree/v8.0.6"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1716,7 +1716,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2026-01-26T15:08:38+00:00"
|
||||
"time": "2026-01-29T09:41:02+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/options-resolver",
|
||||
@@ -2588,16 +2588,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/string",
|
||||
"version": "v8.0.4",
|
||||
"version": "v8.0.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/string.git",
|
||||
"reference": "758b372d6882506821ed666032e43020c4f57194"
|
||||
"reference": "6c9e1108041b5dce21a9a4984b531c4923aa9ec4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/string/zipball/758b372d6882506821ed666032e43020c4f57194",
|
||||
"reference": "758b372d6882506821ed666032e43020c4f57194",
|
||||
"url": "https://api.github.com/repos/symfony/string/zipball/6c9e1108041b5dce21a9a4984b531c4923aa9ec4",
|
||||
"reference": "6c9e1108041b5dce21a9a4984b531c4923aa9ec4",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2654,7 +2654,7 @@
|
||||
"utf8"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/string/tree/v8.0.4"
|
||||
"source": "https://github.com/symfony/string/tree/v8.0.6"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -2674,7 +2674,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2026-01-12T12:37:40+00:00"
|
||||
"time": "2026-02-09T10:14:57+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
@@ -2683,7 +2683,9 @@
|
||||
"stability-flags": {},
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": {},
|
||||
"platform": {
|
||||
"php": ">=8.5.0"
|
||||
},
|
||||
"platform-dev": {},
|
||||
"plugin-api-version": "2.9.0"
|
||||
}
|
||||
|
||||
+49
-13
@@ -1,30 +1,66 @@
|
||||
parameters:
|
||||
ergebnis:
|
||||
noExtends:
|
||||
enabled: false
|
||||
final:
|
||||
enabled: false
|
||||
noParameterWithNullDefaultValue:
|
||||
enabled: false
|
||||
noParameterWithNullableTypeDeclaration:
|
||||
enabled: false
|
||||
noCompact:
|
||||
enabled: false
|
||||
noSwitch:
|
||||
enabled: false
|
||||
noNullableReturnTypeDeclaration:
|
||||
enabled: false
|
||||
finalInAbstractClass:
|
||||
enabled: false
|
||||
noConstructorParameterWithDefaultValue:
|
||||
enabled: false
|
||||
noNamedArgument:
|
||||
enabled: false
|
||||
noParameterWithContainerTypeDeclaration:
|
||||
enabled: false
|
||||
paths:
|
||||
- ../app
|
||||
- ../database
|
||||
- ../routes
|
||||
- ../config
|
||||
- ../bootstrap/app.php
|
||||
- ../bootstrap/providers.php
|
||||
universalObjectCratesClasses:
|
||||
- Illuminate\Database\Eloquent\Model
|
||||
reportUnmatchedIgnoredErrors: true
|
||||
ignoreErrors:
|
||||
# all errors below I will never fix.
|
||||
- '#expects view-string\|null, string given#'
|
||||
- '#expects view-string, string given#'
|
||||
- "#Parameter \\#[1-2] \\$num[1-2] of function bc[a-z]+ expects numeric-string, [a-z\\-|&]+ given#"
|
||||
# ignore everything but things that BREAK
|
||||
- identifier: property.deprecated
|
||||
- identifier: method.deprecated
|
||||
- identifier: cast.useless
|
||||
- identifier: argument.type
|
||||
# all errors below I will (probably) never fix.
|
||||
- identifier: property.unusedType # one false positive
|
||||
- identifier: varTag.nativeType # dont even know what im supposed to fix.
|
||||
- identifier: method.notFound # way too many false positives
|
||||
- identifier: catch.neverThrown # plenty of errors that are thrown undocumented
|
||||
- identifier: staticMethod.dynamicName # dont care
|
||||
- identifier: arguments.count # one false positive
|
||||
- identifier: property.notFound # false positives
|
||||
- identifier: method.dynamicName # i dont care
|
||||
- identifier: staticMethod.dynamicCall # many false positives.
|
||||
- identifier: argument.templateType # no clue how to fix single occurrence.
|
||||
# - '#expects view-string\|null, string given#'
|
||||
# - '#expects view-string, string given#'
|
||||
# - "#Parameter \\#[1-2] \\$num[1-2] of function bc[a-z]+ expects numeric-string, [a-z\\-|&]+ given#"
|
||||
- identifier: missingType.generics # not interesting enough to fix.
|
||||
-
|
||||
identifier: larastan.noEnvCallsOutsideOfConfig
|
||||
path: ../app/Console/Commands/System/CreatesDatabase.php
|
||||
- identifier: missingType.iterableValue # not interesting enough to fix.
|
||||
- identifier: varTag.type # needs a custom extension for every repository, not gonna happen.
|
||||
- '#Dynamic call to static method Illuminate#'
|
||||
- '#Call to an undefined method Illuminate\\Database\\Eloquent\\Relations\\HasMany::before#' # is custom scope
|
||||
- '#Call to an undefined method Illuminate\\Database\\Eloquent\\Relations\\HasMany::after#' # is custom scope
|
||||
- '#Call to an undefined method Illuminate\\Database\\Eloquent\\Relations\\HasMany::withTrashed#' # is to allow soft delete
|
||||
- '#Call to an undefined method Illuminate\\Database\\Eloquent\\Relations\\HasMany::accountTypeIn#' # is a custom scope
|
||||
- '#Call to an undefined method Illuminate\\Database\\Eloquent\\Relations\\BelongsTo::withTrashed#' # is to allow soft delete
|
||||
# - '#Dynamic call to static method Illuminate#'
|
||||
# - '#Call to an undefined method Illuminate\\Database\\Eloquent\\Relations\\HasMany::before#' # is custom scope
|
||||
# - '#Call to an undefined method Illuminate\\Database\\Eloquent\\Relations\\HasMany::after#' # is custom scope
|
||||
# - '#Call to an undefined method Illuminate\\Database\\Eloquent\\Relations\\HasMany::withTrashed#' # is to allow soft delete
|
||||
# - '#Call to an undefined method Illuminate\\Database\\Eloquent\\Relations\\HasMany::accountTypeIn#' # is a custom scope
|
||||
# - '#Call to an undefined method Illuminate\\Database\\Eloquent\\Relations\\BelongsTo::withTrashed#' # is to allow soft delete
|
||||
|
||||
# The level 8 is the highest level. original was 5
|
||||
# 7 is more than enough, higher just leaves NULL things.
|
||||
|
||||
+1
-1
@@ -173,7 +173,7 @@ MAIL_ENCRYPTION=null
|
||||
MAIL_SENDMAIL_COMMAND=
|
||||
|
||||
#
|
||||
# If you use self-signed certificates for your STMP server, you can use the following settings.
|
||||
# If you use self-signed certificates for your SMTP server, you can use the following settings.
|
||||
#
|
||||
MAIL_ALLOW_SELF_SIGNED=false
|
||||
MAIL_VERIFY_PEER=true
|
||||
|
||||
@@ -4,9 +4,9 @@ body:
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Support guidelines
|
||||
description: Please read the support guidelines before proceeding.
|
||||
description: Thank you for reading the support guidelines before proceeding.
|
||||
options:
|
||||
- label: I've read the <!-- MZ2udTpin6FL --> [support guidelines](https://github.com/firefly-iii/firefly-iii/blob/main/.github/support.md)
|
||||
- label: I'm smart and I read the <!-- MZ2udTpin6FL --> [support guidelines](https://github.com/firefly-iii/firefly-iii/blob/main/.github/support.md)
|
||||
required: true
|
||||
|
||||
- type: checkboxes
|
||||
@@ -29,7 +29,7 @@ body:
|
||||
attributes:
|
||||
label: Debug information
|
||||
description: Please provide the table from the /debug page. Do not add backticks or quotes.
|
||||
placeholder: The output from the /debug page
|
||||
placeholder: The output from the /debug page or "N/A"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
@@ -1,23 +1,57 @@
|
||||
<!--
|
||||
Thank you for submitting new code to Firefly III, or any of the related projects. Please read the following rules carefully.
|
||||
|
||||
- Please do not submit solutions for problems that are not already reported in an issue.
|
||||
- Unfortunately, Firefly III can't be your learning experience. If you're new to all of this, please open an issue first.
|
||||
- Please do not open PRs to "discuss" possible solutions or to "get feedback" on your code. I simply don't have time for that.
|
||||
- Pull requests for the MAIN branch will be closed.
|
||||
- DO NOT include translated strings in your PR.
|
||||
- PRs (or parts thereof) that only fix issues inside code comments will not be accepted.
|
||||
🙌 Thanks for contributing a pull request. Before you continue:
|
||||
|
||||
If it feels necessary to open an issue first, please do so, before you open a PR.
|
||||
1. If you introduce new financial solutions or concepts, talk to me FIRST.
|
||||
2. If your PR is more than 25 lines, talk to me FIRST.
|
||||
3. If you fix spelling or code comments, talk to me FIRST.
|
||||
|
||||
See also: https://docs.firefly-iii.org/explanation/support/#contributing-code
|
||||
This is to prevent AI bots, low-effort PRs and spam. Sorry about that.
|
||||
|
||||
Wanna talk to me? Open a GitHub Issue, Discussion, or email me: james@firefly-iii.org
|
||||
|
||||
👀 Please ensure you have taken a look at the contribution guidelines:
|
||||
https://docs.firefly-iii.org/explanation/support/#contributing-code
|
||||
|
||||
Remember that your PR may be CLOSED:
|
||||
|
||||
1. If you do not refer to an existing issue, your PR will be CLOSED.
|
||||
2. If you open a PR on the main branch, your PR will be CLOSED.
|
||||
3. If you only fix a spelling error or code comment, your PR will be CLOSED.
|
||||
|
||||
Again, this is to prevent AI bots, low-effort PRs and spam. I apologize for the harsh tone.
|
||||
|
||||
But if you made it this far thanks again for contributing, and happy developing!
|
||||
|
||||
-->
|
||||
|
||||
This PR fixes issue # (if relevant).
|
||||
|
||||
Changes in this pull request:
|
||||
#### Reference issues and PRs
|
||||
<!--
|
||||
Example: Fixes #1234. See also #3456.
|
||||
-->
|
||||
|
||||
#### What does this implement/fix? Explain your changes.
|
||||
|
||||
|
||||
|
||||
#### AI usage disclosure
|
||||
<!--
|
||||
If AI tools were involved in creating this PR, please check all boxes that apply
|
||||
below and make sure that you adhere to our Automated Contributions Policy:
|
||||
https://docs.firefly-iii.org/explanation/support/#automated-contributions-policy
|
||||
-->
|
||||
I used AI assistance for:
|
||||
- [ ] Code generation (e.g., when writing an implementation or fixing a bug)
|
||||
- [ ] Test/benchmark generation
|
||||
- [ ] Documentation (including examples)
|
||||
- [ ] Research and understanding
|
||||
|
||||
|
||||
#### Any other comments?
|
||||
|
||||
<!--
|
||||
Thanks for contributing!
|
||||
-->
|
||||
|
||||
@JC5
|
||||
|
||||
-
|
||||
-
|
||||
-
|
||||
|
||||
+18
-7
@@ -3,13 +3,12 @@
|
||||
Firefly III is an application to manage your personal finances. As such, the developer has adopted this security
|
||||
disclosure and response policy to ensure that critical issues are responsibly handled.
|
||||
|
||||
## Supported Versions
|
||||
## Supported versions
|
||||
|
||||
Only the latest Firefly III release is maintained. Applicable fixes, including security fixes, will not backported to
|
||||
older release branches. Please refer to [releases.md](https://github.com/firefly-iii/firefly-iii/blob/main/releases.md)
|
||||
for details.
|
||||
older release branches. Please refer to [releases.md](https://github.com/firefly-iii/firefly-iii/blob/main/releases.md) for details.
|
||||
|
||||
## Reporting a Vulnerability - Private Disclosure Process
|
||||
## Reporting a vulnerability - private disclosure process
|
||||
|
||||
Security is of the highest importance and all security vulnerabilities or suspected security vulnerabilities should be
|
||||
reported to Firefly III privately, to minimize attacks against current users of Firefly III before they are fixed.
|
||||
@@ -28,7 +27,7 @@ within 3 business days, including a detailed plan to investigate the issue and a
|
||||
the meantime. Do not report non-security-impacting bugs through this channel.
|
||||
Use [GitHub issues](https://github.com/firefly-iii/firefly-iii/issues/new/choose) instead.
|
||||
|
||||
### Proposed Email Content
|
||||
### Proposed email content
|
||||
|
||||
Provide a descriptive subject line and in the body of the email include the following information:
|
||||
|
||||
@@ -47,7 +46,7 @@ Provide a descriptive subject line and in the body of the email include the foll
|
||||
* When you know of or suspect a potential vulnerability on another project that is used by Firefly III. For example
|
||||
Firefly III has a dependency on Docker, MySQL, etc.
|
||||
|
||||
## Patch, Release, and Disclosure
|
||||
## Patch, release, and disclosure
|
||||
|
||||
The Firefly III developer will respond to vulnerability reports as follows:
|
||||
|
||||
@@ -75,7 +74,7 @@ The Firefly III developer will respond to vulnerability reports as follows:
|
||||
8. 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
|
||||
### 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 Mastodon, Gitter and other channels will
|
||||
@@ -97,6 +96,18 @@ III to provide a hardened Firefly III environment. We will not act on any securi
|
||||
safe defaults. Over time, we will work towards improved safe-by-default configuration, taking into account backwards
|
||||
compatibility.
|
||||
|
||||
## Security scanning through automated means
|
||||
|
||||
There is some additional guidance for security vulnerabilities or suspected security vulnerabilities that have been
|
||||
found with the full or partial support of AI coding agents, large language models and other code-scanning tools. These reports are often not applicable, not actually a vulnerability, or just plain wrong. This takes time away from responding to
|
||||
*actual* security vulnerabilities or suspected security vulnerabilities. If you use automated means to search for security vulnerabilities in the Firefly III code base, please take care to:
|
||||
|
||||
1. manually validate the results before you submit a report,
|
||||
2. explain how the vulnerability can actually be abused by a nefarious third party, and
|
||||
3. try to limit the verbosity of your report.
|
||||
|
||||
At the discretion of the maintainer of the developer, your report may be closed without resolve.
|
||||
|
||||
## Credits
|
||||
|
||||
This security policy is based on [Harbor](https://github.com/goharbor/harbor)'s security policy.
|
||||
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
DDNOV="${DDNOV:1}"
|
||||
|
||||
echo "Firefly III version is ${{ steps.ff3version.outputs.release }}, without v is $FFNOV"
|
||||
echo "Data importer version is ${{ steps.ff3version.outputs.release }}, without v is $FFNOV"
|
||||
echo "Data importer version is ${{ steps.ff3version.outputs.release }}, without v is $DDNOV"
|
||||
|
||||
# user includes no debug info at all, and does not mention current version.
|
||||
# user includes no debug info at all, but does mention current version
|
||||
|
||||
@@ -10,7 +10,7 @@ on:
|
||||
phpversion:
|
||||
description: 'PHP version'
|
||||
required: true
|
||||
default: '8.4'
|
||||
default: '8.5'
|
||||
schedule:
|
||||
- cron: '0 3 * * MON'
|
||||
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Import GPG key
|
||||
uses: crazy-max/ghaction-import-gpg@v6
|
||||
uses: crazy-max/ghaction-import-gpg@v7
|
||||
with:
|
||||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||
passphrase: ${{ secrets.PASSPHRASE }}
|
||||
@@ -42,7 +42,7 @@ jobs:
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ github.event.inputs.phpversion || '8.4' }}
|
||||
php-version: ${{ github.event.inputs.phpversion || '8.5' }}
|
||||
extensions: mbstring, intl, zip, bcmath
|
||||
- name: Switch and pull
|
||||
run: |
|
||||
@@ -174,12 +174,24 @@ jobs:
|
||||
uses: nhedger/setup-mago@v1
|
||||
- name: Run CI
|
||||
run: |
|
||||
cp .env.example .env
|
||||
# install all packages etc.
|
||||
rm -rf vendor composer.lock
|
||||
composer update --no-scripts --no-plugins -q
|
||||
mago format || true
|
||||
mago analyze --reporting-format=github || true
|
||||
composer update --no-scripts -q
|
||||
|
||||
# format code.
|
||||
echo "Will now run Mago Format"
|
||||
mago format
|
||||
sudo chown -R runner:docker resources/lang
|
||||
.ci/phpcs.sh || true
|
||||
echo "Will now run PHPCS"
|
||||
.ci/phpcs.sh
|
||||
|
||||
# lint and check
|
||||
echo "Will now run Mago Lint"
|
||||
mago lint
|
||||
echo "Will now run PHPstan"
|
||||
.ci/phpstan.sh
|
||||
rm .env
|
||||
- name: Calculate variables
|
||||
run: |
|
||||
|
||||
|
||||
@@ -4,6 +4,13 @@ Over time, many people have contributed to Firefly III. Their efforts are not al
|
||||
Please find below all the people who contributed to the Firefly III code. Their names are mentioned in the year of their first contribution.
|
||||
|
||||
## 2026
|
||||
- Joe Longendyke
|
||||
- Daniel Holøien
|
||||
- Matthew Grove
|
||||
- Cinnamon Pyro
|
||||
- R1DEN
|
||||
- RiDEN
|
||||
- Khoa Nguyen
|
||||
- Nick Huang
|
||||
- mateuszkulapl
|
||||
- Gianluca Martino
|
||||
|
||||
@@ -41,7 +41,7 @@ use Illuminate\Support\Facades\Log;
|
||||
/**
|
||||
* Class AccountController
|
||||
*/
|
||||
class AccountController extends Controller
|
||||
final class AccountController extends Controller
|
||||
{
|
||||
use AccountFilter;
|
||||
|
||||
@@ -80,23 +80,23 @@ class AccountController extends Controller
|
||||
public function accounts(AutocompleteApiRequest $request): JsonResponse
|
||||
{
|
||||
// Log::debug('Before All.');
|
||||
['types' => $types, 'query' => $query, 'date' => $date, 'limit' => $limit] = $request->attributes->all();
|
||||
['types' => $types, 'query' => $query, 'date' => $date, 'limit' => $limit] = $request->attributes->all();
|
||||
|
||||
$date ??= today(config('app.timezone'));
|
||||
|
||||
// set date to end-of-day for account balance. so it is at $date 23:59:59
|
||||
$date->endOfDay();
|
||||
|
||||
$return = [];
|
||||
$result = $this->repository->searchAccount((string) $query, $types, $limit);
|
||||
$allBalances = Steam::accountsBalancesOptimized($result, $date, $this->primaryCurrency, $this->convertToPrimary);
|
||||
$return = [];
|
||||
$result = $this->repository->searchAccount((string) $query, $types, $limit);
|
||||
$allBalances = Steam::accountsBalancesOptimized($result, $date, $this->primaryCurrency, $this->convertToPrimary);
|
||||
|
||||
/** @var Account $account */
|
||||
foreach ($result as $account) {
|
||||
$nameWithBalance = $account->name;
|
||||
$currency = $this->repository->getAccountCurrency($account) ?? $this->primaryCurrency;
|
||||
$useCurrency = $currency;
|
||||
if (in_array($account->accountType->type, $this->balanceTypes, true)) {
|
||||
if (in_array($account->accountType->type, $this->balanceTypes, strict: true)) {
|
||||
// this one is correct.
|
||||
Log::debug(sprintf('accounts: Call finalAccountBalance with date/time "%s"', $date->toIso8601String()));
|
||||
$balance = $allBalances[$account->id] ?? [];
|
||||
|
||||
@@ -35,7 +35,7 @@ use Illuminate\Http\Request;
|
||||
/**
|
||||
* Class BillController
|
||||
*/
|
||||
class BillController extends Controller
|
||||
final class BillController extends Controller
|
||||
{
|
||||
private BillRepositoryInterface $repository;
|
||||
protected array $acceptedRoles = [UserRoleEnum::READ_SUBSCRIPTIONS];
|
||||
@@ -63,7 +63,7 @@ class BillController extends Controller
|
||||
public function bills(AutocompleteApiRequest $request): JsonResponse
|
||||
{
|
||||
$result = $this->repository->searchBill($request->attributes->get('query'), $request->attributes->get('limit'));
|
||||
$filtered = $result->map(static fn (Bill $item): array => ['id' => (string) $item->id, 'name' => $item->name, 'active' => $item->active]);
|
||||
$filtered = $result->map(static fn (Bill $item): array => ['id' => (string) $item->id, 'name' => $item->name, 'active' => $item->active]);
|
||||
|
||||
return response()->api($filtered->toArray());
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ use Illuminate\Http\Request;
|
||||
/**
|
||||
* Class BudgetController
|
||||
*/
|
||||
class BudgetController extends Controller
|
||||
final class BudgetController extends Controller
|
||||
{
|
||||
private BudgetRepositoryInterface $repository;
|
||||
protected array $acceptedRoles = [UserRoleEnum::READ_BUDGETS];
|
||||
@@ -63,7 +63,7 @@ class BudgetController extends Controller
|
||||
public function budgets(AutocompleteApiRequest $request): JsonResponse
|
||||
{
|
||||
$result = $this->repository->searchBudget($request->attributes->get('query'), $request->attributes->get('limit'));
|
||||
$filtered = $result->map(static fn (Budget $item): array => ['id' => (string) $item->id, 'name' => $item->name, 'active' => $item->active]);
|
||||
$filtered = $result->map(static fn (Budget $item): array => ['id' => (string) $item->id, 'name' => $item->name, 'active' => $item->active]);
|
||||
|
||||
return response()->api($filtered->toArray());
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ use Illuminate\Http\Request;
|
||||
/**
|
||||
* Class CategoryController
|
||||
*/
|
||||
class CategoryController extends Controller
|
||||
final class CategoryController extends Controller
|
||||
{
|
||||
private CategoryRepositoryInterface $repository;
|
||||
protected array $acceptedRoles = [UserRoleEnum::READ_ONLY];
|
||||
@@ -63,7 +63,7 @@ class CategoryController extends Controller
|
||||
public function categories(AutocompleteApiRequest $request): JsonResponse
|
||||
{
|
||||
$result = $this->repository->searchCategory($request->attributes->get('query'), $request->attributes->get('limit'));
|
||||
$filtered = $result->map(static fn (Category $item): array => ['id' => (string) $item->id, 'name' => $item->name]);
|
||||
$filtered = $result->map(static fn (Category $item): array => ['id' => (string) $item->id, 'name' => $item->name]);
|
||||
|
||||
return response()->api($filtered->toArray());
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ use Illuminate\Http\Request;
|
||||
/**
|
||||
* Class CurrencyController
|
||||
*/
|
||||
class CurrencyController extends Controller
|
||||
final class CurrencyController extends Controller
|
||||
{
|
||||
private CurrencyRepositoryInterface $repository;
|
||||
protected array $acceptedRoles = [UserRoleEnum::READ_ONLY];
|
||||
|
||||
@@ -35,7 +35,7 @@ use Illuminate\Http\Request;
|
||||
/**
|
||||
* Class ObjectGroupController
|
||||
*/
|
||||
class ObjectGroupController extends Controller
|
||||
final class ObjectGroupController extends Controller
|
||||
{
|
||||
private ObjectGroupRepositoryInterface $repository;
|
||||
protected array $acceptedRoles = [UserRoleEnum::READ_ONLY];
|
||||
@@ -67,7 +67,7 @@ class ObjectGroupController extends Controller
|
||||
|
||||
/** @var ObjectGroup $objectGroup */
|
||||
foreach ($result as $objectGroup) {
|
||||
$return[] = ['id' => (string) $objectGroup->id, 'name' => $objectGroup->title, 'title' => $objectGroup->title];
|
||||
$return[] = ['id' => (string) $objectGroup->id, 'name' => $objectGroup->title, 'title' => $objectGroup->title];
|
||||
}
|
||||
|
||||
return response()->api($return);
|
||||
|
||||
@@ -38,7 +38,7 @@ use Illuminate\Http\Request;
|
||||
/**
|
||||
* Class PiggyBankController
|
||||
*/
|
||||
class PiggyBankController extends Controller
|
||||
final class PiggyBankController extends Controller
|
||||
{
|
||||
private AccountRepositoryInterface $accountRepository;
|
||||
private PiggyBankRepositoryInterface $piggyRepository;
|
||||
|
||||
@@ -35,7 +35,7 @@ use Illuminate\Http\Request;
|
||||
/**
|
||||
* Class RecurrenceController
|
||||
*/
|
||||
class RecurrenceController extends Controller
|
||||
final class RecurrenceController extends Controller
|
||||
{
|
||||
private RecurringRepositoryInterface $repository;
|
||||
protected array $acceptedRoles = [UserRoleEnum::READ_RECURRING];
|
||||
|
||||
@@ -35,7 +35,7 @@ use Illuminate\Http\Request;
|
||||
/**
|
||||
* Class RuleController
|
||||
*/
|
||||
class RuleController extends Controller
|
||||
final class RuleController extends Controller
|
||||
{
|
||||
private RuleRepositoryInterface $repository;
|
||||
protected array $acceptedRoles = [UserRoleEnum::READ_RULES];
|
||||
|
||||
@@ -35,7 +35,7 @@ use Illuminate\Http\Request;
|
||||
/**
|
||||
* Class RuleGroupController
|
||||
*/
|
||||
class RuleGroupController extends Controller
|
||||
final class RuleGroupController extends Controller
|
||||
{
|
||||
private RuleGroupRepositoryInterface $repository;
|
||||
protected array $acceptedRoles = [UserRoleEnum::READ_RULES];
|
||||
|
||||
@@ -35,7 +35,7 @@ use Illuminate\Http\Request;
|
||||
/**
|
||||
* Class TagController
|
||||
*/
|
||||
class TagController extends Controller
|
||||
final class TagController extends Controller
|
||||
{
|
||||
private TagRepositoryInterface $repository;
|
||||
protected array $acceptedRoles = [UserRoleEnum::READ_ONLY];
|
||||
@@ -63,7 +63,7 @@ class TagController extends Controller
|
||||
|
||||
/** @var Tag $tag */
|
||||
foreach ($result as $tag) {
|
||||
$array[] = ['id' => (string) $tag->id, 'name' => $tag->tag, 'tag' => $tag->tag];
|
||||
$array[] = ['id' => (string) $tag->id, 'name' => $tag->tag, 'tag' => $tag->tag];
|
||||
}
|
||||
|
||||
return response()->api($array);
|
||||
|
||||
@@ -39,7 +39,7 @@ use Illuminate\Support\Collection;
|
||||
/**
|
||||
* Class TransactionController
|
||||
*/
|
||||
class TransactionController extends Controller
|
||||
final class TransactionController extends Controller
|
||||
{
|
||||
protected array $acceptedRoles = [UserRoleEnum::READ_ONLY];
|
||||
private TransactionGroupRepositoryInterface $groupRepository;
|
||||
|
||||
@@ -35,7 +35,7 @@ use Illuminate\Http\Request;
|
||||
/**
|
||||
* Class TransactionTypeController
|
||||
*/
|
||||
class TransactionTypeController extends Controller
|
||||
final class TransactionTypeController extends Controller
|
||||
{
|
||||
private TransactionTypeRepositoryInterface $repository;
|
||||
protected array $acceptedRoles = [UserRoleEnum::READ_ONLY];
|
||||
@@ -62,7 +62,7 @@ class TransactionTypeController extends Controller
|
||||
/** @var TransactionType $type */
|
||||
foreach ($types as $type) {
|
||||
// different key for consistency.
|
||||
$array[] = ['id' => (string) $type->id, 'name' => $type->type, 'type' => $type->type];
|
||||
$array[] = ['id' => (string) $type->id, 'name' => $type->type, 'type' => $type->type];
|
||||
}
|
||||
|
||||
return response()->api($array);
|
||||
|
||||
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Api\V1\Controllers\Chart;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Api\V1\Controllers\Controller;
|
||||
use FireflyIII\Api\V1\Requests\Chart\ChartRequest;
|
||||
use FireflyIII\Enums\UserRoleEnum;
|
||||
@@ -43,7 +44,7 @@ use Illuminate\Support\Facades\Log;
|
||||
/**
|
||||
* Class AccountController
|
||||
*/
|
||||
class AccountController extends Controller
|
||||
final class AccountController extends Controller
|
||||
{
|
||||
use ApiSupport;
|
||||
use CleansChartData;
|
||||
@@ -142,23 +143,29 @@ class AccountController extends Controller
|
||||
}
|
||||
// create array of values to collect.
|
||||
|
||||
$rangeDates = array_map(static fn (string $d): Carbon => Carbon::createFromFormat('Y-m-d', $d)->startOfDay(), array_keys($range));
|
||||
$rangeVals = array_values($range);
|
||||
$rangeIdx = 0;
|
||||
$rangeCount = count($rangeDates);
|
||||
|
||||
while ($currentStart <= $params['end']) {
|
||||
$format = $currentStart->format('Y-m-d');
|
||||
$label = $currentStart->toAtomString();
|
||||
$balance = array_key_exists($format, $range) ? $range[$format]['balance'] : $previous;
|
||||
$previous = $balance;
|
||||
$currentSet['entries'][$label] = $balance;
|
||||
|
||||
// do the same for the primary currency balance, if relevant:
|
||||
$pcBalance = null;
|
||||
if ($this->convertToPrimary) {
|
||||
$pcBalance = array_key_exists($format, $range) ? $range[$format]['pc_balance'] : $pcPrevious;
|
||||
$pcPrevious = $pcBalance;
|
||||
$currentSet['pc_entries'][$label] = $pcBalance;
|
||||
// Advance through all range entries up to current chart date
|
||||
while ($rangeIdx < $rangeCount && $rangeDates[$rangeIdx] <= $currentStart) {
|
||||
$previous = $rangeVals[$rangeIdx]['balance'];
|
||||
if ($this->convertToPrimary) {
|
||||
$pcPrevious = $rangeVals[$rangeIdx]['pc_balance'];
|
||||
}
|
||||
++$rangeIdx;
|
||||
}
|
||||
$currentStart = Navigation::addPeriod($currentStart, $period);
|
||||
|
||||
// $currentStart->addDay();
|
||||
$currentSet['entries'][$label] = $previous;
|
||||
if ($this->convertToPrimary) {
|
||||
$currentSet['pc_entries'][$label] = $pcPrevious;
|
||||
}
|
||||
|
||||
$currentStart = Navigation::addPeriod($currentStart, $period);
|
||||
}
|
||||
$this->chartData[] = $currentSet;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ use Illuminate\Http\Request;
|
||||
/**
|
||||
* Class BalanceController
|
||||
*/
|
||||
class BalanceController extends Controller
|
||||
final class BalanceController extends Controller
|
||||
{
|
||||
use CleansChartData;
|
||||
use CollectsAccountsFromFilter;
|
||||
|
||||
@@ -47,7 +47,7 @@ use Illuminate\Support\Facades\Log;
|
||||
/**
|
||||
* Class BudgetController
|
||||
*/
|
||||
class BudgetController extends Controller
|
||||
final class BudgetController extends Controller
|
||||
{
|
||||
use CleansChartData;
|
||||
use ValidatesUserGroupTrait;
|
||||
@@ -220,7 +220,7 @@ class BudgetController extends Controller
|
||||
'end_date' => $row['end'],
|
||||
'yAxisID' => 0,
|
||||
'type' => 'bar',
|
||||
'entries' => ['budgeted' => $row['budgeted'], 'spent' => $row['spent'], 'left' => $row['left'], 'overspent' => $row['overspent']],
|
||||
'entries' => ['budgeted' => $row['budgeted'], 'spent' => $row['spent'], 'left' => $row['left'], 'overspent' => $row['overspent']],
|
||||
'pc_entries' => [
|
||||
'budgeted' => $row['pc_budgeted'],
|
||||
'spent' => $row['pc_spent'],
|
||||
|
||||
@@ -45,7 +45,7 @@ use Illuminate\Support\Facades\Log;
|
||||
/**
|
||||
* Class BudgetController
|
||||
*/
|
||||
class CategoryController extends Controller
|
||||
final class CategoryController extends Controller
|
||||
{
|
||||
use CleansChartData;
|
||||
use ValidatesUserGroupTrait;
|
||||
@@ -153,8 +153,8 @@ class CategoryController extends Controller
|
||||
'end_date' => $end->toAtomString(),
|
||||
'yAxisID' => 0,
|
||||
'type' => 'bar',
|
||||
'entries' => ['spent' => '0', 'earned' => '0'],
|
||||
'pc_entries' => ['spent' => '0', 'earned' => '0'],
|
||||
'entries' => ['spent' => '0', 'earned' => '0'],
|
||||
'pc_entries' => ['spent' => '0', 'earned' => '0'],
|
||||
];
|
||||
|
||||
// add monies
|
||||
|
||||
@@ -63,6 +63,8 @@ abstract class Controller extends BaseController
|
||||
use ValidatesRequests;
|
||||
use ValidatesUserGroupTrait;
|
||||
|
||||
protected array $acceptedRoles = [];
|
||||
|
||||
protected const string CONTENT_TYPE = 'application/vnd.api+json';
|
||||
protected const string JSON_CONTENT_TYPE = 'application/json';
|
||||
|
||||
@@ -169,6 +171,9 @@ abstract class Controller extends BaseController
|
||||
return $manager->createData($resource)->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
#[Deprecated(message: <<<'TXT'
|
||||
use Request classes
|
||||
Method to grab all parameters from the URL
|
||||
@@ -222,11 +227,8 @@ abstract class Controller extends BaseController
|
||||
$value = min(max(1, $value), 2 ** 16);
|
||||
$bag->set($integer, $value);
|
||||
}
|
||||
if (
|
||||
null === $value
|
||||
&& 'limit' === $integer // @phpstan-ignore-line
|
||||
&& auth()->check()
|
||||
) {
|
||||
// && 'limit' === $integer
|
||||
if (null === $value && auth()->check()) {
|
||||
// set default for user:
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
|
||||
@@ -42,7 +42,7 @@ use Illuminate\Http\Request;
|
||||
* Because this is a security nightmare waiting to happen validation
|
||||
* is pretty strict.
|
||||
*/
|
||||
class TransactionController extends Controller
|
||||
final class TransactionController extends Controller
|
||||
{
|
||||
private AccountRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ use Illuminate\Support\Facades\Log;
|
||||
/**
|
||||
* Class DestroyController
|
||||
*/
|
||||
class DestroyController extends Controller
|
||||
final class DestroyController extends Controller
|
||||
{
|
||||
private bool $unused;
|
||||
|
||||
@@ -185,6 +185,8 @@ class DestroyController extends Controller
|
||||
/** @var BudgetRepositoryInterface $budgetRepository */
|
||||
$budgetRepository = app(BudgetRepositoryInterface::class);
|
||||
$budgetRepository->destroyAll();
|
||||
|
||||
$abRepository->cleanup();
|
||||
}
|
||||
|
||||
private function destroyCategories(): void
|
||||
|
||||
@@ -38,7 +38,7 @@ use function Safe\date;
|
||||
/**
|
||||
* Class ExportController
|
||||
*/
|
||||
class ExportController extends Controller
|
||||
final class ExportController extends Controller
|
||||
{
|
||||
private ExportDataGenerator $exporter;
|
||||
protected array $acceptedRoles = [UserRoleEnum::READ_ONLY];
|
||||
|
||||
@@ -44,7 +44,7 @@ use Illuminate\Http\Request;
|
||||
/**
|
||||
* Class PurgeController
|
||||
*/
|
||||
class PurgeController extends Controller
|
||||
final class PurgeController extends Controller
|
||||
{
|
||||
protected array $acceptedRoles = [UserRoleEnum::FULL];
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ use Illuminate\Http\JsonResponse;
|
||||
* Shows expense information grouped or limited by date.
|
||||
* I.e. all expenses grouped by account + currency.
|
||||
*/
|
||||
class AccountController extends Controller
|
||||
final class AccountController extends Controller
|
||||
{
|
||||
use ApiSupport;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ use Illuminate\Support\Facades\Log;
|
||||
/**
|
||||
* Class BillController
|
||||
*/
|
||||
class BillController extends Controller
|
||||
final class BillController extends Controller
|
||||
{
|
||||
private BillRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ use Illuminate\Support\Collection;
|
||||
/**
|
||||
* Class BudgetController
|
||||
*/
|
||||
class BudgetController extends Controller
|
||||
final class BudgetController extends Controller
|
||||
{
|
||||
private NoBudgetRepositoryInterface $noRepository;
|
||||
private OperationsRepositoryInterface $opsRepository;
|
||||
|
||||
@@ -36,7 +36,7 @@ use Illuminate\Support\Collection;
|
||||
/**
|
||||
* Class CategoryController
|
||||
*/
|
||||
class CategoryController extends Controller
|
||||
final class CategoryController extends Controller
|
||||
{
|
||||
private NoCategoryRepositoryInterface $noRepository;
|
||||
private OperationsRepositoryInterface $opsRepository;
|
||||
|
||||
@@ -35,7 +35,7 @@ use Illuminate\Support\Facades\Log;
|
||||
/**
|
||||
* Class PeriodController
|
||||
*/
|
||||
class PeriodController extends Controller
|
||||
final class PeriodController extends Controller
|
||||
{
|
||||
public function total(GenericRequest $request): JsonResponse
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ use Illuminate\Support\Facades\Log;
|
||||
/**
|
||||
* Class TagController
|
||||
*/
|
||||
class TagController extends Controller
|
||||
final class TagController extends Controller
|
||||
{
|
||||
private TagRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ use Illuminate\Http\JsonResponse;
|
||||
* Shows income information grouped or limited by date.
|
||||
* I.e. all income grouped by account + currency.
|
||||
*/
|
||||
class AccountController extends Controller
|
||||
final class AccountController extends Controller
|
||||
{
|
||||
use ApiSupport;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ use Illuminate\Support\Collection;
|
||||
/**
|
||||
* Class CategoryController
|
||||
*/
|
||||
class CategoryController extends Controller
|
||||
final class CategoryController extends Controller
|
||||
{
|
||||
private NoCategoryRepositoryInterface $noRepository;
|
||||
private OperationsRepositoryInterface $opsRepository;
|
||||
|
||||
@@ -35,7 +35,7 @@ use Illuminate\Http\JsonResponse;
|
||||
/**
|
||||
* Class PeriodController
|
||||
*/
|
||||
class PeriodController extends Controller
|
||||
final class PeriodController extends Controller
|
||||
{
|
||||
public function total(GenericRequest $request): JsonResponse
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ use Illuminate\Http\JsonResponse;
|
||||
/**
|
||||
* Class TagController
|
||||
*/
|
||||
class TagController extends Controller
|
||||
final class TagController extends Controller
|
||||
{
|
||||
private TagRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ use Illuminate\Http\JsonResponse;
|
||||
/**
|
||||
* Class AccountController
|
||||
*/
|
||||
class AccountController extends Controller
|
||||
final class AccountController extends Controller
|
||||
{
|
||||
use ApiSupport;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ use Illuminate\Support\Collection;
|
||||
/**
|
||||
* Class CategoryController
|
||||
*/
|
||||
class CategoryController extends Controller
|
||||
final class CategoryController extends Controller
|
||||
{
|
||||
private NoCategoryRepositoryInterface $noRepository;
|
||||
private OperationsRepositoryInterface $opsRepository;
|
||||
|
||||
@@ -35,7 +35,7 @@ use Illuminate\Http\JsonResponse;
|
||||
/**
|
||||
* Class PeriodController
|
||||
*/
|
||||
class PeriodController extends Controller
|
||||
final class PeriodController extends Controller
|
||||
{
|
||||
public function total(GenericRequest $request): JsonResponse
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ use Illuminate\Http\JsonResponse;
|
||||
/**
|
||||
* Class TagController
|
||||
*/
|
||||
class TagController extends Controller
|
||||
final class TagController extends Controller
|
||||
{
|
||||
private TagRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ use Illuminate\Http\JsonResponse;
|
||||
/**
|
||||
* Class DestroyController
|
||||
*/
|
||||
class DestroyController extends Controller
|
||||
final class DestroyController extends Controller
|
||||
{
|
||||
public const string RESOURCE_KEY = 'accounts';
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ use League\Fractal\Resource\Collection as FractalCollection;
|
||||
/**
|
||||
* Class ListController
|
||||
*/
|
||||
class ListController extends Controller
|
||||
final class ListController extends Controller
|
||||
{
|
||||
use TransactionFilter;
|
||||
|
||||
@@ -70,21 +70,21 @@ class ListController extends Controller
|
||||
|
||||
public function attachments(PaginationRequest $request, Account $account): JsonResponse
|
||||
{
|
||||
$manager = $this->getManager();
|
||||
['limit' => $limit, 'offset' => $offset, 'page' => $page] = $request->attributes->all();
|
||||
$collection = $this->repository->getAttachments($account);
|
||||
$manager = $this->getManager();
|
||||
['limit' => $limit, 'offset' => $offset, 'page' => $page] = $request->attributes->all();
|
||||
$collection = $this->repository->getAttachments($account);
|
||||
|
||||
$count = $collection->count();
|
||||
$attachments = $collection->slice($offset, $limit);
|
||||
$count = $collection->count();
|
||||
$attachments = $collection->slice($offset, $limit);
|
||||
|
||||
// make paginator:
|
||||
$paginator = new LengthAwarePaginator($attachments, $count, $limit, $page);
|
||||
$paginator = new LengthAwarePaginator($attachments, $count, $limit, $page);
|
||||
$paginator->setPath(route('api.v1.accounts.attachments', [$account->id]).$this->buildParams());
|
||||
|
||||
/** @var AttachmentTransformer $transformer */
|
||||
$transformer = app(AttachmentTransformer::class);
|
||||
$transformer = app(AttachmentTransformer::class);
|
||||
|
||||
$resource = new FractalCollection($attachments, $transformer, 'attachments');
|
||||
$resource = new FractalCollection($attachments, $transformer, 'attachments');
|
||||
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
|
||||
|
||||
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
|
||||
@@ -93,31 +93,31 @@ class ListController extends Controller
|
||||
public function piggyBanks(PaginationRequest $request, Account $account): JsonResponse
|
||||
{
|
||||
// create some objects:
|
||||
$manager = $this->getManager();
|
||||
$manager = $this->getManager();
|
||||
|
||||
['limit' => $limit, 'offset' => $offset, 'page' => $page] = $request->attributes->all();
|
||||
['limit' => $limit, 'offset' => $offset, 'page' => $page] = $request->attributes->all();
|
||||
|
||||
// get list of piggy banks. Count it and split it.
|
||||
$collection = $this->repository->getPiggyBanks($account);
|
||||
$count = $collection->count();
|
||||
$piggyBanks = $collection->slice($offset, $limit);
|
||||
$collection = $this->repository->getPiggyBanks($account);
|
||||
$count = $collection->count();
|
||||
$piggyBanks = $collection->slice($offset, $limit);
|
||||
|
||||
// enrich
|
||||
/** @var User $admin */
|
||||
$admin = auth()->user();
|
||||
$enrichment = new PiggyBankEnrichment();
|
||||
$admin = auth()->user();
|
||||
$enrichment = new PiggyBankEnrichment();
|
||||
$enrichment->setUser($admin);
|
||||
$piggyBanks = $enrichment->enrich($piggyBanks);
|
||||
$piggyBanks = $enrichment->enrich($piggyBanks);
|
||||
|
||||
// make paginator:
|
||||
$paginator = new LengthAwarePaginator($piggyBanks, $count, $limit, $page);
|
||||
$paginator = new LengthAwarePaginator($piggyBanks, $count, $limit, $page);
|
||||
$paginator->setPath(route('api.v1.accounts.piggy-banks', [$account->id]).$this->buildParams());
|
||||
|
||||
/** @var PiggyBankTransformer $transformer */
|
||||
$transformer = app(PiggyBankTransformer::class);
|
||||
$transformer = app(PiggyBankTransformer::class);
|
||||
// $transformer->setParameters($this->parameters);
|
||||
|
||||
$resource = new FractalCollection($piggyBanks, $transformer, 'piggy-banks');
|
||||
$resource = new FractalCollection($piggyBanks, $transformer, 'piggy-banks');
|
||||
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
|
||||
|
||||
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
|
||||
@@ -128,15 +128,16 @@ class ListController extends Controller
|
||||
*/
|
||||
public function transactions(PaginationDateRangeRequest $request, Account $account): JsonResponse
|
||||
{
|
||||
['limit' => $limit, 'page' => $page, 'start' => $start, 'end' => $end, 'types' => $types] = $request->attributes->all();
|
||||
$manager = $this->getManager();
|
||||
['limit' => $limit, 'page' => $page, 'start' => $start, 'end' => $end, 'type' => $type] = $request->attributes->all();
|
||||
$types = $this->mapTransactionTypes($type ?? 'default');
|
||||
$manager = $this->getManager();
|
||||
|
||||
/** @var User $admin */
|
||||
$admin = auth()->user();
|
||||
$admin = auth()->user();
|
||||
|
||||
// use new group collector:
|
||||
/** @var GroupCollectorInterface $collector */
|
||||
$collector = app(GroupCollectorInterface::class);
|
||||
$collector = app(GroupCollectorInterface::class);
|
||||
$collector->setUser($admin)->setAccounts(new Collection()->push($account))->withAPIInformation()->setLimit($limit)->setPage($page)->setTypes($types);
|
||||
if (null !== $start) {
|
||||
$collector->setStart($start);
|
||||
@@ -145,18 +146,18 @@ class ListController extends Controller
|
||||
$collector->setEnd($end);
|
||||
}
|
||||
|
||||
$paginator = $collector->getPaginatedGroups();
|
||||
$paginator = $collector->getPaginatedGroups();
|
||||
$paginator->setPath(route('api.v1.accounts.transactions', [$account->id]).$this->buildParams());
|
||||
|
||||
// enrich
|
||||
$enrichment = new TransactionGroupEnrichment();
|
||||
$enrichment = new TransactionGroupEnrichment();
|
||||
$enrichment->setUser($admin);
|
||||
$transactions = $enrichment->enrich($paginator->getCollection());
|
||||
$transactions = $enrichment->enrich($paginator->getCollection());
|
||||
|
||||
/** @var TransactionGroupTransformer $transformer */
|
||||
$transformer = app(TransactionGroupTransformer::class);
|
||||
$transformer = app(TransactionGroupTransformer::class);
|
||||
|
||||
$resource = new FractalCollection($transactions, $transformer, 'transactions');
|
||||
$resource = new FractalCollection($transactions, $transformer, 'transactions');
|
||||
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
|
||||
|
||||
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
|
||||
|
||||
@@ -41,7 +41,7 @@ use League\Fractal\Resource\Item;
|
||||
/**
|
||||
* Class ShowController
|
||||
*/
|
||||
class ShowController extends Controller
|
||||
final class ShowController extends Controller
|
||||
{
|
||||
use AccountFilter;
|
||||
|
||||
@@ -124,22 +124,22 @@ class ShowController extends Controller
|
||||
// get list of accounts. Count it and split it.
|
||||
$this->repository->resetAccountOrder();
|
||||
$account->refresh();
|
||||
$manager = $this->getManager();
|
||||
['start' => $start, 'end' => $end, 'date' => $date] = $request->attributes->all();
|
||||
$manager = $this->getManager();
|
||||
['start' => $start, 'end' => $end, 'date' => $date] = $request->attributes->all();
|
||||
|
||||
// enrich
|
||||
/** @var User $admin */
|
||||
$admin = auth()->user();
|
||||
$enrichment = new AccountEnrichment();
|
||||
$admin = auth()->user();
|
||||
$enrichment = new AccountEnrichment();
|
||||
$enrichment->setDate($date);
|
||||
$enrichment->setStart($start);
|
||||
$enrichment->setEnd($end);
|
||||
$enrichment->setUser($admin);
|
||||
$account = $enrichment->enrichSingle($account);
|
||||
$account = $enrichment->enrichSingle($account);
|
||||
|
||||
/** @var AccountTransformer $transformer */
|
||||
$transformer = app(AccountTransformer::class);
|
||||
$resource = new Item($account, $transformer, self::RESOURCE_KEY);
|
||||
$transformer = app(AccountTransformer::class);
|
||||
$resource = new Item($account, $transformer, self::RESOURCE_KEY);
|
||||
|
||||
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ use League\Fractal\Resource\Item;
|
||||
/**
|
||||
* Class StoreController
|
||||
*/
|
||||
class StoreController extends Controller
|
||||
final class StoreController extends Controller
|
||||
{
|
||||
public const string RESOURCE_KEY = 'accounts';
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use League\Fractal\Resource\Item;
|
||||
/**
|
||||
* Class UpdateController
|
||||
*/
|
||||
class UpdateController extends Controller
|
||||
final class UpdateController extends Controller
|
||||
{
|
||||
public const string RESOURCE_KEY = 'accounts';
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
/**
|
||||
* Class DestroyController
|
||||
*/
|
||||
class DestroyController extends Controller
|
||||
final class DestroyController extends Controller
|
||||
{
|
||||
private AttachmentRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
/**
|
||||
* Class ShowController
|
||||
*/
|
||||
class ShowController extends Controller
|
||||
final class ShowController extends Controller
|
||||
{
|
||||
private AttachmentRepositoryInterface $repository;
|
||||
|
||||
@@ -121,7 +121,7 @@ class ShowController extends Controller
|
||||
*/
|
||||
public function index(PaginationRequest $request): JsonResponse
|
||||
{
|
||||
['limit' => $limit, 'offset' => $offset, 'page' => $page] = $request->attributes->all();
|
||||
['limit' => $limit, 'offset' => $offset, 'page' => $page] = $request->attributes->all();
|
||||
|
||||
if (true === auth()->user()->hasRole('demo')) {
|
||||
Log::channel('audit')->warning(sprintf('Demo user tries to access attachment API in %s', __METHOD__));
|
||||
@@ -129,21 +129,21 @@ class ShowController extends Controller
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
|
||||
$manager = $this->getManager();
|
||||
$manager = $this->getManager();
|
||||
|
||||
// get list of attachments. Count it and split it.
|
||||
$collection = $this->repository->get();
|
||||
$count = $collection->count();
|
||||
$attachments = $collection->slice($offset, $limit);
|
||||
$collection = $this->repository->get();
|
||||
$count = $collection->count();
|
||||
$attachments = $collection->slice($offset, $limit);
|
||||
|
||||
// make paginator:
|
||||
$paginator = new LengthAwarePaginator($attachments, $count, $limit, $page);
|
||||
$paginator = new LengthAwarePaginator($attachments, $count, $limit, $page);
|
||||
$paginator->setPath(route('api.v1.attachments.index').$this->buildParams());
|
||||
|
||||
/** @var AttachmentTransformer $transformer */
|
||||
$transformer = app(AttachmentTransformer::class);
|
||||
$transformer = app(AttachmentTransformer::class);
|
||||
|
||||
$resource = new FractalCollection($attachments, $transformer, 'attachments');
|
||||
$resource = new FractalCollection($attachments, $transformer, 'attachments');
|
||||
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
|
||||
|
||||
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
|
||||
|
||||
@@ -42,7 +42,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
/**
|
||||
* Class StoreController
|
||||
*/
|
||||
class StoreController extends Controller
|
||||
final class StoreController extends Controller
|
||||
{
|
||||
private AttachmentRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
/**
|
||||
* Class UpdateController
|
||||
*/
|
||||
class UpdateController extends Controller
|
||||
final class UpdateController extends Controller
|
||||
{
|
||||
private AttachmentRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ use League\Fractal\Resource\Item;
|
||||
/**
|
||||
* Class ShowController
|
||||
*/
|
||||
class ShowController extends Controller
|
||||
final class ShowController extends Controller
|
||||
{
|
||||
private AvailableBudgetRepositoryInterface $abRepository;
|
||||
|
||||
@@ -68,29 +68,29 @@ class ShowController extends Controller
|
||||
*/
|
||||
public function index(PaginationDateRangeRequest $request): JsonResponse
|
||||
{
|
||||
$manager = $this->getManager();
|
||||
['limit' => $limit, 'offset' => $offset, 'page' => $page, 'start' => $start, 'end' => $end] = $request->attributes->all();
|
||||
$manager = $this->getManager();
|
||||
['limit' => $limit, 'offset' => $offset, 'page' => $page, 'start' => $start, 'end' => $end] = $request->attributes->all();
|
||||
|
||||
// get list of available budgets. Count it and split it.
|
||||
$collection = $this->abRepository->getAvailableBudgetsByDate($start, $end);
|
||||
$count = $collection->count();
|
||||
$availableBudgets = $collection->slice($offset, $limit);
|
||||
$collection = $this->abRepository->getAvailableBudgetsByDate($start, $end);
|
||||
$count = $collection->count();
|
||||
$availableBudgets = $collection->slice($offset, $limit);
|
||||
|
||||
// enrich
|
||||
/** @var User $admin */
|
||||
$admin = auth()->user();
|
||||
$enrichment = new AvailableBudgetEnrichment();
|
||||
$admin = auth()->user();
|
||||
$enrichment = new AvailableBudgetEnrichment();
|
||||
$enrichment->setUser($admin);
|
||||
$availableBudgets = $enrichment->enrich($availableBudgets);
|
||||
$availableBudgets = $enrichment->enrich($availableBudgets);
|
||||
|
||||
// make paginator:
|
||||
$paginator = new LengthAwarePaginator($availableBudgets, $count, $limit, $page);
|
||||
$paginator = new LengthAwarePaginator($availableBudgets, $count, $limit, $page);
|
||||
$paginator->setPath(route('api.v1.available-budgets.index').$this->buildParams());
|
||||
|
||||
/** @var AvailableBudgetTransformer $transformer */
|
||||
$transformer = app(AvailableBudgetTransformer::class);
|
||||
$transformer = app(AvailableBudgetTransformer::class);
|
||||
|
||||
$resource = new FractalCollection($availableBudgets, $transformer, 'available_budgets');
|
||||
$resource = new FractalCollection($availableBudgets, $transformer, 'available_budgets');
|
||||
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
|
||||
|
||||
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
|
||||
|
||||
@@ -33,7 +33,7 @@ use Illuminate\Http\JsonResponse;
|
||||
/**
|
||||
* Class DestroyController
|
||||
*/
|
||||
class DestroyController extends Controller
|
||||
final class DestroyController extends Controller
|
||||
{
|
||||
private BillRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ use League\Fractal\Resource\Collection as FractalCollection;
|
||||
/**
|
||||
* Class ListController
|
||||
*/
|
||||
class ListController extends Controller
|
||||
final class ListController extends Controller
|
||||
{
|
||||
use TransactionFilter;
|
||||
|
||||
@@ -72,21 +72,21 @@ class ListController extends Controller
|
||||
*/
|
||||
public function attachments(PaginationRequest $request, Bill $bill): JsonResponse
|
||||
{
|
||||
['limit' => $limit, 'offset' => $offset, 'page' => $page] = $request->attributes->all();
|
||||
$manager = $this->getManager();
|
||||
$collection = $this->repository->getAttachments($bill);
|
||||
['limit' => $limit, 'offset' => $offset, 'page' => $page] = $request->attributes->all();
|
||||
$manager = $this->getManager();
|
||||
$collection = $this->repository->getAttachments($bill);
|
||||
|
||||
$count = $collection->count();
|
||||
$attachments = $collection->slice($offset, $limit);
|
||||
$count = $collection->count();
|
||||
$attachments = $collection->slice($offset, $limit);
|
||||
|
||||
// make paginator:
|
||||
$paginator = new LengthAwarePaginator($attachments, $count, $limit, $page);
|
||||
$paginator = new LengthAwarePaginator($attachments, $count, $limit, $page);
|
||||
$paginator->setPath(route('api.v1.bills.attachments', [$bill->id]).$this->buildParams());
|
||||
|
||||
/** @var AttachmentTransformer $transformer */
|
||||
$transformer = app(AttachmentTransformer::class);
|
||||
$transformer = app(AttachmentTransformer::class);
|
||||
|
||||
$resource = new FractalCollection($attachments, $transformer, 'attachments');
|
||||
$resource = new FractalCollection($attachments, $transformer, 'attachments');
|
||||
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
|
||||
|
||||
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
|
||||
@@ -100,20 +100,20 @@ class ListController extends Controller
|
||||
*/
|
||||
public function rules(PaginationRequest $request, Bill $bill): JsonResponse
|
||||
{
|
||||
['limit' => $limit, 'offset' => $offset, 'page' => $page] = $request->attributes->all();
|
||||
['limit' => $limit, 'offset' => $offset, 'page' => $page] = $request->attributes->all();
|
||||
|
||||
$manager = $this->getManager();
|
||||
$collection = $this->repository->getRulesForBill($bill);
|
||||
$count = $collection->count();
|
||||
$rules = $collection->slice($offset, $limit);
|
||||
$manager = $this->getManager();
|
||||
$collection = $this->repository->getRulesForBill($bill);
|
||||
$count = $collection->count();
|
||||
$rules = $collection->slice($offset, $limit);
|
||||
|
||||
// make paginator:
|
||||
$paginator = new LengthAwarePaginator($rules, $count, $limit, $page);
|
||||
$paginator = new LengthAwarePaginator($rules, $count, $limit, $page);
|
||||
$paginator->setPath(route('api.v1.bills.rules', [$bill->id]).$this->buildParams());
|
||||
|
||||
/** @var RuleTransformer $transformer */
|
||||
$transformer = app(RuleTransformer::class);
|
||||
$resource = new FractalCollection($rules, $transformer, 'rules');
|
||||
$transformer = app(RuleTransformer::class);
|
||||
$resource = new FractalCollection($rules, $transformer, 'rules');
|
||||
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
|
||||
|
||||
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
|
||||
@@ -127,16 +127,16 @@ class ListController extends Controller
|
||||
*/
|
||||
public function transactions(PaginationDateRangeRequest $request, Bill $bill): JsonResponse
|
||||
{
|
||||
['limit' => $limit, 'page' => $page, 'types' => $types, 'start' => $start, 'end' => $end] = $request->attributes->all();
|
||||
['limit' => $limit, 'page' => $page, 'types' => $types, 'start' => $start, 'end' => $end] = $request->attributes->all();
|
||||
|
||||
$manager = $this->getManager();
|
||||
$manager = $this->getManager();
|
||||
|
||||
/** @var User $admin */
|
||||
$admin = auth()->user();
|
||||
$admin = auth()->user();
|
||||
|
||||
// use new group collector:
|
||||
/** @var GroupCollectorInterface $collector */
|
||||
$collector = app(GroupCollectorInterface::class);
|
||||
$collector = app(GroupCollectorInterface::class);
|
||||
$collector
|
||||
->setUser($admin)
|
||||
// include source + destination account name and type.
|
||||
@@ -159,18 +159,18 @@ class ListController extends Controller
|
||||
}
|
||||
|
||||
// get paginator.
|
||||
$paginator = $collector->getPaginatedGroups();
|
||||
$paginator = $collector->getPaginatedGroups();
|
||||
$paginator->setPath(route('api.v1.bills.transactions', [$bill->id]).$this->buildParams());
|
||||
|
||||
// enrich
|
||||
$enrichment = new TransactionGroupEnrichment();
|
||||
$enrichment = new TransactionGroupEnrichment();
|
||||
$enrichment->setUser($admin);
|
||||
$transactions = $enrichment->enrich($paginator->getCollection());
|
||||
$transactions = $enrichment->enrich($paginator->getCollection());
|
||||
|
||||
/** @var TransactionGroupTransformer $transformer */
|
||||
$transformer = app(TransactionGroupTransformer::class);
|
||||
$transformer = app(TransactionGroupTransformer::class);
|
||||
|
||||
$resource = new FractalCollection($transactions, $transformer, 'transactions');
|
||||
$resource = new FractalCollection($transactions, $transformer, 'transactions');
|
||||
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
|
||||
|
||||
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
|
||||
|
||||
@@ -41,7 +41,7 @@ use League\Fractal\Resource\Item;
|
||||
/**
|
||||
* Class ShowController
|
||||
*/
|
||||
class ShowController extends Controller
|
||||
final class ShowController extends Controller
|
||||
{
|
||||
private BillRepositoryInterface $repository;
|
||||
|
||||
@@ -67,28 +67,28 @@ class ShowController extends Controller
|
||||
*/
|
||||
public function index(PaginationDateRangeRequest $request): JsonResponse
|
||||
{
|
||||
['limit' => $limit, 'offset' => $offset, 'start' => $start, 'end' => $end, 'page' => $page] = $request->attributes->all();
|
||||
['limit' => $limit, 'offset' => $offset, 'start' => $start, 'end' => $end, 'page' => $page] = $request->attributes->all();
|
||||
|
||||
$this->repository->correctOrder();
|
||||
$bills = $this->repository->getBills();
|
||||
$manager = $this->getManager();
|
||||
$count = $bills->count();
|
||||
$bills = $bills->slice($offset, $limit);
|
||||
$paginator = new LengthAwarePaginator($bills, $count, $limit, $page);
|
||||
$bills = $this->repository->getBills();
|
||||
$manager = $this->getManager();
|
||||
$count = $bills->count();
|
||||
$bills = $bills->slice($offset, $limit);
|
||||
$paginator = new LengthAwarePaginator($bills, $count, $limit, $page);
|
||||
|
||||
// enrich
|
||||
/** @var User $admin */
|
||||
$admin = auth()->user();
|
||||
$enrichment = new SubscriptionEnrichment();
|
||||
$admin = auth()->user();
|
||||
$enrichment = new SubscriptionEnrichment();
|
||||
$enrichment->setUser($admin);
|
||||
$enrichment->setStart($start);
|
||||
$enrichment->setEnd($end);
|
||||
$bills = $enrichment->enrich($bills);
|
||||
$bills = $enrichment->enrich($bills);
|
||||
|
||||
/** @var BillTransformer $transformer */
|
||||
$transformer = app(BillTransformer::class);
|
||||
$transformer = app(BillTransformer::class);
|
||||
|
||||
$resource = new FractalCollection($bills, $transformer, 'bills');
|
||||
$resource = new FractalCollection($bills, $transformer, 'bills');
|
||||
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
|
||||
|
||||
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
|
||||
@@ -102,23 +102,23 @@ class ShowController extends Controller
|
||||
*/
|
||||
public function show(DateRangeRequest $request, Bill $bill): JsonResponse
|
||||
{
|
||||
['start' => $start, 'end' => $end] = $request->attributes->all();
|
||||
['start' => $start, 'end' => $end] = $request->attributes->all();
|
||||
|
||||
$manager = $this->getManager();
|
||||
$manager = $this->getManager();
|
||||
|
||||
// enrich
|
||||
/** @var User $admin */
|
||||
$admin = auth()->user();
|
||||
$enrichment = new SubscriptionEnrichment();
|
||||
$admin = auth()->user();
|
||||
$enrichment = new SubscriptionEnrichment();
|
||||
$enrichment->setUser($admin);
|
||||
$enrichment->setStart($start);
|
||||
$enrichment->setEnd($end);
|
||||
$bill = $enrichment->enrichSingle($bill);
|
||||
$bill = $enrichment->enrichSingle($bill);
|
||||
|
||||
/** @var BillTransformer $transformer */
|
||||
$transformer = app(BillTransformer::class);
|
||||
$transformer = app(BillTransformer::class);
|
||||
|
||||
$resource = new Item($bill, $transformer, 'bills');
|
||||
$resource = new Item($bill, $transformer, 'bills');
|
||||
|
||||
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ use League\Fractal\Resource\Item;
|
||||
/**
|
||||
* Class StoreController
|
||||
*/
|
||||
class StoreController extends Controller
|
||||
final class StoreController extends Controller
|
||||
{
|
||||
use TransactionFilter;
|
||||
|
||||
@@ -83,7 +83,6 @@ class StoreController extends Controller
|
||||
|
||||
/** @var BillTransformer $transformer */
|
||||
$transformer = app(BillTransformer::class);
|
||||
$transformer->setParameters($this->parameters);
|
||||
|
||||
$resource = new Item($bill, $transformer, 'bills');
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ use League\Fractal\Resource\Item;
|
||||
/**
|
||||
* Class UpdateController
|
||||
*/
|
||||
class UpdateController extends Controller
|
||||
final class UpdateController extends Controller
|
||||
{
|
||||
private BillRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ use Illuminate\Http\JsonResponse;
|
||||
/**
|
||||
* Class DestroyController
|
||||
*/
|
||||
class DestroyController extends Controller
|
||||
final class DestroyController extends Controller
|
||||
{
|
||||
private BudgetRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ use League\Fractal\Pagination\IlluminatePaginatorAdapter;
|
||||
use League\Fractal\Resource\Collection as FractalCollection;
|
||||
|
||||
// Class ListController
|
||||
class ListController extends Controller
|
||||
final class ListController extends Controller
|
||||
{
|
||||
use TransactionFilter;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ use League\Fractal\Resource\Item;
|
||||
/**
|
||||
* Class ShowController
|
||||
*/
|
||||
class ShowController extends Controller
|
||||
final class ShowController extends Controller
|
||||
{
|
||||
private BudgetLimitRepositoryInterface $blRepository;
|
||||
private BudgetRepositoryInterface $repository;
|
||||
|
||||
@@ -37,7 +37,7 @@ use League\Fractal\Resource\Item;
|
||||
/**
|
||||
* Class StoreController
|
||||
*/
|
||||
class StoreController extends Controller
|
||||
final class StoreController extends Controller
|
||||
{
|
||||
private BudgetRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ use League\Fractal\Resource\Item;
|
||||
/**
|
||||
* Class UpdateController
|
||||
*/
|
||||
class UpdateController extends Controller
|
||||
final class UpdateController extends Controller
|
||||
{
|
||||
private BudgetRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ use Illuminate\Http\JsonResponse;
|
||||
/**
|
||||
* Class DestroyController
|
||||
*/
|
||||
class DestroyController extends Controller
|
||||
final class DestroyController extends Controller
|
||||
{
|
||||
private BudgetLimitRepositoryInterface $blRepository;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ use League\Fractal\Resource\Collection as FractalCollection;
|
||||
/**
|
||||
* Class ListController
|
||||
*/
|
||||
class ListController extends Controller
|
||||
final class ListController extends Controller
|
||||
{
|
||||
use TransactionFilter;
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Api\V1\Controllers\Models\BudgetLimit;
|
||||
|
||||
use FireflyIII\Api\V1\Controllers\Controller;
|
||||
use FireflyIII\Api\V1\Requests\Data\SameDateRequest;
|
||||
use FireflyIII\Api\V1\Requests\DateRangeRequest;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\Budget;
|
||||
use FireflyIII\Models\BudgetLimit;
|
||||
@@ -44,7 +44,7 @@ use League\Fractal\Resource\Item;
|
||||
/**
|
||||
* Class ShowController
|
||||
*/
|
||||
class ShowController extends Controller
|
||||
final class ShowController extends Controller
|
||||
{
|
||||
private BudgetLimitRepositoryInterface $blRepository;
|
||||
private BudgetRepositoryInterface $repository;
|
||||
@@ -118,12 +118,12 @@ class ShowController extends Controller
|
||||
*
|
||||
* @SuppressWarnings("PHPMD.UnusedFormalParameter")
|
||||
*/
|
||||
public function indexAll(SameDateRequest $request): JsonResponse
|
||||
public function indexAll(DateRangeRequest $request): JsonResponse
|
||||
{
|
||||
$manager = $this->getManager();
|
||||
$manager->parseIncludes('budget');
|
||||
$pageSize = $this->parameters->get('limit');
|
||||
$collection = $this->blRepository->getAllBudgetLimits($this->parameters->get('start'), $this->parameters->get('end'));
|
||||
$collection = $this->blRepository->getAllBudgetLimits($request->attributes->get('start'), $request->attributes->get('end'));
|
||||
$count = $collection->count();
|
||||
$budgetLimits = $collection->slice(($this->parameters->get('page') - 1) * $pageSize, $pageSize);
|
||||
$paginator = new LengthAwarePaginator($budgetLimits, $count, $pageSize, $this->parameters->get('page'));
|
||||
|
||||
@@ -37,7 +37,7 @@ use League\Fractal\Resource\Item;
|
||||
/**
|
||||
* Class StoreController
|
||||
*/
|
||||
class StoreController extends Controller
|
||||
final class StoreController extends Controller
|
||||
{
|
||||
private BudgetLimitRepositoryInterface $blRepository;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use League\Fractal\Resource\Item;
|
||||
/**
|
||||
* Class UpdateController
|
||||
*/
|
||||
class UpdateController extends Controller
|
||||
final class UpdateController extends Controller
|
||||
{
|
||||
private BudgetLimitRepositoryInterface $blRepository;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ use Illuminate\Http\JsonResponse;
|
||||
/**
|
||||
* Class DestroyController
|
||||
*/
|
||||
class DestroyController extends Controller
|
||||
final class DestroyController extends Controller
|
||||
{
|
||||
private CategoryRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ use League\Fractal\Resource\Collection as FractalCollection;
|
||||
/**
|
||||
* Class ListController
|
||||
*/
|
||||
class ListController extends Controller
|
||||
final class ListController extends Controller
|
||||
{
|
||||
use TransactionFilter;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use League\Fractal\Resource\Item;
|
||||
/**
|
||||
* Class ShowController
|
||||
*/
|
||||
class ShowController extends Controller
|
||||
final class ShowController extends Controller
|
||||
{
|
||||
private CategoryRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ use League\Fractal\Resource\Item;
|
||||
/**
|
||||
* Class StoreController
|
||||
*/
|
||||
class StoreController extends Controller
|
||||
final class StoreController extends Controller
|
||||
{
|
||||
private CategoryRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ use League\Fractal\Resource\Item;
|
||||
/**
|
||||
* Class UpdateController
|
||||
*/
|
||||
class UpdateController extends Controller
|
||||
final class UpdateController extends Controller
|
||||
{
|
||||
private CategoryRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ use Carbon\Carbon;
|
||||
use FireflyIII\Api\V1\Controllers\Controller;
|
||||
use FireflyIII\Api\V1\Requests\Models\CurrencyExchangeRate\DestroyRequest;
|
||||
use FireflyIII\Enums\UserRoleEnum;
|
||||
use FireflyIII\Events\Model\CurrencyExchangeRate\DestroyedCurrencyExchangeRate;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\CurrencyExchangeRate;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
@@ -36,7 +37,7 @@ use FireflyIII\Support\Http\Api\ValidatesUserGroupTrait;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class DestroyController extends Controller
|
||||
final class DestroyController extends Controller
|
||||
{
|
||||
use ValidatesUserGroupTrait;
|
||||
|
||||
@@ -59,11 +60,12 @@ class DestroyController extends Controller
|
||||
public function destroy(DestroyRequest $request, TransactionCurrency $from, TransactionCurrency $to): JsonResponse
|
||||
{
|
||||
$this->repository->deleteRates($from, $to);
|
||||
event(new DestroyedCurrencyExchangeRate($from, $to, $this->validateUserGroup($request)));
|
||||
|
||||
return response()->json([], 204);
|
||||
}
|
||||
|
||||
public function destroySingleByDate(TransactionCurrency $from, TransactionCurrency $to, Carbon $date): JsonResponse
|
||||
public function destroySingleByDate(Request $request, TransactionCurrency $from, TransactionCurrency $to, Carbon $date): JsonResponse
|
||||
{
|
||||
$exchangeRate = $this->repository->getSpecificRateOnDate($from, $to, $date);
|
||||
if ($exchangeRate instanceof CurrencyExchangeRate) {
|
||||
@@ -72,14 +74,19 @@ class DestroyController extends Controller
|
||||
if (!$exchangeRate instanceof CurrencyExchangeRate) {
|
||||
throw new FireflyException('Bla');
|
||||
}
|
||||
event(new DestroyedCurrencyExchangeRate($from, $to, $this->validateUserGroup($request)));
|
||||
|
||||
return response()->json([], 204);
|
||||
}
|
||||
|
||||
public function destroySingleById(CurrencyExchangeRate $exchangeRate): JsonResponse
|
||||
public function destroySingleById(Request $request, CurrencyExchangeRate $exchangeRate): JsonResponse
|
||||
{
|
||||
$from = $exchangeRate->fromCurrency;
|
||||
$to = $exchangeRate->toCurrency;
|
||||
$this->repository->deleteRate($exchangeRate);
|
||||
|
||||
event(new DestroyedCurrencyExchangeRate($from, $to, $this->validateUserGroup($request)));
|
||||
|
||||
return response()->json([], 204);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ use Illuminate\Pagination\LengthAwarePaginator;
|
||||
/**
|
||||
* Class ShowController
|
||||
*/
|
||||
class IndexController extends Controller
|
||||
final class IndexController extends Controller
|
||||
{
|
||||
use ValidatesUserGroupTrait;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
/**
|
||||
* Class ShowController
|
||||
*/
|
||||
class ShowController extends Controller
|
||||
final class ShowController extends Controller
|
||||
{
|
||||
use ValidatesUserGroupTrait;
|
||||
|
||||
|
||||
@@ -30,6 +30,8 @@ use FireflyIII\Api\V1\Requests\Models\CurrencyExchangeRate\StoreByCurrenciesRequ
|
||||
use FireflyIII\Api\V1\Requests\Models\CurrencyExchangeRate\StoreByDateRequest;
|
||||
use FireflyIII\Api\V1\Requests\Models\CurrencyExchangeRate\StoreRequest;
|
||||
use FireflyIII\Enums\UserRoleEnum;
|
||||
use FireflyIII\Events\Model\CurrencyExchangeRate\CreatedCurrencyExchangeRate;
|
||||
use FireflyIII\Events\Model\CurrencyExchangeRate\UpdatedCurrencyExchangeRate;
|
||||
use FireflyIII\Models\CurrencyExchangeRate;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\Repositories\ExchangeRate\ExchangeRateRepositoryInterface;
|
||||
@@ -41,7 +43,7 @@ use Illuminate\Http\Request;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
class StoreController extends Controller
|
||||
final class StoreController extends Controller
|
||||
{
|
||||
use ValidatesUserGroupTrait;
|
||||
|
||||
@@ -73,10 +75,12 @@ class StoreController extends Controller
|
||||
if ($object instanceof CurrencyExchangeRate) {
|
||||
// just update it, no matter.
|
||||
$rate = $this->repository->updateExchangeRate($object, $rate, $date);
|
||||
event(new UpdatedCurrencyExchangeRate($rate));
|
||||
}
|
||||
if (!$object instanceof CurrencyExchangeRate) {
|
||||
// store new
|
||||
$rate = $this->repository->storeExchangeRate($from, $to, $rate, $date);
|
||||
event(new CreatedCurrencyExchangeRate($rate));
|
||||
}
|
||||
|
||||
$transformer = new ExchangeRateTransformer();
|
||||
@@ -97,10 +101,12 @@ class StoreController extends Controller
|
||||
// update existing rate.
|
||||
$existing = $this->repository->updateExchangeRate($existing, $rate);
|
||||
$collection->push($existing);
|
||||
event(new UpdatedCurrencyExchangeRate($existing));
|
||||
|
||||
continue;
|
||||
}
|
||||
$new = $this->repository->storeExchangeRate($from, $to, $rate, $date);
|
||||
event(new CreatedCurrencyExchangeRate($new));
|
||||
$collection->push($new);
|
||||
}
|
||||
|
||||
@@ -124,11 +130,13 @@ class StoreController extends Controller
|
||||
// update existing rate.
|
||||
$existing = $this->repository->updateExchangeRate($existing, $rate);
|
||||
$collection->push($existing);
|
||||
event(new UpdatedCurrencyExchangeRate($existing));
|
||||
|
||||
continue;
|
||||
}
|
||||
$new = $this->repository->storeExchangeRate($from, $to, $rate, $date);
|
||||
$collection->push($new);
|
||||
event(new CreatedCurrencyExchangeRate($new));
|
||||
}
|
||||
|
||||
$count = $collection->count();
|
||||
|
||||
@@ -28,6 +28,7 @@ use Carbon\Carbon;
|
||||
use FireflyIII\Api\V1\Controllers\Controller;
|
||||
use FireflyIII\Api\V1\Requests\Models\CurrencyExchangeRate\UpdateRequest;
|
||||
use FireflyIII\Enums\UserRoleEnum;
|
||||
use FireflyIII\Events\Model\CurrencyExchangeRate\UpdatedCurrencyExchangeRate;
|
||||
use FireflyIII\Models\CurrencyExchangeRate;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\Repositories\ExchangeRate\ExchangeRateRepositoryInterface;
|
||||
@@ -37,7 +38,7 @@ use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
class UpdateController extends Controller
|
||||
final class UpdateController extends Controller
|
||||
{
|
||||
use ValidatesUserGroupTrait;
|
||||
|
||||
@@ -66,7 +67,7 @@ class UpdateController extends Controller
|
||||
$date = $request->getDate();
|
||||
$rate = $request->getRate();
|
||||
$exchangeRate = $this->repository->updateExchangeRate($exchangeRate, $rate, $date);
|
||||
|
||||
event(new UpdatedCurrencyExchangeRate($exchangeRate));
|
||||
$transformer = new ExchangeRateTransformer();
|
||||
|
||||
return response()->api($this->jsonApiObject(self::RESOURCE_KEY, $exchangeRate, $transformer))->header('Content-Type', self::CONTENT_TYPE);
|
||||
@@ -77,6 +78,7 @@ class UpdateController extends Controller
|
||||
$date = $request->getDate();
|
||||
$rate = $request->getRate();
|
||||
$exchangeRate = $this->repository->updateExchangeRate($exchangeRate, $rate, $date);
|
||||
event(new UpdatedCurrencyExchangeRate($exchangeRate));
|
||||
$transformer = new ExchangeRateTransformer();
|
||||
$transformer->setParameters($this->parameters);
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ use Illuminate\Http\JsonResponse;
|
||||
/**
|
||||
* Class DestroyController
|
||||
*/
|
||||
class DestroyController extends Controller
|
||||
final class DestroyController extends Controller
|
||||
{
|
||||
private ObjectGroupRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ use League\Fractal\Resource\Collection as FractalCollection;
|
||||
/**
|
||||
* Class ListController
|
||||
*/
|
||||
class ListController extends Controller
|
||||
final class ListController extends Controller
|
||||
{
|
||||
private ObjectGroupRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ use League\Fractal\Resource\Item;
|
||||
/**
|
||||
* Class ShowController
|
||||
*/
|
||||
class ShowController extends Controller
|
||||
final class ShowController extends Controller
|
||||
{
|
||||
private ObjectGroupRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ use League\Fractal\Resource\Item;
|
||||
/**
|
||||
* Class UpdateController
|
||||
*/
|
||||
class UpdateController extends Controller
|
||||
final class UpdateController extends Controller
|
||||
{
|
||||
private ObjectGroupRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ use Illuminate\Http\JsonResponse;
|
||||
/**
|
||||
* Class DestroyController
|
||||
*/
|
||||
class DestroyController extends Controller
|
||||
final class DestroyController extends Controller
|
||||
{
|
||||
private PiggyBankRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ use League\Fractal\Resource\Collection as FractalCollection;
|
||||
/**
|
||||
* Class ListController
|
||||
*/
|
||||
class ListController extends Controller
|
||||
final class ListController extends Controller
|
||||
{
|
||||
private PiggyBankRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use League\Fractal\Resource\Item;
|
||||
/**
|
||||
* Class ShowController
|
||||
*/
|
||||
class ShowController extends Controller
|
||||
final class ShowController extends Controller
|
||||
{
|
||||
private PiggyBankRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ use League\Fractal\Resource\Item;
|
||||
/**
|
||||
* Class StoreController
|
||||
*/
|
||||
class StoreController extends Controller
|
||||
final class StoreController extends Controller
|
||||
{
|
||||
private PiggyBankRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ use League\Fractal\Resource\Item;
|
||||
/**
|
||||
* Class UpdateController
|
||||
*/
|
||||
class UpdateController extends Controller
|
||||
final class UpdateController extends Controller
|
||||
{
|
||||
private PiggyBankRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ use Illuminate\Http\JsonResponse;
|
||||
/**
|
||||
* Class DestroyController
|
||||
*/
|
||||
class DestroyController extends Controller
|
||||
final class DestroyController extends Controller
|
||||
{
|
||||
private RecurringRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ use League\Fractal\Resource\Collection as FractalCollection;
|
||||
/**
|
||||
* Class ListController
|
||||
*/
|
||||
class ListController extends Controller
|
||||
final class ListController extends Controller
|
||||
{
|
||||
use TransactionFilter;
|
||||
|
||||
@@ -83,6 +83,9 @@ class ListController extends Controller
|
||||
// use new group collector:
|
||||
/** @var GroupCollectorInterface $collector */
|
||||
$collector = app(GroupCollectorInterface::class);
|
||||
if (0 === count($journalIds)) {
|
||||
$collector->findNothing();
|
||||
}
|
||||
$collector
|
||||
->setUser($admin)
|
||||
// filter on journal IDs.
|
||||
|
||||
@@ -39,7 +39,7 @@ use League\Fractal\Resource\Item;
|
||||
/**
|
||||
* Class ShowController
|
||||
*/
|
||||
class ShowController extends Controller
|
||||
final class ShowController extends Controller
|
||||
{
|
||||
private RecurringRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ use League\Fractal\Resource\Item;
|
||||
/**
|
||||
* Class StoreController
|
||||
*/
|
||||
class StoreController extends Controller
|
||||
final class StoreController extends Controller
|
||||
{
|
||||
private RecurringRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* TriggerController.php
|
||||
* Copyright (c) 2025 james@firefly-iii.org
|
||||
* Copyright (c) 2026 james@firefly-iii.org
|
||||
*
|
||||
* This file is part of Firefly III (https://github.com/firefly-iii).
|
||||
*
|
||||
@@ -22,10 +20,12 @@ declare(strict_types=1);
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Api\V1\Controllers\Models\Recurrence;
|
||||
|
||||
use FireflyIII\Api\V1\Controllers\Controller;
|
||||
use FireflyIII\Api\V1\Requests\Generic\SingleDateRequest;
|
||||
use FireflyIII\Api\V1\Requests\DateRequest;
|
||||
use FireflyIII\Helpers\Collector\GroupCollectorInterface;
|
||||
use FireflyIII\Jobs\CreateRecurringTransactions;
|
||||
use FireflyIII\Models\Recurrence;
|
||||
@@ -41,7 +41,7 @@ use Illuminate\Support\Facades\Log;
|
||||
use League\Fractal\Pagination\IlluminatePaginatorAdapter;
|
||||
use League\Fractal\Resource\Collection as FractalCollection;
|
||||
|
||||
class TriggerController extends Controller
|
||||
final class TriggerController extends Controller
|
||||
{
|
||||
private RecurringRepositoryInterface $repository;
|
||||
|
||||
@@ -59,12 +59,12 @@ class TriggerController extends Controller
|
||||
});
|
||||
}
|
||||
|
||||
public function trigger(SingleDateRequest $request, Recurrence $recurrence): JsonResponse
|
||||
public function trigger(DateRequest $request, Recurrence $recurrence): JsonResponse
|
||||
{
|
||||
// find recurrence occurrence for this date and trigger it.
|
||||
// grab the date from the last time the recurrence fired:
|
||||
$backupDate = $recurrence->latest_date;
|
||||
$date = $request->getDate();
|
||||
$date = $request->attributes->get('date');
|
||||
|
||||
// fire the recurring cron job on the given date, then post-date the created transaction.
|
||||
Log::info(sprintf('Trigger: will now fire recurring cron job task for date "%s".', $date->format('Y-m-d H:i:s')));
|
||||
|
||||
@@ -37,7 +37,7 @@ use League\Fractal\Resource\Item;
|
||||
/**
|
||||
* Class UpdateController
|
||||
*/
|
||||
class UpdateController extends Controller
|
||||
final class UpdateController extends Controller
|
||||
{
|
||||
private RecurringRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ use Illuminate\Http\JsonResponse;
|
||||
/**
|
||||
* Class DestroyController
|
||||
*/
|
||||
class DestroyController extends Controller
|
||||
final class DestroyController extends Controller
|
||||
{
|
||||
private RuleRepositoryInterface $ruleRepository;
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ use Illuminate\Http\JsonResponse;
|
||||
/**
|
||||
* Class ExpressionController
|
||||
*/
|
||||
class ExpressionController extends Controller
|
||||
final class ExpressionController extends Controller
|
||||
{
|
||||
/**
|
||||
* This endpoint is documented at:
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user