mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Expand API
This commit is contained in:
parent
b3b367fcb3
commit
219c3c11f9
@ -484,4 +484,16 @@ class TransactionGroupRepository implements TransactionGroupRepositoryInterface
|
|||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*/
|
||||||
|
public function countAttachments(int $journalId): int
|
||||||
|
{
|
||||||
|
/** @var TransactionJournal $journal */
|
||||||
|
$journal = $this->user->transactionJournals()->find($journalId);
|
||||||
|
|
||||||
|
return $journal->attachments()->count();
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,6 +86,13 @@ interface TransactionGroupRepositoryInterface
|
|||||||
*/
|
*/
|
||||||
public function getLocation(int $journalId): ?Location;
|
public function getLocation(int $journalId): ?Location;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param int $journalId
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function countAttachments(int $journalId): int;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return object with all found meta field things as Carbon objects.
|
* Return object with all found meta field things as Carbon objects.
|
||||||
*
|
*
|
||||||
|
@ -212,6 +212,8 @@ class TransactionGroupTransformer extends AbstractTransformer
|
|||||||
'longitude' => $longitude,
|
'longitude' => $longitude,
|
||||||
'latitude' => $latitude,
|
'latitude' => $latitude,
|
||||||
'zoom_level' => $zoomLevel,
|
'zoom_level' => $zoomLevel,
|
||||||
|
|
||||||
|
'has_attachments' => $this->hasAttachments((int)$row['transaction_journal_id']),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -248,6 +250,16 @@ class TransactionGroupTransformer extends AbstractTransformer
|
|||||||
return $this->groupRepos->getLocation($journalId);
|
return $this->groupRepos->getLocation($journalId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param int $journalId
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
private function hasAttachments(int $journalId): bool
|
||||||
|
{
|
||||||
|
return $this->groupRepos->countAttachments($journalId) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $array
|
* @param array $array
|
||||||
* @param string $key
|
* @param string $key
|
||||||
|
@ -102,7 +102,7 @@ return [
|
|||||||
'handle_debts' => true,
|
'handle_debts' => true,
|
||||||
],
|
],
|
||||||
'version' => '5.6.5',
|
'version' => '5.6.5',
|
||||||
'api_version' => '1.5.4',
|
'api_version' => '1.5.5',
|
||||||
'db_version' => 18,
|
'db_version' => 18,
|
||||||
|
|
||||||
// generic settings
|
// generic settings
|
||||||
|
Loading…
Reference in New Issue
Block a user