2014-07-03 14:31:32 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Firefly\Storage\TransactionJournal;
|
|
|
|
|
2014-07-25 06:02:01 -05:00
|
|
|
use Carbon\Carbon;
|
2014-07-03 14:31:32 -05:00
|
|
|
|
2014-07-25 06:02:01 -05:00
|
|
|
/**
|
|
|
|
* Interface TransactionJournalRepositoryInterface
|
|
|
|
*
|
|
|
|
* @package Firefly\Storage\TransactionJournal
|
|
|
|
*/
|
2014-07-06 08:18:11 -05:00
|
|
|
interface TransactionJournalRepositoryInterface
|
|
|
|
{
|
2014-07-25 06:02:01 -05:00
|
|
|
/**
|
|
|
|
* @param \Account $from
|
|
|
|
* @param \Account $toAccount
|
|
|
|
* @param $description
|
|
|
|
* @param $amount
|
|
|
|
* @param Carbon $date
|
|
|
|
*
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function createSimpleJournal(\Account $from, \Account $toAccount, $description, $amount, Carbon $date);
|
2014-07-03 14:31:32 -05:00
|
|
|
|
2014-07-25 06:02:01 -05:00
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
2014-07-06 14:07:52 -05:00
|
|
|
public function get();
|
|
|
|
|
2014-08-10 08:01:46 -05:00
|
|
|
/**
|
|
|
|
* @param $what
|
|
|
|
* @param $data
|
|
|
|
*
|
|
|
|
* @return mixed
|
|
|
|
*/
|
2014-08-02 00:34:38 -05:00
|
|
|
public function store($what, $data);
|
|
|
|
|
2014-08-10 08:01:46 -05:00
|
|
|
/**
|
|
|
|
* @param \TransactionJournal $journal
|
|
|
|
* @param $data
|
|
|
|
*
|
|
|
|
* @return mixed
|
|
|
|
*/
|
2014-08-02 00:34:38 -05:00
|
|
|
public function update(\TransactionJournal $journal, $data);
|
|
|
|
|
2014-07-25 06:02:01 -05:00
|
|
|
/**
|
|
|
|
* @param $journalId
|
|
|
|
*
|
|
|
|
* @return mixed
|
|
|
|
*/
|
2014-07-16 14:11:43 -05:00
|
|
|
public function find($journalId);
|
|
|
|
|
2014-07-25 06:02:01 -05:00
|
|
|
/**
|
|
|
|
* @param \Account $account
|
|
|
|
* @param int $count
|
|
|
|
* @param Carbon $start
|
|
|
|
* @param Carbon $end
|
|
|
|
*
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function getByAccountInDateRange(\Account $account, $count = 25, Carbon $start, Carbon $end);
|
2014-07-06 14:07:52 -05:00
|
|
|
|
2014-07-25 06:02:01 -05:00
|
|
|
/**
|
|
|
|
* @param \Account $account
|
|
|
|
* @param Carbon $date
|
|
|
|
*
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function getByAccountAndDate(\Account $account, Carbon $date);
|
2014-07-15 15:16:29 -05:00
|
|
|
|
2014-07-25 06:02:01 -05:00
|
|
|
/**
|
|
|
|
* @param int $count
|
|
|
|
*
|
|
|
|
* @return mixed
|
|
|
|
*/
|
2014-07-25 00:17:56 -05:00
|
|
|
public function paginate($count = 25);
|
|
|
|
|
2014-07-06 14:07:52 -05:00
|
|
|
}
|