feat: relation revendeur sur Customer/Website + WebsiteConfiguration

Customer :
- Ajout revendeurCode (VARCHAR 10, nullable) : stocke le code du revendeur
  apporteur d'affaire (pas de FK, suppression revendeur sans impact)
- Select revendeur dans le formulaire de création client
- Champ revendeur dans la fiche client (info + section système)

Website :
- Ajout revendeurCode (VARCHAR 10, nullable) : même logique que Customer

WebsiteConfiguration (nouvelle entité) :
- website (ManyToOne CASCADE) : site parent
- type (VARCHAR 25) : clé de configuration
- value (TEXT) : valeur
- Contrainte unique (website_id, type)

Formulaire création client :
- Select "Revendeur (apporteur d'affaire)" avec liste des revendeurs actifs

Fiche client :
- Onglet Info : champ code revendeur éditable
- Section système : affiche le code revendeur

Migrations : ALTER TABLE customer/website ADD revendeur_code,
CREATE TABLE website_configuration

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Serreau Jovann
2026-04-04 21:39:26 +02:00
parent c849a31ea1
commit e03233d922
9 changed files with 193 additions and 4 deletions

View File

@@ -78,7 +78,7 @@ class ClientsControllerTest extends TestCase
$userService = $this->createStub(UserManagementService::class);
$logger = $this->createStub(LoggerInterface::class);
$response = $controller->create($request, $repo, $em, $meilisearch, $userService, $logger, $this->createStub(HttpClientInterface::class), $this->createStub(MailerService::class), $this->createStub(Environment::class), 'sk_test_***');
$response = $controller->create($request, $repo, $this->createStub(\App\Repository\RevendeurRepository::class), $em, $meilisearch, $userService, $logger, $this->createStub(HttpClientInterface::class), $this->createStub(MailerService::class), $this->createStub(Environment::class), 'sk_test_***');
$this->assertInstanceOf(Response::class, $response);
}
@@ -98,7 +98,7 @@ class ClientsControllerTest extends TestCase
$userService->method('createBaseUser')->willThrowException(new \InvalidArgumentException('Champs requis'));
$logger = $this->createStub(LoggerInterface::class);
$response = $controller->create($request, $repo, $em, $meilisearch, $userService, $logger, $this->createStub(HttpClientInterface::class), $this->createStub(MailerService::class), $this->createStub(Environment::class), 'sk_test_***');
$response = $controller->create($request, $repo, $this->createStub(\App\Repository\RevendeurRepository::class), $em, $meilisearch, $userService, $logger, $this->createStub(HttpClientInterface::class), $this->createStub(MailerService::class), $this->createStub(Environment::class), 'sk_test_***');
$this->assertInstanceOf(Response::class, $response);
}
@@ -118,7 +118,7 @@ class ClientsControllerTest extends TestCase
$userService->method('createBaseUser')->willThrowException(new \RuntimeException('DB error'));
$logger = $this->createStub(LoggerInterface::class);
$response = $controller->create($request, $repo, $em, $meilisearch, $userService, $logger, $this->createStub(HttpClientInterface::class), $this->createStub(MailerService::class), $this->createStub(Environment::class), 'sk_test_***');
$response = $controller->create($request, $repo, $this->createStub(\App\Repository\RevendeurRepository::class), $em, $meilisearch, $userService, $logger, $this->createStub(HttpClientInterface::class), $this->createStub(MailerService::class), $this->createStub(Environment::class), 'sk_test_***');
$this->assertInstanceOf(Response::class, $response);
}
@@ -286,6 +286,7 @@ class ClientsControllerTest extends TestCase
$response = $controller->create(
$request,
$repo,
$this->createStub(\App\Repository\RevendeurRepository::class),
$this->createStub(EntityManagerInterface::class),
$this->createStub(MeilisearchService::class),
$userService,
@@ -326,6 +327,7 @@ class ClientsControllerTest extends TestCase
$response = $controller->create(
$request,
$repo,
$this->createStub(\App\Repository\RevendeurRepository::class),
$this->createStub(EntityManagerInterface::class),
$this->createStub(MeilisearchService::class),
$userService,
@@ -369,6 +371,7 @@ class ClientsControllerTest extends TestCase
$response = $controller->create(
$request,
$repo,
$this->createStub(\App\Repository\RevendeurRepository::class),
$this->createStub(EntityManagerInterface::class),
$meilisearch,
$userService,