feat(etatLieux): Implémente l'état des lieux de retour (médias, commentaires, points de contrôle, signatures et refus client).

This commit is contained in:
Serreau Jovann
2026-02-12 10:21:32 +01:00
parent 2e7a006fed
commit f6aa522501
18 changed files with 1083 additions and 123 deletions

View File

@@ -0,0 +1,34 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20260211170445 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE etat_lieux_return_comment (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, content TEXT NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, etat_lieux_id INT NOT NULL, PRIMARY KEY (id))');
$this->addSql('CREATE INDEX IDX_5503D02A3F1DAE3C ON etat_lieux_return_comment (etat_lieux_id)');
$this->addSql('ALTER TABLE etat_lieux_return_comment ADD CONSTRAINT FK_5503D02A3F1DAE3C FOREIGN KEY (etat_lieux_id) REFERENCES etat_lieux (id) NOT DEFERRABLE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE etat_lieux_return_comment DROP CONSTRAINT FK_5503D02A3F1DAE3C');
$this->addSql('DROP TABLE etat_lieux_return_comment');
}
}

View File

@@ -0,0 +1,39 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20260212074558 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE etat_lieux_return_point_control (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, name VARCHAR(255) NOT NULL, status BOOLEAN DEFAULT false NOT NULL, details TEXT DEFAULT NULL, etat_lieux_id INT NOT NULL, PRIMARY KEY (id))');
$this->addSql('CREATE INDEX IDX_2EADBB563F1DAE3C ON etat_lieux_return_point_control (etat_lieux_id)');
$this->addSql('CREATE TABLE etat_return_lieux_file (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, file_name VARCHAR(255) DEFAULT NULL, file_size INT DEFAULT NULL, mime_type VARCHAR(255) DEFAULT NULL, type VARCHAR(50) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, etat_lieux_id INT NOT NULL, PRIMARY KEY (id))');
$this->addSql('CREATE INDEX IDX_2E89E9D43F1DAE3C ON etat_return_lieux_file (etat_lieux_id)');
$this->addSql('ALTER TABLE etat_lieux_return_point_control ADD CONSTRAINT FK_2EADBB563F1DAE3C FOREIGN KEY (etat_lieux_id) REFERENCES etat_lieux (id) NOT DEFERRABLE');
$this->addSql('ALTER TABLE etat_return_lieux_file ADD CONSTRAINT FK_2E89E9D43F1DAE3C FOREIGN KEY (etat_lieux_id) REFERENCES etat_lieux (id) NOT DEFERRABLE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE etat_lieux_return_point_control DROP CONSTRAINT FK_2EADBB563F1DAE3C');
$this->addSql('ALTER TABLE etat_return_lieux_file DROP CONSTRAINT FK_2E89E9D43F1DAE3C');
$this->addSql('DROP TABLE etat_lieux_return_point_control');
$this->addSql('DROP TABLE etat_return_lieux_file');
}
}

View File

@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20260212090115 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE etat_lieux ADD raison_refused TEXT DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE etat_lieux DROP raison_refused');
}
}