Start testing new rule actions.

This commit is contained in:
James Cole
2020-08-23 07:42:14 +02:00
parent d89a4d8a54
commit 6e074d9b8b
34 changed files with 608 additions and 246 deletions

View File

@@ -27,7 +27,7 @@ use FireflyIII\Models\Note;
use FireflyIII\Models\RuleAction;
use FireflyIII\Models\TransactionJournal;
use Log;
use DB;
/**
* Class ClearNotes.
*/
@@ -46,7 +46,8 @@ class ClearNotes implements ActionInterface
* Remove notes
*
* @param TransactionJournal $journal
*
* @codeCoverageIgnore
* @deprecated
* @return bool
* @throws Exception
*/
@@ -62,4 +63,17 @@ class ClearNotes implements ActionInterface
return true;
}
/**
* @inheritDoc
*/
public function actOnArray(array $journal): bool
{
DB::table('notes')
->where('noteable_id', $journal['transaction_journal_id'])
->where('noteable_type', TransactionJournal::class)
->delete();
Log::debug(sprintf('RuleAction ClearNotes removed all notes.'));
return true;
}
}