2015-02-09 00:23:39 -06:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace FireflyIII\Repositories\Journal;
|
|
|
|
|
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-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
|
|
|
/**
|
|
|
|
* Get users first transaction journal
|
|
|
|
*
|
|
|
|
* @return TransactionJournal
|
|
|
|
*/
|
|
|
|
public function first();
|
|
|
|
|
2015-02-27 07:27:04 -06:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Get the account_id, which is the asset account that paid for the transaction.
|
|
|
|
*
|
|
|
|
* @param TransactionJournal $journal
|
|
|
|
*
|
|
|
|
* @return int
|
|
|
|
*/
|
|
|
|
public function getAssetAccount(TransactionJournal $journal);
|
|
|
|
|
2015-04-11 12:59:41 -05:00
|
|
|
/**
|
|
|
|
* @param TransactionType $dbType
|
|
|
|
*
|
|
|
|
* @return Collection
|
|
|
|
*/
|
|
|
|
public function getJournalsOfType(TransactionType $dbType);
|
|
|
|
|
2015-02-27 07:27:04 -06:00
|
|
|
/**
|
|
|
|
* @param string $query
|
|
|
|
* @param TransactionJournal $journal
|
|
|
|
*
|
|
|
|
* @return Collection
|
|
|
|
*/
|
|
|
|
public function searchRelated($query, TransactionJournal $journal);
|
|
|
|
|
2015-04-11 12:59:41 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param $type
|
|
|
|
*
|
|
|
|
* @return TransactionType
|
|
|
|
*/
|
|
|
|
public function getTransactionType($type);
|
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-03-29 01:14:32 -05:00
|
|
|
}
|