mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
feat: add tracked domains table
This commit is contained in:
@@ -57,7 +57,7 @@ class Domain
|
||||
* @var Collection<int, DomainEvent>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: DomainEvent::class, mappedBy: 'domain', cascade: ['persist'], orphanRemoval: true)]
|
||||
#[Groups(['domain:item'])]
|
||||
#[Groups(['domain:item', 'domain:list'])]
|
||||
private Collection $events;
|
||||
|
||||
/**
|
||||
@@ -69,7 +69,7 @@ class Domain
|
||||
private Collection $domainEntities;
|
||||
|
||||
#[ORM\Column(type: Types::SIMPLE_ARRAY, nullable: true)]
|
||||
#[Groups(['domain:item'])]
|
||||
#[Groups(['domain:item', 'domain:list'])]
|
||||
private array $status = [];
|
||||
|
||||
/**
|
||||
@@ -93,15 +93,16 @@ class Domain
|
||||
private ?\DateTimeImmutable $createdAt;
|
||||
|
||||
#[ORM\Column(type: Types::DATETIME_IMMUTABLE)]
|
||||
#[Groups(['domain:item', 'domain:list'])]
|
||||
private ?\DateTimeImmutable $updatedAt;
|
||||
|
||||
#[ORM\ManyToOne]
|
||||
#[ORM\JoinColumn(referencedColumnName: 'tld', nullable: false)]
|
||||
#[Groups(['domain:item'])]
|
||||
#[Groups(['domain:item', 'domain:list'])]
|
||||
private ?Tld $tld = null;
|
||||
|
||||
#[ORM\Column(nullable: false)]
|
||||
#[Groups(['domain:item'])]
|
||||
#[Groups(['domain:item', 'domain:list'])]
|
||||
private ?bool $deleted;
|
||||
|
||||
public function __construct()
|
||||
|
||||
@@ -8,7 +8,6 @@ use ApiPlatform\Metadata\Get;
|
||||
use ApiPlatform\Metadata\GetCollection;
|
||||
use ApiPlatform\Metadata\Post;
|
||||
use ApiPlatform\Metadata\Put;
|
||||
use App\Controller\WatchListController;
|
||||
use App\Repository\WatchListRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
@@ -27,6 +26,16 @@ use Symfony\Component\Uid\Uuid;
|
||||
normalizationContext: ['groups' => 'watchlist:list'],
|
||||
name: 'get_all_mine',
|
||||
),
|
||||
new GetCollection(
|
||||
uriTemplate: '/tracked',
|
||||
routeName: 'watchlist_get_tracked_domains',
|
||||
normalizationContext: ['groups' => [
|
||||
'domain:list',
|
||||
'tld:list',
|
||||
'event:list',
|
||||
]],
|
||||
name: 'get_tracked_domains'
|
||||
),
|
||||
new Get(
|
||||
normalizationContext: ['groups' => [
|
||||
'watchlist:item',
|
||||
@@ -42,7 +51,6 @@ use Symfony\Component\Uid\Uuid;
|
||||
),
|
||||
new Get(
|
||||
routeName: 'watchlist_calendar',
|
||||
controller: WatchListController::class,
|
||||
openapiContext: [
|
||||
'responses' => [
|
||||
'200' => [
|
||||
|
||||
Reference in New Issue
Block a user