refactor: search domain by registrant name

This commit is contained in:
Maël Gangloff
2025-11-08 20:02:37 +01:00
parent d769c48955
commit 8b03c54a16
6 changed files with 194 additions and 55 deletions

View File

@@ -14,6 +14,8 @@ use Symfony\Component\Serializer\Attribute\SerializedName;
#[ORM\UniqueConstraint(
columns: ['tld_id', 'handle']
)]
#[ORM\Index(name: 'entity_j_card_fn_idx', columns: ['j_card_fn'])]
#[ORM\Index(name: 'entity_j_card_org_idx', columns: ['j_card_org'])]
class Entity
{
#[ORM\Id]
@@ -63,6 +65,24 @@ class Entity
#[Groups(['entity:item', 'domain:item', 'watchlist:item'])]
private array $jCard = [];
#[ORM\Column(
type: 'string',
insertable: false,
updatable: false,
columnDefinition: "VARCHAR(255) GENERATED ALWAYS AS (LOWER(jsonb_path_query_first(j_card, '$[1]?(@[0] == \"fn\")[3]') #>> '{}')) STORED",
generated: 'ALWAYS',
)]
private ?string $jCardFn;
#[ORM\Column(
type: 'string',
insertable: false,
updatable: false,
columnDefinition: "VARCHAR(255) GENERATED ALWAYS AS (LOWER(jsonb_path_query_first(j_card, '$[1]?(@[0] == \"org\")[3]') #>> '{}')) STORED",
generated: 'ALWAYS',
)]
private ?string $jCardOrg;
#[ORM\Column(nullable: true)]
#[Groups(['entity:item', 'domain:item', 'watchlist:item'])]
private ?array $remarks = null;
@@ -239,4 +259,28 @@ class Entity
return $this;
}
public function getJCardFn(): ?string
{
return $this->jCardFn;
}
public function getJCardOrg(): ?string
{
return $this->jCardOrg;
}
public function setJCardFn(?string $jCardFn): Entity
{
$this->jCardFn = $jCardFn;
return $this;
}
public function setJCardOrg(?string $jCardOrg): Entity
{
$this->jCardOrg = $jCardOrg;
return $this;
}
}