feat: add domain_status when domain is deleted

This commit is contained in:
Maël Gangloff
2025-08-26 16:34:37 +02:00
parent e270a3d970
commit c1fa5c571f

View File

@@ -268,7 +268,18 @@ readonly class RDAPService
'idnDomain' => $idnDomain,
]);
$domain->setDeleted(true)->updateTimestamps();
$domain->updateTimestamps();
if (!$domain->getDeleted() && $domain->getUpdatedAt() !== $domain->getCreatedAt()) {
$this->em->persist((new DomainStatus())
->setDomain($domain)
->setCreatedAt($domain->getUpdatedAt())
->setDate($domain->getUpdatedAt())
->setAddStatus([])
->setDeleteStatus($domain->getStatus()));
}
$domain->setDeleted(true);
$this->em->persist($domain);
$this->em->flush();
}