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.
45 lines
1.5 KiB
PHP
45 lines
1.5 KiB
PHP
<?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');
|
|
}
|
|
}
|