From 737ad4605b5b6139fffe3d9d22243fe77d7df261 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Gangloff?= Date: Fri, 19 Jul 2024 22:58:50 +0200 Subject: [PATCH] feat(api): add tld property in domain endpoint --- src/Entity/Domain.php | 4 +++- src/Service/RDAPService.php | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Entity/Domain.php b/src/Entity/Domain.php index d463765..c0e9d97 100644 --- a/src/Entity/Domain.php +++ b/src/Entity/Domain.php @@ -36,7 +36,8 @@ use Symfony\Component\Serializer\Attribute\Groups; 'entity:list', 'domain-entity:entity', 'nameserver-entity:nameserver', - 'nameserver-entity:entity' + 'nameserver-entity:entity', + 'tld:item' ] ] ), @@ -107,6 +108,7 @@ class Domain #[ORM\ManyToOne] #[ORM\JoinColumn(referencedColumnName: 'tld', nullable: false)] + #[Groups(['domain:item'])] private ?Tld $tld = null; public function __construct() diff --git a/src/Service/RDAPService.php b/src/Service/RDAPService.php index 36e18ed..d6f93b2 100644 --- a/src/Service/RDAPService.php +++ b/src/Service/RDAPService.php @@ -225,7 +225,8 @@ readonly class RDAPService if (!array_key_exists('events', $rdapEntity)) return $entity; foreach ($rdapEntity['events'] as $rdapEntityEvent) { - if ($rdapEntityEvent["eventAction"] === EventAction::LastChanged->value) continue; + $eventAction = $rdapEntityEvent["eventAction"]; + if ($eventAction === EventAction::LastChanged->value || $eventAction === EventAction::LastUpdateOfRDAPDatabase) continue; $event = $this->entityEventRepository->findOneBy([ "action" => EventAction::from($rdapEntityEvent["eventAction"]), "date" => new DateTimeImmutable($rdapEntityEvent["eventDate"])