d42b288434
LST-58 (2.4), part 2 — Prospect (new entity). Completes the Directory backend.
- ProspectStatus enum (new/contacted/qualified/won/lost) + Prospect entity
(name, company, email, phone, address, status, source, notes,
convertedClient -> ClientInterface) with Timestampable/Blamable + #[Auditable].
- API: GetCollection/Get (ROLE_USER), Post/Patch/Delete (ROLE_ADMIN),
custom POST /prospects/{id}/convert (ConvertProspectProcessor: creates a
Client from the prospect, links convertedClient, sets status=Won; idempotent).
SearchFilter on status.
- Repository interface + Doctrine impl (bound); 6 MCP tools (list/get/create/
update/delete/convert-prospect); Serializer::prospect(). Module perms
directory.prospects.view/manage. Demo fixtures (3 prospects, one converted).
- Additive migration: CREATE TABLE prospect + FKs ON DELETE SET NULL + COMMENT.
163 tests green (incl. conversion test), mapping valid, cs-fixer clean.
44 lines
1.1 KiB
PHP
44 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Module\Directory;
|
|
|
|
use App\Shared\Domain\Module\ModuleInterface;
|
|
|
|
final class DirectoryModule implements ModuleInterface
|
|
{
|
|
public static function id(): string
|
|
{
|
|
return 'directory';
|
|
}
|
|
|
|
public static function label(): string
|
|
{
|
|
return 'Répertoire';
|
|
}
|
|
|
|
public static function isRequired(): bool
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
* Permissions RBAC fin du Module Directory.
|
|
*
|
|
* Additif : alimente le catalogue RBAC. La sécurité des opérations API
|
|
* reste en ROLE_USER/ROLE_ADMIN (non recâblée ici).
|
|
*
|
|
* @return list<array{code: string, label: string}>
|
|
*/
|
|
public static function permissions(): array
|
|
{
|
|
return [
|
|
['code' => 'directory.clients.view', 'label' => 'Voir les clients'],
|
|
['code' => 'directory.clients.manage', 'label' => 'Gérer les clients'],
|
|
['code' => 'directory.prospects.view', 'label' => 'Voir les prospects'],
|
|
['code' => 'directory.prospects.manage', 'label' => 'Gérer les prospects'],
|
|
];
|
|
}
|
|
}
|