2015-02-09 00:23:39 -06:00
|
|
|
<?php
|
2016-02-05 05:08:25 -06:00
|
|
|
declare(strict_types = 1);
|
2015-02-09 00:23:39 -06:00
|
|
|
|
|
|
|
namespace FireflyIII\Repositories\Journal;
|
|
|
|
|
2015-05-04 16:46:14 -05:00
|
|
|
use Carbon\Carbon;
|
2015-04-03 02:30:44 -05:00
|
|
|
use FireflyIII\Models\Transaction;
|
2015-04-07 11:26:14 -05:00
|
|
|
use FireflyIII\Models\TransactionJournal;
|
2015-04-11 12:59:41 -05:00
|
|
|
use FireflyIII\Models\TransactionType;
|
2015-05-04 16:46:14 -05:00
|
|
|
use Illuminate\Pagination\LengthAwarePaginator;
|
2015-02-25 14:19:06 -06:00
|
|
|
use Illuminate\Support\Collection;
|
2015-02-09 00:23:39 -06:00
|
|
|
|
2015-02-11 00:35:10 -06:00
|
|
|
/**
|
|
|
|
* Interface JournalRepositoryInterface
|
|
|
|
*
|
|
|
|
* @package FireflyIII\Repositories\Journal
|
|
|
|
*/
|
|
|
|
interface JournalRepositoryInterface
|
|
|
|
{
|
2015-04-11 12:59:41 -05:00
|
|
|
/**
|
2015-05-05 00:28:04 -05:00
|
|
|
* @param TransactionJournal $journal
|
2015-04-11 12:59:41 -05:00
|
|
|
*
|
2015-05-05 00:28:04 -05:00
|
|
|
* @return bool
|
2015-04-11 12:59:41 -05:00
|
|
|
*/
|
2015-05-05 00:28:04 -05:00
|
|
|
public function delete(TransactionJournal $journal);
|
2015-04-11 12:59:41 -05:00
|
|
|
|
2015-05-04 16:46:14 -05:00
|
|
|
/**
|
2015-05-05 00:28:04 -05:00
|
|
|
* Get users first transaction journal
|
2015-05-04 16:46:14 -05:00
|
|
|
*
|
|
|
|
* @return TransactionJournal
|
|
|
|
*/
|
2015-05-05 00:28:04 -05:00
|
|
|
public function first();
|
2015-05-04 16:46:14 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param TransactionJournal $journal
|
|
|
|
* @param Transaction $transaction
|
|
|
|
*
|
|
|
|
* @return float
|
|
|
|
*/
|
|
|
|
public function getAmountBefore(TransactionJournal $journal, Transaction $transaction);
|
|
|
|
|
2015-04-28 03:36:13 -05:00
|
|
|
/**
|
2015-04-28 10:10:52 -05:00
|
|
|
* @param TransactionType $dbType
|
2015-04-28 03:36:13 -05:00
|
|
|
*
|
2015-04-28 10:10:52 -05:00
|
|
|
* @return Collection
|
2015-04-28 03:36:13 -05:00
|
|
|
*/
|
2015-04-28 10:10:52 -05:00
|
|
|
public function getJournalsOfType(TransactionType $dbType);
|
2015-04-28 03:36:13 -05:00
|
|
|
|
2015-05-04 16:46:14 -05:00
|
|
|
/**
|
|
|
|
* @param array $types
|
|
|
|
* @param int $offset
|
|
|
|
* @param int $page
|
|
|
|
*
|
|
|
|
* @return LengthAwarePaginator
|
|
|
|
*/
|
2016-02-05 02:25:15 -06:00
|
|
|
public function getJournalsOfTypes(array $types, int $offset, int $page);
|
2015-05-04 16:46:14 -05:00
|
|
|
|
2016-02-17 13:31:18 -06:00
|
|
|
/**
|
|
|
|
* @param array $types
|
|
|
|
* @param int $offset
|
|
|
|
* @param int $count
|
|
|
|
*
|
|
|
|
* @return Collection
|
|
|
|
*/
|
|
|
|
public function getCollectionOfTypes(array $types, int $offset, int $count);
|
|
|
|
|
2015-04-28 03:36:13 -05:00
|
|
|
/**
|
2016-02-05 02:25:15 -06:00
|
|
|
* @param string $type
|
2015-04-28 03:36:13 -05:00
|
|
|
*
|
2015-04-28 10:10:52 -05:00
|
|
|
* @return TransactionType
|
2015-04-28 03:36:13 -05:00
|
|
|
*/
|
2016-02-05 02:25:15 -06:00
|
|
|
public function getTransactionType(string $type);
|
2015-04-28 03:36:13 -05:00
|
|
|
|
2015-05-05 00:28:04 -05:00
|
|
|
/**
|
2015-07-06 15:23:34 -05:00
|
|
|
* @param int $journalId
|
2015-05-05 00:28:04 -05:00
|
|
|
* @param Carbon $date
|
|
|
|
*
|
|
|
|
* @return TransactionJournal
|
|
|
|
*/
|
2016-02-05 02:25:15 -06:00
|
|
|
public function getWithDate(int $journalId, Carbon $date);
|
2015-05-05 00:28:04 -05:00
|
|
|
|
2015-04-11 12:59:41 -05:00
|
|
|
/**
|
2015-04-28 10:10:52 -05:00
|
|
|
* @param TransactionJournal $journal
|
|
|
|
* @param array $array
|
2015-04-11 12:59:41 -05:00
|
|
|
*
|
2015-04-28 10:10:52 -05:00
|
|
|
* @return void
|
2015-04-11 12:59:41 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
2015-04-28 10:10:52 -05:00
|
|
|
* @param TransactionJournal $journal
|
|
|
|
* @param array $array
|
|
|
|
*
|
|
|
|
* @return void
|
2015-04-11 12:59:41 -05:00
|
|
|
*/
|
2015-04-28 10:10:52 -05:00
|
|
|
public function saveTags(TransactionJournal $journal, array $array);
|
|
|
|
|
2015-02-24 15:53:38 -06:00
|
|
|
/**
|
|
|
|
* @param array $data
|
|
|
|
*
|
|
|
|
* @return TransactionJournal
|
|
|
|
*/
|
|
|
|
public function store(array $data);
|
2015-02-09 00:23:39 -06:00
|
|
|
|
2015-02-25 14:19:06 -06:00
|
|
|
/**
|
|
|
|
* @param TransactionJournal $journal
|
2015-02-27 07:27:04 -06:00
|
|
|
* @param array $data
|
2015-02-25 14:19:06 -06:00
|
|
|
*
|
2015-02-27 07:27:04 -06:00
|
|
|
* @return mixed
|
2015-02-25 14:19:06 -06:00
|
|
|
*/
|
2015-02-27 07:27:04 -06:00
|
|
|
public function update(TransactionJournal $journal, array $data);
|
2015-04-28 10:10:52 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param TransactionJournal $journal
|
|
|
|
* @param array $array
|
|
|
|
*
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function updateTags(TransactionJournal $journal, array $array);
|
2015-03-29 01:14:32 -05:00
|
|
|
}
|