feat: Permettre l'import d'élèves via fichier CSV ou XLSX
L'import manuel élève par élève est fastidieux pour les établissements qui gèrent des centaines d'élèves. Un wizard d'import en 4 étapes (upload → mapping → preview → confirmation) permet de traiter un fichier complet en une seule opération, avec détection automatique du format (Pronote, École Directe) et validation avant import. L'import est traité de manière asynchrone via Messenger pour ne pas bloquer l'interface, avec suivi de progression en temps réel et réutilisation des mappings entre imports successifs.
This commit is contained in:
44
backend/migrations/Version20260224143000.php
Normal file
44
backend/migrations/Version20260224143000.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20260224143000 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Create student_import_batches table for CSV/XLSX student import wizard';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('CREATE TABLE student_import_batches (
|
||||
id UUID NOT NULL,
|
||||
tenant_id UUID NOT NULL,
|
||||
original_filename VARCHAR(255) NOT NULL,
|
||||
total_rows INT NOT NULL DEFAULT 0,
|
||||
detected_columns JSONB NOT NULL DEFAULT \'[]\',
|
||||
detected_format VARCHAR(50) DEFAULT NULL,
|
||||
status VARCHAR(20) NOT NULL DEFAULT \'pending\',
|
||||
mapping_data JSONB DEFAULT NULL,
|
||||
imported_count INT NOT NULL DEFAULT 0,
|
||||
error_count INT NOT NULL DEFAULT 0,
|
||||
rows_data JSONB NOT NULL DEFAULT \'[]\',
|
||||
created_at TIMESTAMPTZ NOT NULL,
|
||||
completed_at TIMESTAMPTZ DEFAULT NULL,
|
||||
PRIMARY KEY (id)
|
||||
)');
|
||||
|
||||
$this->addSql('CREATE INDEX idx_student_import_batches_tenant ON student_import_batches (tenant_id)');
|
||||
$this->addSql('CREATE INDEX idx_student_import_batches_status ON student_import_batches (status)');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('DROP TABLE student_import_batches');
|
||||
}
|
||||
}
|
||||
34
backend/migrations/Version20260224214219.php
Normal file
34
backend/migrations/Version20260224214219.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20260224214219 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Ajouter la table saved_column_mappings pour réutiliser les mappings d\'import';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql(<<<'SQL'
|
||||
CREATE TABLE saved_column_mappings (
|
||||
tenant_id UUID NOT NULL,
|
||||
format VARCHAR(50) NOT NULL,
|
||||
mapping_data JSONB NOT NULL,
|
||||
saved_at TIMESTAMPTZ NOT NULL,
|
||||
PRIMARY KEY (tenant_id, format)
|
||||
)
|
||||
SQL);
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('DROP TABLE saved_column_mappings');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user