SuperSeller3000/src/Infrastructure/Persistence/Repository/DoctrineInvoiceRepository.php
Simon Kuehn 487c7f8da1 feat: add security layer, domain repositories and infrastructure services
ApiKeyAuthenticator, PermissionVoter and UserProvider implement
Symfony Security for the API (Bearer token) and admin (session) flows.
Domain repository interfaces added for ApiKey, User, AIPipelineJob and
Invoice; Doctrine implementations provided.

Also adds DatabaseLogHandler for structured DB logging, SerpApiWebSearch,
and the LogEntry domain entity.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 22:43:58 +00:00

33 lines
862 B
PHP

<?php
declare(strict_types=1);
namespace App\Infrastructure\Persistence\Repository;
use App\Domain\Order\Invoice;
use App\Domain\Order\Repository\InvoiceRepositoryInterface;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Uid\Uuid;
final class DoctrineInvoiceRepository implements InvoiceRepositoryInterface
{
public function __construct(private readonly EntityManagerInterface $em)
{
}
public function findById(Uuid $id): ?Invoice
{
return $this->em->find(Invoice::class, $id);
}
public function findByFrappeInvoiceId(string $frappeInvoiceId): ?Invoice
{
return $this->em->getRepository(Invoice::class)->findOneBy(['frappeInvoiceId' => $frappeInvoiceId]);
}
public function save(Invoice $invoice): void
{
$this->em->persist($invoice);
$this->em->flush();
}
}