Add routes for transactions.

This commit is contained in:
James Cole
2021-03-06 20:52:42 +01:00
parent 93a31337fc
commit fa5d33caf5
9 changed files with 195 additions and 158 deletions

View File

@@ -54,13 +54,14 @@ class TransactionLinkTransformer extends AbstractTransformer
public function transform(TransactionJournalLink $link): array
{
$notes = $this->repository->getLinkNoteText($link);
return [
'id' => (int)$link->id,
'id' => (string)$link->id,
'created_at' => $link->created_at->toAtomString(),
'updated_at' => $link->updated_at->toAtomString(),
'inward_id' => (int) $link->source_id,
'outward_id' => (int) $link->destination_id,
'link_type_id' => (int) $link->link_type_id,
'inward_id' => (string)$link->source_id,
'outward_id' => (string)$link->destination_id,
'link_type_id' => (string)$link->link_type_id,
'notes' => '' === $notes ? null : $notes,
'links' => [
[