mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-04 03:43:07 +00:00
No longer create a default rule.
This commit is contained in:
@@ -80,7 +80,6 @@ class CreateController extends Controller
|
||||
public function create(Request $request, RuleGroup $ruleGroup = null)
|
||||
{
|
||||
$this->createDefaultRuleGroup();
|
||||
$this->createDefaultRule();
|
||||
$preFilled = [
|
||||
'strict' => true,
|
||||
];
|
||||
@@ -145,7 +144,6 @@ class CreateController extends Controller
|
||||
$request->session()->flash('info', (string)trans('firefly.instructions_rule_from_bill', ['name' => e($bill->name)]));
|
||||
|
||||
$this->createDefaultRuleGroup();
|
||||
$this->createDefaultRule();
|
||||
$preFilled = [
|
||||
'strict' => true,
|
||||
'title' => (string)trans('firefly.new_rule_for_bill_title', ['name' => $bill->name]),
|
||||
@@ -202,7 +200,6 @@ class CreateController extends Controller
|
||||
$oldActions = [];
|
||||
|
||||
$this->createDefaultRuleGroup();
|
||||
$this->createDefaultRule();
|
||||
|
||||
// collect pre-filled information:
|
||||
$preFilled = [
|
||||
|
@@ -74,7 +74,6 @@ class IndexController extends Controller
|
||||
public function index()
|
||||
{
|
||||
$this->createDefaultRuleGroup();
|
||||
$this->createDefaultRule();
|
||||
$this->ruleGroupRepos->resetOrder();
|
||||
$ruleGroups = $this->ruleGroupRepos->getAllRuleGroupsWithRules(null);
|
||||
|
||||
|
@@ -36,54 +36,6 @@ use Throwable;
|
||||
*/
|
||||
trait RuleManagement
|
||||
{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected function createDefaultRule(): void
|
||||
{
|
||||
/** @var RuleRepositoryInterface $ruleRepository */
|
||||
$ruleRepository = app(RuleRepositoryInterface::class);
|
||||
if (0 === $ruleRepository->count()) {
|
||||
$data = [
|
||||
'rule_group_id' => $ruleRepository->getFirstRuleGroup()->id,
|
||||
'stop_processing' => 0,
|
||||
'title' => (string)trans('firefly.default_rule_name'),
|
||||
'description' => (string)trans('firefly.default_rule_description'),
|
||||
'trigger' => 'store-journal',
|
||||
'strict' => true,
|
||||
'active' => true,
|
||||
'triggers' => [
|
||||
[
|
||||
'type' => 'description_is',
|
||||
'value' => (string)trans('firefly.default_rule_trigger_description'),
|
||||
'stop_processing' => false,
|
||||
|
||||
],
|
||||
[
|
||||
'type' => 'from_account_is',
|
||||
'value' => (string)trans('firefly.default_rule_trigger_source_account'),
|
||||
'stop_processing' => false,
|
||||
|
||||
],
|
||||
|
||||
],
|
||||
'actions' => [
|
||||
[
|
||||
'type' => 'prepend_description',
|
||||
'value' => (string)trans('firefly.default_rule_action_prepend'),
|
||||
'stop_processing' => false,
|
||||
],
|
||||
[
|
||||
'type' => 'set_category',
|
||||
'value' => (string)trans('firefly.default_rule_action_set_category'),
|
||||
'stop_processing' => false,
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
$ruleRepository->store($data);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
|
Reference in New Issue
Block a user