feat: firsts endpoints and firsts tests
This commit is contained in:
parent
89570ad951
commit
6bc3696190
@@ -2,17 +2,18 @@
|
||||
|
||||
namespace App\Domain\Scraping\Infrastructure\Persistence;
|
||||
|
||||
use App\Domain\Scraping\Domain\Contract\Repository\ScrapingJobRepositoryInterface;
|
||||
use App\Domain\Scraping\Domain\Model\ScrapingJob;
|
||||
use App\Domain\Scraping\Domain\Model\ScrapingStatus;
|
||||
use App\Domain\Scraping\Domain\Repository\ScrapingJobRepositoryInterface;
|
||||
use App\Domain\Scraping\Infrastructure\Persistence\Entity\ScrapingJobEntity;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
|
||||
class DoctrineScrapingJobRepository implements ScrapingJobRepositoryInterface
|
||||
readonly class DoctrineScrapingJobRepository implements ScrapingJobRepositoryInterface
|
||||
{
|
||||
public function __construct(
|
||||
private readonly EntityManagerInterface $entityManager
|
||||
) {}
|
||||
private EntityManagerInterface $entityManager
|
||||
) {
|
||||
}
|
||||
|
||||
public function save(ScrapingJob $job): void
|
||||
{
|
||||
@@ -46,7 +47,7 @@ class DoctrineScrapingJobRepository implements ScrapingJobRepositoryInterface
|
||||
->getQuery()
|
||||
->getResult();
|
||||
|
||||
return array_map(fn(ScrapingJobEntity $entity) => $entity->toDomain(), $entities);
|
||||
return array_map(fn (ScrapingJobEntity $entity) => $entity->toDomain(), $entities);
|
||||
}
|
||||
|
||||
public function findInProgressJobs(): array
|
||||
@@ -58,6 +59,6 @@ class DoctrineScrapingJobRepository implements ScrapingJobRepositoryInterface
|
||||
->getQuery()
|
||||
->getResult();
|
||||
|
||||
return array_map(fn(ScrapingJobEntity $entity) => $entity->toDomain(), $entities);
|
||||
return array_map(fn (ScrapingJobEntity $entity) => $entity->toDomain(), $entities);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user