Check submission sizes.

This commit is contained in:
James Cole
2023-12-31 06:20:29 +01:00
parent 81a11ee5b4
commit a49cf1fd3d
13 changed files with 82 additions and 68 deletions

View File

@@ -536,16 +536,16 @@
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
"version": "v7.0.1", "version": "v7.0.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/console.git", "url": "https://github.com/symfony/console.git",
"reference": "cdce5c684b2f920bb1343deecdfba356ffad83d5" "reference": "f8587c4cdc5acad67af71c37db34ef03af91e59c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/cdce5c684b2f920bb1343deecdfba356ffad83d5", "url": "https://api.github.com/repos/symfony/console/zipball/f8587c4cdc5acad67af71c37db34ef03af91e59c",
"reference": "cdce5c684b2f920bb1343deecdfba356ffad83d5", "reference": "f8587c4cdc5acad67af71c37db34ef03af91e59c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -609,7 +609,7 @@
"terminal" "terminal"
], ],
"support": { "support": {
"source": "https://github.com/symfony/console/tree/v7.0.1" "source": "https://github.com/symfony/console/tree/v7.0.2"
}, },
"funding": [ "funding": [
{ {
@@ -625,7 +625,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-12-01T15:10:06+00:00" "time": "2023-12-10T16:54:46+00:00"
}, },
{ {
"name": "symfony/deprecation-contracts", "name": "symfony/deprecation-contracts",
@@ -696,16 +696,16 @@
}, },
{ {
"name": "symfony/event-dispatcher", "name": "symfony/event-dispatcher",
"version": "v7.0.0", "version": "v7.0.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/event-dispatcher.git", "url": "https://github.com/symfony/event-dispatcher.git",
"reference": "c459b40ffe67c49af6fd392aac374c9edf8a027e" "reference": "098b62ae81fdd6cbf941f355059f617db28f4f9a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/c459b40ffe67c49af6fd392aac374c9edf8a027e", "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/098b62ae81fdd6cbf941f355059f617db28f4f9a",
"reference": "c459b40ffe67c49af6fd392aac374c9edf8a027e", "reference": "098b62ae81fdd6cbf941f355059f617db28f4f9a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -756,7 +756,7 @@
"description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/event-dispatcher/tree/v7.0.0" "source": "https://github.com/symfony/event-dispatcher/tree/v7.0.2"
}, },
"funding": [ "funding": [
{ {
@@ -772,7 +772,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-07-27T16:29:09+00:00" "time": "2023-12-27T22:24:19+00:00"
}, },
{ {
"name": "symfony/event-dispatcher-contracts", "name": "symfony/event-dispatcher-contracts",
@@ -1538,16 +1538,16 @@
}, },
{ {
"name": "symfony/process", "name": "symfony/process",
"version": "v7.0.0", "version": "v7.0.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/process.git", "url": "https://github.com/symfony/process.git",
"reference": "13bdb1670c7f510494e04fcb2bfa29af63db9c0d" "reference": "acd3eb5cb02382c1cb0287ba29b2908cc6ffa83a"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/13bdb1670c7f510494e04fcb2bfa29af63db9c0d", "url": "https://api.github.com/repos/symfony/process/zipball/acd3eb5cb02382c1cb0287ba29b2908cc6ffa83a",
"reference": "13bdb1670c7f510494e04fcb2bfa29af63db9c0d", "reference": "acd3eb5cb02382c1cb0287ba29b2908cc6ffa83a",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1579,7 +1579,7 @@
"description": "Executes commands in sub-processes", "description": "Executes commands in sub-processes",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"support": { "support": {
"source": "https://github.com/symfony/process/tree/v7.0.0" "source": "https://github.com/symfony/process/tree/v7.0.2"
}, },
"funding": [ "funding": [
{ {
@@ -1595,7 +1595,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-11-20T16:43:42+00:00" "time": "2023-12-24T09:15:37+00:00"
}, },
{ {
"name": "symfony/service-contracts", "name": "symfony/service-contracts",
@@ -1743,16 +1743,16 @@
}, },
{ {
"name": "symfony/string", "name": "symfony/string",
"version": "v7.0.0", "version": "v7.0.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/string.git", "url": "https://github.com/symfony/string.git",
"reference": "92bd2bfbba476d4a1838e5e12168bef2fd1e6620" "reference": "cc78f14f91f5e53b42044d0620961c48028ff9f5"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/92bd2bfbba476d4a1838e5e12168bef2fd1e6620", "url": "https://api.github.com/repos/symfony/string/zipball/cc78f14f91f5e53b42044d0620961c48028ff9f5",
"reference": "92bd2bfbba476d4a1838e5e12168bef2fd1e6620", "reference": "cc78f14f91f5e53b42044d0620961c48028ff9f5",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1809,7 +1809,7 @@
"utf8" "utf8"
], ],
"support": { "support": {
"source": "https://github.com/symfony/string/tree/v7.0.0" "source": "https://github.com/symfony/string/tree/v7.0.2"
}, },
"funding": [ "funding": [
{ {
@@ -1825,7 +1825,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2023-11-29T08:40:23+00:00" "time": "2023-12-10T16:54:46+00:00"
} }
], ],
"packages-dev": [], "packages-dev": [],

View File

@@ -115,6 +115,7 @@ class AccountFormRequest extends FormRequest
'amount_currency_id_virtual_balance' => 'exists:transaction_currencies,id', 'amount_currency_id_virtual_balance' => 'exists:transaction_currencies,id',
'what' => 'in:'.$types, 'what' => 'in:'.$types,
'interest_period' => 'in:daily,monthly,yearly', 'interest_period' => 'in:daily,monthly,yearly',
'notes' => 'between:1,65536|nullable',
]; ];
$rules = Location::requestRules($rules); $rules = Location::requestRules($rules);

View File

@@ -65,6 +65,7 @@ class BudgetFormStoreRequest extends FormRequest
'auto_budget_currency_id' => 'exists:transaction_currencies,id', 'auto_budget_currency_id' => 'exists:transaction_currencies,id',
'auto_budget_amount' => 'min:0|max:1000000000|required_if:auto_budget_type,1|required_if:auto_budget_type,2', 'auto_budget_amount' => 'min:0|max:1000000000|required_if:auto_budget_type,1|required_if:auto_budget_type,2',
'auto_budget_period' => 'in:daily,weekly,monthly,quarterly,half_year,yearly', 'auto_budget_period' => 'in:daily,weekly,monthly,quarterly,half_year,yearly',
'notes' => 'between:1,65536|nullable',
]; ];
} }

View File

@@ -75,6 +75,7 @@ class BudgetFormUpdateRequest extends FormRequest
'auto_budget_currency_id' => 'exists:transaction_currencies,id', 'auto_budget_currency_id' => 'exists:transaction_currencies,id',
'auto_budget_amount' => 'min:0|max:1000000000|required_if:auto_budget_type,1|required_if:auto_budget_type,2|numeric', 'auto_budget_amount' => 'min:0|max:1000000000|required_if:auto_budget_type,1|required_if:auto_budget_type,2|numeric',
'auto_budget_period' => 'in:daily,weekly,monthly,quarterly,half_year,yearly', 'auto_budget_period' => 'in:daily,weekly,monthly,quarterly,half_year,yearly',
'notes' => 'between:1,65536|nullable',
]; ];
} }

