Added API endpoints to fetch invoices (#5070)
* added serializer attributes for API usage * new setters to fill invoice data from fixture * re-usable fixture helper methods * added API endpoints to fetch invoices * adjust tests
This commit is contained in:
@@ -24,6 +24,8 @@ use Faker\Factory;
|
||||
*/
|
||||
final class TimesheetFixtures implements TestFixture
|
||||
{
|
||||
use FixturesTrait;
|
||||
|
||||
private int $running = 0;
|
||||
/**
|
||||
* @var Activity[]
|
||||
@@ -307,54 +309,6 @@ final class TimesheetFixtures implements TestFixture
|
||||
return $start;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ObjectManager $manager
|
||||
* @return array<int|string, Activity>
|
||||
*/
|
||||
private function getAllActivities(ObjectManager $manager): array
|
||||
{
|
||||
$all = [];
|
||||
/** @var Activity[] $entries */
|
||||
$entries = $manager->getRepository(Activity::class)->findAll();
|
||||
foreach ($entries as $temp) {
|
||||
$all[$temp->getId()] = $temp;
|
||||
}
|
||||
|
||||
return $all;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ObjectManager $manager
|
||||
* @return array<int|string, Project>
|
||||
*/
|
||||
private function getAllProjects(ObjectManager $manager): array
|
||||
{
|
||||
$all = [];
|
||||
/** @var Project[] $entries */
|
||||
$entries = $manager->getRepository(Project::class)->findAll();
|
||||
foreach ($entries as $temp) {
|
||||
$all[$temp->getId()] = $temp;
|
||||
}
|
||||
|
||||
return $all;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ObjectManager $manager
|
||||
* @return array<int|string, User>
|
||||
*/
|
||||
private function getAllUsers(ObjectManager $manager): array
|
||||
{
|
||||
$all = [];
|
||||
/** @var User[] $entries */
|
||||
$entries = $manager->getRepository(User::class)->findAll();
|
||||
foreach ($entries as $temp) {
|
||||
$all[$temp->getId()] = $temp;
|
||||
}
|
||||
|
||||
return $all;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \DateTime $start
|
||||
* @param array<Tag> $tagArray
|
||||
|
||||
Reference in New Issue
Block a user