mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-03-04 06:51:26 +00:00
Compare commits
422 Commits
develop-20
...
develop-20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0aea8875d4 | ||
|
|
773e2ac262 | ||
|
|
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 | ||
|
|
73089c2084 | ||
|
|
34260f2a4f | ||
|
|
c3872aa738 | ||
|
|
4bcd163b47 | ||
|
|
31d444292f | ||
|
|
a27e21f002 | ||
|
|
0f7118d5b3 | ||
|
|
4f9a1fde5d | ||
|
|
bc596cb1c2 | ||
|
|
7110556ef0 | ||
|
|
3e1b703dfc | ||
|
|
fce0750509 | ||
|
|
f5385d0229 | ||
|
|
8599c4a3c1 | ||
|
|
d210e7dcdd | ||
|
|
8de9e0ba29 | ||
|
|
7fa9e79f2a | ||
|
|
4a5281fd80 | ||
|
|
ad60974430 | ||
|
|
195794881b | ||
|
|
3e6a997dd5 | ||
|
|
2eedfd9f26 | ||
|
|
9ec0515bb6 | ||
|
|
6b197eecb9 | ||
|
|
591c970882 | ||
|
|
15d91dbe1b | ||
|
|
6ff87bf447 | ||
|
|
147ce154d8 | ||
|
|
2c8be33000 | ||
|
|
b472890c84 | ||
|
|
2fabcf5193 | ||
|
|
5ed4e7aa79 | ||
|
|
973caad7e4 | ||
|
|
d273503a15 | ||
|
|
cc149adb5d | ||
|
|
ac8bcb786b | ||
|
|
642deefba5 | ||
|
|
5b13b64fd7 | ||
|
|
653a64d0a8 | ||
|
|
c9dcdc90ec | ||
|
|
1f04888331 | ||
|
|
28c21ecb7e | ||
|
|
7382030e61 | ||
|
|
a573e19dbc | ||
|
|
b152a2c8d9 | ||
|
|
7e14c36fc0 | ||
|
|
58bfc7f8ce | ||
|
|
6b8c005108 | ||
|
|
ceb660fd02 | ||
|
|
7fac1e8614 | ||
|
|
809e34f5fe | ||
|
|
73ca57c8c4 | ||
|
|
63088ffeb1 | ||
|
|
4e88ebd52d | ||
|
|
85fd38d146 | ||
|
|
e83d7051eb | ||
|
|
567f2dae17 | ||
|
|
c231ae4016 | ||
|
|
fb13a4cdcb | ||
|
|
724042e1d8 | ||
|
|
84a30c3c8f | ||
|
|
6c9dac831a | ||
|
|
e605ddb779 | ||
|
|
4b19ed8f07 | ||
|
|
57bd8e09d4 | ||
|
|
32f1a7c9c2 | ||
|
|
fc5b0db43f | ||
|
|
c2721f3f48 | ||
|
|
96291c9bce | ||
|
|
ab9400aaee | ||
|
|
31d1ee11cb | ||
|
|
694dc3816c | ||
|
|
c647fa7b94 | ||
|
|
022d59bfdd | ||
|
|
057b82b471 | ||
|
|
2872c6592f | ||
|
|
fa02c15f55 | ||
|
|
c74c8a96b8 | ||
|
|
2c2ebae8fa | ||
|
|
aff9afb767 | ||
|
|
c8e95fe131 | ||
|
|
cef514c22b | ||
|
|
46d2ba3d3b | ||
|
|
45a0504eba | ||
|
|
9711bc1d04 | ||
|
|
cf2343c0dd | ||
|
|
34097cecf0 | ||
|
|
8735be2f6b | ||
|
|
0e8cc91308 | ||
|
|
5cbb311e4d | ||
|
|
c334641b90 | ||
|
|
4c2356881d | ||
|
|
d9a0d06712 | ||
|
|
65b9dedc03 | ||
|
|
e46ef138b1 | ||
|
|
f0fdb57754 | ||
|
|
09799582aa | ||
|
|
850c824da1 | ||
|
|
34160da67a | ||
|
|
2848a64c13 | ||
|
|
998d6bf874 | ||
|
|
b85200e1f6 | ||
|
|
6944001887 | ||
|
|
154abf1fc0 | ||
|
|
0113cc1651 | ||
|
|
38b5b656a1 | ||
|
|
e74163a7ec | ||
|
|
c60094d231 | ||
|
|
39d46d469c | ||
|
|
6caea5ffa3 | ||
|
|
4024f76a51 | ||
|
|
de84946371 | ||
|
|
6d4aca54de | ||
|
|
256262b2ba | ||
|
|
fb035ba594 | ||
|
|
20776949a6 | ||
|
|
ad5a8a2934 | ||
|
|
e37ef69491 | ||
|
|
df8a406c58 | ||
|
|
88d3e01065 | ||
|
|
7a1c32f1aa | ||
|
|
54df0d44f7 | ||
|
|
1f7775032b | ||
|
|
8cfe1e8047 | ||
|
|
f0be634829 | ||
|
|
485e1138f8 | ||
|
|
9abf08b3be | ||
|
|
f08943b926 | ||
|
|
2de9926db8 | ||
|
|
b4d01d464d | ||
|
|
229b45c7ad | ||
|
|
8e89c5af62 | ||
|
|
264fec7a6a | ||
|
|
d4b1d097fe | ||
|
|
bbd6acb824 | ||
|
|
4e7d12f06b | ||
|
|
9811583379 | ||
|
|
0063cab690 | ||
|
|
d3add7c92b | ||
|
|
a491e4921f | ||
|
|
171bc03668 | ||
|
|
dd5476bfc7 | ||
|
|
bc0769358d | ||
|
|
ccf33f1db6 | ||
|
|
35f611b3f2 | ||
|
|
e5d394533c | ||
|
|
831d39a41e | ||
|
|
2920a9b9e3 | ||
|
|
5c8204e963 | ||
|
|
d25283f193 | ||
|
|
20986e6426 | ||
|
|
9cd0ebe37e | ||
|
|
9c2b83a971 | ||
|
|
e1d32da409 | ||
|
|
c51df8cd83 | ||
|
|
9f016aed16 | ||
|
|
27df5ea800 | ||
|
|
2d7cdd36f0 | ||
|
|
7888023c1a | ||
|
|
3032118788 | ||
|
|
89d96ddc17 | ||
|
|
97c9937571 | ||
|
|
c46aca0594 | ||
|
|
0b33e1ff09 | ||
|
|
d267d2a0b0 | ||
|
|
f2996dcebe | ||
|
|
ebb6a186cc | ||
|
|
304fae439a | ||
|
|
9ca81cf305 | ||
|
|
cad5fb6d6b | ||
|
|
53efafdbb2 | ||
|
|
7922017288 | ||
|
|
4e910a33dd | ||
|
|
bb031cdeb6 | ||
|
|
60026bbcba | ||
|
|
e96a1850da | ||
|
|
bd2a746b8a | ||
|
|
e4a3cbc9da | ||
|
|
18734b0edd | ||
|
|
f52b3bf5f5 | ||
|
|
3abba71f8d | ||
|
|
95bdc87ed7 | ||
|
|
9a66b4017b | ||
|
|
610e3f3ae5 | ||
|
|
a58e70c08b | ||
|
|
24c96d40c9 | ||
|
|
74ae59910f | ||
|
|
6d49815be9 | ||
|
|
ae680cd41f | ||
|
|
5e9ea1ca10 | ||
|
|
6f558f424d | ||
|
|
4387876203 | ||
|
|
1b1ce3e04e | ||
|
|
ff64675122 | ||
|
|
1c545b7a74 | ||
|
|
a433ddcd7e | ||
|
|
b0e1b6fe51 | ||
|
|
f5523e60b6 | ||
|
|
e300efe640 | ||
|
|
a97f227ddb | ||
|
|
5f8d7049b5 | ||
|
|
7e80f78f2e | ||
|
|
ad922745c4 | ||
|
|
40abe74dc1 | ||
|
|
e5d2c4d163 | ||
|
|
2851053900 | ||
|
|
b2f6ce1277 | ||
|
|
340b0661ba | ||
|
|
be18f11f8c | ||
|
|
2f8ee67b31 | ||
|
|
1ecf55165e | ||
|
|
5aceccde4a | ||
|
|
abfaee5a55 | ||
|
|
fa65cc7ee2 | ||
|
|
d64f1d0c18 | ||
|
|
31206ce56c | ||
|
|
e4e9a09522 | ||
|
|
11303dc6e2 | ||
|
|
993f5cd292 | ||
|
|
cc0854c712 | ||
|
|
5c6aee0037 | ||
|
|
391f8c34cc | ||
|
|
db6ed26d5a | ||
|
|
eece951036 | ||
|
|
3d7a62293b | ||
|
|
2691dbe438 | ||
|
|
fe971ec611 | ||
|
|
9e4c5435f0 | ||
|
|
cdb2b91813 | ||
|
|
f4cf158d21 | ||
|
|
b19f1d0353 | ||
|
|
eb2c612476 | ||
|
|
e89eede8a0 | ||
|
|
00e09c4bd9 | ||
|
|
33e63434a3 | ||
|
|
1b68e5374a | ||
|
|
f93e55f9b0 | ||
|
|
4a3f62df89 | ||
|
|
0c5ac39d5e |
@@ -26,6 +26,7 @@ $paths = [
|
||||
$current . '/../../config',
|
||||
$current . '/../../routes',
|
||||
$current . '/../../tests',
|
||||
$current . '/../../resources/lang/en_US',
|
||||
];
|
||||
|
||||
$finder = PhpCsFixer\Finder::create()
|
||||
@@ -42,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"
|
||||
}
|
||||
}
|
||||
|
||||
128
.ci/php-cs-fixer/composer.lock
generated
128
.ci/php-cs-fixer/composer.lock
generated
@@ -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.93.0",
|
||||
"version": "v3.94.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
|
||||
"reference": "50895a07cface1385082e4caa6a6786c4e033468"
|
||||
"reference": "7787ceff91365ba7d623ec410b8f429cdebb4f63"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/50895a07cface1385082e4caa6a6786c4e033468",
|
||||
"reference": "50895a07cface1385082e4caa6a6786c4e033468",
|
||||
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/7787ceff91365ba7d623ec410b8f429cdebb4f63",
|
||||
"reference": "7787ceff91365ba7d623ec410b8f429cdebb4f63",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -428,7 +428,7 @@
|
||||
"react/event-loop": "^1.5",
|
||||
"react/socket": "^1.16",
|
||||
"react/stream": "^1.4",
|
||||
"sebastian/diff": "^4.0.6 || ^5.1.1 || ^6.0.2 || ^7.0",
|
||||
"sebastian/diff": "^4.0.6 || ^5.1.1 || ^6.0.2 || ^7.0 || ^8.0",
|
||||
"symfony/console": "^5.4.47 || ^6.4.24 || ^7.0 || ^8.0",
|
||||
"symfony/event-dispatcher": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0",
|
||||
"symfony/filesystem": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0",
|
||||
@@ -442,18 +442,18 @@
|
||||
"symfony/stopwatch": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"facile-it/paraunit": "^1.3.1 || ^2.7",
|
||||
"infection/infection": "^0.32",
|
||||
"justinrainbow/json-schema": "^6.6",
|
||||
"facile-it/paraunit": "^1.3.1 || ^2.7.1",
|
||||
"infection/infection": "^0.32.3",
|
||||
"justinrainbow/json-schema": "^6.6.4",
|
||||
"keradus/cli-executor": "^2.3",
|
||||
"mikey179/vfsstream": "^1.6.12",
|
||||
"php-coveralls/php-coveralls": "^2.9",
|
||||
"php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.6",
|
||||
"php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.6",
|
||||
"phpunit/phpunit": "^9.6.31 || ^10.5.60 || ^11.5.48",
|
||||
"php-coveralls/php-coveralls": "^2.9.1",
|
||||
"php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.7",
|
||||
"php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.7",
|
||||
"phpunit/phpunit": "^9.6.34 || ^10.5.63 || ^11.5.51",
|
||||
"symfony/polyfill-php85": "^1.33",
|
||||
"symfony/var-dumper": "^5.4.48 || ^6.4.26 || ^7.4.0 || ^8.0",
|
||||
"symfony/yaml": "^5.4.45 || ^6.4.30 || ^7.4.1 || ^8.0"
|
||||
"symfony/var-dumper": "^5.4.48 || ^6.4.32 || ^7.4.4 || ^8.0.4",
|
||||
"symfony/yaml": "^5.4.45 || ^6.4.30 || ^7.4.1 || ^8.0.1"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-dom": "For handling output formats in XML",
|
||||
@@ -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.93.0"
|
||||
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.94.2"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -502,7 +502,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2026-01-23T17:33:21+00:00"
|
||||
"time": "2026-02-20T16:13:53+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/container",
|
||||
@@ -1185,29 +1185,29 @@
|
||||
},
|
||||
{
|
||||
"name": "sebastian/diff",
|
||||
"version": "7.0.0",
|
||||
"version": "8.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/diff.git",
|
||||
"reference": "7ab1ea946c012266ca32390913653d844ecd085f"
|
||||
"reference": "a2b6d09d7729ee87d605a439469f9dcc39be5ea3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7ab1ea946c012266ca32390913653d844ecd085f",
|
||||
"reference": "7ab1ea946c012266ca32390913653d844ecd085f",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/a2b6d09d7729ee87d605a439469f9dcc39be5ea3",
|
||||
"reference": "a2b6d09d7729ee87d605a439469f9dcc39be5ea3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=8.3"
|
||||
"php": ">=8.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^12.0",
|
||||
"phpunit/phpunit": "^13.0",
|
||||
"symfony/process": "^7.2"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "7.0-dev"
|
||||
"dev-main": "8.0-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -1240,28 +1240,40 @@
|
||||
"support": {
|
||||
"issues": "https://github.com/sebastianbergmann/diff/issues",
|
||||
"security": "https://github.com/sebastianbergmann/diff/security/policy",
|
||||
"source": "https://github.com/sebastianbergmann/diff/tree/7.0.0"
|
||||
"source": "https://github.com/sebastianbergmann/diff/tree/8.0.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/sebastianbergmann",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://liberapay.com/sebastianbergmann",
|
||||
"type": "liberapay"
|
||||
},
|
||||
{
|
||||
"url": "https://thanks.dev/u/gh/sebastianbergmann",
|
||||
"type": "thanks_dev"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/sebastian/diff",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-02-07T04:55:46+00:00"
|
||||
"time": "2026-02-06T04:42:27+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/console",
|
||||
"version": "v8.0.4",
|
||||
"version": "v8.0.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/console.git",
|
||||
"reference": "ace03c4cf9805080ff40cbeec69fca180c339a3b"
|
||||
"reference": "488285876e807a4777f074041d8bb508623419fa"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/ace03c4cf9805080ff40cbeec69fca180c339a3b",
|
||||
"reference": "ace03c4cf9805080ff40cbeec69fca180c339a3b",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/488285876e807a4777f074041d8bb508623419fa",
|
||||
"reference": "488285876e807a4777f074041d8bb508623419fa",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1318,7 +1330,7 @@
|
||||
"terminal"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/console/tree/v8.0.4"
|
||||
"source": "https://github.com/symfony/console/tree/v8.0.6"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1338,7 +1350,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2026-01-13T13:06:50+00:00"
|
||||
"time": "2026-02-25T16:59:43+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/deprecation-contracts",
|
||||
@@ -1570,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": {
|
||||
@@ -1616,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": [
|
||||
{
|
||||
@@ -1636,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.4",
|
||||
"version": "v8.0.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/finder.git",
|
||||
"reference": "42e48eb02e07d5f3771d194d67da117eb824c8c1"
|
||||
"reference": "441404f09a54de6d1bd6ad219e088cdf4c91f97c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/finder/zipball/42e48eb02e07d5f3771d194d67da117eb824c8c1",
|
||||
"reference": "42e48eb02e07d5f3771d194d67da117eb824c8c1",
|
||||
"url": "https://api.github.com/repos/symfony/finder/zipball/441404f09a54de6d1bd6ad219e088cdf4c91f97c",
|
||||
"reference": "441404f09a54de6d1bd6ad219e088cdf4c91f97c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1684,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.4"
|
||||
"source": "https://github.com/symfony/finder/tree/v8.0.6"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -1704,7 +1716,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2026-01-12T12:37:40+00:00"
|
||||
"time": "2026-01-29T09:41:02+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/options-resolver",
|
||||
@@ -2358,16 +2370,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/process",
|
||||
"version": "v8.0.4",
|
||||
"version": "v8.0.5",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/process.git",
|
||||
"reference": "10df72602d88c0a3fa685b822976a052611dd607"
|
||||
"reference": "b5f3aa6762e33fd95efbaa2ec4f4bc9fdd16d674"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/process/zipball/10df72602d88c0a3fa685b822976a052611dd607",
|
||||
"reference": "10df72602d88c0a3fa685b822976a052611dd607",
|
||||
"url": "https://api.github.com/repos/symfony/process/zipball/b5f3aa6762e33fd95efbaa2ec4f4bc9fdd16d674",
|
||||
"reference": "b5f3aa6762e33fd95efbaa2ec4f4bc9fdd16d674",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2399,7 +2411,7 @@
|
||||
"description": "Executes commands in sub-processes",
|
||||
"homepage": "https://symfony.com",
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/process/tree/v8.0.4"
|
||||
"source": "https://github.com/symfony/process/tree/v8.0.5"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -2419,7 +2431,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2026-01-23T11:07:10+00:00"
|
||||
"time": "2026-01-26T15:08:38+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/service-contracts",
|
||||
@@ -2576,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": {
|
||||
@@ -2642,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": [
|
||||
{
|
||||
@@ -2662,7 +2674,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2026-01-12T12:37:40+00:00"
|
||||
"time": "2026-02-09T10:14:57+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
@@ -2671,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"
|
||||
}
|
||||
|
||||
@@ -9,10 +9,55 @@ parameters:
|
||||
- Illuminate\Database\Eloquent\Model
|
||||
reportUnmatchedIgnoredErrors: true
|
||||
ignoreErrors:
|
||||
# these are actually interesting but not right now:
|
||||
- identifier: notIdentical.alwaysTrue
|
||||
- identifier: method.notFound
|
||||
- identifier: nullsafe.neverNull
|
||||
- identifier: identical.alwaysFalse
|
||||
- identifier: if.condNotBoolean
|
||||
# - identifier: booleanNot.exprNotBoolean
|
||||
- identifier: method.nonObject
|
||||
- identifier: function.impossibleType
|
||||
- identifier: booleanNot.exprNotBoolean
|
||||
- identifier: ternary.condNotBoolean
|
||||
- identifier: booleanNot.alwaysFalse
|
||||
- identifier: booleanAnd.alwaysFalse
|
||||
- identifier: greater.alwaysTrue
|
||||
- identifier: function.alreadyNarrowedType
|
||||
- identifier: booleanNot.alwaysTrue
|
||||
- identifier: property.phpDocType
|
||||
- identifier: nullCoalesce.offset
|
||||
- identifier: nullCoalesce.variable
|
||||
- identifier: larastan.noUnnecessaryCollectionCall
|
||||
- identifier: varTag.differentVariable
|
||||
- identifier: identical.alwaysTrue
|
||||
- identifier: clone.nonObject
|
||||
- identifier: assign.propertyReadOnly
|
||||
- identifier: property.nonObject
|
||||
- identifier: varTag.nativeType
|
||||
- identifier: booleanAnd.leftAlwaysFalse
|
||||
- identifier: property.onlyWritten
|
||||
- identifier: parameter.phpDocType
|
||||
- identifier: property.dynamicName
|
||||
- identifier: property.unusedType
|
||||
- identifier: staticMethod.deprecated
|
||||
- identifier: greater.invalid
|
||||
- identifier: instanceof.alwaysTrue
|
||||
# ignore everything but things that BREAK
|
||||
- identifier: property.deprecated
|
||||
- identifier: method.deprecated
|
||||
- identifier: cast.useless
|
||||
- identifier: parameter.deprecatedClass
|
||||
- identifier: method.deprecatedClass
|
||||
- identifier: argument.type
|
||||
- identifier: return.type
|
||||
- identifier: assign.propertyType
|
||||
- identifier: return.unusedType
|
||||
- identifier: return.phpDocType
|
||||
# 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#"
|
||||
# - '#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
|
||||
@@ -20,11 +65,11 @@ parameters:
|
||||
- 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
|
||||
# - '#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.
|
||||
|
||||
6
.github/ISSUE_TEMPLATE/bug.yml
vendored
6
.github/ISSUE_TEMPLATE/bug.yml
vendored
@@ -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
|
||||
|
||||
|
||||
BIN
.github/assets/img/europe.png
vendored
Normal file
BIN
.github/assets/img/europe.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
BIN
.github/assets/img/testmu.png
vendored
Normal file
BIN
.github/assets/img/testmu.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
7
.github/mergify.yml
vendored
7
.github/mergify.yml
vendored
@@ -1,11 +1,4 @@
|
||||
pull_request_rules:
|
||||
- name: Make sure PR are up to date before merging
|
||||
description: This automatically updates PRs when they are out-of-date with the
|
||||
base branch to avoid semantic conflicts (next step is using a merge
|
||||
queue).
|
||||
conditions: []
|
||||
actions:
|
||||
update:
|
||||
- name: Close all on main
|
||||
conditions:
|
||||
- base=main
|
||||
|
||||
20
.github/pull_request_template.md
vendored
20
.github/pull_request_template.md
vendored
@@ -1,20 +1,22 @@
|
||||
<!--
|
||||
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.
|
||||
Please TALK TO ME FIRST before you open a PR.
|
||||
|
||||
If it feels necessary to open an issue first, please do so, before you open a PR.
|
||||
1. If you fix a problem that has no ticket, talk to me FIRST.
|
||||
2. If you introduce new financial solutions or concepts, talk to me FIRST.
|
||||
3. If your PR is more than 25 lines, talk to me FIRST.
|
||||
4. If you used AI to write your PR, talk to me FIRST.
|
||||
5. If you fix spelling or code comments, talk to me FIRST.
|
||||
|
||||
Wanna talk to me? Open a GitHub Issue, Discussion, or send me an email: james@firefly-iii.org
|
||||
|
||||
See also: https://docs.firefly-iii.org/explanation/support/#contributing-code
|
||||
|
||||
-->
|
||||
|
||||
@JC5
|
||||
|
||||
This PR fixes issue # (if relevant).
|
||||
This PR fixes issue # <!-- mandatory field! -->.
|
||||
|
||||
Changes in this pull request:
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
12
.github/workflows/release.yml
vendored
12
.github/workflows/release.yml
vendored
@@ -10,7 +10,7 @@ on:
|
||||
phpversion:
|
||||
description: 'PHP version'
|
||||
required: true
|
||||
default: '8.4'
|
||||
default: '8.5'
|
||||
schedule:
|
||||
- cron: '0 3 * * MON'
|
||||
|
||||
@@ -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,18 @@ jobs:
|
||||
uses: nhedger/setup-mago@v1
|
||||
- name: Run CI
|
||||
run: |
|
||||
# install all packages etc.
|
||||
rm -rf vendor composer.lock
|
||||
composer update --no-scripts --no-plugins -q
|
||||
|
||||
# format code.
|
||||
mago format || true
|
||||
mago analyze --reporting-format=github || true
|
||||
sudo chown -R runner:docker resources/lang
|
||||
.ci/phpcs.sh || true
|
||||
|
||||
# lint and check
|
||||
mago lint
|
||||
.ci/phpstan.sh
|
||||
- name: Calculate variables
|
||||
run: |
|
||||
|
||||
|
||||
@@ -4,6 +4,12 @@ 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
|
||||
- Matthew Grove
|
||||
- Cinnamon Pyro
|
||||
- R1DEN
|
||||
- RiDEN
|
||||
- Khoa Nguyen
|
||||
- Nick Huang
|
||||
- mateuszkulapl
|
||||
- Gianluca Martino
|
||||
- embedded
|
||||
|
||||
@@ -31,7 +31,6 @@ use FireflyIII\Enums\UserRoleEnum;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use FireflyIII\Support\Debug\Timer;
|
||||
use FireflyIII\Support\Facades\Amount;
|
||||
use FireflyIII\Support\Facades\Steam;
|
||||
use FireflyIII\Support\Http\Api\AccountFilter;
|
||||
@@ -42,7 +41,7 @@ use Illuminate\Support\Facades\Log;
|
||||
/**
|
||||
* Class AccountController
|
||||
*/
|
||||
class AccountController extends Controller
|
||||
final class AccountController extends Controller
|
||||
{
|
||||
use AccountFilter;
|
||||
|
||||
@@ -80,7 +79,7 @@ class AccountController extends Controller
|
||||
*/
|
||||
public function accounts(AutocompleteApiRequest $request): JsonResponse
|
||||
{
|
||||
Log::debug('Before All.');
|
||||
// Log::debug('Before All.');
|
||||
['types' => $types, 'query' => $query, 'date' => $date, 'limit' => $limit] = $request->attributes->all();
|
||||
|
||||
$date ??= today(config('app.timezone'));
|
||||
@@ -89,8 +88,6 @@ class AccountController extends Controller
|
||||
$date->endOfDay();
|
||||
|
||||
$return = [];
|
||||
$timer = Timer::getInstance();
|
||||
$timer->start(sprintf('AC accounts "%s"', $query));
|
||||
$result = $this->repository->searchAccount((string) $query, $types, $limit);
|
||||
$allBalances = Steam::accountsBalancesOptimized($result, $date, $this->primaryCurrency, $this->convertToPrimary);
|
||||
|
||||
@@ -136,7 +133,6 @@ class AccountController extends Controller
|
||||
|
||||
return $posA - $posB;
|
||||
});
|
||||
$timer->stop(sprintf('AC accounts "%s"', $query));
|
||||
|
||||
return response()->api($return);
|
||||
}
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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;
|
||||
@@ -104,6 +104,48 @@ class BudgetController extends Controller
|
||||
return response()->json($this->clean($data));
|
||||
}
|
||||
|
||||
private function filterLimit(int $currencyId, Collection $limits): ?BudgetLimit
|
||||
{
|
||||
$amount = '0';
|
||||
$limit = null;
|
||||
$converter = new ExchangeRateConverter();
|
||||
|
||||
/** @var BudgetLimit $current */
|
||||
foreach ($limits as $current) {
|
||||
if ($this->convertToPrimary) {
|
||||
if ($current->transaction_currency_id === $this->primaryCurrency->id) {
|
||||
// simply add it.
|
||||
$amount = bcadd($amount, (string) $current->amount);
|
||||
Log::debug(sprintf('Set amount in limit to %s', $amount));
|
||||
}
|
||||
if ($current->transaction_currency_id !== $this->primaryCurrency->id) {
|
||||
// convert and then add it.
|
||||
$converted = $converter->convert($current->transactionCurrency, $this->primaryCurrency, $current->start_date, $current->amount);
|
||||
$amount = bcadd($amount, $converted);
|
||||
Log::debug(sprintf(
|
||||
'Budgeted in limit #%d: %s %s, converted to %s %s',
|
||||
$current->id,
|
||||
$current->transactionCurrency->code,
|
||||
$current->amount,
|
||||
$this->primaryCurrency->code,
|
||||
$converted
|
||||
));
|
||||
Log::debug(sprintf('Set amount in limit to %s', $amount));
|
||||
}
|
||||
}
|
||||
if ($current->transaction_currency_id === $currencyId) {
|
||||
$limit = $current;
|
||||
}
|
||||
}
|
||||
if (null !== $limit && $this->convertToPrimary) {
|
||||
// convert and add all amounts.
|
||||
$limit->amount = Steam::positive($amount);
|
||||
Log::debug(sprintf('Final amount in limit with converted amount %s', $limit->amount));
|
||||
}
|
||||
|
||||
return $limit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws FireflyException
|
||||
*/
|
||||
@@ -250,46 +292,4 @@ class BudgetController extends Controller
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
private function filterLimit(int $currencyId, Collection $limits): ?BudgetLimit
|
||||
{
|
||||
$amount = '0';
|
||||
$limit = null;
|
||||
$converter = new ExchangeRateConverter();
|
||||
|
||||
/** @var BudgetLimit $current */
|
||||
foreach ($limits as $current) {
|
||||
if ($this->convertToPrimary) {
|
||||
if ($current->transaction_currency_id === $this->primaryCurrency->id) {
|
||||
// simply add it.
|
||||
$amount = bcadd($amount, (string) $current->amount);
|
||||
Log::debug(sprintf('Set amount in limit to %s', $amount));
|
||||
}
|
||||
if ($current->transaction_currency_id !== $this->primaryCurrency->id) {
|
||||
// convert and then add it.
|
||||
$converted = $converter->convert($current->transactionCurrency, $this->primaryCurrency, $current->start_date, $current->amount);
|
||||
$amount = bcadd($amount, $converted);
|
||||
Log::debug(sprintf(
|
||||
'Budgeted in limit #%d: %s %s, converted to %s %s',
|
||||
$current->id,
|
||||
$current->transactionCurrency->code,
|
||||
$current->amount,
|
||||
$this->primaryCurrency->code,
|
||||
$converted
|
||||
));
|
||||
Log::debug(sprintf('Set amount in limit to %s', $amount));
|
||||
}
|
||||
}
|
||||
if ($current->transaction_currency_id === $currencyId) {
|
||||
$limit = $current;
|
||||
}
|
||||
}
|
||||
if (null !== $limit && $this->convertToPrimary) {
|
||||
// convert and add all amounts.
|
||||
$limit->amount = Steam::positive($amount);
|
||||
Log::debug(sprintf('Final amount in limit with converted amount %s', $limit->amount));
|
||||
}
|
||||
|
||||
return $limit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ use Illuminate\Support\Facades\Log;
|
||||
/**
|
||||
* Class BudgetController
|
||||
*/
|
||||
class CategoryController extends Controller
|
||||
final class CategoryController extends Controller
|
||||
{
|
||||
use CleansChartData;
|
||||
use ValidatesUserGroupTrait;
|
||||
|
||||
@@ -98,6 +98,77 @@ abstract class Controller extends BaseController
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to help build URL's.
|
||||
*/
|
||||
final protected function buildParams(): string
|
||||
{
|
||||
$return = '?';
|
||||
$params = [];
|
||||
foreach ($this->parameters as $key => $value) {
|
||||
if ('page' === $key) {
|
||||
continue;
|
||||
}
|
||||
if ($value instanceof Carbon) {
|
||||
$params[$key] = $value->format('Y-m-d');
|
||||
|
||||
continue;
|
||||
}
|
||||
$params[$key] = $value;
|
||||
}
|
||||
|
||||
return $return.http_build_query($params);
|
||||
}
|
||||
|
||||
final protected function getManager(): Manager
|
||||
{
|
||||
// create some objects:
|
||||
$manager = new Manager();
|
||||
$baseUrl = request()->getSchemeAndHttpHost().'/api/v1';
|
||||
$manager->setSerializer(new JsonApiSerializer($baseUrl));
|
||||
|
||||
return $manager;
|
||||
}
|
||||
|
||||
final protected function jsonApiList(string $key, LengthAwarePaginator $paginator, AbstractTransformer $transformer): array
|
||||
{
|
||||
$manager = new Manager();
|
||||
$baseUrl = sprintf('%s/api/v1/', request()->getSchemeAndHttpHost());
|
||||
|
||||
// TODO add stuff to path?
|
||||
|
||||
$manager->setSerializer(new JsonApiSerializer($baseUrl));
|
||||
|
||||
$objects = $paginator->getCollection();
|
||||
|
||||
// the transformer, at this point, needs to collect information that ALL items in the collection
|
||||
// require, like meta-data and stuff like that, and save it for later.
|
||||
// $objects = $transformer->collectMetaData($objects);
|
||||
$paginator->setCollection($objects);
|
||||
|
||||
$resource = new FractalCollection($objects, $transformer, $key);
|
||||
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
|
||||
|
||||
return $manager->createData($resource)->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a JSON API object and returns it.
|
||||
*
|
||||
* @param array<int, mixed>|Model $object
|
||||
*/
|
||||
final protected function jsonApiObject(string $key, array|Model $object, AbstractTransformer $transformer): array
|
||||
{
|
||||
// create some objects:
|
||||
$manager = new Manager();
|
||||
$baseUrl = sprintf('%s/api/v1', request()->getSchemeAndHttpHost());
|
||||
$manager->setSerializer(new JsonApiSerializer($baseUrl));
|
||||
|
||||
$resource = new Item($object, $transformer, $key);
|
||||
|
||||
return $manager->createData($resource)->toArray();
|
||||
}
|
||||
|
||||
#[Deprecated(message: <<<'TXT'
|
||||
use Request classes
|
||||
Method to grab all parameters from the URL
|
||||
@@ -170,75 +241,4 @@ abstract class Controller extends BaseController
|
||||
|
||||
// return $this->getSortParameters($bag);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to help build URL's.
|
||||
*/
|
||||
final protected function buildParams(): string
|
||||
{
|
||||
$return = '?';
|
||||
$params = [];
|
||||
foreach ($this->parameters as $key => $value) {
|
||||
if ('page' === $key) {
|
||||
continue;
|
||||
}
|
||||
if ($value instanceof Carbon) {
|
||||
$params[$key] = $value->format('Y-m-d');
|
||||
|
||||
continue;
|
||||
}
|
||||
$params[$key] = $value;
|
||||
}
|
||||
|
||||
return $return.http_build_query($params);
|
||||
}
|
||||
|
||||
final protected function getManager(): Manager
|
||||
{
|
||||
// create some objects:
|
||||
$manager = new Manager();
|
||||
$baseUrl = request()->getSchemeAndHttpHost().'/api/v1';
|
||||
$manager->setSerializer(new JsonApiSerializer($baseUrl));
|
||||
|
||||
return $manager;
|
||||
}
|
||||
|
||||
final protected function jsonApiList(string $key, LengthAwarePaginator $paginator, AbstractTransformer $transformer): array
|
||||
{
|
||||
$manager = new Manager();
|
||||
$baseUrl = sprintf('%s/api/v1/', request()->getSchemeAndHttpHost());
|
||||
|
||||
// TODO add stuff to path?
|
||||
|
||||
$manager->setSerializer(new JsonApiSerializer($baseUrl));
|
||||
|
||||
$objects = $paginator->getCollection();
|
||||
|
||||
// the transformer, at this point, needs to collect information that ALL items in the collection
|
||||
// require, like meta-data and stuff like that, and save it for later.
|
||||
// $objects = $transformer->collectMetaData($objects);
|
||||
$paginator->setCollection($objects);
|
||||
|
||||
$resource = new FractalCollection($objects, $transformer, $key);
|
||||
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
|
||||
|
||||
return $manager->createData($resource)->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a JSON API object and returns it.
|
||||
*
|
||||
* @param array<int, mixed>|Model $object
|
||||
*/
|
||||
final protected function jsonApiObject(string $key, array|Model $object, AbstractTransformer $transformer): array
|
||||
{
|
||||
// create some objects:
|
||||
$manager = new Manager();
|
||||
$baseUrl = sprintf('%s/api/v1', request()->getSchemeAndHttpHost());
|
||||
$manager->setSerializer(new JsonApiSerializer($baseUrl));
|
||||
|
||||
$resource = new Item($object, $transformer, $key);
|
||||
|
||||
return $manager->createData($resource)->toArray();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -137,70 +137,6 @@ class DestroyController extends Controller
|
||||
return response()->json([], 204);
|
||||
}
|
||||
|
||||
private function destroyBudgets(): void
|
||||
{
|
||||
/** @var AvailableBudgetRepositoryInterface $abRepository */
|
||||
$abRepository = app(AvailableBudgetRepositoryInterface::class);
|
||||
$abRepository->destroyAll();
|
||||
|
||||
/** @var BudgetLimitRepositoryInterface $blRepository */
|
||||
$blRepository = app(BudgetLimitRepositoryInterface::class);
|
||||
$blRepository->destroyAll();
|
||||
|
||||
/** @var BudgetRepositoryInterface $budgetRepository */
|
||||
$budgetRepository = app(BudgetRepositoryInterface::class);
|
||||
$budgetRepository->destroyAll();
|
||||
}
|
||||
|
||||
private function destroyBills(): void
|
||||
{
|
||||
/** @var BillRepositoryInterface $repository */
|
||||
$repository = app(BillRepositoryInterface::class);
|
||||
$repository->destroyAll();
|
||||
}
|
||||
|
||||
private function destroyPiggyBanks(): void
|
||||
{
|
||||
/** @var PiggyBankRepositoryInterface $repository */
|
||||
$repository = app(PiggyBankRepositoryInterface::class);
|
||||
$repository->destroyAll();
|
||||
}
|
||||
|
||||
private function destroyRules(): void
|
||||
{
|
||||
/** @var RuleGroupRepositoryInterface $repository */
|
||||
$repository = app(RuleGroupRepositoryInterface::class);
|
||||
$repository->destroyAll();
|
||||
}
|
||||
|
||||
private function destroyRecurringTransactions(): void
|
||||
{
|
||||
/** @var RecurringRepositoryInterface $repository */
|
||||
$repository = app(RecurringRepositoryInterface::class);
|
||||
$repository->destroyAll();
|
||||
}
|
||||
|
||||
private function destroyCategories(): void
|
||||
{
|
||||
/** @var CategoryRepositoryInterface $categoryRepos */
|
||||
$categoryRepos = app(CategoryRepositoryInterface::class);
|
||||
$categoryRepos->destroyAll();
|
||||
}
|
||||
|
||||
private function destroyTags(): void
|
||||
{
|
||||
/** @var TagRepositoryInterface $tagRepository */
|
||||
$tagRepository = app(TagRepositoryInterface::class);
|
||||
$tagRepository->destroyAll();
|
||||
}
|
||||
|
||||
private function destroyObjectGroups(): void
|
||||
{
|
||||
/** @var ObjectGroupRepositoryInterface $repository */
|
||||
$repository = app(ObjectGroupRepositoryInterface::class);
|
||||
$repository->deleteAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<int, string> $types
|
||||
*/
|
||||
@@ -229,6 +165,70 @@ class DestroyController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
private function destroyBills(): void
|
||||
{
|
||||
/** @var BillRepositoryInterface $repository */
|
||||
$repository = app(BillRepositoryInterface::class);
|
||||
$repository->destroyAll();
|
||||
}
|
||||
|
||||
private function destroyBudgets(): void
|
||||
{
|
||||
/** @var AvailableBudgetRepositoryInterface $abRepository */
|
||||
$abRepository = app(AvailableBudgetRepositoryInterface::class);
|
||||
$abRepository->destroyAll();
|
||||
|
||||
/** @var BudgetLimitRepositoryInterface $blRepository */
|
||||
$blRepository = app(BudgetLimitRepositoryInterface::class);
|
||||
$blRepository->destroyAll();
|
||||
|
||||
/** @var BudgetRepositoryInterface $budgetRepository */
|
||||
$budgetRepository = app(BudgetRepositoryInterface::class);
|
||||
$budgetRepository->destroyAll();
|
||||
}
|
||||
|
||||
private function destroyCategories(): void
|
||||
{
|
||||
/** @var CategoryRepositoryInterface $categoryRepos */
|
||||
$categoryRepos = app(CategoryRepositoryInterface::class);
|
||||
$categoryRepos->destroyAll();
|
||||
}
|
||||
|
||||
private function destroyObjectGroups(): void
|
||||
{
|
||||
/** @var ObjectGroupRepositoryInterface $repository */
|
||||
$repository = app(ObjectGroupRepositoryInterface::class);
|
||||
$repository->deleteAll();
|
||||
}
|
||||
|
||||
private function destroyPiggyBanks(): void
|
||||
{
|
||||
/** @var PiggyBankRepositoryInterface $repository */
|
||||
$repository = app(PiggyBankRepositoryInterface::class);
|
||||
$repository->destroyAll();
|
||||
}
|
||||
|
||||
private function destroyRecurringTransactions(): void
|
||||
{
|
||||
/** @var RecurringRepositoryInterface $repository */
|
||||
$repository = app(RecurringRepositoryInterface::class);
|
||||
$repository->destroyAll();
|
||||
}
|
||||
|
||||
private function destroyRules(): void
|
||||
{
|
||||
/** @var RuleGroupRepositoryInterface $repository */
|
||||
$repository = app(RuleGroupRepositoryInterface::class);
|
||||
$repository->destroyAll();
|
||||
}
|
||||
|
||||
private function destroyTags(): void
|
||||
{
|
||||
/** @var TagRepositoryInterface $tagRepository */
|
||||
$tagRepository = app(TagRepositoryInterface::class);
|
||||
$tagRepository->destroyAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<int, string> $types
|
||||
*/
|
||||
|
||||
@@ -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];
|
||||
@@ -72,33 +72,6 @@ class ExportController extends Controller
|
||||
return $this->returnExport('accounts');
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws FireflyException
|
||||
* @throws DatetimeException
|
||||
*/
|
||||
private function returnExport(string $key): LaravelResponse
|
||||
{
|
||||
$date = date('Y-m-d-H-i-s');
|
||||
$fileName = sprintf('%s-export-%s.csv', $date, $key);
|
||||
$data = $this->exporter->export();
|
||||
|
||||
/** @var LaravelResponse $response */
|
||||
$response = response($data[$key]);
|
||||
$response
|
||||
->header('Content-Description', 'File Transfer')
|
||||
->header('Content-Type', 'application/octet-stream')
|
||||
->header('Content-Disposition', 'attachment; filename='.$fileName)
|
||||
->header('Content-Transfer-Encoding', 'binary')
|
||||
->header('Connection', 'Keep-Alive')
|
||||
->header('Expires', '0')
|
||||
->header('Cache-Control', 'must-revalidate, post-check=0, pre-check=0')
|
||||
->header('Pragma', 'public')
|
||||
->header('Content-Length', (string) strlen((string) $data[$key]))
|
||||
;
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws DatetimeException
|
||||
* @throws FireflyException
|
||||
@@ -204,4 +177,31 @@ class ExportController extends Controller
|
||||
|
||||
return $this->returnExport('transactions');
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws FireflyException
|
||||
* @throws DatetimeException
|
||||
*/
|
||||
private function returnExport(string $key): LaravelResponse
|
||||
{
|
||||
$date = date('Y-m-d-H-i-s');
|
||||
$fileName = sprintf('%s-export-%s.csv', $date, $key);
|
||||
$data = $this->exporter->export();
|
||||
|
||||
/** @var LaravelResponse $response */
|
||||
$response = response($data[$key]);
|
||||
$response
|
||||
->header('Content-Description', 'File Transfer')
|
||||
->header('Content-Type', 'application/octet-stream')
|
||||
->header('Content-Disposition', 'attachment; filename='.$fileName)
|
||||
->header('Content-Transfer-Encoding', 'binary')
|
||||
->header('Connection', 'Keep-Alive')
|
||||
->header('Expires', '0')
|
||||
->header('Cache-Control', 'must-revalidate, post-check=0, pre-check=0')
|
||||
->header('Pragma', 'public')
|
||||
->header('Content-Length', (string) strlen((string) $data[$key]))
|
||||
;
|
||||
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ use League\Fractal\Resource\Item;
|
||||
/**
|
||||
* Class ShowController
|
||||
*/
|
||||
class ShowController extends Controller
|
||||
final class ShowController extends Controller
|
||||
{
|
||||
private BillRepositoryInterface $repository;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ use League\Fractal\Resource\Item;
|
||||
/**
|
||||
* Class StoreController
|
||||
*/
|
||||
class StoreController extends Controller
|
||||
final class StoreController extends Controller
|
||||
{
|
||||
use TransactionFilter;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -36,7 +36,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;
|
||||
|
||||
@@ -63,13 +63,6 @@ class DestroyController extends Controller
|
||||
return response()->json([], 204);
|
||||
}
|
||||
|
||||
public function destroySingleById(CurrencyExchangeRate $exchangeRate): JsonResponse
|
||||
{
|
||||
$this->repository->deleteRate($exchangeRate);
|
||||
|
||||
return response()->json([], 204);
|
||||
}
|
||||
|
||||
public function destroySingleByDate(TransactionCurrency $from, TransactionCurrency $to, Carbon $date): JsonResponse
|
||||
{
|
||||
$exchangeRate = $this->repository->getSpecificRateOnDate($from, $to, $date);
|
||||
@@ -82,4 +75,11 @@ class DestroyController extends Controller
|
||||
|
||||
return response()->json([], 204);
|
||||
}
|
||||
|
||||
public function destroySingleById(CurrencyExchangeRate $exchangeRate): JsonResponse
|
||||
{
|
||||
$this->repository->deleteRate($exchangeRate);
|
||||
|
||||
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;
|
||||
|
||||
@@ -75,14 +75,6 @@ class ShowController extends Controller
|
||||
return response()->json($this->jsonApiList(self::RESOURCE_KEY, $paginator, $transformer))->header('Content-Type', self::CONTENT_TYPE);
|
||||
}
|
||||
|
||||
public function showSingleById(CurrencyExchangeRate $exchangeRate): JsonResponse
|
||||
{
|
||||
$transformer = new ExchangeRateTransformer();
|
||||
$transformer->setParameters($this->parameters);
|
||||
|
||||
return response()->api($this->jsonApiObject(self::RESOURCE_KEY, $exchangeRate, $transformer))->header('Content-Type', self::CONTENT_TYPE);
|
||||
}
|
||||
|
||||
public function showSingleByDate(TransactionCurrency $from, TransactionCurrency $to, Carbon $date): JsonResponse
|
||||
{
|
||||
$transformer = new ExchangeRateTransformer();
|
||||
@@ -95,4 +87,12 @@ class ShowController extends Controller
|
||||
|
||||
return response()->api($this->jsonApiObject(self::RESOURCE_KEY, $exchangeRate, $transformer))->header('Content-Type', self::CONTENT_TYPE);
|
||||
}
|
||||
|
||||
public function showSingleById(CurrencyExchangeRate $exchangeRate): JsonResponse
|
||||
{
|
||||
$transformer = new ExchangeRateTransformer();
|
||||
$transformer->setParameters($this->parameters);
|
||||
|
||||
return response()->api($this->jsonApiObject(self::RESOURCE_KEY, $exchangeRate, $transformer))->header('Content-Type', self::CONTENT_TYPE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ use Illuminate\Http\Request;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
class StoreController extends Controller
|
||||
final class StoreController extends Controller
|
||||
{
|
||||
use ValidatesUserGroupTrait;
|
||||
|
||||
@@ -61,6 +61,30 @@ class StoreController extends Controller
|
||||
});
|
||||
}
|
||||
|
||||
public function store(StoreRequest $request): JsonResponse
|
||||
{
|
||||
$date = $request->getDate();
|
||||
$rate = $request->getRate();
|
||||
$from = $request->getFromCurrency();
|
||||
$to = $request->getToCurrency();
|
||||
|
||||
// already has rate?
|
||||
$object = $this->repository->getSpecificRateOnDate($from, $to, $date);
|
||||
if ($object instanceof CurrencyExchangeRate) {
|
||||
// just update it, no matter.
|
||||
$rate = $this->repository->updateExchangeRate($object, $rate, $date);
|
||||
}
|
||||
if (!$object instanceof CurrencyExchangeRate) {
|
||||
// store new
|
||||
$rate = $this->repository->storeExchangeRate($from, $to, $rate, $date);
|
||||
}
|
||||
|
||||
$transformer = new ExchangeRateTransformer();
|
||||
$transformer->setParameters($this->parameters);
|
||||
|
||||
return response()->api($this->jsonApiObject(self::RESOURCE_KEY, $rate, $transformer))->header('Content-Type', self::CONTENT_TYPE);
|
||||
}
|
||||
|
||||
public function storeByCurrencies(StoreByCurrenciesRequest $request, TransactionCurrency $from, TransactionCurrency $to): JsonResponse
|
||||
{
|
||||
$data = $request->getAll();
|
||||
@@ -114,28 +138,4 @@ class StoreController extends Controller
|
||||
|
||||
return response()->json($this->jsonApiList(self::RESOURCE_KEY, $paginator, $transformer))->header('Content-Type', self::CONTENT_TYPE);
|
||||
}
|
||||
|
||||
public function store(StoreRequest $request): JsonResponse
|
||||
{
|
||||
$date = $request->getDate();
|
||||
$rate = $request->getRate();
|
||||
$from = $request->getFromCurrency();
|
||||
$to = $request->getToCurrency();
|
||||
|
||||
// already has rate?
|
||||
$object = $this->repository->getSpecificRateOnDate($from, $to, $date);
|
||||
if ($object instanceof CurrencyExchangeRate) {
|
||||
// just update it, no matter.
|
||||
$rate = $this->repository->updateExchangeRate($object, $rate, $date);
|
||||
}
|
||||
if (!$object instanceof CurrencyExchangeRate) {
|
||||
// store new
|
||||
$rate = $this->repository->storeExchangeRate($from, $to, $rate, $date);
|
||||
}
|
||||
|
||||
$transformer = new ExchangeRateTransformer();
|
||||
$transformer->setParameters($this->parameters);
|
||||
|
||||
return response()->api($this->jsonApiObject(self::RESOURCE_KEY, $rate, $transformer))->header('Content-Type', self::CONTENT_TYPE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,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;
|
||||
|
||||
@@ -57,17 +57,6 @@ class UpdateController extends Controller
|
||||
});
|
||||
}
|
||||
|
||||
public function updateById(UpdateRequest $request, CurrencyExchangeRate $exchangeRate): JsonResponse
|
||||
{
|
||||
$date = $request->getDate();
|
||||
$rate = $request->getRate();
|
||||
$exchangeRate = $this->repository->updateExchangeRate($exchangeRate, $rate, $date);
|
||||
$transformer = new ExchangeRateTransformer();
|
||||
$transformer->setParameters($this->parameters);
|
||||
|
||||
return response()->api($this->jsonApiObject(self::RESOURCE_KEY, $exchangeRate, $transformer))->header('Content-Type', self::CONTENT_TYPE);
|
||||
}
|
||||
|
||||
public function updateByDate(UpdateRequest $request, TransactionCurrency $from, TransactionCurrency $to, Carbon $date): JsonResponse
|
||||
{
|
||||
$exchangeRate = $this->repository->getSpecificRateOnDate($from, $to, $date);
|
||||
@@ -82,4 +71,15 @@ class UpdateController extends Controller
|
||||
|
||||
return response()->api($this->jsonApiObject(self::RESOURCE_KEY, $exchangeRate, $transformer))->header('Content-Type', self::CONTENT_TYPE);
|
||||
}
|
||||
|
||||
public function updateById(UpdateRequest $request, CurrencyExchangeRate $exchangeRate): JsonResponse
|
||||
{
|
||||
$date = $request->getDate();
|
||||
$rate = $request->getRate();
|
||||
$exchangeRate = $this->repository->updateExchangeRate($exchangeRate, $rate, $date);
|
||||
$transformer = new ExchangeRateTransformer();
|
||||
$transformer->setParameters($this->parameters);
|
||||
|
||||
return response()->api($this->jsonApiObject(self::RESOURCE_KEY, $exchangeRate, $transformer))->header('Content-Type', self::CONTENT_TYPE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -63,30 +63,28 @@ class TriggerController extends Controller
|
||||
{
|
||||
// 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();
|
||||
$backupDate = $recurrence->latest_date;
|
||||
$date = $request->getDate();
|
||||
|
||||
// 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')));
|
||||
|
||||
/** @var CreateRecurringTransactions $job */
|
||||
$job = app(CreateRecurringTransactions::class);
|
||||
$job = app(CreateRecurringTransactions::class);
|
||||
$job->setRecurrences(new Collection()->push($recurrence));
|
||||
$job->setDate($date);
|
||||
$job->setForce(false);
|
||||
$job->handle();
|
||||
Log::debug('Done with recurrence.');
|
||||
|
||||
$groups = $job->getGroups();
|
||||
$groups = $job->getGroups();
|
||||
$this->repository->markGroupsAsNow($groups);
|
||||
$recurrence->latest_date = $backupDate;
|
||||
$recurrence->latest_date_tz = $backupDate?->format('e');
|
||||
$recurrence->save();
|
||||
$recurrence = $this->repository->setLatestDate($recurrence, $backupDate);
|
||||
Preferences::mark();
|
||||
|
||||
// enrich groups and return them:
|
||||
|
||||
$paginator = new LengthAwarePaginator(new Collection(), 0, 1);
|
||||
$paginator = new LengthAwarePaginator(new Collection(), 0, 1);
|
||||
if ($groups->count() > 0) {
|
||||
/** @var User $admin */
|
||||
$admin = auth()->user();
|
||||
@@ -98,20 +96,20 @@ class TriggerController extends Controller
|
||||
$paginator = $collector->getPaginatedGroups();
|
||||
}
|
||||
|
||||
$manager = $this->getManager();
|
||||
$manager = $this->getManager();
|
||||
$paginator->setPath(route('api.v1.recurrences.trigger', [$recurrence->id]).$this->buildParams());
|
||||
|
||||
// enrich
|
||||
$admin = auth()->user();
|
||||
$enrichment = new TransactionGroupEnrichment();
|
||||
$admin = auth()->user();
|
||||
$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);
|
||||
$transformer->setParameters($this->parameters);
|
||||
|
||||
$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);
|
||||
|
||||
@@ -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