This commit is contained in:
James Cole
2019-09-22 22:10:39 +02:00
parent 5214f87003
commit 0340ed6f19

View File

@@ -84,7 +84,10 @@ class PiggyBankEventTransformer extends AbstractTransformer
// get associated journal and transaction, if any: // get associated journal and transaction, if any:
$journalId = (int)$event->transaction_journal_id; $journalId = (int)$event->transaction_journal_id;
$groupId = null;
if (0 !== $journalId) {
$groupId = (int)$event->transactionJournal->transaction_group_id;
}
$data = [ $data = [
'id' => (int)$event->id, 'id' => (int)$event->id,
'created_at' => $event->created_at->toAtomString(), 'created_at' => $event->created_at->toAtomString(),
@@ -95,6 +98,7 @@ class PiggyBankEventTransformer extends AbstractTransformer
'currency_symbol' => $currency->symbol, 'currency_symbol' => $currency->symbol,
'currency_decimal_places' => $currency->decimal_places, 'currency_decimal_places' => $currency->decimal_places,
'transaction_journal_id' => $journalId, 'transaction_journal_id' => $journalId,
'transaction_group_id' => $groupId,
'links' => [ 'links' => [
[ [
'rel' => 'self', 'rel' => 'self',