mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-08-18 17:04:56 -05:00
🤖 Auto commit for release 'develop' on 2026-03-04
This commit is contained in:
@@ -70,21 +70,21 @@ final 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->setPath(route('api.v1.accounts.attachments', [$account->id]) . $this->buildParams());
|
||||
$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 @@ final 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->setPath(route('api.v1.accounts.piggy-banks', [$account->id]) . $this->buildParams());
|
||||
$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,16 +128,16 @@ final class ListController extends Controller
|
||||
*/
|
||||
public function transactions(PaginationDateRangeRequest $request, Account $account): JsonResponse
|
||||
{
|
||||
['limit' => $limit, 'page' => $page, 'start' => $start, 'end' => $end, 'type' => $type] = $request->attributes->all();
|
||||
$types = $this->mapTransactionTypes($type ?? 'default');
|
||||
$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);
|
||||
@@ -146,18 +146,18 @@ final class ListController extends Controller
|
||||
$collector->setEnd($end);
|
||||
}
|
||||
|
||||
$paginator = $collector->getPaginatedGroups();
|
||||
$paginator->setPath(route('api.v1.accounts.transactions', [$account->id]) . $this->buildParams());
|
||||
$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);
|
||||
|
||||
@@ -44,9 +44,8 @@ abstract class AggregateFormRequest extends ApiRequest
|
||||
array $cookies = [],
|
||||
array $files = [],
|
||||
array $server = [],
|
||||
$content = null
|
||||
): void
|
||||
{
|
||||
$content = null
|
||||
): void {
|
||||
parent::initialize($query, $request, $attributes, $cookies, $files, $server, $content);
|
||||
|
||||
// instantiate all subrequests and share current requests' bags with them
|
||||
@@ -54,7 +53,7 @@ abstract class AggregateFormRequest extends ApiRequest
|
||||
|
||||
/** @var array|string $config */
|
||||
foreach ($this->getRequests() as $config) {
|
||||
$requestClass = is_array($config) ? array_shift($config) : $config;
|
||||
$requestClass = is_array($config) ? array_shift($config) : $config;
|
||||
|
||||
if (!is_a($requestClass, Request::class, true)) {
|
||||
throw new RuntimeException('getRequests() must return class-strings of subclasses of Request');
|
||||
@@ -84,7 +83,7 @@ abstract class AggregateFormRequest extends ApiRequest
|
||||
// check all subrequests for rules and combine them
|
||||
return array_reduce(
|
||||
$this->requests,
|
||||
static fn(array $rules, FormRequest $request): array => $rules + (method_exists($request, 'rules') ? $request->rules() : []),
|
||||
static fn (array $rules, FormRequest $request): array => $rules + (method_exists($request, 'rules') ? $request->rules() : []),
|
||||
[]
|
||||
);
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ class UpgradesToGroups extends Command
|
||||
private function findOpposingTransaction(TransactionJournal $journal, Transaction $transaction): ?Transaction
|
||||
{
|
||||
$set = $journal->transactions->filter(static function (Transaction $subject) use ($transaction): bool {
|
||||
$amount = (((float) $transaction->amount) * -1) === (float) $subject->amount; // intentional float
|
||||
$amount = ((float) $transaction->amount * -1) === (float) $subject->amount; // intentional float
|
||||
$identifier = $transaction->identifier === $subject->identifier;
|
||||
Log::debug(sprintf('Amount the same? %s', var_export($amount, true)));
|
||||
Log::debug(sprintf('ID the same? %s', var_export($identifier, true)));
|
||||
|
||||
@@ -57,7 +57,8 @@ class DeletedAccountObserver
|
||||
$groupIds = TransactionJournal::whereIn('id', $journalIds)
|
||||
->get(['transaction_journals.transaction_group_id'])
|
||||
->pluck('transaction_group_id')
|
||||
->toArray();
|
||||
->toArray()
|
||||
;
|
||||
|
||||
if (count($journalIds) > 0) {
|
||||
Transaction::whereIn('transaction_journal_id', $journalIds)->delete();
|
||||
|
||||
@@ -273,7 +273,7 @@ trait AttachmentCollection
|
||||
/** @var null|Attachment $object */
|
||||
$object = auth()->user()->attachments()->find($attachment['id']);
|
||||
$notes = (string) $object?->notes()->first()?->text;
|
||||
if('' !== $notes && $notes === $value) {
|
||||
if ('' !== $notes && $notes === $value) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -298,7 +298,7 @@ trait AttachmentCollection
|
||||
/** @var null|Attachment $object */
|
||||
$object = auth()->user()->attachments()->find($attachment['id']);
|
||||
$notes = (string) $object?->notes()->first()?->text;
|
||||
if('' !== $notes && $notes !== $value) {
|
||||
if ('' !== $notes && $notes !== $value) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -323,7 +323,7 @@ trait AttachmentCollection
|
||||
/** @var null|Attachment $object */
|
||||
$object = auth()->user()->attachments()->find($attachment['id']);
|
||||
$notes = (string) $object?->notes()->first()?->text;
|
||||
if( '' !== $notes && str_contains(strtolower($notes), strtolower($value))) {
|
||||
if ('' !== $notes && str_contains(strtolower($notes), strtolower($value))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -348,7 +348,7 @@ trait AttachmentCollection
|
||||
/** @var null|Attachment $object */
|
||||
$object = auth()->user()->attachments()->find($attachment['id']);
|
||||
$notes = (string) $object?->notes()->first()?->text;
|
||||
if('' !== $notes && !str_contains(strtolower($notes), strtolower($value))) {
|
||||
if ('' !== $notes && !str_contains(strtolower($notes), strtolower($value))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -374,7 +374,7 @@ trait AttachmentCollection
|
||||
$object = auth()->user()->attachments()->find($attachment['id']);
|
||||
$notes = (string) $object?->notes()->first()?->text;
|
||||
|
||||
if('' !== $notes && !str_ends_with(strtolower($notes), strtolower($value))) {
|
||||
if ('' !== $notes && !str_ends_with(strtolower($notes), strtolower($value))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -399,7 +399,7 @@ trait AttachmentCollection
|
||||
/** @var null|Attachment $object */
|
||||
$object = auth()->user()->attachments()->find($attachment['id']);
|
||||
$notes = (string) $object?->notes()->first()?->text;
|
||||
if('' !== $notes && !str_starts_with(strtolower($notes), strtolower($value))) {
|
||||
if ('' !== $notes && !str_starts_with(strtolower($notes), strtolower($value))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -424,7 +424,7 @@ trait AttachmentCollection
|
||||
/** @var null|Attachment $object */
|
||||
$object = auth()->user()->attachments()->find($attachment['id']);
|
||||
$notes = (string) $object?->notes()->first()?->text;
|
||||
if('' !== $notes && str_ends_with(strtolower($notes), strtolower($value))) {
|
||||
if ('' !== $notes && str_ends_with(strtolower($notes), strtolower($value))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -449,7 +449,7 @@ trait AttachmentCollection
|
||||
/** @var null|Attachment $object */
|
||||
$object = auth()->user()->attachments()->find($attachment['id']);
|
||||
$notes = (string) $object?->notes()->first()?->text;
|
||||
if('' !== $notes && str_starts_with(strtolower($notes), strtolower($value))) {
|
||||
if ('' !== $notes && str_starts_with(strtolower($notes), strtolower($value))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,10 +283,11 @@ class GroupCollector implements GroupCollectorInterface
|
||||
}
|
||||
echo $query;
|
||||
|
||||
die(PHP_EOL. 'To see the query, uncomment the next lines first.');
|
||||
// echo '<pre>';
|
||||
// print_r($this->query->getBindings());
|
||||
// echo '</pre>';
|
||||
exit(PHP_EOL.'To see the query, uncomment the next lines first.');
|
||||
|
||||
// echo '<pre>';
|
||||
// print_r($this->query->getBindings());
|
||||
// echo '</pre>';
|
||||
}
|
||||
|
||||
public function dumpQueryInLogs(): void
|
||||
|
||||
@@ -278,7 +278,7 @@ final class LoginController extends Controller
|
||||
if ($response) {
|
||||
return $response;
|
||||
}
|
||||
$path = Steam::getSafeUrl(session()->pull('url.intended', route('index')), route('index'));
|
||||
$path = Steam::getSafeUrl(session()->pull('url.intended', route('index')), route('index'));
|
||||
Log::debug(sprintf('SafeURL is %s', $path));
|
||||
|
||||
return $request->wantsJson() ? new JsonResponse([], 204) : redirect()->to($path);
|
||||
|
||||
@@ -195,7 +195,7 @@ final class DebugController extends Controller
|
||||
}
|
||||
// no name route:
|
||||
if (null === $route->getName()) {
|
||||
die('Route name is NULL, cannot deal with this.');
|
||||
exit('Route name is NULL, cannot deal with this.');
|
||||
}
|
||||
|
||||
echo substr($route->uri(), 3);
|
||||
@@ -234,7 +234,7 @@ final class DebugController extends Controller
|
||||
}
|
||||
// no name route:
|
||||
if (null === $route->getName()) {
|
||||
die('Route name is NULL, cannot deal with this.');
|
||||
exit('Route name is NULL, cannot deal with this.');
|
||||
}
|
||||
if (!str_contains($route->uri(), '{')) {
|
||||
$return[$route->getName()] = route($route->getName());
|
||||
|
||||
@@ -97,34 +97,35 @@ class Authenticate
|
||||
throw new AuthenticationException('The user is not logged in but must be.', $guards);
|
||||
}
|
||||
}
|
||||
throw new FireflyException('This point is generally unreachable.');
|
||||
//
|
||||
// exit('five');
|
||||
// foreach ($guards as $guard) {
|
||||
// exit('six');
|
||||
// if ('api' !== $guard) {
|
||||
// $this->auth->guard($guard)->authenticate();
|
||||
// }
|
||||
// $result = $this->auth->guard($guard)->check();
|
||||
// if ($result) {
|
||||
// $user = $this->auth->guard($guard)->user();
|
||||
// $this->validateBlockedUser($user, $guards);
|
||||
//
|
||||
// // According to PHPstan the method returns void, but we'll see.
|
||||
// return $this->auth->shouldUse($guard);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// exit('seven');
|
||||
|
||||
throw new FireflyException('This point is generally unreachable.');
|
||||
|
||||
//
|
||||
// exit('five');
|
||||
// foreach ($guards as $guard) {
|
||||
// exit('six');
|
||||
// if ('api' !== $guard) {
|
||||
// $this->auth->guard($guard)->authenticate();
|
||||
// }
|
||||
// $result = $this->auth->guard($guard)->check();
|
||||
// if ($result) {
|
||||
// $user = $this->auth->guard($guard)->user();
|
||||
// $this->validateBlockedUser($user, $guards);
|
||||
//
|
||||
// // According to PHPstan the method returns void, but we'll see.
|
||||
// return $this->auth->shouldUse($guard);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// exit('seven');
|
||||
// this is a massive hack, but if the handler has the oauth exception
|
||||
// at this point we can report its error instead of a generic one.
|
||||
// $message = 'Unauthenticated.';
|
||||
// if (Handler::$lastError instanceof OAuthServerException) {
|
||||
// $message = Handler::$lastError->getHint();
|
||||
// }
|
||||
//
|
||||
// throw new AuthenticationException($message, $guards);
|
||||
// $message = 'Unauthenticated.';
|
||||
// if (Handler::$lastError instanceof OAuthServerException) {
|
||||
// $message = Handler::$lastError->getHint();
|
||||
// }
|
||||
//
|
||||
// throw new AuthenticationException($message, $guards);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -40,7 +40,7 @@ class NotifiesUserAboutNewIpAddress implements ShouldQueue
|
||||
return; // do not email demo user.
|
||||
}
|
||||
|
||||
/** @var array|null $list */
|
||||
/** @var null|array $list */
|
||||
$list = Preferences::getForUser($user, 'login_ip_history', [])->data;
|
||||
if (!is_array($list)) {
|
||||
$list = [];
|
||||
|
||||
@@ -81,7 +81,6 @@ class Account extends Model
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
|
||||
|
||||
public function accountMeta(): HasMany
|
||||
{
|
||||
return $this->hasMany(AccountMeta::class);
|
||||
|
||||
@@ -85,8 +85,12 @@ class NoCategoryRepository implements NoCategoryRepositoryInterface, UserGroupIn
|
||||
'currency_code' => (string) $journal['currency_code'],
|
||||
'currency_decimal_places' => (int) $journal['currency_decimal_places'],
|
||||
'foreign_currency_id' => (int) ($journal['foreign_currency_id'] ?? 0),
|
||||
'foreign_amount' => array_key_exists('foreign_amount', $journal) && null !== $journal['foreign_amount'] ? Steam::negative((string) $journal['foreign_amount']) : null,
|
||||
'pc_amount' => array_key_exists('pc_amount', $journal) && null !== $journal['pc_amount'] ? Steam::negative((string) $journal['pc_amount']) : null,
|
||||
'foreign_amount' => array_key_exists('foreign_amount', $journal) && null !== $journal['foreign_amount']
|
||||
? Steam::negative((string) $journal['foreign_amount'])
|
||||
: null,
|
||||
'pc_amount' => array_key_exists('pc_amount', $journal) && null !== $journal['pc_amount']
|
||||
? Steam::negative((string) $journal['pc_amount'])
|
||||
: null,
|
||||
'date' => $journal['date'],
|
||||
];
|
||||
}
|
||||
@@ -139,8 +143,12 @@ class NoCategoryRepository implements NoCategoryRepositoryInterface, UserGroupIn
|
||||
'currency_code' => (string) $journal['currency_code'],
|
||||
'currency_decimal_places' => (int) $journal['currency_decimal_places'],
|
||||
'foreign_currency_id' => (int) ($journal['foreign_currency_id'] ?? 0),
|
||||
'foreign_amount' => array_key_exists('foreign_amount', $journal) && null !== $journal['foreign_amount'] ? Steam::positive((string) $journal['foreign_amount']) : null,
|
||||
'pc_amount' => array_key_exists('pc_amount', $journal) && null !== $journal['pc_amount'] ? Steam::positive((string) $journal['pc_amount']) : null,
|
||||
'foreign_amount' => array_key_exists('foreign_amount', $journal) && null !== $journal['foreign_amount']
|
||||
? Steam::positive((string) $journal['foreign_amount'])
|
||||
: null,
|
||||
'pc_amount' => array_key_exists('pc_amount', $journal) && null !== $journal['pc_amount']
|
||||
? Steam::positive((string) $journal['pc_amount'])
|
||||
: null,
|
||||
'date' => $journal['date'],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -159,8 +159,12 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn
|
||||
'currency_code' => (string) $journal['currency_code'],
|
||||
'currency_decimal_places' => (int) $journal['currency_decimal_places'],
|
||||
'foreign_currency_id' => (int) ($journal['foreign_currency_id'] ?? 0),
|
||||
'foreign_amount' => array_key_exists('foreign_amount', $journal) && null !== $journal['foreign_amount'] ? Steam::negative((string) $journal['foreign_amount']) : null,
|
||||
'pc_amount' => array_key_exists('pc_amount', $journal) && null !== $journal['pc_amount'] ? Steam::negative((string) $journal['pc_amount']) : null,
|
||||
'foreign_amount' => array_key_exists('foreign_amount', $journal) && null !== $journal['foreign_amount']
|
||||
? Steam::negative((string) $journal['foreign_amount'])
|
||||
: null,
|
||||
'pc_amount' => array_key_exists('pc_amount', $journal) && null !== $journal['pc_amount']
|
||||
? Steam::negative((string) $journal['pc_amount'])
|
||||
: null,
|
||||
'date' => $journal['date'],
|
||||
'source_account_id' => (string) $journal['source_account_id'],
|
||||
'budget_name' => $journal['budget_name'],
|
||||
@@ -237,8 +241,12 @@ class OperationsRepository implements OperationsRepositoryInterface, UserGroupIn
|
||||
'currency_code' => (string) $journal['currency_code'],
|
||||
'currency_decimal_places' => (int) $journal['currency_decimal_places'],
|
||||
'foreign_currency_id' => (int) ($journal['foreign_currency_id'] ?? 0),
|
||||
'foreign_amount' => array_key_exists('foreign_amount', $journal) && null !== $journal['foreign_amount'] ? Steam::positive((string) $journal['foreign_amount']) : null,
|
||||
'pc_amount' => array_key_exists('pc_amount', $journal) && null !== $journal['pc_amount'] ? Steam::positive((string) $journal['pc_amount']) : null,
|
||||
'foreign_amount' => array_key_exists('foreign_amount', $journal) && null !== $journal['foreign_amount']
|
||||
? Steam::positive((string) $journal['foreign_amount'])
|
||||
: null,
|
||||
'pc_amount' => array_key_exists('pc_amount', $journal) && null !== $journal['pc_amount']
|
||||
? Steam::positive((string) $journal['pc_amount'])
|
||||
: null,
|
||||
'date' => $journal['date'],
|
||||
'source_account_id' => (string) $journal['source_account_id'],
|
||||
'destination_account_id' => (string) $journal['destination_account_id'],
|
||||
|
||||
@@ -40,6 +40,7 @@ use FireflyIII\Support\Repositories\UserGroup\UserGroupInterface;
|
||||
use FireflyIII\Support\Repositories\UserGroup\UserGroupTrait;
|
||||
use Illuminate\Support\Collection;
|
||||
use Override;
|
||||
|
||||
use function Safe\json_encode;
|
||||
|
||||
/**
|
||||
|
||||
@@ -54,7 +54,8 @@ class PeriodStatisticRepository implements PeriodStatisticRepositoryInterface, U
|
||||
->where('type', 'LIKE', sprintf('%s%%', $prefix))
|
||||
->where('start', '>=', $start)
|
||||
->where('end', '<=', $end)
|
||||
->get();
|
||||
->get()
|
||||
;
|
||||
}
|
||||
|
||||
#[Override]
|
||||
@@ -109,7 +110,8 @@ class PeriodStatisticRepository implements PeriodStatisticRepositoryInterface, U
|
||||
}
|
||||
})
|
||||
->where('type', 'LIKE', sprintf('%s%%', $prefix))
|
||||
->delete();
|
||||
->delete()
|
||||
;
|
||||
Log::debug(sprintf('Deleted %d entries for prefix "%s"', $count, $prefix));
|
||||
}
|
||||
|
||||
@@ -121,15 +123,16 @@ class PeriodStatisticRepository implements PeriodStatisticRepositoryInterface, U
|
||||
return;
|
||||
}
|
||||
$count = PeriodStatistic::where('primary_statable_type', $class)
|
||||
->whereIn('primary_statable_id', $objects->pluck('id')->toArray())
|
||||
->where(function (Builder $q) use ($dates): void {
|
||||
foreach ($dates as $date) {
|
||||
$q->where(function (Builder $q1) use ($date): void {
|
||||
$q1->where('start', '<=', $date)->where('end', '>=', $date);
|
||||
});
|
||||
}
|
||||
})
|
||||
->delete();
|
||||
->whereIn('primary_statable_id', $objects->pluck('id')->toArray())
|
||||
->where(function (Builder $q) use ($dates): void {
|
||||
foreach ($dates as $date) {
|
||||
$q->where(function (Builder $q1) use ($date): void {
|
||||
$q1->where('start', '<=', $date)->where('end', '>=', $date);
|
||||
});
|
||||
}
|
||||
})
|
||||
->delete()
|
||||
;
|
||||
Log::debug(sprintf('Delete %d statistics for %dx %s', $count, $objects->count(), $class));
|
||||
}
|
||||
|
||||
@@ -146,14 +149,13 @@ class PeriodStatisticRepository implements PeriodStatisticRepositoryInterface, U
|
||||
#[Override]
|
||||
public function savePrefixedStatistic(
|
||||
string $prefix,
|
||||
int $currencyId,
|
||||
int $currencyId,
|
||||
Carbon $start,
|
||||
Carbon $end,
|
||||
string $type,
|
||||
int $count,
|
||||
int $count,
|
||||
string $amount
|
||||
): PeriodStatistic
|
||||
{
|
||||
): PeriodStatistic {
|
||||
Log::debug(sprintf('Store as type "%s"', sprintf('%s_%s', $prefix, $type)));
|
||||
$stat = new PeriodStatistic();
|
||||
$stat->transaction_currency_id = $currencyId;
|
||||
@@ -168,22 +170,22 @@ class PeriodStatisticRepository implements PeriodStatisticRepositoryInterface, U
|
||||
$stat->save();
|
||||
|
||||
Log::debug(sprintf(
|
||||
'Saved #%d [currency #%d, type "%s", %s to %s, %d, %s] as new statistic.',
|
||||
$stat->id,
|
||||
$stat->transaction_currency_id,
|
||||
$stat->type,
|
||||
$stat->start->toW3cString(),
|
||||
$stat->end->toW3cString(),
|
||||
$count,
|
||||
$amount
|
||||
));
|
||||
'Saved #%d [currency #%d, type "%s", %s to %s, %d, %s] as new statistic.',
|
||||
$stat->id,
|
||||
$stat->transaction_currency_id,
|
||||
$stat->type,
|
||||
$stat->start->toW3cString(),
|
||||
$stat->end->toW3cString(),
|
||||
$count,
|
||||
$amount
|
||||
));
|
||||
|
||||
return $stat;
|
||||
}
|
||||
|
||||
public function saveStatistic(Model $model, int $currencyId, Carbon $start, Carbon $end, string $type, int $count, string $amount): PeriodStatistic
|
||||
{
|
||||
$stat = new PeriodStatistic();
|
||||
$stat = new PeriodStatistic();
|
||||
$stat->primaryStatable()->associate($model);
|
||||
$stat->transaction_currency_id = $currencyId;
|
||||
$stat->user_group_id = $this->getUserGroup()->id;
|
||||
@@ -197,16 +199,16 @@ class PeriodStatisticRepository implements PeriodStatisticRepositoryInterface, U
|
||||
$stat->save();
|
||||
|
||||
Log::debug(sprintf(
|
||||
'Saved #%d [currency #%d, Model %s #%d, %s to %s, %d, %s] as new statistic.',
|
||||
$stat->id,
|
||||
$model::class,
|
||||
$model->id,
|
||||
$stat->transaction_currency_id,
|
||||
$stat->start->toW3cString(),
|
||||
$stat->end->toW3cString(),
|
||||
$count,
|
||||
$amount
|
||||
));
|
||||
'Saved #%d [currency #%d, Model %s #%d, %s to %s, %d, %s] as new statistic.',
|
||||
$stat->id,
|
||||
$model::class,
|
||||
$model->id,
|
||||
$stat->transaction_currency_id,
|
||||
$stat->start->toW3cString(),
|
||||
$stat->end->toW3cString(),
|
||||
$count,
|
||||
$amount
|
||||
));
|
||||
|
||||
return $stat;
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Exception\ClientException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Override;
|
||||
|
||||
use function Safe\file_get_contents;
|
||||
use function Safe\json_decode;
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Services\Internal\Support;
|
||||
|
||||
use FireflyIII\Enums\TransactionTypeEnum;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Factory\AccountMetaFactory;
|
||||
use FireflyIII\Models\Account;
|
||||
use FireflyIII\Models\Transaction;
|
||||
@@ -132,6 +131,7 @@ class CreditRecalculateService
|
||||
|
||||
return $usedAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* case 4
|
||||
* it's a deposit into this liability (from revenue account).
|
||||
|
||||
@@ -28,14 +28,10 @@ use FireflyIII\Events\Model\Bill\UpdatedExistingBill;
|
||||
use FireflyIII\Factory\TransactionCurrencyFactory;
|
||||
use FireflyIII\Models\Bill;
|
||||
use FireflyIII\Models\ObjectGroup;
|
||||
use FireflyIII\Models\Rule;
|
||||
use FireflyIII\Models\RuleTrigger;
|
||||
use FireflyIII\Repositories\ObjectGroup\CreatesObjectGroups;
|
||||
use FireflyIII\Services\Internal\Support\BillServiceTrait;
|
||||
use FireflyIII\Support\Facades\Amount;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
/**
|
||||
* Class BillUpdateService
|
||||
@@ -120,7 +116,6 @@ class BillUpdateService
|
||||
return $bill;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @SuppressWarnings("PHPMD.NPathComplexity")
|
||||
*/
|
||||
|
||||
@@ -41,7 +41,7 @@ class RemoteUserGuard implements Guard
|
||||
{
|
||||
protected Application $application;
|
||||
protected ?User $user = null;
|
||||
private bool $tried = false;
|
||||
private bool $tried = false;
|
||||
|
||||
/**
|
||||
* Create a new authentication guard.
|
||||
|
||||
@@ -36,18 +36,18 @@ use Illuminate\Support\Collection;
|
||||
class CategoryEnrichment implements EnrichmentInterface
|
||||
{
|
||||
private Collection $collection;
|
||||
private array $earned = [];
|
||||
private ?Carbon $end = null;
|
||||
private array $ids = [];
|
||||
private array $notes = [];
|
||||
private array $pcEarned = [];
|
||||
private array $pcSpent = [];
|
||||
private array $pcTransfers = [];
|
||||
private array $spent = [];
|
||||
private ?Carbon $start = null;
|
||||
private array $transfers = [];
|
||||
private User $user;
|
||||
private UserGroup $userGroup;
|
||||
private array $earned = [];
|
||||
private ?Carbon $end = null;
|
||||
private array $ids = [];
|
||||
private array $notes = [];
|
||||
private array $pcEarned = [];
|
||||
private array $pcSpent = [];
|
||||
private array $pcTransfers = [];
|
||||
private array $spent = [];
|
||||
private ?Carbon $start = null;
|
||||
private array $transfers = [];
|
||||
private User $user;
|
||||
private UserGroup $userGroup;
|
||||
|
||||
public function enrich(Collection $collection): Collection
|
||||
{
|
||||
@@ -60,7 +60,7 @@ class CategoryEnrichment implements EnrichmentInterface
|
||||
return $collection;
|
||||
}
|
||||
|
||||
public function enrichSingle(array | Model $model): array | Model
|
||||
public function enrichSingle(array|Model $model): array|Model
|
||||
{
|
||||
// Log::debug(__METHOD__);
|
||||
$collection = new Collection()->push($model);
|
||||
@@ -93,7 +93,7 @@ class CategoryEnrichment implements EnrichmentInterface
|
||||
private function appendCollectedData(): void
|
||||
{
|
||||
$this->collection = $this->collection->map(function (Category $item): Category {
|
||||
$id = (int)$item->id;
|
||||
$id = (int) $item->id;
|
||||
$meta = [
|
||||
'notes' => $this->notes[$id] ?? null,
|
||||
'spent' => $this->spent[$id] ?? null,
|
||||
@@ -113,7 +113,7 @@ class CategoryEnrichment implements EnrichmentInterface
|
||||
{
|
||||
/** @var Category $category */
|
||||
foreach ($this->collection as $category) {
|
||||
$this->ids[] = (int)$category->id;
|
||||
$this->ids[] = (int) $category->id;
|
||||
}
|
||||
$this->ids = array_unique($this->ids);
|
||||
}
|
||||
@@ -121,14 +121,15 @@ class CategoryEnrichment implements EnrichmentInterface
|
||||
private function collectNotes(): void
|
||||
{
|
||||
$notes = Note::query()
|
||||
->whereIn('noteable_id', $this->ids)
|
||||
->whereNotNull('notes.text')
|
||||
->where('notes.text', '!=', '')
|
||||
->where('noteable_type', Category::class)
|
||||
->get(['notes.noteable_id', 'notes.text'])
|
||||
->toArray();
|
||||
->whereIn('noteable_id', $this->ids)
|
||||
->whereNotNull('notes.text')
|
||||
->where('notes.text', '!=', '')
|
||||
->where('noteable_type', Category::class)
|
||||
->get(['notes.noteable_id', 'notes.text'])
|
||||
->toArray()
|
||||
;
|
||||
foreach ($notes as $note) {
|
||||
$this->notes[(int)$note['noteable_id']] = (string)$note['text'];
|
||||
$this->notes[(int) $note['noteable_id']] = (string) $note['text'];
|
||||
}
|
||||
|
||||
// Log::debug(sprintf('Enrich with %d note(s)', count($this->notes)));
|
||||
@@ -141,11 +142,11 @@ class CategoryEnrichment implements EnrichmentInterface
|
||||
$opsRepository = app(OperationsRepositoryInterface::class);
|
||||
$opsRepository->setUser($this->user);
|
||||
$opsRepository->setUserGroup($this->userGroup);
|
||||
$expenses = $opsRepository->collectExpenses($this->start, $this->end, null, $this->collection);
|
||||
$income = $opsRepository->collectIncome($this->start, $this->end, null, $this->collection);
|
||||
$transfers = $opsRepository->collectTransfers($this->start, $this->end, null, $this->collection);
|
||||
$expenses = $opsRepository->collectExpenses($this->start, $this->end, null, $this->collection);
|
||||
$income = $opsRepository->collectIncome($this->start, $this->end, null, $this->collection);
|
||||
$transfers = $opsRepository->collectTransfers($this->start, $this->end, null, $this->collection);
|
||||
foreach ($this->collection as $item) {
|
||||
$id = (int)$item->id;
|
||||
$id = (int) $item->id;
|
||||
$this->spent[$id] = array_values($opsRepository->sumCollectedTransactionsByCategory($expenses, $item, 'negative'));
|
||||
$this->pcSpent[$id] = array_values($opsRepository->sumCollectedTransactionsByCategory($expenses, $item, 'negative', true));
|
||||
$this->earned[$id] = array_values($opsRepository->sumCollectedTransactionsByCategory($income, $item, 'positive'));
|
||||
|
||||
@@ -46,13 +46,7 @@ class AuditProcessor
|
||||
return new LogRecord($record->datetime, $record->channel, $record->level, $message, $record->context, $record->extra, $record->formatted);
|
||||
}
|
||||
|
||||
$message = sprintf(
|
||||
'AUDIT: %s (%s -> %s:%s)',
|
||||
$record['message'],
|
||||
app('request')->ip(),
|
||||
request()->method(),
|
||||
request()->url()
|
||||
);
|
||||
$message = sprintf('AUDIT: %s (%s -> %s:%s)', $record['message'], app('request')->ip(), request()->method(), request()->url());
|
||||
|
||||
return new LogRecord($record->datetime, $record->channel, $record->level, $message, $record->context, $record->extra, $record->formatted);
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support\Search\QueryParser;
|
||||
|
||||
|
||||
use SensitiveParameter;
|
||||
|
||||
use function Safe\preg_split;
|
||||
|
||||
/**
|
||||
|
||||
@@ -51,6 +51,7 @@ use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
use Safe\Exceptions\JsonException;
|
||||
use ValueError;
|
||||
|
||||
use function Safe\iconv;
|
||||
use function Safe\json_encode;
|
||||
use function Safe\preg_match;
|
||||
@@ -78,7 +79,7 @@ class FireflyValidator extends Validator
|
||||
if (!is_string($value) || 6 !== strlen($value)) {
|
||||
return false;
|
||||
}
|
||||
$user = auth()->user();
|
||||
$user = auth()->user();
|
||||
if (null === $user) {
|
||||
Log::error('No user during validate2faCode');
|
||||
|
||||
@@ -89,9 +90,9 @@ class FireflyValidator extends Validator
|
||||
if (is_array($secret)) {
|
||||
$secret = '';
|
||||
}
|
||||
$secret = (string)$secret;
|
||||
$secret = (string) $secret;
|
||||
|
||||
return (bool)Facade::verifyKey($secret, $value);
|
||||
return (bool) Facade::verifyKey($secret, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -105,13 +106,14 @@ class FireflyValidator extends Validator
|
||||
{
|
||||
$field = $parameters[1] ?? 'id';
|
||||
|
||||
if (0 === (int)$value) {
|
||||
if (0 === (int) $value) {
|
||||
return true;
|
||||
}
|
||||
$count = DB::table($parameters[0])
|
||||
->where('user_id', auth()->user()->id)
|
||||
->where($field, $value)
|
||||
->count();
|
||||
->where('user_id', auth()->user()->id)
|
||||
->where($field, $value)
|
||||
->count()
|
||||
;
|
||||
|
||||
return 1 === $count;
|
||||
}
|
||||
@@ -135,15 +137,15 @@ class FireflyValidator extends Validator
|
||||
if (!is_string($value) || 6 !== strlen($value)) {
|
||||
return false;
|
||||
}
|
||||
$user = auth()->user();
|
||||
$user = auth()->user();
|
||||
if (null === $user) {
|
||||
Log::error('No user during validate2faCode');
|
||||
|
||||
return false;
|
||||
}
|
||||
$secret = (string)$user->mfa_secret;
|
||||
$secret = (string) $user->mfa_secret;
|
||||
|
||||
return (bool)Facade::verifyKey($secret, $value);
|
||||
return (bool) Facade::verifyKey($secret, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -250,10 +252,10 @@ class FireflyValidator extends Validator
|
||||
];
|
||||
|
||||
// take
|
||||
$first = substr($value, 0, 4);
|
||||
$last = substr($value, 4);
|
||||
$iban = $last . $first;
|
||||
$iban = trim(str_replace($search, $replace, $iban));
|
||||
$first = substr($value, 0, 4);
|
||||
$last = substr($value, 4);
|
||||
$iban = $last.$first;
|
||||
$iban = trim(str_replace($search, $replace, $iban));
|
||||
if ('' === $iban) {
|
||||
return false;
|
||||
}
|
||||
@@ -268,7 +270,7 @@ class FireflyValidator extends Validator
|
||||
return false;
|
||||
}
|
||||
|
||||
return 1 === (int)$checksum;
|
||||
return 1 === (int) $checksum;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -283,7 +285,7 @@ class FireflyValidator extends Validator
|
||||
/** @var mixed $compare */
|
||||
$compare = $parameters[0] ?? '0';
|
||||
|
||||
return bccomp((string)$value, (string)$compare) < 0;
|
||||
return bccomp((string) $value, (string) $compare) < 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -298,7 +300,7 @@ class FireflyValidator extends Validator
|
||||
/** @var mixed $compare */
|
||||
$compare = $parameters[0] ?? '0';
|
||||
|
||||
return bccomp((string)$value, (string)$compare) > 0;
|
||||
return bccomp((string) $value, (string) $compare) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -312,7 +314,7 @@ class FireflyValidator extends Validator
|
||||
{
|
||||
$field = $parameters[1] ?? 'id';
|
||||
|
||||
if (0 === (int)$value) {
|
||||
if (0 === (int) $value) {
|
||||
return true;
|
||||
}
|
||||
$count = DB::table($parameters[0])->where($field, $value)->count();
|
||||
@@ -324,8 +326,8 @@ class FireflyValidator extends Validator
|
||||
{
|
||||
// first, get the index from this string:
|
||||
$value ??= '';
|
||||
$parts = explode('.', $attribute);
|
||||
$index = (int)($parts[1] ?? '0');
|
||||
$parts = explode('.', $attribute);
|
||||
$index = (int) ($parts[1] ?? '0');
|
||||
|
||||
// get the name of the trigger from the data array:
|
||||
$actionType = $this->data['actions'][$index]['type'] ?? 'invalid';
|
||||
@@ -391,8 +393,8 @@ class FireflyValidator extends Validator
|
||||
public function validateRuleTriggerValue(string $attribute, ?string $value = null): bool
|
||||
{
|
||||
// first, get the index from this string:
|
||||
$parts = explode('.', $attribute);
|
||||
$index = (int)($parts[1] ?? '0');
|
||||
$parts = explode('.', $attribute);
|
||||
$index = (int) ($parts[1] ?? '0');
|
||||
|
||||
// get the name of the trigger from the data array:
|
||||
$triggerType = $this->data['triggers'][$index]['type'] ?? 'invalid';
|
||||
@@ -403,14 +405,14 @@ class FireflyValidator extends Validator
|
||||
}
|
||||
|
||||
// these trigger types need a numerical check:
|
||||
$numerical = ['amount_less', 'amount_more', 'amount_exactly'];
|
||||
$numerical = ['amount_less', 'amount_more', 'amount_exactly'];
|
||||
if (in_array($triggerType, $numerical, true)) {
|
||||
return is_numeric($value);
|
||||
}
|
||||
|
||||
// these triggers need just the word "true":
|
||||
// TODO create a helper to automatically return these.
|
||||
$needTrue = [
|
||||
$needTrue = [
|
||||
'reconciled',
|
||||
'has_attachments',
|
||||
'has_any_category',
|
||||
@@ -439,7 +441,7 @@ class FireflyValidator extends Validator
|
||||
|
||||
// these trigger types need a simple strlen check:
|
||||
// TODO create a helper to automatically return these.
|
||||
$length = [
|
||||
$length = [
|
||||
'source_account_starts',
|
||||
'source_account_ends',
|
||||
'source_account_is',
|
||||
@@ -468,13 +470,13 @@ class FireflyValidator extends Validator
|
||||
// check if it's an existing account.
|
||||
// TODO create a helper to automatically return these.
|
||||
if (in_array($triggerType, ['destination_account_id', 'source_account_id'], true)) {
|
||||
return is_numeric($value) && (int)$value > 0;
|
||||
return is_numeric($value) && (int) $value > 0;
|
||||
}
|
||||
|
||||
// check transaction type.
|
||||
// TODO create a helper to automatically return these.
|
||||
if ('transaction_type' === $triggerType) {
|
||||
$count = TransactionType::where('type', ucfirst((string)$value))->count();
|
||||
$count = TransactionType::where('type', ucfirst((string) $value))->count();
|
||||
|
||||
return 1 === $count;
|
||||
}
|
||||
@@ -505,10 +507,10 @@ class FireflyValidator extends Validator
|
||||
*/
|
||||
public function validateSecurePassword($attribute, ?string $value): bool
|
||||
{
|
||||
$value = (string)$value;
|
||||
$value = (string) $value;
|
||||
$verify = false;
|
||||
if (array_key_exists('verify_password', $this->data)) {
|
||||
$verify = 1 === (int)$this->data['verify_password'];
|
||||
$verify = 1 === (int) $this->data['verify_password'];
|
||||
}
|
||||
if ($verify) {
|
||||
/** @var Verifier $service */
|
||||
@@ -548,7 +550,7 @@ class FireflyValidator extends Validator
|
||||
if (array_key_exists('type', $this->data) && !is_array($this->data['type'])) {
|
||||
Log::debug('validateUniqueAccountForUser::typeString');
|
||||
|
||||
return $this->validateByAccountTypeString($value, $parameters, (string)$this->data['type']);
|
||||
return $this->validateByAccountTypeString($value, $parameters, (string) $this->data['type']);
|
||||
}
|
||||
if (array_key_exists('account_type_id', $this->data)) {
|
||||
Log::debug('validateUniqueAccountForUser::typeId');
|
||||
@@ -559,7 +561,7 @@ class FireflyValidator extends Validator
|
||||
if (null !== $parameterId) {
|
||||
Log::debug('validateUniqueAccountForUser::paramId');
|
||||
|
||||
return $this->validateByParameterId((int)$parameterId, $value);
|
||||
return $this->validateByParameterId((int) $parameterId, $value);
|
||||
}
|
||||
if (array_key_exists('id', $this->data)) {
|
||||
Log::debug('validateUniqueAccountForUser::accountId');
|
||||
@@ -584,23 +586,24 @@ class FireflyValidator extends Validator
|
||||
*/
|
||||
public function validateUniqueAccountNumberForUser($attribute, $value, $parameters): bool
|
||||
{
|
||||
$accountId = (int)($this->data['id'] ?? 0.0);
|
||||
$accountId = (int) ($this->data['id'] ?? 0.0);
|
||||
if (0 === $accountId) {
|
||||
$accountId = (int)($parameters[0] ?? 0.0);
|
||||
$accountId = (int) ($parameters[0] ?? 0.0);
|
||||
}
|
||||
|
||||
$query = AccountMeta::leftJoin('accounts', 'accounts.id', '=', 'account_meta.account_id')
|
||||
->whereNull('accounts.deleted_at')
|
||||
->where('accounts.user_id', auth()->user()->id)
|
||||
->where('account_meta.name', 'account_number')
|
||||
->where('account_meta.data', json_encode($value));
|
||||
$query = AccountMeta::leftJoin('accounts', 'accounts.id', '=', 'account_meta.account_id')
|
||||
->whereNull('accounts.deleted_at')
|
||||
->where('accounts.user_id', auth()->user()->id)
|
||||
->where('account_meta.name', 'account_number')
|
||||
->where('account_meta.data', json_encode($value))
|
||||
;
|
||||
|
||||
if ($accountId > 0) {
|
||||
// exclude current account from check.
|
||||
$query->where('account_meta.account_id', '!=', $accountId);
|
||||
}
|
||||
$set = $query->get(['account_meta.*']);
|
||||
$count = $set->count();
|
||||
$set = $query->get(['account_meta.*']);
|
||||
$count = $set->count();
|
||||
if (0 === $count) {
|
||||
return true;
|
||||
}
|
||||
@@ -608,7 +611,7 @@ class FireflyValidator extends Validator
|
||||
// pretty much impossible but still.
|
||||
return false;
|
||||
}
|
||||
$type = $this->data['objectType'] ?? 'unknown';
|
||||
$type = $this->data['objectType'] ?? 'unknown';
|
||||
if ('expense' !== $type && 'revenue' !== $type) {
|
||||
Log::warning(sprintf('Account number "%s" is not unique and account type "%s" cannot share its account number.', $value, $type));
|
||||
|
||||
@@ -620,7 +623,7 @@ class FireflyValidator extends Validator
|
||||
/** @var AccountMeta $entry */
|
||||
foreach ($set as $entry) {
|
||||
$otherAccount = $entry->account;
|
||||
$otherType = (string)config(sprintf('firefly.shortNamesByFullName.%s', $otherAccount->accountType->type));
|
||||
$otherType = (string) config(sprintf('firefly.shortNamesByFullName.%s', $otherAccount->accountType->type));
|
||||
if (('expense' === $otherType || 'revenue' === $otherType) && $otherType !== $type) {
|
||||
Log::debug(sprintf('The other account with this account number is a "%s" so return true.', $otherType));
|
||||
|
||||
@@ -638,9 +641,10 @@ class FireflyValidator extends Validator
|
||||
public function validateUniqueCurrency(string $field, string $attribute, string $value): bool
|
||||
{
|
||||
return 0 === DB::table('transaction_currencies')
|
||||
->where($field, $value)
|
||||
->whereNull('deleted_at')
|
||||
->count();
|
||||
->where($field, $value)
|
||||
->whereNull('deleted_at')
|
||||
->count()
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -648,17 +652,17 @@ class FireflyValidator extends Validator
|
||||
*/
|
||||
public function validateUniqueCurrencyCode(?string $attribute, ?string $value): bool
|
||||
{
|
||||
return $this->validateUniqueCurrency('code', (string)$attribute, (string)$value);
|
||||
return $this->validateUniqueCurrency('code', (string) $attribute, (string) $value);
|
||||
}
|
||||
|
||||
public function validateUniqueCurrencyName(?string $attribute, ?string $value): bool
|
||||
{
|
||||
return $this->validateUniqueCurrency('name', (string)$attribute, (string)$value);
|
||||
return $this->validateUniqueCurrency('name', (string) $attribute, (string) $value);
|
||||
}
|
||||
|
||||
public function validateUniqueCurrencySymbol(?string $attribute, ?string $value): bool
|
||||
{
|
||||
return $this->validateUniqueCurrency('symbol', (string)$attribute, (string)$value);
|
||||
return $this->validateUniqueCurrency('symbol', (string) $attribute, (string) $value);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -670,7 +674,7 @@ class FireflyValidator extends Validator
|
||||
*/
|
||||
public function validateUniqueExistingWebhook($value, $parameters, $something): bool
|
||||
{
|
||||
$existingId = (int)($something[0] ?? 0);
|
||||
$existingId = (int) ($something[0] ?? 0);
|
||||
$trigger = 0;
|
||||
$response = 0;
|
||||
$delivery = 0;
|
||||
@@ -681,7 +685,7 @@ class FireflyValidator extends Validator
|
||||
// get existing webhook value:
|
||||
if (0 !== $existingId) {
|
||||
/** @var null|Webhook $webhook */
|
||||
$webhook = auth()->user()->webhooks()->find($existingId);
|
||||
$webhook = auth()->user()->webhooks()->find($existingId);
|
||||
if (null === $webhook) {
|
||||
return false;
|
||||
}
|
||||
@@ -699,12 +703,13 @@ class FireflyValidator extends Validator
|
||||
$userId = auth()->user()->id;
|
||||
|
||||
return 0 === Webhook::whereUserId($userId)
|
||||
->where('trigger', $trigger)
|
||||
->where('response', $response)
|
||||
->where('delivery', $delivery)
|
||||
->where('id', '!=', $existingId)
|
||||
->where('url', $url)
|
||||
->count();
|
||||
->where('trigger', $trigger)
|
||||
->where('response', $response)
|
||||
->where('delivery', $delivery)
|
||||
->where('id', '!=', $existingId)
|
||||
->where('url', $url)
|
||||
->count()
|
||||
;
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -726,23 +731,24 @@ class FireflyValidator extends Validator
|
||||
public function validateUniqueObjectForUser($attribute, $value, $parameters): bool
|
||||
{
|
||||
[$table, $field] = $parameters;
|
||||
$exclude = (int)($parameters[2] ?? 0.0);
|
||||
$exclude = (int) ($parameters[2] ?? 0.0);
|
||||
|
||||
/*
|
||||
* If other data (in $this->getData()) contains
|
||||
* ID field, set that field to be the $exclude.
|
||||
*/
|
||||
$data = $this->getData();
|
||||
if (!array_key_exists(2, $parameters) && array_key_exists('id', $data) && (int)$data['id'] > 0) {
|
||||
$exclude = (int)$data['id'];
|
||||
$data = $this->getData();
|
||||
if (!array_key_exists(2, $parameters) && array_key_exists('id', $data) && (int) $data['id'] > 0) {
|
||||
$exclude = (int) $data['id'];
|
||||
}
|
||||
// get entries from table
|
||||
$result = DB::table($table)
|
||||
->where('user_id', auth()->user()->id)
|
||||
->whereNull('deleted_at')
|
||||
->where('id', '!=', $exclude)
|
||||
->where($field, $value)
|
||||
->first([$field]);
|
||||
$result = DB::table($table)
|
||||
->where('user_id', auth()->user()->id)
|
||||
->whereNull('deleted_at')
|
||||
->where('id', '!=', $exclude)
|
||||
->where($field, $value)
|
||||
->first([$field])
|
||||
;
|
||||
if (null === $result) {
|
||||
return true; // not found, so true.
|
||||
}
|
||||
@@ -762,11 +768,12 @@ class FireflyValidator extends Validator
|
||||
{
|
||||
$exclude = $parameters[0] ?? null;
|
||||
$query = DB::table('object_groups')
|
||||
->whereNull('object_groups.deleted_at')
|
||||
->where('object_groups.user_id', auth()->user()->id)
|
||||
->where('object_groups.title', $value);
|
||||
->whereNull('object_groups.deleted_at')
|
||||
->where('object_groups.user_id', auth()->user()->id)
|
||||
->where('object_groups.title', $value)
|
||||
;
|
||||
if (null !== $exclude) {
|
||||
$query->where('object_groups.id', '!=', (int)$exclude);
|
||||
$query->where('object_groups.id', '!=', (int) $exclude);
|
||||
}
|
||||
|
||||
return 0 === $query->count();
|
||||
@@ -783,10 +790,11 @@ class FireflyValidator extends Validator
|
||||
{
|
||||
$exclude = $parameters[0] ?? null;
|
||||
$query = PiggyBank::leftJoin('account_piggy_bank', 'account_piggy_bank.piggy_bank_id', '=', 'piggy_banks.id')
|
||||
->leftJoin('accounts', 'accounts.id', '=', 'account_piggy_bank.account_id')
|
||||
->where('accounts.user_id', auth()->user()->id);
|
||||
->leftJoin('accounts', 'accounts.id', '=', 'account_piggy_bank.account_id')
|
||||
->where('accounts.user_id', auth()->user()->id)
|
||||
;
|
||||
if (null !== $exclude) {
|
||||
$query->where('piggy_banks.id', '!=', (int)$exclude);
|
||||
$query->where('piggy_banks.id', '!=', (int) $exclude);
|
||||
}
|
||||
$query->where('piggy_banks.name', $value);
|
||||
|
||||
@@ -807,18 +815,19 @@ class FireflyValidator extends Validator
|
||||
$deliveries = Webhook::getDeliveriesForValidation();
|
||||
|
||||
// integers
|
||||
$trigger = $triggers[$this->data['trigger']] ?? 0;
|
||||
$response = $responses[$this->data['response']] ?? 0;
|
||||
$delivery = $deliveries[$this->data['delivery']] ?? 0;
|
||||
$url = $this->data['url'];
|
||||
$userId = auth()->user()->id;
|
||||
$trigger = $triggers[$this->data['trigger']] ?? 0;
|
||||
$response = $responses[$this->data['response']] ?? 0;
|
||||
$delivery = $deliveries[$this->data['delivery']] ?? 0;
|
||||
$url = $this->data['url'];
|
||||
$userId = auth()->user()->id;
|
||||
|
||||
return 0 === Webhook::whereUserId($userId)
|
||||
->where('trigger', $trigger)
|
||||
->where('response', $response)
|
||||
->where('delivery', $delivery)
|
||||
->where('url', $url)
|
||||
->count();
|
||||
->where('trigger', $trigger)
|
||||
->where('response', $response)
|
||||
->where('delivery', $delivery)
|
||||
->where('url', $url)
|
||||
->count()
|
||||
;
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -831,9 +840,9 @@ class FireflyValidator extends Validator
|
||||
}
|
||||
|
||||
/** @var User $user */
|
||||
$user = User::find($this->data['user_id']);
|
||||
$type = AccountType::find($this->data['account_type_id'])->first();
|
||||
$value = $this->data['name'];
|
||||
$user = User::find($this->data['user_id']);
|
||||
$type = AccountType::find($this->data['account_type_id'])->first();
|
||||
$value = $this->data['name'];
|
||||
|
||||
/** @var null|Account $result */
|
||||
$result = $user->accounts()->where('account_type_id', $type->id)->where('name', $value)->first();
|
||||
@@ -849,10 +858,10 @@ class FireflyValidator extends Validator
|
||||
/** @var Account $existingAccount */
|
||||
$existingAccount = Account::find($this->data['id']);
|
||||
|
||||
$type = $existingAccount->accountType;
|
||||
$ignore = $existingAccount->id;
|
||||
$type = $existingAccount->accountType;
|
||||
$ignore = $existingAccount->id;
|
||||
|
||||
$entry = auth()->user()->accounts()->where('account_type_id', $type->id)->where('id', '!=', $ignore)->where('name', $value)->first();
|
||||
$entry = auth()->user()->accounts()->where('account_type_id', $type->id)->where('id', '!=', $ignore)->where('name', $value)->first();
|
||||
|
||||
return null === $entry;
|
||||
}
|
||||
@@ -869,7 +878,7 @@ class FireflyValidator extends Validator
|
||||
private function validateByAccountTypeId($value, $parameters): bool
|
||||
{
|
||||
$type = AccountType::find($this->data['account_type_id'])->first();
|
||||
$ignore = (int)($parameters[0] ?? 0.0);
|
||||
$ignore = (int) ($parameters[0] ?? 0.0);
|
||||
|
||||
/** @var null|Account $result */
|
||||
$result = auth()->user()->accounts()->where('account_type_id', $type->id)->where('id', '!=', $ignore)->where('name', $value)->first();
|
||||
@@ -880,18 +889,18 @@ class FireflyValidator extends Validator
|
||||
private function validateByAccountTypeString(string $value, array $parameters, string $type): bool
|
||||
{
|
||||
/** @var null|array $search */
|
||||
$search = config('firefly.accountTypeByIdentifier.' . $type);
|
||||
$search = config('firefly.accountTypeByIdentifier.'.$type);
|
||||
|
||||
if (null === $search) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$accountTypes = AccountType::whereIn('type', $search)->get();
|
||||
$ignore = (int)($parameters[0] ?? 0.0);
|
||||
$ignore = (int) ($parameters[0] ?? 0.0);
|
||||
$accountTypeIds = $accountTypes->pluck('id')->toArray();
|
||||
|
||||
/** @var null|Account $result */
|
||||
$result = auth()->user()->accounts()->whereIn('account_type_id', $accountTypeIds)->where('id', '!=', $ignore)->where('name', $value)->first();
|
||||
$result = auth()->user()->accounts()->whereIn('account_type_id', $accountTypeIds)->where('id', '!=', $ignore)->where('name', $value)->first();
|
||||
|
||||
return null === $result;
|
||||
}
|
||||
@@ -904,10 +913,10 @@ class FireflyValidator extends Validator
|
||||
/** @var Account $existingAccount */
|
||||
$existingAccount = Account::find($accountId);
|
||||
|
||||
$type = $existingAccount->accountType;
|
||||
$ignore = $existingAccount->id;
|
||||
$type = $existingAccount->accountType;
|
||||
$ignore = $existingAccount->id;
|
||||
|
||||
$entry = auth()->user()->accounts()->where('account_type_id', $type->id)->where('id', '!=', $ignore)->where('name', $value)->first();
|
||||
$entry = auth()->user()->accounts()->where('account_type_id', $type->id)->where('id', '!=', $ignore)->where('name', $value)->first();
|
||||
|
||||
return null === $entry;
|
||||
}
|
||||
|
||||
+2
-2
@@ -78,8 +78,8 @@ return [
|
||||
'running_balance_column' => (bool)envNonEmpty('USE_RUNNING_BALANCE', true), // this is only the default value, is not used.
|
||||
// see cer.php for exchange rates feature flag.
|
||||
],
|
||||
'version' => '6.5.2',
|
||||
'build_time' => 1772516401,
|
||||
'version' => 'develop/2026-03-04',
|
||||
'build_time' => 1772603748,
|
||||
'api_version' => '2.1.0', // field is no longer used.
|
||||
'db_version' => 28, // field is no longer used.
|
||||
|
||||
|
||||
@@ -31,8 +31,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
private const TABLE_ALREADY_EXISTS = 'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.';
|
||||
private const TABLE_ERROR = 'Could not create table "%s": %s';
|
||||
|
||||
|
||||
@@ -31,8 +31,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
private const TABLE_ALREADY_EXISTS = 'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.';
|
||||
private const TABLE_ERROR = 'Could not create table "%s": %s';
|
||||
|
||||
@@ -69,5 +68,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -31,8 +31,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
private const TABLE_ALREADY_EXISTS = 'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.';
|
||||
private const TABLE_ERROR = 'Could not create table "%s": %s';
|
||||
|
||||
@@ -631,5 +630,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -28,8 +28,7 @@ use Illuminate\Database\Migrations\Migration;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -41,5 +40,4 @@ return new class extends Migration
|
||||
* @SuppressWarnings("PHPMD.ShortMethodName")
|
||||
*/
|
||||
public function up(): void {}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -31,8 +31,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
private const COLUMN_ALREADY_EXISTS = 'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.';
|
||||
private const TABLE_UPDATE_ERROR = 'Could not update table "%s": %s';
|
||||
|
||||
@@ -70,5 +69,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -31,8 +31,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -68,5 +67,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -31,8 +31,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -67,5 +66,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -31,8 +31,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -68,5 +67,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -31,8 +31,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -71,5 +70,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -31,8 +31,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -160,5 +159,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -31,8 +31,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -101,5 +100,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -31,8 +31,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -105,5 +104,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -31,8 +31,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -94,5 +93,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -31,8 +31,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -68,5 +67,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -32,8 +32,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -67,5 +66,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -32,8 +32,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -69,5 +68,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -32,8 +32,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -65,5 +64,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -32,8 +32,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -70,5 +69,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
+2
-4
@@ -32,8 +32,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -64,5 +63,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -32,8 +32,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -91,5 +90,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -32,8 +32,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -95,5 +94,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -29,8 +29,7 @@ use Illuminate\Database\Migrations\Migration;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -42,5 +41,4 @@ return new class extends Migration
|
||||
* @SuppressWarnings("PHPMD.ShortMethodName")
|
||||
*/
|
||||
public function up(): void {}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -32,8 +32,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -178,5 +177,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -32,8 +32,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -75,5 +74,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -32,8 +32,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -69,5 +68,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -32,8 +32,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -90,5 +89,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -32,8 +32,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -72,5 +71,4 @@ return new class extends Migration
|
||||
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -32,8 +32,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -63,5 +62,4 @@ return new class extends Migration
|
||||
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -32,8 +32,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -73,5 +72,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -32,8 +32,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -160,5 +159,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -32,8 +32,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -71,5 +70,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -32,8 +32,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -73,5 +72,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -32,8 +32,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -84,5 +83,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -32,8 +32,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -69,5 +68,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -32,8 +32,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -134,5 +133,4 @@ return new class extends Migration
|
||||
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -30,8 +30,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
/**
|
||||
* Class ChangesForV550
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -265,5 +264,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -30,8 +30,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
/**
|
||||
* Class ChangesForV550b2
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -76,5 +75,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -27,8 +27,7 @@ use Illuminate\Database\QueryException;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -64,5 +63,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -30,8 +30,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
/**
|
||||
* Class ExtendCurrencyInfo
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -54,5 +53,4 @@ return new class extends Migration
|
||||
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -28,8 +28,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
/**
|
||||
* Class DropTeleTable
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -47,5 +46,4 @@ return new class extends Migration
|
||||
{
|
||||
Schema::dropIfExists('telemetry');
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -30,8 +30,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
/**
|
||||
* Class UserGroups
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
private array $tables = [
|
||||
'accounts',
|
||||
'attachments',
|
||||
@@ -198,5 +197,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -30,8 +30,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
/**
|
||||
* Class CreateLocalPersonalAccessTokensTable
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
@@ -66,5 +65,4 @@ return new class extends Migration
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
};
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* 2024_12_19_061003_add_native_amount_column.php
|
||||
* Copyright (c) 2025 james@firefly-iii.org.
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* 2025_07_10_065736_rename_tag_mode.php
|
||||
* Copyright (c) 2025 james@firefly-iii.org
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* 2025_08_19_180459_create_webhook_details_tables.php
|
||||
* Copyright (c) 2025 james@firefly-iii.org
|
||||
|
||||
@@ -15,9 +15,7 @@ return new class extends Migration {
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
}
|
||||
public function down(): void {}
|
||||
|
||||
public function up(): void
|
||||
{
|
||||
|
||||
Generated
+20
-31
@@ -4597,9 +4597,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/caniuse-lite": {
|
||||
"version": "1.0.30001775",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001775.tgz",
|
||||
"integrity": "sha512-s3Qv7Lht9zbVKE9XoTyRG6wVDCKdtOFIjBGg3+Yhn6JaytuNKPIjBMTMIY1AnOH3seL5mvF+x33oGAyK3hVt3A==",
|
||||
"version": "1.0.30001776",
|
||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001776.tgz",
|
||||
"integrity": "sha512-sg01JDPzZ9jGshqKSckOQthXnYwOEP50jeVFhaSFbZcOy05TiuuaffDOfcwtCisJ9kNQuLBFibYywv2Bgm9osw==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -5802,9 +5802,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/electron-to-chromium": {
|
||||
"version": "1.5.302",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.302.tgz",
|
||||
"integrity": "sha512-sM6HAN2LyK82IyPBpznDRqlTQAtuSaO+ShzFiWTvoMJLHyZ+Y39r8VMfHzwbU8MVBzQ4Wdn85+wlZl2TLGIlwg==",
|
||||
"version": "1.5.307",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.307.tgz",
|
||||
"integrity": "sha512-5z3uFKBWjiNR44nFcYdkcXjKMbg5KXNdciu7mhTPo9tB7NbqSNP2sSnGR+fqknZSCwKkBN+oxiiajWs4dT6ORg==",
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
@@ -7331,9 +7331,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/immutable": {
|
||||
"version": "5.1.4",
|
||||
"resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.4.tgz",
|
||||
"integrity": "sha512-p6u1bG3YSnINT5RQmx/yRZBpenIl30kVxkTLDyHLIMk0gict704Q9n+thfDI7lTRm9vXdDYutVzXhzcThxTnXA==",
|
||||
"version": "5.1.5",
|
||||
"resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.5.tgz",
|
||||
"integrity": "sha512-t7xcm2siw+hlUM68I+UEOK+z84RzmN59as9DZ7P1l0994DKUWV7UXBMQZVxaoMSRQ+PBZbHCOoBt7a2wxOMt+A==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
@@ -8514,9 +8514,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/node-releases": {
|
||||
"version": "2.0.27",
|
||||
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz",
|
||||
"integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==",
|
||||
"version": "2.0.36",
|
||||
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.36.tgz",
|
||||
"integrity": "sha512-TdC8FSgHz8Mwtw9g5L4gR/Sh9XhSP/0DEkQxfEFXOpiul5IiHgHan2VhYYb6agDSfp4KuvltmGApc8HMgUrIkA==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
@@ -10378,16 +10378,6 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/serialize-javascript": {
|
||||
"version": "6.0.2",
|
||||
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz",
|
||||
"integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"randombytes": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/serve-index": {
|
||||
"version": "1.9.2",
|
||||
"resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.2.tgz",
|
||||
@@ -11033,16 +11023,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/terser-webpack-plugin": {
|
||||
"version": "5.3.16",
|
||||
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.16.tgz",
|
||||
"integrity": "sha512-h9oBFCWrq78NyWWVcSwZarJkZ01c2AyGrzs1crmHZO3QUg9D61Wu4NPjBy69n7JqylFF5y+CsUZYmYEIZ3mR+Q==",
|
||||
"version": "5.3.17",
|
||||
"resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.17.tgz",
|
||||
"integrity": "sha512-YR7PtUp6GMU91BgSJmlaX/rS2lGDbAF7D+Wtq7hRO+MiljNmodYvqslzCFiYVAgW+Qoaaia/QUIP4lGXufjdZw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@jridgewell/trace-mapping": "^0.3.25",
|
||||
"jest-worker": "^27.4.5",
|
||||
"schema-utils": "^4.3.0",
|
||||
"serialize-javascript": "^6.0.2",
|
||||
"terser": "^5.31.1"
|
||||
},
|
||||
"engines": {
|
||||
@@ -11836,9 +11825,9 @@
|
||||
"license": "BSD-2-Clause"
|
||||
},
|
||||
"node_modules/webpack": {
|
||||
"version": "5.105.3",
|
||||
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.105.3.tgz",
|
||||
"integrity": "sha512-LLBBA4oLmT7sZdHiYE/PeVuifOxYyE2uL/V+9VQP7YSYdJU7bSf7H8bZRRxW8kEPMkmVjnrXmoR3oejIdX0xbg==",
|
||||
"version": "5.105.4",
|
||||
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.105.4.tgz",
|
||||
"integrity": "sha512-jTywjboN9aHxFlToqb0K0Zs9SbBoW4zRUlGzI2tYNxVYcEi/IPpn+Xi4ye5jTLvX2YeLuic/IvxNot+Q1jMoOw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -11852,7 +11841,7 @@
|
||||
"acorn-import-phases": "^1.0.3",
|
||||
"browserslist": "^4.28.1",
|
||||
"chrome-trace-event": "^1.0.2",
|
||||
"enhanced-resolve": "^5.19.0",
|
||||
"enhanced-resolve": "^5.20.0",
|
||||
"es-module-lexer": "^2.0.0",
|
||||
"eslint-scope": "5.1.1",
|
||||
"events": "^3.2.0",
|
||||
@@ -11864,7 +11853,7 @@
|
||||
"neo-async": "^2.6.2",
|
||||
"schema-utils": "^4.3.3",
|
||||
"tapable": "^2.3.0",
|
||||
"terser-webpack-plugin": "^5.3.16",
|
||||
"terser-webpack-plugin": "^5.3.17",
|
||||
"watchpack": "^2.5.1",
|
||||
"webpack-sources": "^3.3.4"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user