View File

@@ -64,6 +64,7 @@ class CategoryFormRequest extends FormRequest
// fixed // fixed
return [ return [
'name' => $nameRule, 'name' => $nameRule,
'notes' => 'between:1,65536|nullable',
]; ];
} }
} }

View File

@@ -161,7 +161,7 @@ class RecurrenceFormRequest extends FormRequest
'first_date' => 'required|date|after:'.$today->format('Y-m-d'), 'first_date' => 'required|date|after:'.$today->format('Y-m-d'),
'repetition_type' => ['required', new ValidRecurrenceRepetitionValue(), new ValidRecurrenceRepetitionType(), 'between:1,20'], 'repetition_type' => ['required', new ValidRecurrenceRepetitionValue(), new ValidRecurrenceRepetitionType(), 'between:1,20'],
'skip' => 'required|numeric|integer|gte:0|lte:31', 'skip' => 'required|numeric|integer|gte:0|lte:31',
'notes' => 'between:1,65536|nullable',
// optional for recurrence: // optional for recurrence:
'recurring_description' => 'between:0,65000', 'recurring_description' => 'between:0,65000',
'active' => 'numeric|between:0,1', 'active' => 'numeric|between:0,1',

View File

@@ -60,7 +60,8 @@ class BudgetRepository implements BudgetRepositoryInterface
$search->where('name', 'LIKE', sprintf('%%%s', $query)); $search->where('name', 'LIKE', sprintf('%%%s', $query));
} }
$search->orderBy('order', 'ASC') $search->orderBy('order', 'ASC')
->orderBy('name', 'ASC')->where('active', true); ->orderBy('name', 'ASC')->where('active', true)
;
return $search->take($limit)->get(); return $search->take($limit)->get();
} }
@@ -72,7 +73,8 @@ class BudgetRepository implements BudgetRepositoryInterface
$search->where('name', 'LIKE', sprintf('%s%%', $query)); $search->where('name', 'LIKE', sprintf('%s%%', $query));
} }
$search->orderBy('order', 'ASC') $search->orderBy('order', 'ASC')
->orderBy('name', 'ASC')->where('active', true); ->orderBy('name', 'ASC')->where('active', true)
;
return $search->take($limit)->get(); return $search->take($limit)->get();
} }
@@ -163,7 +165,8 @@ class BudgetRepository implements BudgetRepositoryInterface
return $this->user->budgets()->where('active', true) return $this->user->budgets()->where('active', true)
->orderBy('order', 'ASC') ->orderBy('order', 'ASC')
->orderBy('name', 'ASC') ->orderBy('name', 'ASC')
->get(); ->get()
;
} }
public function budgetedInPeriodForBudget(Budget $budget, Carbon $start, Carbon $end): array public function budgetedInPeriodForBudget(Budget $budget, Carbon $start, Carbon $end): array
@@ -331,7 +334,8 @@ class BudgetRepository implements BudgetRepositoryInterface
public function getBudgets(): Collection public function getBudgets(): Collection
{ {
return $this->user->budgets()->orderBy('order', 'ASC') return $this->user->budgets()->orderBy('order', 'ASC')
->orderBy('name', 'ASC')->get(); ->orderBy('name', 'ASC')->get()
;
} }
public function destroyAutoBudget(Budget $budget): void public function destroyAutoBudget(Budget $budget): void
@@ -416,7 +420,8 @@ class BudgetRepository implements BudgetRepositoryInterface
{ {
return $this->user->budgets() return $this->user->budgets()
->orderBy('order', 'ASC') ->orderBy('order', 'ASC')
->orderBy('name', 'ASC')->where('active', 0)->get(); ->orderBy('name', 'ASC')->where('active', 0)->get()
;
} }
public function getNoteText(Budget $budget): ?string public function getNoteText(Budget $budget): ?string
@@ -436,7 +441,8 @@ class BudgetRepository implements BudgetRepositoryInterface
$search->where('name', 'LIKE', sprintf('%%%s%%', $query)); $search->where('name', 'LIKE', sprintf('%%%s%%', $query));
} }
$search->orderBy('order', 'ASC') $search->orderBy('order', 'ASC')
->orderBy('name', 'ASC')->where('active', true); ->orderBy('name', 'ASC')->where('active', true)
;
return $search->take($limit)->get(); return $search->take($limit)->get();
} }
@@ -473,7 +479,8 @@ class BudgetRepository implements BudgetRepositoryInterface
->setRange($start, $end) ->setRange($start, $end)
->excludeDestinationAccounts($selection) ->excludeDestinationAccounts($selection)
->setTypes([TransactionType::WITHDRAWAL]) ->setTypes([TransactionType::WITHDRAWAL])
->setBudgets($this->getActiveBudgets()); ->setBudgets($this->getActiveBudgets())
;
$journals = $collector->getExtractedJournals(); $journals = $collector->getExtractedJournals();
$array = []; $array = [];
@@ -534,7 +541,8 @@ class BudgetRepository implements BudgetRepositoryInterface
->setRange($start, $end) ->setRange($start, $end)
->excludeDestinationAccounts($selection) ->excludeDestinationAccounts($selection)
->setTypes([TransactionType::WITHDRAWAL]) ->setTypes([TransactionType::WITHDRAWAL])
->setBudget($budget); ->setBudget($budget)
;
$journals = $collector->getExtractedJournals(); $journals = $collector->getExtractedJournals();
$array = []; $array = [];
@@ -708,7 +716,8 @@ class BudgetRepository implements BudgetRepositoryInterface
->where('rules.user_id', $this->user->id) ->where('rules.user_id', $this->user->id)
->whereIn('rule_actions.action_type', $types) ->whereIn('rule_actions.action_type', $types)
->where('rule_actions.action_value', $oldName) ->where('rule_actions.action_value', $oldName)
->get(['rule_actions.*']); ->get(['rule_actions.*'])
;
app('log')->debug(sprintf('Found %d actions to update.', $actions->count())); app('log')->debug(sprintf('Found %d actions to update.', $actions->count()));
/** @var RuleAction $action */ /** @var RuleAction $action */
@@ -726,7 +735,8 @@ class BudgetRepository implements BudgetRepositoryInterface
->where('rules.user_id', $this->user->id) ->where('rules.user_id', $this->user->id)
->whereIn('rule_triggers.trigger_type', $types) ->whereIn('rule_triggers.trigger_type', $types)
->where('rule_triggers.trigger_value', $oldName) ->where('rule_triggers.trigger_value', $oldName)
->get(['rule_triggers.*']); ->get(['rule_triggers.*'])
;
app('log')->debug(sprintf('Found %d triggers to update.', $triggers->count())); app('log')->debug(sprintf('Found %d triggers to update.', $triggers->count()));
/** @var RuleTrigger $trigger */ /** @var RuleTrigger $trigger */