mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-03-13 07:48:04 +00:00
Compare commits
176 Commits
v6.5.0
...
develop-20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 |
48
.ci/php-cs-fixer/composer.lock
generated
48
.ci/php-cs-fixer/composer.lock
generated
@@ -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": [],
|
||||
|
||||
@@ -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.
|
||||
|
||||
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 |
@@ -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
|
||||
|
||||
22
.github/workflows/release.yml
vendored
22
.github/workflows/release.yml
vendored
@@ -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 }}
|
||||
@@ -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,8 @@ 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
|
||||
|
||||
@@ -41,7 +41,7 @@ use Illuminate\Support\Facades\Log;
|
||||
/**
|
||||
* Class AccountController
|
||||
*/
|
||||
class AccountController extends Controller
|
||||
final class AccountController extends Controller
|
||||
{
|
||||
use AccountFilter;
|
||||
|
||||
@@ -80,16 +80,16 @@ 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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -44,7 +44,7 @@ use Illuminate\Support\Facades\Log;
|
||||
/**
|
||||
* Class AccountController
|
||||
*/
|
||||
class AccountController extends Controller
|
||||
final class AccountController extends Controller
|
||||
{
|
||||
use ApiSupport;
|
||||
use CleansChartData;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -38,7 +38,7 @@ use League\Fractal\Resource\Item;
|
||||
/**
|
||||
* Class ShowController
|
||||
*/
|
||||
class ShowController extends Controller
|
||||
final class ShowController extends Controller
|
||||
{
|
||||
private RuleRepositoryInterface $ruleRepository;
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ use League\Fractal\Resource\Item;
|
||||
/**
|
||||
* Class StoreController
|
||||
*/
|
||||
class StoreController extends Controller
|
||||
final class StoreController extends Controller
|
||||
{
|
||||
private RuleRepositoryInterface $ruleRepository;
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ use League\Fractal\Resource\Collection as FractalCollection;
|
||||
/**
|
||||
* Class TriggerController
|
||||
*/
|
||||
class TriggerController extends Controller
|
||||
final class TriggerController extends Controller
|
||||
{
|
||||
private RuleRepositoryInterface $ruleRepository;
|
||||
|
||||
@@ -78,15 +78,15 @@ class TriggerController extends Controller
|
||||
// overrule the rule(s) if necessary.
|
||||
if (array_key_exists('start', $parameters) && null !== $parameters['start']) {
|
||||
// add a range:
|
||||
$ruleEngine->addOperator(['type' => 'date_after', 'value' => $parameters['start']->format('Y-m-d')]);
|
||||
$ruleEngine->addOperator(['type' => 'date_after', 'value' => $parameters['start']->format('Y-m-d')]);
|
||||
}
|
||||
|
||||
if (array_key_exists('end', $parameters) && null !== $parameters['end']) {
|
||||
// add a range:
|
||||
$ruleEngine->addOperator(['type' => 'date_before', 'value' => $parameters['end']->format('Y-m-d')]);
|
||||
$ruleEngine->addOperator(['type' => 'date_before', 'value' => $parameters['end']->format('Y-m-d')]);
|
||||
}
|
||||
if (array_key_exists('accounts', $parameters) && '' !== $parameters['accounts']) {
|
||||
$ruleEngine->addOperator(['type' => 'account_id', 'value' => implode(',', $parameters['accounts'])]);
|
||||
$ruleEngine->addOperator(['type' => 'account_id', 'value' => implode(',', $parameters['accounts'])]);
|
||||
}
|
||||
|
||||
// file the rule(s)
|
||||
@@ -98,7 +98,7 @@ class TriggerController extends Controller
|
||||
$enrichment->setUser($rule->user);
|
||||
$transactions = $enrichment->enrich($transactions);
|
||||
|
||||
$paginator = new LengthAwarePaginator($transactions, $count, 31337, $this->parameters->get('page'));
|
||||
$paginator = new LengthAwarePaginator($transactions, $count, 31_337, $this->parameters->get('page'));
|
||||
$paginator->setPath(route('api.v1.rules.test', [$rule->id]).$this->buildParams());
|
||||
|
||||
// resulting list is presented as JSON thing.
|
||||
@@ -132,15 +132,15 @@ class TriggerController extends Controller
|
||||
// overrule the rule(s) if necessary.
|
||||
if (array_key_exists('start', $parameters) && null !== $parameters['start']) {
|
||||
// add a range:
|
||||
$ruleEngine->addOperator(['type' => 'date_after', 'value' => $parameters['start']->format('Y-m-d')]);
|
||||
$ruleEngine->addOperator(['type' => 'date_after', 'value' => $parameters['start']->format('Y-m-d')]);
|
||||
}
|
||||
|
||||
if (array_key_exists('end', $parameters) && null !== $parameters['end']) {
|
||||
// add a range:
|
||||
$ruleEngine->addOperator(['type' => 'date_before', 'value' => $parameters['end']->format('Y-m-d')]);
|
||||
$ruleEngine->addOperator(['type' => 'date_before', 'value' => $parameters['end']->format('Y-m-d')]);
|
||||
}
|
||||
if (array_key_exists('accounts', $parameters) && is_array($parameters['accounts']) && count($parameters['accounts']) > 0) {
|
||||
$ruleEngine->addOperator(['type' => 'account_id', 'value' => implode(',', $parameters['accounts'])]);
|
||||
$ruleEngine->addOperator(['type' => 'account_id', 'value' => implode(',', $parameters['accounts'])]);
|
||||
}
|
||||
|
||||
// fire the rule(s)
|
||||
|
||||
@@ -36,7 +36,7 @@ use League\Fractal\Resource\Item;
|
||||
/**
|
||||
* Class UpdateController
|
||||
*/
|
||||
class UpdateController extends Controller
|
||||
final class UpdateController extends Controller
|
||||
{
|
||||
private RuleRepositoryInterface $ruleRepository;
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ use Illuminate\Http\JsonResponse;
|
||||
/**
|
||||
* Class DestroyController
|
||||
*/
|
||||
class DestroyController extends Controller
|
||||
final class DestroyController extends Controller
|
||||
{
|
||||
private RuleGroupRepositoryInterface $ruleGroupRepository;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ use League\Fractal\Resource\Collection as FractalCollection;
|
||||
/**
|
||||
* Class ListController
|
||||
*/
|
||||
class ListController extends Controller
|
||||
final class ListController extends Controller
|
||||
{
|
||||
private RuleGroupRepositoryInterface $ruleGroupRepository;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user