First working version of the group collector.

This commit is contained in:
James Cole
2019-03-24 14:48:12 +01:00
parent d94b23b15d
commit c946a4040f
8 changed files with 321 additions and 43 deletions

View File

@@ -25,6 +25,7 @@ namespace FireflyIII\Helpers\Collector;
use Carbon\Carbon;
use FireflyIII\User;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Collection;
/**
@@ -39,6 +40,13 @@ interface GroupCollectorInterface
*/
public function getGroups(): Collection;
/**
* Same as getGroups but everything is in a paginator.
*
* @return LengthAwarePaginator
*/
public function getPaginatedGroups(): LengthAwarePaginator;
/**
* Define which accounts can be part of the source and destination transactions.
*
@@ -76,6 +84,15 @@ interface GroupCollectorInterface
*/
public function setRange(Carbon $start, Carbon $end): GroupCollectorInterface;
/**
* Limit the included transaction types.
*
* @param array $types
*
* @return GroupCollectorInterface
*/
public function setTypes(array $types): GroupCollectorInterface;
/**
* Set the user object and start the query.
*
@@ -85,4 +102,32 @@ interface GroupCollectorInterface
*/
public function setUser(User $user): GroupCollectorInterface;
/**
* Will include the source and destination account names and types.
*
* @return GroupCollectorInterface
*/
public function withAccountInformation(): GroupCollectorInterface;
/**
* Include bill name + ID.
*
* @return GroupCollectorInterface
*/
public function withBillInformation(): GroupCollectorInterface;
/**
* Will include budget ID + name, if any.
*
* @return GroupCollectorInterface
*/
public function withBudgetInformation(): GroupCollectorInterface;
/**
* Will include category ID + name, if any.
*
* @return GroupCollectorInterface
*/
public function withCategoryInformation(): GroupCollectorInterface;
}