mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-15 16:57:09 +00:00
Implement custom trigger for recurring transactions
This commit is contained in:
@@ -41,10 +41,17 @@ interface RecurringRepositoryInterface
|
||||
/**
|
||||
* Destroy a recurring transaction.
|
||||
*
|
||||
* @param Recurrence $recurrence
|
||||
* @param Recurrence $recurrence
|
||||
*/
|
||||
public function destroy(Recurrence $recurrence): void;
|
||||
|
||||
/**
|
||||
* @param Recurrence $recurrence
|
||||
* @param Carbon $date
|
||||
* @return bool
|
||||
*/
|
||||
public function createdPreviously(Recurrence $recurrence, Carbon $date): bool;
|
||||
|
||||
/**
|
||||
* Destroy all recurring transactions.
|
||||
*/
|
||||
@@ -67,7 +74,7 @@ interface RecurringRepositoryInterface
|
||||
/**
|
||||
* Get the category from a recurring transaction transaction.
|
||||
*
|
||||
* @param RecurrenceTransaction $recTransaction
|
||||
* @param RecurrenceTransaction $recTransaction
|
||||
*
|
||||
* @return null|int
|
||||
*/
|
||||
@@ -76,7 +83,7 @@ interface RecurringRepositoryInterface
|
||||
/**
|
||||
* Get the budget ID from a recurring transaction transaction.
|
||||
*
|
||||
* @param RecurrenceTransaction $recTransaction
|
||||
* @param RecurrenceTransaction $recTransaction
|
||||
*
|
||||
* @return null|int
|
||||
*/
|
||||
@@ -85,7 +92,7 @@ interface RecurringRepositoryInterface
|
||||
/**
|
||||
* Get the category from a recurring transaction transaction.
|
||||
*
|
||||
* @param RecurrenceTransaction $recTransaction
|
||||
* @param RecurrenceTransaction $recTransaction
|
||||
*
|
||||
* @return null|int
|
||||
*/
|
||||
@@ -94,7 +101,7 @@ interface RecurringRepositoryInterface
|
||||
/**
|
||||
* Get the category from a recurring transaction transaction.
|
||||
*
|
||||
* @param RecurrenceTransaction $recTransaction
|
||||
* @param RecurrenceTransaction $recTransaction
|
||||
*
|
||||
* @return null|string
|
||||
*/
|
||||
@@ -103,9 +110,9 @@ interface RecurringRepositoryInterface
|
||||
/**
|
||||
* Returns the count of journals created for this recurrence, possibly limited by time.
|
||||
*
|
||||
* @param Recurrence $recurrence
|
||||
* @param Carbon|null $start
|
||||
* @param Carbon|null $end
|
||||
* @param Recurrence $recurrence
|
||||
* @param Carbon|null $start
|
||||
* @param Carbon|null $end
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
@@ -114,7 +121,7 @@ interface RecurringRepositoryInterface
|
||||
/**
|
||||
* Get journal ID's for journals created by this recurring transaction.
|
||||
*
|
||||
* @param Recurrence $recurrence
|
||||
* @param Recurrence $recurrence
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@@ -123,7 +130,7 @@ interface RecurringRepositoryInterface
|
||||
/**
|
||||
* Get the notes.
|
||||
*
|
||||
* @param Recurrence $recurrence
|
||||
* @param Recurrence $recurrence
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
@@ -132,16 +139,16 @@ interface RecurringRepositoryInterface
|
||||
/**
|
||||
* Generate events in the date range.
|
||||
*
|
||||
* @param RecurrenceRepetition $repetition
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
* @param RecurrenceRepetition $repetition
|
||||
* @param Carbon $start
|
||||
* @param Carbon $end
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getOccurrencesInRange(RecurrenceRepetition $repetition, Carbon $start, Carbon $end): array;
|
||||
|
||||
/**
|
||||
* @param RecurrenceTransaction $transaction
|
||||
* @param RecurrenceTransaction $transaction
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
@@ -150,23 +157,23 @@ interface RecurringRepositoryInterface
|
||||
/**
|
||||
* Get the tags from the recurring transaction.
|
||||
*
|
||||
* @param RecurrenceTransaction $transaction
|
||||
* @param RecurrenceTransaction $transaction
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getTags(RecurrenceTransaction $transaction): array;
|
||||
|
||||
/**
|
||||
* @param Recurrence $recurrence
|
||||
* @param int $page
|
||||
* @param int $pageSize
|
||||
* @param Recurrence $recurrence
|
||||
* @param int $page
|
||||
* @param int $pageSize
|
||||
*
|
||||
* @return LengthAwarePaginator
|
||||
*/
|
||||
public function getTransactionPaginator(Recurrence $recurrence, int $page, int $pageSize): LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* @param Recurrence $recurrence
|
||||
* @param Recurrence $recurrence
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
@@ -176,9 +183,9 @@ interface RecurringRepositoryInterface
|
||||
* Calculate the next X iterations starting on the date given in $date.
|
||||
* Returns an array of Carbon objects.
|
||||
*
|
||||
* @param RecurrenceRepetition $repetition
|
||||
* @param Carbon $date
|
||||
* @param int $count
|
||||
* @param RecurrenceRepetition $repetition
|
||||
* @param Carbon $date
|
||||
* @param int $count
|
||||
*
|
||||
* @return array
|
||||
* @throws FireflyException
|
||||
@@ -191,10 +198,10 @@ interface RecurringRepositoryInterface
|
||||
*
|
||||
* Only returns them of they are after $afterDate
|
||||
*
|
||||
* @param RecurrenceRepetition $repetition
|
||||
* @param Carbon $date
|
||||
* @param Carbon $afterDate
|
||||
* @param int $count
|
||||
* @param RecurrenceRepetition $repetition
|
||||
* @param Carbon $date
|
||||
* @param Carbon $afterDate
|
||||
* @param int $count
|
||||
*
|
||||
* @return array
|
||||
* @throws FireflyException
|
||||
@@ -204,15 +211,15 @@ interface RecurringRepositoryInterface
|
||||
/**
|
||||
* Parse the repetition in a string that is user readable.
|
||||
*
|
||||
* @param RecurrenceRepetition $repetition
|
||||
* @param RecurrenceRepetition $repetition
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function repetitionDescription(RecurrenceRepetition $repetition): string;
|
||||
|
||||
/**
|
||||
* @param string $query
|
||||
* @param int $limit
|
||||
* @param string $query
|
||||
* @param int $limit
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
@@ -221,14 +228,14 @@ interface RecurringRepositoryInterface
|
||||
/**
|
||||
* Set user for in repository.
|
||||
*
|
||||
* @param User $user
|
||||
* @param User $user
|
||||
*/
|
||||
public function setUser(User $user): void;
|
||||
|
||||
/**
|
||||
* Store a new recurring transaction.
|
||||
*
|
||||
* @param array $data
|
||||
* @param array $data
|
||||
*
|
||||
* @return Recurrence
|
||||
* @throws FireflyException
|
||||
@@ -238,8 +245,8 @@ interface RecurringRepositoryInterface
|
||||
/**
|
||||
* Calculate how many transactions are to be expected from this recurrence.
|
||||
*
|
||||
* @param Recurrence $recurrence
|
||||
* @param RecurrenceRepetition $repetition
|
||||
* @param Recurrence $recurrence
|
||||
* @param RecurrenceRepetition $repetition
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
@@ -248,8 +255,8 @@ interface RecurringRepositoryInterface
|
||||
/**
|
||||
* Update a recurring transaction.
|
||||
*
|
||||
* @param Recurrence $recurrence
|
||||
* @param array $data
|
||||
* @param Recurrence $recurrence
|
||||
* @param array $data
|
||||
*
|
||||
* @return Recurrence
|
||||
*/
|
||||
|
Reference in New Issue
Block a user