feat: consider the domain's EPP status codes to monitor it carefully

This commit is contained in:
Maël Gangloff
2024-08-25 01:47:32 +02:00
parent e3f1229c74
commit 4bb3ba7765

View File

@@ -76,7 +76,8 @@ readonly class RDAPService
'xn--hlcj6aya9esc7a',
];
public const IMPORTANT_EVENTS = [EventAction::Deletion->value, EventAction::Expiration->value];
private const IMPORTANT_EVENTS = [EventAction::Deletion->value, EventAction::Expiration->value];
private const IMPORTANT_STATUS = ['auto renew period', 'redemption period', 'pending delete'];
public function __construct(private HttpClientInterface $client,
private EntityRepository $entityRepository,
@@ -106,6 +107,11 @@ readonly class RDAPService
return false;
}
$status = $domain->getStatus();
if (!empty($status) && count(array_intersect($status, self::IMPORTANT_STATUS))) {
return true;
}
/** @var DomainEvent[] $events */
$events = $domain->getEvents()
->filter(fn (DomainEvent $e) => $e->getDate() <= new \DateTimeImmutable('now'))