mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat: consider the domain's EPP status codes to monitor it carefully
This commit is contained in:
@@ -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'))
|
||||
|
||||
Reference in New Issue
Block a user