2016-01-13 11:34:56 -06:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* RuleRepositoryInterface.php
|
|
|
|
* Copyright (C) 2016 Sander Dorigo
|
|
|
|
*
|
|
|
|
* This software may be modified and distributed under the terms
|
|
|
|
* of the MIT license. See the LICENSE file for details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace FireflyIII\Repositories\Rule;
|
|
|
|
|
2016-01-14 02:38:48 -06:00
|
|
|
use FireflyIII\Models\Rule;
|
2016-01-14 14:34:17 -06:00
|
|
|
use FireflyIII\Models\RuleAction;
|
2016-01-13 11:34:56 -06:00
|
|
|
use FireflyIII\Models\RuleGroup;
|
2016-01-14 14:34:17 -06:00
|
|
|
use FireflyIII\Models\RuleTrigger;
|
2016-01-14 03:33:24 -06:00
|
|
|
use Illuminate\Support\Collection;
|
2016-01-13 11:34:56 -06:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Interface RuleRepositoryInterface
|
|
|
|
*
|
|
|
|
* @package FireflyIII\Repositories\Rule
|
|
|
|
*/
|
|
|
|
interface RuleRepositoryInterface
|
|
|
|
{
|
|
|
|
/**
|
2016-01-15 04:27:27 -06:00
|
|
|
* @param Rule $rule
|
2016-01-13 14:44:26 -06:00
|
|
|
*
|
2016-01-14 14:34:17 -06:00
|
|
|
* @return bool
|
2016-01-13 14:44:26 -06:00
|
|
|
*/
|
2016-01-15 04:27:27 -06:00
|
|
|
public function destroyRule(Rule $rule);
|
2016-01-13 14:44:26 -06:00
|
|
|
|
2016-01-14 14:34:17 -06:00
|
|
|
/**
|
2016-01-15 04:27:27 -06:00
|
|
|
* @param RuleGroup $ruleGroup
|
2016-01-14 14:34:17 -06:00
|
|
|
*
|
2016-01-15 04:27:27 -06:00
|
|
|
* @return int
|
2016-01-14 14:34:17 -06:00
|
|
|
*/
|
2016-01-15 04:27:27 -06:00
|
|
|
public function getHighestOrderInRuleGroup(RuleGroup $ruleGroup);
|
2016-01-14 14:34:17 -06:00
|
|
|
|
2016-01-14 04:27:15 -06:00
|
|
|
/**
|
2016-01-15 02:25:32 -06:00
|
|
|
* @param Rule $rule
|
2016-01-14 04:27:15 -06:00
|
|
|
* @param array $ids
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function reorderRuleTriggers(Rule $rule, array $ids);
|
|
|
|
|
|
|
|
/**
|
2016-01-15 02:25:32 -06:00
|
|
|
* @param Rule $rule
|
2016-01-14 04:27:15 -06:00
|
|
|
* @param array $ids
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function reorderRuleActions(Rule $rule, array $ids);
|
|
|
|
|
2016-01-13 14:44:26 -06:00
|
|
|
/**
|
2016-01-15 04:27:27 -06:00
|
|
|
* @param RuleGroup $ruleGroup
|
2016-01-14 02:38:48 -06:00
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function resetRulesInGroupOrder(RuleGroup $ruleGroup);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param Rule $rule
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function moveRuleUp(Rule $rule);
|
|
|
|
|
2016-01-15 02:25:32 -06:00
|
|
|
/**
|
|
|
|
* @param Rule $rule
|
|
|
|
* @param array $data
|
|
|
|
* @return Rule
|
|
|
|
*/
|
|
|
|
public function updateRule(Rule $rule, array $data);
|
|
|
|
|
2016-01-14 02:38:48 -06:00
|
|
|
/**
|
|
|
|
* @param Rule $rule
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function moveRuleDown(Rule $rule);
|
|
|
|
|
2016-01-14 14:34:17 -06:00
|
|
|
/**
|
|
|
|
* @param array $data
|
|
|
|
*
|
|
|
|
* @return Rule
|
|
|
|
*/
|
|
|
|
public function storeRule(array $data);
|
|
|
|
|
|
|
|
/**
|
2016-01-15 02:25:32 -06:00
|
|
|
* @param Rule $rule
|
2016-01-14 14:34:17 -06:00
|
|
|
* @param string $action
|
|
|
|
* @param string $value
|
2016-01-15 02:25:32 -06:00
|
|
|
* @param bool $stopProcessing
|
|
|
|
* @param int $order
|
2016-01-14 14:34:17 -06:00
|
|
|
*
|
|
|
|
* @return RuleTrigger
|
|
|
|
*/
|
|
|
|
public function storeTrigger(Rule $rule, $action, $value, $stopProcessing, $order);
|
|
|
|
|
|
|
|
/**
|
2016-01-15 02:25:32 -06:00
|
|
|
* @param Rule $rule
|
2016-01-14 14:34:17 -06:00
|
|
|
* @param string $action
|
|
|
|
* @param string $value
|
2016-01-15 02:25:32 -06:00
|
|
|
* @param bool $stopProcessing
|
|
|
|
* @param int $order
|
2016-01-14 14:34:17 -06:00
|
|
|
*
|
|
|
|
* @return RuleAction
|
|
|
|
*/
|
|
|
|
public function storeAction(Rule $rule, $action, $value, $stopProcessing, $order);
|
|
|
|
|
2016-01-13 11:34:56 -06:00
|
|
|
}
|