Phase 0 : entités, migrations, API Platform, PostGIS

- API Platform + Doctrine ORM + jsor/doctrine-postgis installés
- 6 entités Symfony (SargassumObservation, SargassumForecast,
  DataIngestionJob, CoastalPoint, ImpactScore, UserFeedback)
- Migration initiale manuelle avec CREATE EXTENSION postgis,
  toutes les tables, index GIST et BTREE
- doctrine.yaml configuré pour PostgreSQL 16 + types PostGIS
- Roadmap Phase 0 complète

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Gwadaking
2026-04-01 02:37:27 -04:00
parent 34e9675350
commit e5e729c487
36 changed files with 7102 additions and 23 deletions

View File

@@ -0,0 +1,57 @@
<?php
namespace App\Entity;
use App\Repository\UserFeedbackRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Types\UuidType;
use Symfony\Component\Uid\Uuid;
#[ORM\Entity(repositoryClass: UserFeedbackRepository::class)]
#[ORM\Index(columns: ['timestamp'], name: 'idx_feedback_timestamp')]
class UserFeedback
{
#[ORM\Id]
#[ORM\Column(type: UuidType::NAME, unique: true)]
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
private ?Uuid $id = null;
#[ORM\Column(type: 'geometry', options: ['geometry_type' => 'POINT', 'srid' => 4326])]
private mixed $location = null;
#[ORM\ManyToOne(inversedBy: 'feedbacks')]
#[ORM\JoinColumn(nullable: true)]
private ?CoastalPoint $coastalPoint = null;
#[ORM\Column]
private ?\DateTimeImmutable $timestamp = null;
#[ORM\Column]
private ?bool $hasSeaweed = null;
#[ORM\Column(length: 20, nullable: true)]
private ?string $density = null;
#[ORM\Column(length: 100, nullable: true)]
private ?string $source = null;
public function __construct()
{
$this->timestamp = new \DateTimeImmutable();
}
public function getId(): ?Uuid { return $this->id; }
public function getLocation(): mixed { return $this->location; }
public function setLocation(mixed $location): static { $this->location = $location; return $this; }
public function getCoastalPoint(): ?CoastalPoint { return $this->coastalPoint; }
public function setCoastalPoint(?CoastalPoint $coastalPoint): static { $this->coastalPoint = $coastalPoint; return $this; }
public function getTimestamp(): ?\DateTimeImmutable { return $this->timestamp; }
public function setTimestamp(\DateTimeImmutable $timestamp): static { $this->timestamp = $timestamp; return $this; }
public function getHasSeaweed(): ?bool { return $this->hasSeaweed; }
public function setHasSeaweed(bool $hasSeaweed): static { $this->hasSeaweed = $hasSeaweed; return $this; }
public function getDensity(): ?string { return $this->density; }
public function setDensity(?string $density): static { $this->density = $density; return $this; }
public function getSource(): ?string { return $this->source; }
public function setSource(?string $source): static { $this->source = $source; return $this; }
}