diff --git a/.gitignore b/.gitignore index 2a5536b8d33c22dddf82165aec68bd12dc209be6..b2f649cfdb182392e35be5e4ec06044e0d9581df 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ /.env /helm/api-platform/charts/* !/helm/api-platform/charts/.gitignore + +.idea/* diff --git a/api/.gitignore b/api/.gitignore index d270e414b426a6647813c0dca252c65e1f5ff268..ae93018f235cd62b0e8536d2cce6dab6f898b1be 100644 --- a/api/.gitignore +++ b/api/.gitignore @@ -19,3 +19,7 @@ .phpunit.result.cache /phpunit.xml ###< symfony/phpunit-bridge ### + +### Migration ### +/migrations/* +``` diff --git a/api/README.md b/api/README.md index d0edd4cfc66a3f2208dbda4be65593e9273a1899..8941c79a2d46caeeb71189bed18aa8e9ba00451e 100644 --- a/api/README.md +++ b/api/README.md @@ -3,3 +3,11 @@ The API will be here. Refer to the [Getting Started Guide](https://api-platform.com/docs/distribution) for more information. + +## Migrations and database + +```bash +docker compose exec php bin/console doctrine:migrations:diff +docker compose exec php bin/console doctrine:migrations:migrate +``` + diff --git a/api/src/Entity/Sale.php b/api/src/Entity/Sale.php new file mode 100644 index 0000000000000000000000000000000000000000..9ceb2c1394e677d4aaf043dbebfadd1bdbbd695a --- /dev/null +++ b/api/src/Entity/Sale.php @@ -0,0 +1,95 @@ +date = $date; + $this->amount = $amount; + $this->surface = $surface; + $this->region = $region; + } + + // getters + public function getId(): ?int + { + return $this->id; + } + + public function getDate(): ?\DateTimeInterface + { + return $this->date; + } + + public function getAmount(): ?float + { + return $this->amount; + } + + public function getSurface(): ?float + { + return $this->surface; + } + + public function getRegion(): ?string + { + return $this->region; + } + + // setters + public function setDate(\DateTimeImmutable $date): void + { + $this->date = $date; + } + + public function setAmount(float $amount): void + { + $this->amount = $amount; + } + + public function setSurface(float $surface): void + { + $this->surface = $surface; + } + + public function setRegion(string $region): void + { + $this->region = $region; + } +}