Improve recurrences

This commit is contained in:
James Cole
2019-06-29 19:47:40 +02:00
parent 947b83cbd1
commit 6197c77303
13 changed files with 210 additions and 36 deletions

View File

@@ -429,13 +429,19 @@ class RecurringRepository implements RecurringRepositoryInterface
* @param array $data
*
* @return Recurrence
* @throws FireflyException
*/
public function store(array $data): Recurrence
{
$factory = new RecurrenceFactory;
/** @var RecurrenceFactory $factory */
$factory = app(RecurrenceFactory::class);
$factory->setUser($this->user);
$result = $factory->create($data);
if (null === $result) {
throw new FireflyException($factory->getErrors()->first());
}
return $factory->create($data);
return $result;
}
/**

View File

@@ -176,10 +176,9 @@ interface RecurringRepositoryInterface
/**
* Store a new recurring transaction.
*\
*
* @param array $data
*
* @throws FireflyException
* @return Recurrence
*/
public function store(array $data): Recurrence;