Covered transaction controller.

This commit is contained in:
James Cole
2015-05-05 07:28:04 +02:00
parent 3176e54614
commit 59d2bf3f79
5 changed files with 119 additions and 20 deletions

View File

@@ -26,6 +26,21 @@ use Log;
class JournalRepository implements JournalRepositoryInterface
{
/**
* @param int $id
*
* @return bool
*/
public function deactivateReminder($id)
{
$reminder = Auth::user()->reminders()->find($id);
if ($reminder) {
$reminder->active = 0;
$reminder->save();
}
}
/**
* @param TransactionJournal $journal
*
@@ -69,7 +84,7 @@ class JournalRepository implements JournalRepositoryInterface
->where('transaction_journals.order', '>=', $journal->order)
->where('transaction_journals.id', '!=', $journal->id)
->sum('transactions.amount')
);
);
}
/**

View File

@@ -16,6 +16,13 @@ use Illuminate\Support\Collection;
*/
interface JournalRepositoryInterface
{
/**
* @param int $id
*
* @return bool
*/
public function deactivateReminder($id);
/**
* @param TransactionJournal $journal
*
@@ -30,14 +37,6 @@ interface JournalRepositoryInterface
*/
public function first();
/**
* @param $id
* @param Carbon $date
*
* @return TransactionJournal
*/
public function getWithDate($id, Carbon $date);
/**
* @param TransactionJournal $journal
* @param Transaction $transaction
@@ -69,6 +68,14 @@ interface JournalRepositoryInterface
*/
public function getTransactionType($type);
/**
* @param $id
* @param Carbon $date
*
* @return TransactionJournal
*/
public function getWithDate($id, Carbon $date);
/**
* @param TransactionJournal $journal
* @param array $array