mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
Lots of new code for recurring transactions. #1469
This commit is contained in:
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Repositories\Recurring;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Models\Recurrence;
|
||||
use FireflyIII\Models\RecurrenceRepetition;
|
||||
use FireflyIII\User;
|
||||
@@ -53,6 +54,19 @@ interface RecurringRepositoryInterface
|
||||
*/
|
||||
public function getNoteText(Recurrence $recurrence): string;
|
||||
|
||||
/**
|
||||
* Generate events in the date range.
|
||||
*
|
||||
* @param RecurrenceRepetition $repetition
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @throws FireflyException
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getOccurrencesInRange(RecurrenceRepetition $repetition, Carbon $start, Carbon $end): array;
|
||||
|
||||
/**
|
||||
* Calculate the next X iterations starting on the date given in $date.
|
||||
* Returns an array of Carbon objects.
|
||||
@@ -61,9 +75,10 @@ interface RecurringRepositoryInterface
|
||||
* @param Carbon $date
|
||||
* @param int $count
|
||||
*
|
||||
* @throws FireflyException
|
||||
* @return array
|
||||
*/
|
||||
public function getXOccurrences(RecurrenceRepetition $repetition, Carbon $date, int $count = 5): array;
|
||||
public function getXOccurrences(RecurrenceRepetition $repetition, Carbon $date, int $count): array;
|
||||
|
||||
/**
|
||||
* Parse the repetition in a string that is user readable.
|
||||
@@ -81,4 +96,12 @@ interface RecurringRepositoryInterface
|
||||
*/
|
||||
public function setUser(User $user): void;
|
||||
|
||||
/**
|
||||
* @param array $data
|
||||
*
|
||||
* @throws FireflyException
|
||||
* @return Recurrence
|
||||
*/
|
||||
public function store(array $data): Recurrence;
|
||||
|
||||
}
|
Reference in New Issue
Block a user