diff --git a/config/modules.php b/config/modules.php index 8ca723b..15f2ccc 100644 --- a/config/modules.php +++ b/config/modules.php @@ -8,9 +8,11 @@ declare(strict_types=1); */ use App\Module\Core\CoreModule; +use App\Module\ProjectManagement\ProjectManagementModule; use App\Module\TimeTracking\TimeTrackingModule; return [ CoreModule::class, TimeTrackingModule::class, + ProjectManagementModule::class, ]; diff --git a/config/packages/doctrine.yaml b/config/packages/doctrine.yaml index fe3adb4..af7da9c 100644 --- a/config/packages/doctrine.yaml +++ b/config/packages/doctrine.yaml @@ -22,9 +22,9 @@ doctrine: auto_mapping: true resolve_target_entities: App\Shared\Domain\Contract\UserInterface: App\Module\Core\Domain\Entity\User - App\Shared\Domain\Contract\ProjectInterface: App\Entity\Project - App\Shared\Domain\Contract\TaskInterface: App\Entity\Task - App\Shared\Domain\Contract\TaskTagInterface: App\Entity\TaskTag + App\Shared\Domain\Contract\ProjectInterface: App\Module\ProjectManagement\Domain\Entity\Project + App\Shared\Domain\Contract\TaskInterface: App\Module\ProjectManagement\Domain\Entity\Task + App\Shared\Domain\Contract\TaskTagInterface: App\Module\ProjectManagement\Domain\Entity\TaskTag App\Shared\Domain\Contract\ClientInterface: App\Entity\Client mappings: App: @@ -43,6 +43,11 @@ doctrine: is_bundle: false dir: '%kernel.project_dir%/src/Module/TimeTracking/Domain/Entity' prefix: 'App\Module\TimeTracking\Domain\Entity' + ProjectManagement: + type: attribute + is_bundle: false + dir: '%kernel.project_dir%/src/Module/ProjectManagement/Domain/Entity' + prefix: 'App\Module\ProjectManagement\Domain\Entity' controller_resolver: auto_mapping: false diff --git a/config/services.yaml b/config/services.yaml index a2f46b5..9d4c54d 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -31,25 +31,25 @@ services: # add more service definitions when explicit configuration is needed # please note that last definitions always *replace* previous ones - App\EventListener\TaskDocumentListener: + App\Module\ProjectManagement\Infrastructure\EventListener\TaskDocumentListener: arguments: $uploadDir: '%task_document_upload_dir%' tags: - { name: doctrine.orm.entity_listener } - App\State\TaskDocumentProcessor: + App\Module\ProjectManagement\Infrastructure\ApiPlatform\State\TaskDocumentProcessor: arguments: $uploadDir: '%task_document_upload_dir%' - App\Controller\TaskDocumentDownloadController: + App\Module\ProjectManagement\Infrastructure\Controller\TaskDocumentDownloadController: arguments: $uploadDir: '%task_document_upload_dir%' - App\Mcp\Tool\Task\AddTaskDocumentTool: + App\Module\ProjectManagement\Infrastructure\Mcp\Tool\Task\AddTaskDocumentTool: arguments: $uploadDir: '%task_document_upload_dir%' - App\Mcp\Tool\Task\UpdateTaskDocumentTool: + App\Module\ProjectManagement\Infrastructure\Mcp\Tool\Task\UpdateTaskDocumentTool: arguments: $uploadDir: '%task_document_upload_dir%' @@ -75,4 +75,22 @@ services: App\Module\TimeTracking\Domain\Repository\TimeEntryRepositoryInterface: '@App\Module\TimeTracking\Infrastructure\Doctrine\DoctrineTimeEntryRepository' + App\Module\ProjectManagement\Domain\Repository\ProjectRepositoryInterface: '@App\Module\ProjectManagement\Infrastructure\Doctrine\DoctrineProjectRepository' + + App\Module\ProjectManagement\Domain\Repository\TaskRepositoryInterface: '@App\Module\ProjectManagement\Infrastructure\Doctrine\DoctrineTaskRepository' + + App\Module\ProjectManagement\Domain\Repository\WorkflowRepositoryInterface: '@App\Module\ProjectManagement\Infrastructure\Doctrine\DoctrineWorkflowRepository' + + App\Module\ProjectManagement\Domain\Repository\TaskStatusRepositoryInterface: '@App\Module\ProjectManagement\Infrastructure\Doctrine\DoctrineTaskStatusRepository' + + App\Module\ProjectManagement\Domain\Repository\TaskGroupRepositoryInterface: '@App\Module\ProjectManagement\Infrastructure\Doctrine\DoctrineTaskGroupRepository' + + App\Module\ProjectManagement\Domain\Repository\TaskEffortRepositoryInterface: '@App\Module\ProjectManagement\Infrastructure\Doctrine\DoctrineTaskEffortRepository' + + App\Module\ProjectManagement\Domain\Repository\TaskPriorityRepositoryInterface: '@App\Module\ProjectManagement\Infrastructure\Doctrine\DoctrineTaskPriorityRepository' + + App\Module\ProjectManagement\Domain\Repository\TaskTagRepositoryInterface: '@App\Module\ProjectManagement\Infrastructure\Doctrine\DoctrineTaskTagRepository' + + App\Module\ProjectManagement\Domain\Repository\TaskRecurrenceRepositoryInterface: '@App\Module\ProjectManagement\Infrastructure\Doctrine\DoctrineTaskRecurrenceRepository' + App\Shared\Domain\Contract\NotifierInterface: '@App\Module\Core\Infrastructure\Notifier' diff --git a/config/sidebar.php b/config/sidebar.php index dcdeb4d..1147980 100644 --- a/config/sidebar.php +++ b/config/sidebar.php @@ -20,8 +20,8 @@ return [ 'icon' => 'mdi:view-dashboard-outline', 'items' => [ ['label' => 'sidebar.general.dashboard', 'to' => '/', 'icon' => 'mdi:view-dashboard-outline'], - ['label' => 'sidebar.general.myTasks', 'to' => '/my-tasks', 'icon' => 'mdi:clipboard-check-outline'], - ['label' => 'sidebar.general.projects', 'to' => '/projects', 'icon' => 'mdi:folder-outline'], + ['label' => 'sidebar.general.myTasks', 'to' => '/my-tasks', 'icon' => 'mdi:clipboard-check-outline', 'module' => 'project-management'], + ['label' => 'sidebar.general.projects', 'to' => '/projects', 'icon' => 'mdi:folder-outline', 'module' => 'project-management'], ['label' => 'sidebar.general.timeTracking', 'to' => '/time-tracking', 'icon' => 'mdi:calendar-edit-outline', 'module' => 'time-tracking'], ], ], diff --git a/src/ApiResource/BookStackLink.php b/src/ApiResource/BookStackLink.php index f324d6e..5414d22 100644 --- a/src/ApiResource/BookStackLink.php +++ b/src/ApiResource/BookStackLink.php @@ -9,8 +9,8 @@ use ApiPlatform\Metadata\Delete; use ApiPlatform\Metadata\GetCollection; use ApiPlatform\Metadata\Link; use ApiPlatform\Metadata\Post; -use App\Entity\Task; use App\Entity\TaskBookStackLink; +use App\Module\ProjectManagement\Domain\Entity\Task; use App\State\BookStackLinkProcessor; use App\State\BookStackLinkProvider; use Symfony\Component\Serializer\Attribute\Groups; diff --git a/src/ApiResource/BookStackSearchResult.php b/src/ApiResource/BookStackSearchResult.php index 83ca6f9..2f1f6fb 100644 --- a/src/ApiResource/BookStackSearchResult.php +++ b/src/ApiResource/BookStackSearchResult.php @@ -7,7 +7,7 @@ namespace App\ApiResource; use ApiPlatform\Metadata\ApiResource; use ApiPlatform\Metadata\GetCollection; use ApiPlatform\Metadata\Link; -use App\Entity\Task; +use App\Module\ProjectManagement\Domain\Entity\Task; use App\State\BookStackSearchResultProvider; use Symfony\Component\Serializer\Attribute\Groups; diff --git a/src/Controller/Mail/MailCreateTaskController.php b/src/Controller/Mail/MailCreateTaskController.php index 2231d0e..3c283ac 100644 --- a/src/Controller/Mail/MailCreateTaskController.php +++ b/src/Controller/Mail/MailCreateTaskController.php @@ -4,14 +4,14 @@ declare(strict_types=1); namespace App\Controller\Mail; -use App\Entity\Project; -use App\Entity\Task; -use App\Entity\TaskGroup; use App\Entity\TaskMailLink; -use App\Entity\TaskStatus; use App\Module\Core\Domain\Entity\User; +use App\Module\ProjectManagement\Domain\Entity\Project; +use App\Module\ProjectManagement\Domain\Entity\Task; +use App\Module\ProjectManagement\Domain\Entity\TaskGroup; +use App\Module\ProjectManagement\Domain\Entity\TaskStatus; +use App\Module\ProjectManagement\Domain\Repository\TaskRepositoryInterface; use App\Repository\MailMessageRepository; -use App\Repository\TaskRepository; use App\Security\MailAccessChecker; use DateTimeImmutable; use Doctrine\ORM\EntityManagerInterface; @@ -31,7 +31,7 @@ class MailCreateTaskController extends AbstractController private readonly MailMessageRepository $messageRepository, private readonly EntityManagerInterface $em, private readonly MailAccessChecker $accessChecker, - private readonly TaskRepository $taskRepository, + private readonly TaskRepositoryInterface $taskRepository, ) {} public function __invoke(Request $request, int $id): JsonResponse diff --git a/src/Controller/Mail/MailLinkTaskController.php b/src/Controller/Mail/MailLinkTaskController.php index 86d96b8..2cb3524 100644 --- a/src/Controller/Mail/MailLinkTaskController.php +++ b/src/Controller/Mail/MailLinkTaskController.php @@ -4,8 +4,8 @@ declare(strict_types=1); namespace App\Controller\Mail; -use App\Entity\Task; use App\Entity\TaskMailLink; +use App\Module\ProjectManagement\Domain\Entity\Task; use App\Repository\MailMessageRepository; use App\Repository\TaskMailLinkRepository; use App\Security\MailAccessChecker; diff --git a/src/Controller/Mail/MailUnlinkTaskController.php b/src/Controller/Mail/MailUnlinkTaskController.php index 399959e..09f646b 100644 --- a/src/Controller/Mail/MailUnlinkTaskController.php +++ b/src/Controller/Mail/MailUnlinkTaskController.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Controller\Mail; -use App\Entity\Task; +use App\Module\ProjectManagement\Domain\Entity\Task; use App\Repository\MailMessageRepository; use App\Repository\TaskMailLinkRepository; use App\Security\MailAccessChecker; diff --git a/src/Controller/Mail/TaskMailsListController.php b/src/Controller/Mail/TaskMailsListController.php index 6b2180e..8a9b0a4 100644 --- a/src/Controller/Mail/TaskMailsListController.php +++ b/src/Controller/Mail/TaskMailsListController.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace App\Controller\Mail; -use App\Entity\Task; +use App\Module\ProjectManagement\Domain\Entity\Task; use App\Repository\TaskMailLinkRepository; use App\Security\MailAccessChecker; use DateTimeInterface; diff --git a/src/DataFixtures/AppFixtures.php b/src/DataFixtures/AppFixtures.php index 1649a55..00adb95 100644 --- a/src/DataFixtures/AppFixtures.php +++ b/src/DataFixtures/AppFixtures.php @@ -9,23 +9,23 @@ use App\Entity\AbsencePolicy; use App\Entity\AbsenceRequest; use App\Entity\Client; use App\Entity\MailConfiguration; -use App\Entity\Project; -use App\Entity\Task; -use App\Entity\TaskEffort; -use App\Entity\TaskGroup; -use App\Entity\TaskPriority; -use App\Entity\TaskRecurrence; -use App\Entity\TaskStatus; -use App\Entity\TaskTag; -use App\Entity\Workflow; use App\Entity\ZimbraConfiguration; use App\Enum\AbsenceStatus; use App\Enum\AbsenceType; use App\Enum\ContractType; -use App\Enum\RecurrenceType; -use App\Enum\StatusCategory; use App\Module\Core\Application\Rbac\RbacSeeder; use App\Module\Core\Domain\Entity\User; +use App\Module\ProjectManagement\Domain\Entity\Project; +use App\Module\ProjectManagement\Domain\Entity\Task; +use App\Module\ProjectManagement\Domain\Entity\TaskEffort; +use App\Module\ProjectManagement\Domain\Entity\TaskGroup; +use App\Module\ProjectManagement\Domain\Entity\TaskPriority; +use App\Module\ProjectManagement\Domain\Entity\TaskRecurrence; +use App\Module\ProjectManagement\Domain\Entity\TaskStatus; +use App\Module\ProjectManagement\Domain\Entity\TaskTag; +use App\Module\ProjectManagement\Domain\Entity\Workflow; +use App\Module\ProjectManagement\Domain\Enum\RecurrenceType; +use App\Module\ProjectManagement\Domain\Enum\StatusCategory; use App\Module\TimeTracking\Domain\Entity\TimeEntry; use DateTimeImmutable; use DateTimeZone; diff --git a/src/Entity/Client.php b/src/Entity/Client.php index 48cbee1..6f3bf8a 100644 --- a/src/Entity/Client.php +++ b/src/Entity/Client.php @@ -10,6 +10,7 @@ use ApiPlatform\Metadata\Get; use ApiPlatform\Metadata\GetCollection; use ApiPlatform\Metadata\Patch; use ApiPlatform\Metadata\Post; +use App\Module\ProjectManagement\Domain\Entity\Project; use App\Repository\ClientRepository; use App\Shared\Domain\Contract\ClientInterface; use Doctrine\Common\Collections\ArrayCollection; diff --git a/src/Entity/TaskBookStackLink.php b/src/Entity/TaskBookStackLink.php index 34b3f01..a9c6519 100644 --- a/src/Entity/TaskBookStackLink.php +++ b/src/Entity/TaskBookStackLink.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace App\Entity; +use App\Module\ProjectManagement\Domain\Entity\Task; use App\Repository\TaskBookStackLinkRepository; use DateTimeImmutable; use Doctrine\ORM\Mapping as ORM; diff --git a/src/Entity/TaskMailLink.php b/src/Entity/TaskMailLink.php index 041efcb..9ef6364 100644 --- a/src/Entity/TaskMailLink.php +++ b/src/Entity/TaskMailLink.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace App\Entity; +use App\Module\ProjectManagement\Domain\Entity\Task; use App\Repository\TaskMailLinkRepository; use App\Shared\Domain\Contract\UserInterface; use DateTimeImmutable; diff --git a/src/Mcp/Tool/Serializer.php b/src/Mcp/Tool/Serializer.php index 964c451..2003aa6 100644 --- a/src/Mcp/Tool/Serializer.php +++ b/src/Mcp/Tool/Serializer.php @@ -8,15 +8,15 @@ use App\Entity\AbsenceBalance; use App\Entity\AbsencePolicy; use App\Entity\AbsenceRequest; use App\Entity\Client; -use App\Entity\Project; -use App\Entity\Task; -use App\Entity\TaskDocument; -use App\Entity\TaskEffort; -use App\Entity\TaskGroup; -use App\Entity\TaskPriority; -use App\Entity\TaskStatus; -use App\Entity\TaskTag; use App\Module\Core\Domain\Entity\User; +use App\Module\ProjectManagement\Domain\Entity\Project; +use App\Module\ProjectManagement\Domain\Entity\Task; +use App\Module\ProjectManagement\Domain\Entity\TaskDocument; +use App\Module\ProjectManagement\Domain\Entity\TaskEffort; +use App\Module\ProjectManagement\Domain\Entity\TaskGroup; +use App\Module\ProjectManagement\Domain\Entity\TaskPriority; +use App\Module\ProjectManagement\Domain\Entity\TaskStatus; +use App\Module\ProjectManagement\Domain\Entity\TaskTag; use App\Module\TimeTracking\Domain\Entity\TimeEntry; use Doctrine\Common\Collections\Collection; diff --git a/src/Entity/Project.php b/src/Module/ProjectManagement/Domain/Entity/Project.php similarity index 94% rename from src/Entity/Project.php rename to src/Module/ProjectManagement/Domain/Entity/Project.php index 32acbd7..1fe5cb1 100644 --- a/src/Entity/Project.php +++ b/src/Module/ProjectManagement/Domain/Entity/Project.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Entity; +namespace App\Module\ProjectManagement\Domain\Entity; use ApiPlatform\Doctrine\Orm\Filter\BooleanFilter; use ApiPlatform\Metadata\ApiFilter; @@ -13,11 +13,11 @@ use ApiPlatform\Metadata\GetCollection; use ApiPlatform\Metadata\Link; use ApiPlatform\Metadata\Patch; use ApiPlatform\Metadata\Post; -use App\ApiResource\SwitchWorkflowOutput; -use App\Repository\ProjectRepository; +use App\Module\ProjectManagement\Infrastructure\ApiPlatform\Resource\SwitchWorkflowOutput; +use App\Module\ProjectManagement\Infrastructure\ApiPlatform\State\SwitchProjectWorkflowProcessor; +use App\Module\ProjectManagement\Infrastructure\Doctrine\DoctrineProjectRepository; use App\Shared\Domain\Contract\ClientInterface; use App\Shared\Domain\Contract\ProjectInterface; -use App\State\SwitchProjectWorkflowProcessor; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; @@ -54,7 +54,7 @@ use Symfony\Component\Validator\Constraints as Assert; order: ['name' => 'ASC'], )] #[ApiFilter(BooleanFilter::class, properties: ['archived'])] -#[ORM\Entity(repositoryClass: ProjectRepository::class)] +#[ORM\Entity(repositoryClass: DoctrineProjectRepository::class)] #[UniqueEntity(fields: ['code'], message: 'Ce code de projet est déjà utilisé.')] class Project implements ProjectInterface { diff --git a/src/Entity/Task.php b/src/Module/ProjectManagement/Domain/Entity/Task.php similarity index 97% rename from src/Entity/Task.php rename to src/Module/ProjectManagement/Domain/Entity/Task.php index 6977231..ecbabc3 100644 --- a/src/Entity/Task.php +++ b/src/Module/ProjectManagement/Domain/Entity/Task.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Entity; +namespace App\Module\ProjectManagement\Domain\Entity; use ApiPlatform\Doctrine\Orm\Filter\BooleanFilter; use ApiPlatform\Doctrine\Orm\Filter\DateFilter; @@ -15,11 +15,11 @@ use ApiPlatform\Metadata\Get; use ApiPlatform\Metadata\GetCollection; use ApiPlatform\Metadata\Patch; use ApiPlatform\Metadata\Post; -use App\Repository\TaskRepository; +use App\Module\ProjectManagement\Infrastructure\ApiPlatform\State\TaskCalendarProcessor; +use App\Module\ProjectManagement\Infrastructure\ApiPlatform\State\TaskNumberProcessor; +use App\Module\ProjectManagement\Infrastructure\Doctrine\DoctrineTaskRepository; use App\Shared\Domain\Contract\TaskInterface; use App\Shared\Domain\Contract\UserInterface; -use App\State\TaskCalendarProcessor; -use App\State\TaskNumberProcessor; use DateTimeImmutable; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; @@ -44,7 +44,7 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; #[ApiFilter(DateFilter::class, properties: ['scheduledStart', 'scheduledEnd', 'deadline'])] #[ApiFilter(BooleanFilter::class, properties: ['archived', 'syncToCalendar'])] #[ApiFilter(OrderFilter::class, properties: ['scheduledStart', 'deadline'])] -#[ORM\Entity(repositoryClass: TaskRepository::class)] +#[ORM\Entity(repositoryClass: DoctrineTaskRepository::class)] #[ORM\Table(name: 'task')] #[ORM\UniqueConstraint(name: 'uniq_task_project_number', columns: ['project_id', 'number'])] class Task implements TaskInterface diff --git a/src/Entity/TaskDocument.php b/src/Module/ProjectManagement/Domain/Entity/TaskDocument.php similarity index 93% rename from src/Entity/TaskDocument.php rename to src/Module/ProjectManagement/Domain/Entity/TaskDocument.php index 235fc14..3d2d5f3 100644 --- a/src/Entity/TaskDocument.php +++ b/src/Module/ProjectManagement/Domain/Entity/TaskDocument.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Entity; +namespace App\Module\ProjectManagement\Domain\Entity; use ApiPlatform\Doctrine\Orm\Filter\SearchFilter; use ApiPlatform\Metadata\ApiFilter; @@ -11,10 +11,10 @@ use ApiPlatform\Metadata\Delete; use ApiPlatform\Metadata\Get; use ApiPlatform\Metadata\GetCollection; use ApiPlatform\Metadata\Post; -use App\EventListener\TaskDocumentListener; +use App\Module\ProjectManagement\Infrastructure\ApiPlatform\State\TaskDocumentProcessor; +use App\Module\ProjectManagement\Infrastructure\ApiPlatform\State\TaskDocumentProvider; +use App\Module\ProjectManagement\Infrastructure\EventListener\TaskDocumentListener; use App\Shared\Domain\Contract\UserInterface; -use App\State\TaskDocumentProcessor; -use App\State\TaskDocumentProvider; use DateTimeImmutable; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Serializer\Attribute\Groups; diff --git a/src/Entity/TaskEffort.php b/src/Module/ProjectManagement/Domain/Entity/TaskEffort.php similarity index 87% rename from src/Entity/TaskEffort.php rename to src/Module/ProjectManagement/Domain/Entity/TaskEffort.php index 04ce397..5dabd51 100644 --- a/src/Entity/TaskEffort.php +++ b/src/Module/ProjectManagement/Domain/Entity/TaskEffort.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Entity; +namespace App\Module\ProjectManagement\Domain\Entity; use ApiPlatform\Metadata\ApiResource; use ApiPlatform\Metadata\Delete; @@ -10,7 +10,7 @@ use ApiPlatform\Metadata\Get; use ApiPlatform\Metadata\GetCollection; use ApiPlatform\Metadata\Patch; use ApiPlatform\Metadata\Post; -use App\Repository\TaskEffortRepository; +use App\Module\ProjectManagement\Infrastructure\Doctrine\DoctrineTaskEffortRepository; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Serializer\Attribute\Groups; @@ -26,7 +26,7 @@ use Symfony\Component\Serializer\Attribute\Groups; denormalizationContext: ['groups' => ['task_effort:write']], order: ['label' => 'ASC'], )] -#[ORM\Entity(repositoryClass: TaskEffortRepository::class)] +#[ORM\Entity(repositoryClass: DoctrineTaskEffortRepository::class)] class TaskEffort { #[ORM\Id] diff --git a/src/Entity/TaskGroup.php b/src/Module/ProjectManagement/Domain/Entity/TaskGroup.php similarity index 93% rename from src/Entity/TaskGroup.php rename to src/Module/ProjectManagement/Domain/Entity/TaskGroup.php index 8a5ecf8..c013da7 100644 --- a/src/Entity/TaskGroup.php +++ b/src/Module/ProjectManagement/Domain/Entity/TaskGroup.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Entity; +namespace App\Module\ProjectManagement\Domain\Entity; use ApiPlatform\Doctrine\Orm\Filter\BooleanFilter; use ApiPlatform\Doctrine\Orm\Filter\SearchFilter; @@ -13,7 +13,7 @@ use ApiPlatform\Metadata\Get; use ApiPlatform\Metadata\GetCollection; use ApiPlatform\Metadata\Patch; use ApiPlatform\Metadata\Post; -use App\Repository\TaskGroupRepository; +use App\Module\ProjectManagement\Infrastructure\Doctrine\DoctrineTaskGroupRepository; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Serializer\Attribute\Groups; @@ -31,7 +31,7 @@ use Symfony\Component\Serializer\Attribute\Groups; )] #[ApiFilter(SearchFilter::class, properties: ['project' => 'exact'])] #[ApiFilter(BooleanFilter::class, properties: ['archived'])] -#[ORM\Entity(repositoryClass: TaskGroupRepository::class)] +#[ORM\Entity(repositoryClass: DoctrineTaskGroupRepository::class)] class TaskGroup { #[ORM\Id] diff --git a/src/Entity/TaskPriority.php b/src/Module/ProjectManagement/Domain/Entity/TaskPriority.php similarity index 89% rename from src/Entity/TaskPriority.php rename to src/Module/ProjectManagement/Domain/Entity/TaskPriority.php index c960977..9840bee 100644 --- a/src/Entity/TaskPriority.php +++ b/src/Module/ProjectManagement/Domain/Entity/TaskPriority.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Entity; +namespace App\Module\ProjectManagement\Domain\Entity; use ApiPlatform\Metadata\ApiResource; use ApiPlatform\Metadata\Delete; @@ -10,7 +10,7 @@ use ApiPlatform\Metadata\Get; use ApiPlatform\Metadata\GetCollection; use ApiPlatform\Metadata\Patch; use ApiPlatform\Metadata\Post; -use App\Repository\TaskPriorityRepository; +use App\Module\ProjectManagement\Infrastructure\Doctrine\DoctrineTaskPriorityRepository; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Serializer\Attribute\Groups; @@ -26,7 +26,7 @@ use Symfony\Component\Serializer\Attribute\Groups; denormalizationContext: ['groups' => ['task_priority:write']], order: ['label' => 'ASC'], )] -#[ORM\Entity(repositoryClass: TaskPriorityRepository::class)] +#[ORM\Entity(repositoryClass: DoctrineTaskPriorityRepository::class)] class TaskPriority { #[ORM\Id] diff --git a/src/Entity/TaskRecurrence.php b/src/Module/ProjectManagement/Domain/Entity/TaskRecurrence.php similarity index 94% rename from src/Entity/TaskRecurrence.php rename to src/Module/ProjectManagement/Domain/Entity/TaskRecurrence.php index a6a6dc5..eb82b3e 100644 --- a/src/Entity/TaskRecurrence.php +++ b/src/Module/ProjectManagement/Domain/Entity/TaskRecurrence.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Entity; +namespace App\Module\ProjectManagement\Domain\Entity; use ApiPlatform\Metadata\ApiResource; use ApiPlatform\Metadata\Delete; @@ -10,8 +10,8 @@ use ApiPlatform\Metadata\Get; use ApiPlatform\Metadata\GetCollection; use ApiPlatform\Metadata\Patch; use ApiPlatform\Metadata\Post; -use App\Enum\RecurrenceType; -use App\Repository\TaskRecurrenceRepository; +use App\Module\ProjectManagement\Domain\Enum\RecurrenceType; +use App\Module\ProjectManagement\Infrastructure\Doctrine\DoctrineTaskRecurrenceRepository; use DateTimeImmutable; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; @@ -29,7 +29,7 @@ use Symfony\Component\Serializer\Attribute\Groups; normalizationContext: ['groups' => ['task_recurrence:read']], denormalizationContext: ['groups' => ['task_recurrence:write']], )] -#[ORM\Entity(repositoryClass: TaskRecurrenceRepository::class)] +#[ORM\Entity(repositoryClass: DoctrineTaskRecurrenceRepository::class)] class TaskRecurrence { #[ORM\Id] diff --git a/src/Entity/TaskStatus.php b/src/Module/ProjectManagement/Domain/Entity/TaskStatus.php similarity index 93% rename from src/Entity/TaskStatus.php rename to src/Module/ProjectManagement/Domain/Entity/TaskStatus.php index 021afdc..301d417 100644 --- a/src/Entity/TaskStatus.php +++ b/src/Module/ProjectManagement/Domain/Entity/TaskStatus.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Entity; +namespace App\Module\ProjectManagement\Domain\Entity; use ApiPlatform\Metadata\ApiResource; use ApiPlatform\Metadata\Delete; @@ -10,8 +10,8 @@ use ApiPlatform\Metadata\Get; use ApiPlatform\Metadata\GetCollection; use ApiPlatform\Metadata\Patch; use ApiPlatform\Metadata\Post; -use App\Enum\StatusCategory; -use App\Repository\TaskStatusRepository; +use App\Module\ProjectManagement\Domain\Enum\StatusCategory; +use App\Module\ProjectManagement\Infrastructure\Doctrine\DoctrineTaskStatusRepository; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Serializer\Attribute\Groups; use Symfony\Component\Validator\Constraints as Assert; @@ -28,7 +28,7 @@ use Symfony\Component\Validator\Constraints as Assert; denormalizationContext: ['groups' => ['task_status:write']], order: ['position' => 'ASC'], )] -#[ORM\Entity(repositoryClass: TaskStatusRepository::class)] +#[ORM\Entity(repositoryClass: DoctrineTaskStatusRepository::class)] class TaskStatus { #[ORM\Id] diff --git a/src/Entity/TaskTag.php b/src/Module/ProjectManagement/Domain/Entity/TaskTag.php similarity index 90% rename from src/Entity/TaskTag.php rename to src/Module/ProjectManagement/Domain/Entity/TaskTag.php index c351e7f..136cc91 100644 --- a/src/Entity/TaskTag.php +++ b/src/Module/ProjectManagement/Domain/Entity/TaskTag.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Entity; +namespace App\Module\ProjectManagement\Domain\Entity; use ApiPlatform\Metadata\ApiResource; use ApiPlatform\Metadata\Delete; @@ -10,7 +10,7 @@ use ApiPlatform\Metadata\Get; use ApiPlatform\Metadata\GetCollection; use ApiPlatform\Metadata\Patch; use ApiPlatform\Metadata\Post; -use App\Repository\TaskTagRepository; +use App\Module\ProjectManagement\Infrastructure\Doctrine\DoctrineTaskTagRepository; use App\Shared\Domain\Contract\TaskTagInterface; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Serializer\Attribute\Groups; @@ -27,7 +27,7 @@ use Symfony\Component\Serializer\Attribute\Groups; denormalizationContext: ['groups' => ['task_tag:write']], order: ['label' => 'ASC'], )] -#[ORM\Entity(repositoryClass: TaskTagRepository::class)] +#[ORM\Entity(repositoryClass: DoctrineTaskTagRepository::class)] #[ORM\Table(name: 'task_type')] class TaskTag implements TaskTagInterface { diff --git a/src/Entity/Workflow.php b/src/Module/ProjectManagement/Domain/Entity/Workflow.php similarity index 92% rename from src/Entity/Workflow.php rename to src/Module/ProjectManagement/Domain/Entity/Workflow.php index 1b3ffff..1afa1a3 100644 --- a/src/Entity/Workflow.php +++ b/src/Module/ProjectManagement/Domain/Entity/Workflow.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Entity; +namespace App\Module\ProjectManagement\Domain\Entity; use ApiPlatform\Metadata\ApiResource; use ApiPlatform\Metadata\Delete; @@ -10,8 +10,8 @@ use ApiPlatform\Metadata\Get; use ApiPlatform\Metadata\GetCollection; use ApiPlatform\Metadata\Patch; use ApiPlatform\Metadata\Post; -use App\Repository\WorkflowRepository; -use App\State\WorkflowDeleteProcessor; +use App\Module\ProjectManagement\Infrastructure\ApiPlatform\State\WorkflowDeleteProcessor; +use App\Module\ProjectManagement\Infrastructure\Doctrine\DoctrineWorkflowRepository; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; @@ -31,7 +31,7 @@ use Symfony\Component\Validator\Constraints as Assert; denormalizationContext: ['groups' => ['workflow:write']], order: ['position' => 'ASC'], )] -#[ORM\Entity(repositoryClass: WorkflowRepository::class)] +#[ORM\Entity(repositoryClass: DoctrineWorkflowRepository::class)] #[UniqueEntity(fields: ['name'], message: 'Ce nom de workflow est déjà utilisé.')] class Workflow { diff --git a/src/Enum/RecurrenceType.php b/src/Module/ProjectManagement/Domain/Enum/RecurrenceType.php similarity index 77% rename from src/Enum/RecurrenceType.php rename to src/Module/ProjectManagement/Domain/Enum/RecurrenceType.php index 0df9a70..8db59b3 100644 --- a/src/Enum/RecurrenceType.php +++ b/src/Module/ProjectManagement/Domain/Enum/RecurrenceType.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Enum; +namespace App\Module\ProjectManagement\Domain\Enum; enum RecurrenceType: string { diff --git a/src/Enum/StatusCategory.php b/src/Module/ProjectManagement/Domain/Enum/StatusCategory.php similarity index 81% rename from src/Enum/StatusCategory.php rename to src/Module/ProjectManagement/Domain/Enum/StatusCategory.php index c9eaef5..70114d1 100644 --- a/src/Enum/StatusCategory.php +++ b/src/Module/ProjectManagement/Domain/Enum/StatusCategory.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Enum; +namespace App\Module\ProjectManagement\Domain\Enum; enum StatusCategory: string { diff --git a/src/Module/ProjectManagement/Domain/Repository/ProjectRepositoryInterface.php b/src/Module/ProjectManagement/Domain/Repository/ProjectRepositoryInterface.php new file mode 100644 index 0000000..e057b50 --- /dev/null +++ b/src/Module/ProjectManagement/Domain/Repository/ProjectRepositoryInterface.php @@ -0,0 +1,20 @@ + $criteria + * @param null|array $orderBy + * + * @return Project[] + */ + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array; +} diff --git a/src/Module/ProjectManagement/Domain/Repository/TaskEffortRepositoryInterface.php b/src/Module/ProjectManagement/Domain/Repository/TaskEffortRepositoryInterface.php new file mode 100644 index 0000000..c3bac00 --- /dev/null +++ b/src/Module/ProjectManagement/Domain/Repository/TaskEffortRepositoryInterface.php @@ -0,0 +1,20 @@ + $criteria + * @param null|array $orderBy + * + * @return TaskEffort[] + */ + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array; +} diff --git a/src/Module/ProjectManagement/Domain/Repository/TaskGroupRepositoryInterface.php b/src/Module/ProjectManagement/Domain/Repository/TaskGroupRepositoryInterface.php new file mode 100644 index 0000000..9226827 --- /dev/null +++ b/src/Module/ProjectManagement/Domain/Repository/TaskGroupRepositoryInterface.php @@ -0,0 +1,20 @@ + $criteria + * @param null|array $orderBy + * + * @return TaskGroup[] + */ + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array; +} diff --git a/src/Module/ProjectManagement/Domain/Repository/TaskPriorityRepositoryInterface.php b/src/Module/ProjectManagement/Domain/Repository/TaskPriorityRepositoryInterface.php new file mode 100644 index 0000000..645462b --- /dev/null +++ b/src/Module/ProjectManagement/Domain/Repository/TaskPriorityRepositoryInterface.php @@ -0,0 +1,20 @@ + $criteria + * @param null|array $orderBy + * + * @return TaskPriority[] + */ + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array; +} diff --git a/src/Module/ProjectManagement/Domain/Repository/TaskRecurrenceRepositoryInterface.php b/src/Module/ProjectManagement/Domain/Repository/TaskRecurrenceRepositoryInterface.php new file mode 100644 index 0000000..76b2f81 --- /dev/null +++ b/src/Module/ProjectManagement/Domain/Repository/TaskRecurrenceRepositoryInterface.php @@ -0,0 +1,12 @@ + $criteria + * @param null|array $orderBy + * + * @return TaskStatus[] + */ + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array; + + public function findFirstNonFinal(): ?TaskStatus; +} diff --git a/src/Module/ProjectManagement/Domain/Repository/TaskTagRepositoryInterface.php b/src/Module/ProjectManagement/Domain/Repository/TaskTagRepositoryInterface.php new file mode 100644 index 0000000..8ead853 --- /dev/null +++ b/src/Module/ProjectManagement/Domain/Repository/TaskTagRepositoryInterface.php @@ -0,0 +1,20 @@ + $criteria + * @param null|array $orderBy + * + * @return TaskTag[] + */ + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array; +} diff --git a/src/Module/ProjectManagement/Domain/Repository/WorkflowRepositoryInterface.php b/src/Module/ProjectManagement/Domain/Repository/WorkflowRepositoryInterface.php new file mode 100644 index 0000000..6da80d3 --- /dev/null +++ b/src/Module/ProjectManagement/Domain/Repository/WorkflowRepositoryInterface.php @@ -0,0 +1,22 @@ + $criteria + * @param null|array $orderBy + * + * @return Workflow[] + */ + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array; + + public function findDefault(): ?Workflow; +} diff --git a/src/ApiResource/SwitchWorkflowOutput.php b/src/Module/ProjectManagement/Infrastructure/ApiPlatform/Resource/SwitchWorkflowOutput.php similarity index 88% rename from src/ApiResource/SwitchWorkflowOutput.php rename to src/Module/ProjectManagement/Infrastructure/ApiPlatform/Resource/SwitchWorkflowOutput.php index ddc3133..7594f8b 100644 --- a/src/ApiResource/SwitchWorkflowOutput.php +++ b/src/Module/ProjectManagement/Infrastructure/ApiPlatform/Resource/SwitchWorkflowOutput.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\ApiResource; +namespace App\Module\ProjectManagement\Infrastructure\ApiPlatform\Resource; use Symfony\Component\Serializer\Attribute\Groups; diff --git a/src/State/RecurrenceHandler.php b/src/Module/ProjectManagement/Infrastructure/ApiPlatform/State/RecurrenceHandler.php similarity index 85% rename from src/State/RecurrenceHandler.php rename to src/Module/ProjectManagement/Infrastructure/ApiPlatform/State/RecurrenceHandler.php index 2e587bd..82ad1d6 100644 --- a/src/State/RecurrenceHandler.php +++ b/src/Module/ProjectManagement/Infrastructure/ApiPlatform/State/RecurrenceHandler.php @@ -2,21 +2,21 @@ declare(strict_types=1); -namespace App\State; +namespace App\Module\ProjectManagement\Infrastructure\ApiPlatform\State; -use App\Entity\Task; -use App\Repository\TaskRepository; -use App\Repository\TaskStatusRepository; -use App\Service\CalDavService; -use App\Service\RecurrenceCalculator; +use App\Module\ProjectManagement\Domain\Entity\Task; +use App\Module\ProjectManagement\Domain\Repository\TaskRepositoryInterface; +use App\Module\ProjectManagement\Domain\Repository\TaskStatusRepositoryInterface; +use App\Module\ProjectManagement\Infrastructure\Service\CalDavService; +use App\Module\ProjectManagement\Infrastructure\Service\RecurrenceCalculator; use Doctrine\ORM\EntityManagerInterface; final readonly class RecurrenceHandler { public function __construct( private RecurrenceCalculator $calculator, - private TaskRepository $taskRepository, - private TaskStatusRepository $statusRepository, + private TaskRepositoryInterface $taskRepository, + private TaskStatusRepositoryInterface $statusRepository, private CalDavService $calDavService, private EntityManagerInterface $entityManager, ) {} diff --git a/src/State/SwitchProjectWorkflowProcessor.php b/src/Module/ProjectManagement/Infrastructure/ApiPlatform/State/SwitchProjectWorkflowProcessor.php similarity index 92% rename from src/State/SwitchProjectWorkflowProcessor.php rename to src/Module/ProjectManagement/Infrastructure/ApiPlatform/State/SwitchProjectWorkflowProcessor.php index c5822ae..822f085 100644 --- a/src/State/SwitchProjectWorkflowProcessor.php +++ b/src/Module/ProjectManagement/Infrastructure/ApiPlatform/State/SwitchProjectWorkflowProcessor.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace App\State; +namespace App\Module\ProjectManagement\Infrastructure\ApiPlatform\State; use ApiPlatform\Metadata\Operation; use ApiPlatform\State\ProcessorInterface; -use App\ApiResource\SwitchWorkflowOutput; -use App\Entity\Project; -use App\Entity\TaskStatus; -use App\Entity\Workflow; +use App\Module\ProjectManagement\Domain\Entity\Project; +use App\Module\ProjectManagement\Domain\Entity\TaskStatus; +use App\Module\ProjectManagement\Domain\Entity\Workflow; +use App\Module\ProjectManagement\Infrastructure\ApiPlatform\Resource\SwitchWorkflowOutput; use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; diff --git a/src/State/TaskCalendarProcessor.php b/src/Module/ProjectManagement/Infrastructure/ApiPlatform/State/TaskCalendarProcessor.php similarity index 91% rename from src/State/TaskCalendarProcessor.php rename to src/Module/ProjectManagement/Infrastructure/ApiPlatform/State/TaskCalendarProcessor.php index 5e3013e..cb130f1 100644 --- a/src/State/TaskCalendarProcessor.php +++ b/src/Module/ProjectManagement/Infrastructure/ApiPlatform/State/TaskCalendarProcessor.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace App\State; +namespace App\Module\ProjectManagement\Infrastructure\ApiPlatform\State; use ApiPlatform\Metadata\Delete; use ApiPlatform\Metadata\Operation; use ApiPlatform\State\ProcessorInterface; -use App\Entity\Task; -use App\Entity\TaskStatus; -use App\Service\CalDavService; +use App\Module\ProjectManagement\Domain\Entity\Task; +use App\Module\ProjectManagement\Domain\Entity\TaskStatus; +use App\Module\ProjectManagement\Infrastructure\Service\CalDavService; use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\DependencyInjection\Attribute\Autowire; diff --git a/src/State/TaskDocumentProcessor.php b/src/Module/ProjectManagement/Infrastructure/ApiPlatform/State/TaskDocumentProcessor.php similarity index 98% rename from src/State/TaskDocumentProcessor.php rename to src/Module/ProjectManagement/Infrastructure/ApiPlatform/State/TaskDocumentProcessor.php index 51c6750..47adceb 100644 --- a/src/State/TaskDocumentProcessor.php +++ b/src/Module/ProjectManagement/Infrastructure/ApiPlatform/State/TaskDocumentProcessor.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace App\State; +namespace App\Module\ProjectManagement\Infrastructure\ApiPlatform\State; use ApiPlatform\Metadata\Operation; use ApiPlatform\State\ProcessorInterface; -use App\Entity\Task; -use App\Entity\TaskDocument; +use App\Module\ProjectManagement\Domain\Entity\Task; +use App\Module\ProjectManagement\Domain\Entity\TaskDocument; use App\Service\Share\Exception\InvalidPathException; use App\Service\Share\Exception\ShareConnectionException; use App\Service\Share\Exception\ShareNotConfiguredException; diff --git a/src/State/TaskDocumentProvider.php b/src/Module/ProjectManagement/Infrastructure/ApiPlatform/State/TaskDocumentProvider.php similarity index 91% rename from src/State/TaskDocumentProvider.php rename to src/Module/ProjectManagement/Infrastructure/ApiPlatform/State/TaskDocumentProvider.php index 62cea2f..4687569 100644 --- a/src/State/TaskDocumentProvider.php +++ b/src/Module/ProjectManagement/Infrastructure/ApiPlatform/State/TaskDocumentProvider.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace App\State; +namespace App\Module\ProjectManagement\Infrastructure\ApiPlatform\State; use ApiPlatform\Metadata\Operation; use ApiPlatform\State\ProviderInterface; -use App\Entity\TaskDocument; +use App\Module\ProjectManagement\Domain\Entity\TaskDocument; use App\Shared\Domain\Contract\UserInterface; use Doctrine\ORM\EntityManagerInterface; use Symfony\Bundle\SecurityBundle\Security; diff --git a/src/State/TaskNumberProcessor.php b/src/Module/ProjectManagement/Infrastructure/ApiPlatform/State/TaskNumberProcessor.php similarity index 82% rename from src/State/TaskNumberProcessor.php rename to src/Module/ProjectManagement/Infrastructure/ApiPlatform/State/TaskNumberProcessor.php index 038a865..e6fdfef 100644 --- a/src/State/TaskNumberProcessor.php +++ b/src/Module/ProjectManagement/Infrastructure/ApiPlatform/State/TaskNumberProcessor.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace App\State; +namespace App\Module\ProjectManagement\Infrastructure\ApiPlatform\State; use ApiPlatform\Metadata\Operation; use ApiPlatform\Metadata\Post; use ApiPlatform\State\ProcessorInterface; -use App\Entity\Task; -use App\Repository\TaskRepository; -use App\Service\CalDavService; +use App\Module\ProjectManagement\Domain\Entity\Task; +use App\Module\ProjectManagement\Domain\Repository\TaskRepositoryInterface; +use App\Module\ProjectManagement\Infrastructure\Service\CalDavService; use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\DependencyInjection\Attribute\Autowire; @@ -24,7 +24,7 @@ final readonly class TaskNumberProcessor implements ProcessorInterface public function __construct( #[Autowire(service: 'api_platform.doctrine.orm.state.persist_processor')] private ProcessorInterface $persistProcessor, - private TaskRepository $taskRepository, + private TaskRepositoryInterface $taskRepository, private EntityManagerInterface $entityManager, private CalDavService $calDavService, ) {} diff --git a/src/State/WorkflowDeleteProcessor.php b/src/Module/ProjectManagement/Infrastructure/ApiPlatform/State/WorkflowDeleteProcessor.php similarity index 89% rename from src/State/WorkflowDeleteProcessor.php rename to src/Module/ProjectManagement/Infrastructure/ApiPlatform/State/WorkflowDeleteProcessor.php index a0efec9..8e30b88 100644 --- a/src/State/WorkflowDeleteProcessor.php +++ b/src/Module/ProjectManagement/Infrastructure/ApiPlatform/State/WorkflowDeleteProcessor.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace App\State; +namespace App\Module\ProjectManagement\Infrastructure\ApiPlatform\State; use ApiPlatform\Metadata\Operation; use ApiPlatform\State\ProcessorInterface; -use App\Entity\Workflow; +use App\Module\ProjectManagement\Domain\Entity\Workflow; use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\HttpKernel\Exception\HttpException; diff --git a/src/Controller/TaskDocumentDownloadController.php b/src/Module/ProjectManagement/Infrastructure/Controller/TaskDocumentDownloadController.php similarity index 96% rename from src/Controller/TaskDocumentDownloadController.php rename to src/Module/ProjectManagement/Infrastructure/Controller/TaskDocumentDownloadController.php index ce05ede..6c93a7f 100644 --- a/src/Controller/TaskDocumentDownloadController.php +++ b/src/Module/ProjectManagement/Infrastructure/Controller/TaskDocumentDownloadController.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Controller; +namespace App\Module\ProjectManagement\Infrastructure\Controller; -use App\Entity\TaskDocument; +use App\Module\ProjectManagement\Domain\Entity\TaskDocument; use App\Service\Share\Exception\ShareConnectionException; use App\Service\Share\Exception\ShareNotConfiguredException; use App\Service\Share\FileSource; diff --git a/src/Module/ProjectManagement/Infrastructure/Doctrine/DoctrineProjectRepository.php b/src/Module/ProjectManagement/Infrastructure/Doctrine/DoctrineProjectRepository.php new file mode 100644 index 0000000..1a1719f --- /dev/null +++ b/src/Module/ProjectManagement/Infrastructure/Doctrine/DoctrineProjectRepository.php @@ -0,0 +1,26 @@ + + */ +class DoctrineProjectRepository extends ServiceEntityRepository implements ProjectRepositoryInterface +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, Project::class); + } + + public function findById(int $id): ?Project + { + return $this->find($id); + } +} diff --git a/src/Module/ProjectManagement/Infrastructure/Doctrine/DoctrineTaskEffortRepository.php b/src/Module/ProjectManagement/Infrastructure/Doctrine/DoctrineTaskEffortRepository.php new file mode 100644 index 0000000..d343363 --- /dev/null +++ b/src/Module/ProjectManagement/Infrastructure/Doctrine/DoctrineTaskEffortRepository.php @@ -0,0 +1,26 @@ + + */ +class DoctrineTaskEffortRepository extends ServiceEntityRepository implements TaskEffortRepositoryInterface +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, TaskEffort::class); + } + + public function findById(int $id): ?TaskEffort + { + return $this->find($id); + } +} diff --git a/src/Module/ProjectManagement/Infrastructure/Doctrine/DoctrineTaskGroupRepository.php b/src/Module/ProjectManagement/Infrastructure/Doctrine/DoctrineTaskGroupRepository.php new file mode 100644 index 0000000..4fd5100 --- /dev/null +++ b/src/Module/ProjectManagement/Infrastructure/Doctrine/DoctrineTaskGroupRepository.php @@ -0,0 +1,26 @@ + + */ +class DoctrineTaskGroupRepository extends ServiceEntityRepository implements TaskGroupRepositoryInterface +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, TaskGroup::class); + } + + public function findById(int $id): ?TaskGroup + { + return $this->find($id); + } +} diff --git a/src/Module/ProjectManagement/Infrastructure/Doctrine/DoctrineTaskPriorityRepository.php b/src/Module/ProjectManagement/Infrastructure/Doctrine/DoctrineTaskPriorityRepository.php new file mode 100644 index 0000000..749e020 --- /dev/null +++ b/src/Module/ProjectManagement/Infrastructure/Doctrine/DoctrineTaskPriorityRepository.php @@ -0,0 +1,26 @@ + + */ +class DoctrineTaskPriorityRepository extends ServiceEntityRepository implements TaskPriorityRepositoryInterface +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, TaskPriority::class); + } + + public function findById(int $id): ?TaskPriority + { + return $this->find($id); + } +} diff --git a/src/Module/ProjectManagement/Infrastructure/Doctrine/DoctrineTaskRecurrenceRepository.php b/src/Module/ProjectManagement/Infrastructure/Doctrine/DoctrineTaskRecurrenceRepository.php new file mode 100644 index 0000000..838ae46 --- /dev/null +++ b/src/Module/ProjectManagement/Infrastructure/Doctrine/DoctrineTaskRecurrenceRepository.php @@ -0,0 +1,26 @@ + + */ +class DoctrineTaskRecurrenceRepository extends ServiceEntityRepository implements TaskRecurrenceRepositoryInterface +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, TaskRecurrence::class); + } + + public function findById(int $id): ?TaskRecurrence + { + return $this->find($id); + } +} diff --git a/src/Repository/TaskRepository.php b/src/Module/ProjectManagement/Infrastructure/Doctrine/DoctrineTaskRepository.php similarity index 72% rename from src/Repository/TaskRepository.php rename to src/Module/ProjectManagement/Infrastructure/Doctrine/DoctrineTaskRepository.php index 5922bcc..3e5a94f 100644 --- a/src/Repository/TaskRepository.php +++ b/src/Module/ProjectManagement/Infrastructure/Doctrine/DoctrineTaskRepository.php @@ -2,23 +2,29 @@ declare(strict_types=1); -namespace App\Repository; +namespace App\Module\ProjectManagement\Infrastructure\Doctrine; -use App\Entity\Project; -use App\Entity\Task; +use App\Module\ProjectManagement\Domain\Entity\Project; +use App\Module\ProjectManagement\Domain\Entity\Task; +use App\Module\ProjectManagement\Domain\Repository\TaskRepositoryInterface; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Persistence\ManagerRegistry; /** * @extends ServiceEntityRepository */ -class TaskRepository extends ServiceEntityRepository +class DoctrineTaskRepository extends ServiceEntityRepository implements TaskRepositoryInterface { public function __construct(ManagerRegistry $registry) { parent::__construct($registry, Task::class); } + public function findById(int $id): ?Task + { + return $this->find($id); + } + /** * Returns the max task number for a project, using an advisory lock * to prevent race conditions when creating tasks concurrently. diff --git a/src/Repository/TaskStatusRepository.php b/src/Module/ProjectManagement/Infrastructure/Doctrine/DoctrineTaskStatusRepository.php similarity index 57% rename from src/Repository/TaskStatusRepository.php rename to src/Module/ProjectManagement/Infrastructure/Doctrine/DoctrineTaskStatusRepository.php index fdc80b5..0142acf 100644 --- a/src/Repository/TaskStatusRepository.php +++ b/src/Module/ProjectManagement/Infrastructure/Doctrine/DoctrineTaskStatusRepository.php @@ -2,19 +2,28 @@ declare(strict_types=1); -namespace App\Repository; +namespace App\Module\ProjectManagement\Infrastructure\Doctrine; -use App\Entity\TaskStatus; +use App\Module\ProjectManagement\Domain\Entity\TaskStatus; +use App\Module\ProjectManagement\Domain\Repository\TaskStatusRepositoryInterface; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Persistence\ManagerRegistry; -class TaskStatusRepository extends ServiceEntityRepository +/** + * @extends ServiceEntityRepository + */ +class DoctrineTaskStatusRepository extends ServiceEntityRepository implements TaskStatusRepositoryInterface { public function __construct(ManagerRegistry $registry) { parent::__construct($registry, TaskStatus::class); } + public function findById(int $id): ?TaskStatus + { + return $this->find($id); + } + public function findFirstNonFinal(): ?TaskStatus { return $this->createQueryBuilder('s') diff --git a/src/Module/ProjectManagement/Infrastructure/Doctrine/DoctrineTaskTagRepository.php b/src/Module/ProjectManagement/Infrastructure/Doctrine/DoctrineTaskTagRepository.php new file mode 100644 index 0000000..2c19038 --- /dev/null +++ b/src/Module/ProjectManagement/Infrastructure/Doctrine/DoctrineTaskTagRepository.php @@ -0,0 +1,26 @@ + + */ +class DoctrineTaskTagRepository extends ServiceEntityRepository implements TaskTagRepositoryInterface +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, TaskTag::class); + } + + public function findById(int $id): ?TaskTag + { + return $this->find($id); + } +} diff --git a/src/Repository/WorkflowRepository.php b/src/Module/ProjectManagement/Infrastructure/Doctrine/DoctrineWorkflowRepository.php similarity index 52% rename from src/Repository/WorkflowRepository.php rename to src/Module/ProjectManagement/Infrastructure/Doctrine/DoctrineWorkflowRepository.php index fafd288..b635402 100644 --- a/src/Repository/WorkflowRepository.php +++ b/src/Module/ProjectManagement/Infrastructure/Doctrine/DoctrineWorkflowRepository.php @@ -2,22 +2,28 @@ declare(strict_types=1); -namespace App\Repository; +namespace App\Module\ProjectManagement\Infrastructure\Doctrine; -use App\Entity\Workflow; +use App\Module\ProjectManagement\Domain\Entity\Workflow; +use App\Module\ProjectManagement\Domain\Repository\WorkflowRepositoryInterface; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Persistence\ManagerRegistry; /** * @extends ServiceEntityRepository */ -class WorkflowRepository extends ServiceEntityRepository +class DoctrineWorkflowRepository extends ServiceEntityRepository implements WorkflowRepositoryInterface { public function __construct(ManagerRegistry $registry) { parent::__construct($registry, Workflow::class); } + public function findById(int $id): ?Workflow + { + return $this->find($id); + } + public function findDefault(): ?Workflow { return $this->findOneBy(['isDefault' => true]); diff --git a/src/EventListener/TaskDocumentListener.php b/src/Module/ProjectManagement/Infrastructure/EventListener/TaskDocumentListener.php similarity index 87% rename from src/EventListener/TaskDocumentListener.php rename to src/Module/ProjectManagement/Infrastructure/EventListener/TaskDocumentListener.php index 3e762d2..414a9a9 100644 --- a/src/EventListener/TaskDocumentListener.php +++ b/src/Module/ProjectManagement/Infrastructure/EventListener/TaskDocumentListener.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\EventListener; +namespace App\Module\ProjectManagement\Infrastructure\EventListener; -use App\Entity\TaskDocument; +use App\Module\ProjectManagement\Domain\Entity\TaskDocument; use Doctrine\ORM\Event\PreRemoveEventArgs; use Psr\Log\LoggerInterface; diff --git a/src/EventListener/TaskNotificationListener.php b/src/Module/ProjectManagement/Infrastructure/EventListener/TaskNotificationListener.php similarity index 96% rename from src/EventListener/TaskNotificationListener.php rename to src/Module/ProjectManagement/Infrastructure/EventListener/TaskNotificationListener.php index e34b84d..07539d5 100644 --- a/src/EventListener/TaskNotificationListener.php +++ b/src/Module/ProjectManagement/Infrastructure/EventListener/TaskNotificationListener.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\EventListener; +namespace App\Module\ProjectManagement\Infrastructure\EventListener; -use App\Entity\Task; +use App\Module\ProjectManagement\Domain\Entity\Task; use App\Shared\Domain\Contract\NotifierInterface; use App\Shared\Domain\Contract\UserInterface; use Doctrine\Bundle\DoctrineBundle\Attribute\AsDoctrineListener; diff --git a/src/EventListener/UniqueDefaultWorkflowListener.php b/src/Module/ProjectManagement/Infrastructure/EventListener/UniqueDefaultWorkflowListener.php similarity index 91% rename from src/EventListener/UniqueDefaultWorkflowListener.php rename to src/Module/ProjectManagement/Infrastructure/EventListener/UniqueDefaultWorkflowListener.php index 15b61c4..7db1599 100644 --- a/src/EventListener/UniqueDefaultWorkflowListener.php +++ b/src/Module/ProjectManagement/Infrastructure/EventListener/UniqueDefaultWorkflowListener.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\EventListener; +namespace App\Module\ProjectManagement\Infrastructure\EventListener; -use App\Entity\Workflow; +use App\Module\ProjectManagement\Domain\Entity\Workflow; use Doctrine\Bundle\DoctrineBundle\Attribute\AsDoctrineListener; use Doctrine\ORM\Event\OnFlushEventArgs; use Doctrine\ORM\Events; diff --git a/src/Mcp/Tool/Project/CreateProjectTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Project/CreateProjectTool.php similarity index 93% rename from src/Mcp/Tool/Project/CreateProjectTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Project/CreateProjectTool.php index b901ab1..ff212e6 100644 --- a/src/Mcp/Tool/Project/CreateProjectTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Project/CreateProjectTool.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace App\Mcp\Tool\Project; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\Project; -use App\Entity\Project; use App\Mcp\Tool\Serializer; +use App\Module\ProjectManagement\Domain\Entity\Project; use App\Repository\ClientRepository; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; diff --git a/src/Mcp/Tool/Project/DeleteProjectTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Project/DeleteProjectTool.php similarity index 80% rename from src/Mcp/Tool/Project/DeleteProjectTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Project/DeleteProjectTool.php index ed0f488..8cef311 100644 --- a/src/Mcp/Tool/Project/DeleteProjectTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Project/DeleteProjectTool.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Mcp\Tool\Project; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\Project; -use App\Repository\ProjectRepository; +use App\Module\ProjectManagement\Domain\Repository\ProjectRepositoryInterface; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; use Mcp\Capability\Attribute\McpTool; @@ -17,7 +17,7 @@ use function sprintf; class DeleteProjectTool { public function __construct( - private readonly ProjectRepository $projectRepository, + private readonly ProjectRepositoryInterface $projectRepository, private readonly EntityManagerInterface $entityManager, private readonly Security $security, ) {} @@ -28,7 +28,7 @@ class DeleteProjectTool throw new AccessDeniedException('Access denied: ROLE_ADMIN required.'); } - $project = $this->projectRepository->find($id); + $project = $this->projectRepository->findById($id); if (null === $project) { throw new InvalidArgumentException(sprintf('Project with ID %d not found.', $id)); } diff --git a/src/Mcp/Tool/Project/GetProjectTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Project/GetProjectTool.php similarity index 79% rename from src/Mcp/Tool/Project/GetProjectTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Project/GetProjectTool.php index 8674fd4..96b3652 100644 --- a/src/Mcp/Tool/Project/GetProjectTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Project/GetProjectTool.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace App\Mcp\Tool\Project; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\Project; use App\Mcp\Tool\Serializer; -use App\Repository\ProjectRepository; -use App\Repository\TaskRepository; +use App\Module\ProjectManagement\Domain\Repository\ProjectRepositoryInterface; +use App\Module\ProjectManagement\Domain\Repository\TaskRepositoryInterface; use InvalidArgumentException; use Mcp\Capability\Attribute\McpTool; use Symfony\Bundle\SecurityBundle\Security; @@ -18,8 +18,8 @@ use function sprintf; class GetProjectTool { public function __construct( - private readonly ProjectRepository $projectRepository, - private readonly TaskRepository $taskRepository, + private readonly ProjectRepositoryInterface $projectRepository, + private readonly TaskRepositoryInterface $taskRepository, private readonly Security $security, ) {} @@ -29,7 +29,7 @@ class GetProjectTool throw new AccessDeniedException('Access denied: ROLE_USER required.'); } - $project = $this->projectRepository->find($id); + $project = $this->projectRepository->findById($id); if (null === $project) { throw new InvalidArgumentException(sprintf('Project with ID %d not found.', $id)); diff --git a/src/Mcp/Tool/Project/ListProjectsTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Project/ListProjectsTool.php similarity index 78% rename from src/Mcp/Tool/Project/ListProjectsTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Project/ListProjectsTool.php index 1d3e227..a15c886 100644 --- a/src/Mcp/Tool/Project/ListProjectsTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Project/ListProjectsTool.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace App\Mcp\Tool\Project; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\Project; use App\Mcp\Tool\Serializer; -use App\Repository\ProjectRepository; +use App\Module\ProjectManagement\Domain\Repository\ProjectRepositoryInterface; use Mcp\Capability\Attribute\McpTool; use Symfony\Bundle\SecurityBundle\Security; use Symfony\Component\Security\Core\Exception\AccessDeniedException; @@ -14,7 +14,7 @@ use Symfony\Component\Security\Core\Exception\AccessDeniedException; class ListProjectsTool { public function __construct( - private readonly ProjectRepository $projectRepository, + private readonly ProjectRepositoryInterface $projectRepository, private readonly Security $security, ) {} diff --git a/src/Mcp/Tool/Project/UpdateProjectTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Project/UpdateProjectTool.php similarity index 88% rename from src/Mcp/Tool/Project/UpdateProjectTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Project/UpdateProjectTool.php index d2d9460..4e9275b 100644 --- a/src/Mcp/Tool/Project/UpdateProjectTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Project/UpdateProjectTool.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace App\Mcp\Tool\Project; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\Project; use App\Mcp\Tool\Serializer; +use App\Module\ProjectManagement\Domain\Repository\ProjectRepositoryInterface; use App\Repository\ClientRepository; -use App\Repository\ProjectRepository; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; use Mcp\Capability\Attribute\McpTool; @@ -19,7 +19,7 @@ use function sprintf; class UpdateProjectTool { public function __construct( - private readonly ProjectRepository $projectRepository, + private readonly ProjectRepositoryInterface $projectRepository, private readonly ClientRepository $clientRepository, private readonly EntityManagerInterface $entityManager, private readonly Security $security, @@ -38,7 +38,7 @@ class UpdateProjectTool throw new AccessDeniedException('Access denied: ROLE_USER required.'); } - $project = $this->projectRepository->find($id); + $project = $this->projectRepository->findById($id); if (null === $project) { throw new InvalidArgumentException(sprintf('Project with ID %d not found.', $id)); diff --git a/src/Mcp/Tool/Task/AddTaskDocumentTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/AddTaskDocumentTool.php similarity index 92% rename from src/Mcp/Tool/Task/AddTaskDocumentTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/AddTaskDocumentTool.php index e879d3b..c480396 100644 --- a/src/Mcp/Tool/Task/AddTaskDocumentTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/AddTaskDocumentTool.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace App\Mcp\Tool\Task; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\Task; -use App\Entity\TaskDocument; -use App\Repository\TaskRepository; +use App\Module\ProjectManagement\Domain\Entity\TaskDocument; +use App\Module\ProjectManagement\Domain\Repository\TaskRepositoryInterface; use DateTimeImmutable; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; @@ -33,7 +33,7 @@ class AddTaskDocumentTool public function __construct( private readonly EntityManagerInterface $entityManager, - private readonly TaskRepository $taskRepository, + private readonly TaskRepositoryInterface $taskRepository, private readonly Security $security, private readonly string $uploadDir, ) {} @@ -52,7 +52,7 @@ class AddTaskDocumentTool throw new AccessDeniedException('Access denied: ROLE_USER required.'); } - $task = $this->taskRepository->find($taskId); + $task = $this->taskRepository->findById($taskId); if (null === $task) { throw new InvalidArgumentException(sprintf('Task with ID %d not found.', $taskId)); } diff --git a/src/Mcp/Tool/Task/CreateTaskRecurrenceTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/CreateTaskRecurrenceTool.php similarity index 86% rename from src/Mcp/Tool/Task/CreateTaskRecurrenceTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/CreateTaskRecurrenceTool.php index 499e687..d661606 100644 --- a/src/Mcp/Tool/Task/CreateTaskRecurrenceTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/CreateTaskRecurrenceTool.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace App\Mcp\Tool\Task; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\Task; -use App\Entity\TaskRecurrence; -use App\Enum\RecurrenceType; -use App\Repository\TaskRepository; -use App\Service\CalDavService; +use App\Module\ProjectManagement\Domain\Entity\TaskRecurrence; +use App\Module\ProjectManagement\Domain\Enum\RecurrenceType; +use App\Module\ProjectManagement\Domain\Repository\TaskRepositoryInterface; +use App\Module\ProjectManagement\Infrastructure\Service\CalDavService; use DateTimeImmutable; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; @@ -22,7 +22,7 @@ class CreateTaskRecurrenceTool { public function __construct( private readonly EntityManagerInterface $entityManager, - private readonly TaskRepository $taskRepository, + private readonly TaskRepositoryInterface $taskRepository, private readonly Security $security, private readonly CalDavService $calDavService, ) {} @@ -41,7 +41,7 @@ class CreateTaskRecurrenceTool throw new AccessDeniedException('Access denied: ROLE_USER required.'); } - $task = $this->taskRepository->find($taskId); + $task = $this->taskRepository->findById($taskId); if (null === $task) { throw new InvalidArgumentException(sprintf('Task with ID %d not found.', $taskId)); } diff --git a/src/Mcp/Tool/Task/CreateTaskTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/CreateTaskTool.php similarity index 79% rename from src/Mcp/Tool/Task/CreateTaskTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/CreateTaskTool.php index 9067417..7cd3fbd 100644 --- a/src/Mcp/Tool/Task/CreateTaskTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/CreateTaskTool.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace App\Mcp\Tool\Task; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\Task; -use App\Entity\Task; use App\Mcp\Tool\Serializer; use App\Module\Core\Infrastructure\Doctrine\DoctrineUserRepository; -use App\Repository\ProjectRepository; -use App\Repository\TaskEffortRepository; -use App\Repository\TaskGroupRepository; -use App\Repository\TaskPriorityRepository; -use App\Repository\TaskRepository; -use App\Repository\TaskStatusRepository; -use App\Repository\TaskTagRepository; -use App\Service\CalDavService; +use App\Module\ProjectManagement\Domain\Entity\Task; +use App\Module\ProjectManagement\Domain\Repository\ProjectRepositoryInterface; +use App\Module\ProjectManagement\Domain\Repository\TaskEffortRepositoryInterface; +use App\Module\ProjectManagement\Domain\Repository\TaskGroupRepositoryInterface; +use App\Module\ProjectManagement\Domain\Repository\TaskPriorityRepositoryInterface; +use App\Module\ProjectManagement\Domain\Repository\TaskRepositoryInterface; +use App\Module\ProjectManagement\Domain\Repository\TaskStatusRepositoryInterface; +use App\Module\ProjectManagement\Domain\Repository\TaskTagRepositoryInterface; +use App\Module\ProjectManagement\Infrastructure\Service\CalDavService; use DateTimeImmutable; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; @@ -29,13 +29,13 @@ class CreateTaskTool { public function __construct( private readonly EntityManagerInterface $entityManager, - private readonly ProjectRepository $projectRepository, - private readonly TaskRepository $taskRepository, - private readonly TaskStatusRepository $taskStatusRepository, - private readonly TaskPriorityRepository $taskPriorityRepository, - private readonly TaskEffortRepository $taskEffortRepository, - private readonly TaskGroupRepository $taskGroupRepository, - private readonly TaskTagRepository $taskTagRepository, + private readonly ProjectRepositoryInterface $projectRepository, + private readonly TaskRepositoryInterface $taskRepository, + private readonly TaskStatusRepositoryInterface $taskStatusRepository, + private readonly TaskPriorityRepositoryInterface $taskPriorityRepository, + private readonly TaskEffortRepositoryInterface $taskEffortRepository, + private readonly TaskGroupRepositoryInterface $taskGroupRepository, + private readonly TaskTagRepositoryInterface $taskTagRepository, private readonly DoctrineUserRepository $userRepository, private readonly Security $security, private readonly CalDavService $calDavService, @@ -65,7 +65,7 @@ class CreateTaskTool throw new AccessDeniedException('Access denied: ROLE_USER required.'); } - $project = $this->projectRepository->find($projectId); + $project = $this->projectRepository->findById($projectId); if (null === $project) { throw new InvalidArgumentException(sprintf('Project with ID %d not found.', $projectId)); } @@ -78,21 +78,21 @@ class CreateTaskTool $task->setDescription($description); } if (null !== $statusId) { - $status = $this->taskStatusRepository->find($statusId); + $status = $this->taskStatusRepository->findById($statusId); if (null === $status) { throw new InvalidArgumentException(sprintf('TaskStatus with ID %d not found.', $statusId)); } $task->setStatus($status); } if (null !== $priorityId) { - $priority = $this->taskPriorityRepository->find($priorityId); + $priority = $this->taskPriorityRepository->findById($priorityId); if (null === $priority) { throw new InvalidArgumentException(sprintf('TaskPriority with ID %d not found.', $priorityId)); } $task->setPriority($priority); } if (null !== $effortId) { - $effort = $this->taskEffortRepository->find($effortId); + $effort = $this->taskEffortRepository->findById($effortId); if (null === $effort) { throw new InvalidArgumentException(sprintf('TaskEffort with ID %d not found.', $effortId)); } @@ -106,7 +106,7 @@ class CreateTaskTool $task->setAssignee($assignee); } if (null !== $groupId) { - $group = $this->taskGroupRepository->find($groupId); + $group = $this->taskGroupRepository->findById($groupId); if (null === $group) { throw new InvalidArgumentException(sprintf('TaskGroup with ID %d not found.', $groupId)); } @@ -114,7 +114,7 @@ class CreateTaskTool } if (null !== $tagIds) { foreach ($tagIds as $tagId) { - $tag = $this->taskTagRepository->find($tagId); + $tag = $this->taskTagRepository->findById($tagId); if (null === $tag) { throw new InvalidArgumentException(sprintf('TaskTag with ID %d not found.', $tagId)); } diff --git a/src/Mcp/Tool/Task/DeleteTaskDocumentTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/DeleteTaskDocumentTool.php similarity index 92% rename from src/Mcp/Tool/Task/DeleteTaskDocumentTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/DeleteTaskDocumentTool.php index 99ffa12..25ed3d7 100644 --- a/src/Mcp/Tool/Task/DeleteTaskDocumentTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/DeleteTaskDocumentTool.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Mcp\Tool\Task; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\Task; -use App\Entity\TaskDocument; +use App\Module\ProjectManagement\Domain\Entity\TaskDocument; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; use Mcp\Capability\Attribute\McpTool; diff --git a/src/Mcp/Tool/Task/DeleteTaskRecurrenceTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/DeleteTaskRecurrenceTool.php similarity index 82% rename from src/Mcp/Tool/Task/DeleteTaskRecurrenceTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/DeleteTaskRecurrenceTool.php index 4039fff..8a0399a 100644 --- a/src/Mcp/Tool/Task/DeleteTaskRecurrenceTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/DeleteTaskRecurrenceTool.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace App\Mcp\Tool\Task; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\Task; -use App\Repository\TaskRecurrenceRepository; -use App\Service\CalDavService; +use App\Module\ProjectManagement\Domain\Repository\TaskRecurrenceRepositoryInterface; +use App\Module\ProjectManagement\Infrastructure\Service\CalDavService; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; use Mcp\Capability\Attribute\McpTool; @@ -19,7 +19,7 @@ class DeleteTaskRecurrenceTool { public function __construct( private readonly EntityManagerInterface $entityManager, - private readonly TaskRecurrenceRepository $taskRecurrenceRepository, + private readonly TaskRecurrenceRepositoryInterface $taskRecurrenceRepository, private readonly Security $security, private readonly CalDavService $calDavService, ) {} @@ -30,7 +30,7 @@ class DeleteTaskRecurrenceTool throw new AccessDeniedException('Access denied: ROLE_USER required.'); } - $recurrence = $this->taskRecurrenceRepository->find($recurrenceId); + $recurrence = $this->taskRecurrenceRepository->findById($recurrenceId); if (null === $recurrence) { throw new InvalidArgumentException(sprintf('TaskRecurrence with ID %d not found.', $recurrenceId)); } diff --git a/src/Mcp/Tool/Task/DeleteTaskTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/DeleteTaskTool.php similarity index 82% rename from src/Mcp/Tool/Task/DeleteTaskTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/DeleteTaskTool.php index fa006a3..bbf0a04 100644 --- a/src/Mcp/Tool/Task/DeleteTaskTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/DeleteTaskTool.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace App\Mcp\Tool\Task; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\Task; -use App\Repository\TaskRepository; -use App\Service\CalDavService; +use App\Module\ProjectManagement\Domain\Repository\TaskRepositoryInterface; +use App\Module\ProjectManagement\Infrastructure\Service\CalDavService; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; use Mcp\Capability\Attribute\McpTool; @@ -18,7 +18,7 @@ use function sprintf; class DeleteTaskTool { public function __construct( - private readonly TaskRepository $taskRepository, + private readonly TaskRepositoryInterface $taskRepository, private readonly EntityManagerInterface $entityManager, private readonly Security $security, private readonly CalDavService $calDavService, @@ -30,7 +30,7 @@ class DeleteTaskTool throw new AccessDeniedException('Access denied: ROLE_USER required.'); } - $task = $this->taskRepository->find($id); + $task = $this->taskRepository->findById($id); if (null === $task) { throw new InvalidArgumentException(sprintf('Task with ID %d not found.', $id)); diff --git a/src/Mcp/Tool/Task/GetTaskTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/GetTaskTool.php similarity index 87% rename from src/Mcp/Tool/Task/GetTaskTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/GetTaskTool.php index 94f0bfb..2c88709 100644 --- a/src/Mcp/Tool/Task/GetTaskTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/GetTaskTool.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace App\Mcp\Tool\Task; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\Task; use App\Mcp\Tool\Serializer; -use App\Repository\TaskRepository; +use App\Module\ProjectManagement\Domain\Repository\TaskRepositoryInterface; use InvalidArgumentException; use Mcp\Capability\Attribute\McpTool; use Symfony\Bundle\SecurityBundle\Security; @@ -17,7 +17,7 @@ use function sprintf; class GetTaskTool { public function __construct( - private readonly TaskRepository $taskRepository, + private readonly TaskRepositoryInterface $taskRepository, private readonly Security $security, ) {} @@ -27,7 +27,7 @@ class GetTaskTool throw new AccessDeniedException('Access denied: ROLE_USER required.'); } - $task = $this->taskRepository->find($id); + $task = $this->taskRepository->findById($id); if (null === $task) { throw new InvalidArgumentException(sprintf('Task with ID %d not found.', $id)); diff --git a/src/Mcp/Tool/Task/ListTasksTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/ListTasksTool.php similarity index 94% rename from src/Mcp/Tool/Task/ListTasksTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/ListTasksTool.php index 9722ad0..3d3b3db 100644 --- a/src/Mcp/Tool/Task/ListTasksTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/ListTasksTool.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace App\Mcp\Tool\Task; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\Task; use App\Mcp\Tool\Serializer; -use App\Repository\TaskRepository; +use App\Module\ProjectManagement\Domain\Repository\TaskRepositoryInterface; use Mcp\Capability\Attribute\McpTool; use Symfony\Bundle\SecurityBundle\Security; use Symfony\Component\Security\Core\Exception\AccessDeniedException; @@ -14,7 +14,7 @@ use Symfony\Component\Security\Core\Exception\AccessDeniedException; class ListTasksTool { public function __construct( - private readonly TaskRepository $taskRepository, + private readonly TaskRepositoryInterface $taskRepository, private readonly Security $security, ) {} diff --git a/src/Mcp/Tool/Task/UpdateTaskDocumentTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/UpdateTaskDocumentTool.php similarity index 96% rename from src/Mcp/Tool/Task/UpdateTaskDocumentTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/UpdateTaskDocumentTool.php index 59cc4a4..d80e695 100644 --- a/src/Mcp/Tool/Task/UpdateTaskDocumentTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/UpdateTaskDocumentTool.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Mcp\Tool\Task; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\Task; -use App\Entity\TaskDocument; +use App\Module\ProjectManagement\Domain\Entity\TaskDocument; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; use Mcp\Capability\Attribute\McpTool; diff --git a/src/Mcp/Tool/Task/UpdateTaskRecurrenceTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/UpdateTaskRecurrenceTool.php similarity index 85% rename from src/Mcp/Tool/Task/UpdateTaskRecurrenceTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/UpdateTaskRecurrenceTool.php index ae03b4f..6c2b7c6 100644 --- a/src/Mcp/Tool/Task/UpdateTaskRecurrenceTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/UpdateTaskRecurrenceTool.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace App\Mcp\Tool\Task; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\Task; -use App\Enum\RecurrenceType; -use App\Repository\TaskRecurrenceRepository; -use App\Service\CalDavService; +use App\Module\ProjectManagement\Domain\Enum\RecurrenceType; +use App\Module\ProjectManagement\Domain\Repository\TaskRecurrenceRepositoryInterface; +use App\Module\ProjectManagement\Infrastructure\Service\CalDavService; use DateTimeImmutable; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; @@ -21,7 +21,7 @@ class UpdateTaskRecurrenceTool { public function __construct( private readonly EntityManagerInterface $entityManager, - private readonly TaskRecurrenceRepository $taskRecurrenceRepository, + private readonly TaskRecurrenceRepositoryInterface $taskRecurrenceRepository, private readonly Security $security, private readonly CalDavService $calDavService, ) {} @@ -40,7 +40,7 @@ class UpdateTaskRecurrenceTool throw new AccessDeniedException('Access denied: ROLE_USER required.'); } - $recurrence = $this->taskRecurrenceRepository->find($recurrenceId); + $recurrence = $this->taskRecurrenceRepository->findById($recurrenceId); if (null === $recurrence) { throw new InvalidArgumentException(sprintf('TaskRecurrence with ID %d not found.', $recurrenceId)); } diff --git a/src/Mcp/Tool/Task/UpdateTaskTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/UpdateTaskTool.php similarity index 81% rename from src/Mcp/Tool/Task/UpdateTaskTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/UpdateTaskTool.php index a345f23..10e8b6d 100644 --- a/src/Mcp/Tool/Task/UpdateTaskTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Task/UpdateTaskTool.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace App\Mcp\Tool\Task; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\Task; use App\Mcp\Tool\Serializer; use App\Module\Core\Infrastructure\Doctrine\DoctrineUserRepository; -use App\Repository\TaskEffortRepository; -use App\Repository\TaskGroupRepository; -use App\Repository\TaskPriorityRepository; -use App\Repository\TaskRepository; -use App\Repository\TaskStatusRepository; -use App\Repository\TaskTagRepository; -use App\Service\CalDavService; +use App\Module\ProjectManagement\Domain\Repository\TaskEffortRepositoryInterface; +use App\Module\ProjectManagement\Domain\Repository\TaskGroupRepositoryInterface; +use App\Module\ProjectManagement\Domain\Repository\TaskPriorityRepositoryInterface; +use App\Module\ProjectManagement\Domain\Repository\TaskRepositoryInterface; +use App\Module\ProjectManagement\Domain\Repository\TaskStatusRepositoryInterface; +use App\Module\ProjectManagement\Domain\Repository\TaskTagRepositoryInterface; +use App\Module\ProjectManagement\Infrastructure\Service\CalDavService; use DateTimeImmutable; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; @@ -27,12 +27,12 @@ class UpdateTaskTool { public function __construct( private readonly EntityManagerInterface $entityManager, - private readonly TaskRepository $taskRepository, - private readonly TaskStatusRepository $taskStatusRepository, - private readonly TaskPriorityRepository $taskPriorityRepository, - private readonly TaskEffortRepository $taskEffortRepository, - private readonly TaskGroupRepository $taskGroupRepository, - private readonly TaskTagRepository $taskTagRepository, + private readonly TaskRepositoryInterface $taskRepository, + private readonly TaskStatusRepositoryInterface $taskStatusRepository, + private readonly TaskPriorityRepositoryInterface $taskPriorityRepository, + private readonly TaskEffortRepositoryInterface $taskEffortRepository, + private readonly TaskGroupRepositoryInterface $taskGroupRepository, + private readonly TaskTagRepositoryInterface $taskTagRepository, private readonly DoctrineUserRepository $userRepository, private readonly Security $security, private readonly CalDavService $calDavService, @@ -63,7 +63,7 @@ class UpdateTaskTool throw new AccessDeniedException('Access denied: ROLE_USER required.'); } - $task = $this->taskRepository->find($id); + $task = $this->taskRepository->findById($id); if (null === $task) { throw new InvalidArgumentException(sprintf('Task with ID %d not found.', $id)); @@ -76,21 +76,21 @@ class UpdateTaskTool $task->setDescription($description); } if (null !== $statusId) { - $status = $this->taskStatusRepository->find($statusId); + $status = $this->taskStatusRepository->findById($statusId); if (null === $status) { throw new InvalidArgumentException(sprintf('TaskStatus with ID %d not found.', $statusId)); } $task->setStatus($status); } if (null !== $priorityId) { - $priority = $this->taskPriorityRepository->find($priorityId); + $priority = $this->taskPriorityRepository->findById($priorityId); if (null === $priority) { throw new InvalidArgumentException(sprintf('TaskPriority with ID %d not found.', $priorityId)); } $task->setPriority($priority); } if (null !== $effortId) { - $effort = $this->taskEffortRepository->find($effortId); + $effort = $this->taskEffortRepository->findById($effortId); if (null === $effort) { throw new InvalidArgumentException(sprintf('TaskEffort with ID %d not found.', $effortId)); } @@ -104,7 +104,7 @@ class UpdateTaskTool $task->setAssignee($assignee); } if (null !== $groupId) { - $group = $this->taskGroupRepository->find($groupId); + $group = $this->taskGroupRepository->findById($groupId); if (null === $group) { throw new InvalidArgumentException(sprintf('TaskGroup with ID %d not found.', $groupId)); } @@ -116,7 +116,7 @@ class UpdateTaskTool $task->removeTag($existingTag); } foreach ($tagIds as $tagId) { - $tag = $this->taskTagRepository->find($tagId); + $tag = $this->taskTagRepository->findById($tagId); if (null === $tag) { throw new InvalidArgumentException(sprintf('TaskTag with ID %d not found.', $tagId)); } diff --git a/src/Mcp/Tool/TaskMeta/CreateEffortTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/CreateEffortTool.php similarity index 87% rename from src/Mcp/Tool/TaskMeta/CreateEffortTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/CreateEffortTool.php index 5c2fb95..6f73d94 100644 --- a/src/Mcp/Tool/TaskMeta/CreateEffortTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/CreateEffortTool.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Mcp\Tool\TaskMeta; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\TaskMeta; -use App\Entity\TaskEffort; +use App\Module\ProjectManagement\Domain\Entity\TaskEffort; use Doctrine\ORM\EntityManagerInterface; use Mcp\Capability\Attribute\McpTool; use Symfony\Bundle\SecurityBundle\Security; diff --git a/src/Mcp/Tool/TaskMeta/CreateGroupTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/CreateGroupTool.php similarity index 80% rename from src/Mcp/Tool/TaskMeta/CreateGroupTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/CreateGroupTool.php index a65a2e7..4e40a3e 100644 --- a/src/Mcp/Tool/TaskMeta/CreateGroupTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/CreateGroupTool.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace App\Mcp\Tool\TaskMeta; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\TaskMeta; -use App\Entity\TaskGroup; use App\Mcp\Tool\Serializer; -use App\Repository\ProjectRepository; +use App\Module\ProjectManagement\Domain\Entity\TaskGroup; +use App\Module\ProjectManagement\Domain\Repository\ProjectRepositoryInterface; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; use Mcp\Capability\Attribute\McpTool; @@ -20,7 +20,7 @@ class CreateGroupTool { public function __construct( private readonly EntityManagerInterface $entityManager, - private readonly ProjectRepository $projectRepository, + private readonly ProjectRepositoryInterface $projectRepository, private readonly Security $security, ) {} @@ -34,7 +34,7 @@ class CreateGroupTool throw new AccessDeniedException('Access denied: ROLE_USER required.'); } - $project = $this->projectRepository->find($projectId); + $project = $this->projectRepository->findById($projectId); if (null === $project) { throw new InvalidArgumentException(sprintf('Project with ID %d not found.', $projectId)); } diff --git a/src/Mcp/Tool/TaskMeta/CreatePriorityTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/CreatePriorityTool.php similarity index 89% rename from src/Mcp/Tool/TaskMeta/CreatePriorityTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/CreatePriorityTool.php index 9e324f9..814d060 100644 --- a/src/Mcp/Tool/TaskMeta/CreatePriorityTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/CreatePriorityTool.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Mcp\Tool\TaskMeta; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\TaskMeta; -use App\Entity\TaskPriority; +use App\Module\ProjectManagement\Domain\Entity\TaskPriority; use Doctrine\ORM\EntityManagerInterface; use Mcp\Capability\Attribute\McpTool; use Symfony\Bundle\SecurityBundle\Security; diff --git a/src/Mcp/Tool/TaskMeta/CreateStatusTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/CreateStatusTool.php similarity index 84% rename from src/Mcp/Tool/TaskMeta/CreateStatusTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/CreateStatusTool.php index ae978f3..d847c8e 100644 --- a/src/Mcp/Tool/TaskMeta/CreateStatusTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/CreateStatusTool.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace App\Mcp\Tool\TaskMeta; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\TaskMeta; -use App\Entity\TaskStatus; -use App\Enum\StatusCategory; -use App\Repository\WorkflowRepository; +use App\Module\ProjectManagement\Domain\Entity\TaskStatus; +use App\Module\ProjectManagement\Domain\Enum\StatusCategory; +use App\Module\ProjectManagement\Domain\Repository\WorkflowRepositoryInterface; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; use Mcp\Capability\Attribute\McpTool; @@ -19,7 +19,7 @@ use function sprintf; class CreateStatusTool { public function __construct( - private readonly WorkflowRepository $workflowRepository, + private readonly WorkflowRepositoryInterface $workflowRepository, private readonly EntityManagerInterface $entityManager, private readonly Security $security, ) {} @@ -36,7 +36,7 @@ class CreateStatusTool throw new AccessDeniedException('Access denied: ROLE_ADMIN required.'); } - $workflow = $this->workflowRepository->find($workflowId); + $workflow = $this->workflowRepository->findById($workflowId); if (null === $workflow) { throw new InvalidArgumentException(sprintf('Workflow with ID %d not found.', $workflowId)); } diff --git a/src/Mcp/Tool/TaskMeta/CreateTagTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/CreateTagTool.php similarity index 89% rename from src/Mcp/Tool/TaskMeta/CreateTagTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/CreateTagTool.php index 867ea25..b5b2ffd 100644 --- a/src/Mcp/Tool/TaskMeta/CreateTagTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/CreateTagTool.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Mcp\Tool\TaskMeta; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\TaskMeta; -use App\Entity\TaskTag; +use App\Module\ProjectManagement\Domain\Entity\TaskTag; use Doctrine\ORM\EntityManagerInterface; use Mcp\Capability\Attribute\McpTool; use Symfony\Bundle\SecurityBundle\Security; diff --git a/src/Mcp/Tool/TaskMeta/DeleteEffortTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/DeleteEffortTool.php similarity index 79% rename from src/Mcp/Tool/TaskMeta/DeleteEffortTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/DeleteEffortTool.php index 92dc8e1..fa662fc 100644 --- a/src/Mcp/Tool/TaskMeta/DeleteEffortTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/DeleteEffortTool.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Mcp\Tool\TaskMeta; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\TaskMeta; -use App\Repository\TaskEffortRepository; +use App\Module\ProjectManagement\Domain\Repository\TaskEffortRepositoryInterface; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; use Mcp\Capability\Attribute\McpTool; @@ -17,7 +17,7 @@ use function sprintf; class DeleteEffortTool { public function __construct( - private readonly TaskEffortRepository $effortRepository, + private readonly TaskEffortRepositoryInterface $effortRepository, private readonly EntityManagerInterface $entityManager, private readonly Security $security, ) {} @@ -28,7 +28,7 @@ class DeleteEffortTool throw new AccessDeniedException('Access denied: ROLE_USER required.'); } - $effort = $this->effortRepository->find($id); + $effort = $this->effortRepository->findById($id); if (null === $effort) { throw new InvalidArgumentException(sprintf('TaskEffort with ID %d not found.', $id)); } diff --git a/src/Mcp/Tool/TaskMeta/DeleteGroupTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/DeleteGroupTool.php similarity index 79% rename from src/Mcp/Tool/TaskMeta/DeleteGroupTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/DeleteGroupTool.php index ae65342..41565cf 100644 --- a/src/Mcp/Tool/TaskMeta/DeleteGroupTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/DeleteGroupTool.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Mcp\Tool\TaskMeta; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\TaskMeta; -use App\Repository\TaskGroupRepository; +use App\Module\ProjectManagement\Domain\Repository\TaskGroupRepositoryInterface; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; use Mcp\Capability\Attribute\McpTool; @@ -17,7 +17,7 @@ use function sprintf; class DeleteGroupTool { public function __construct( - private readonly TaskGroupRepository $taskGroupRepository, + private readonly TaskGroupRepositoryInterface $taskGroupRepository, private readonly EntityManagerInterface $entityManager, private readonly Security $security, ) {} @@ -28,7 +28,7 @@ class DeleteGroupTool throw new AccessDeniedException('Access denied: ROLE_USER required.'); } - $group = $this->taskGroupRepository->find($id); + $group = $this->taskGroupRepository->findById($id); if (null === $group) { throw new InvalidArgumentException(sprintf('TaskGroup with ID %d not found.', $id)); } diff --git a/src/Mcp/Tool/TaskMeta/DeletePriorityTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/DeletePriorityTool.php similarity index 79% rename from src/Mcp/Tool/TaskMeta/DeletePriorityTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/DeletePriorityTool.php index 4c9b25a..025b986 100644 --- a/src/Mcp/Tool/TaskMeta/DeletePriorityTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/DeletePriorityTool.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Mcp\Tool\TaskMeta; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\TaskMeta; -use App\Repository\TaskPriorityRepository; +use App\Module\ProjectManagement\Domain\Repository\TaskPriorityRepositoryInterface; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; use Mcp\Capability\Attribute\McpTool; @@ -17,7 +17,7 @@ use function sprintf; class DeletePriorityTool { public function __construct( - private readonly TaskPriorityRepository $priorityRepository, + private readonly TaskPriorityRepositoryInterface $priorityRepository, private readonly EntityManagerInterface $entityManager, private readonly Security $security, ) {} @@ -28,7 +28,7 @@ class DeletePriorityTool throw new AccessDeniedException('Access denied: ROLE_USER required.'); } - $priority = $this->priorityRepository->find($id); + $priority = $this->priorityRepository->findById($id); if (null === $priority) { throw new InvalidArgumentException(sprintf('TaskPriority with ID %d not found.', $id)); } diff --git a/src/Mcp/Tool/TaskMeta/DeleteStatusTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/DeleteStatusTool.php similarity index 80% rename from src/Mcp/Tool/TaskMeta/DeleteStatusTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/DeleteStatusTool.php index d5aab15..5a4122d 100644 --- a/src/Mcp/Tool/TaskMeta/DeleteStatusTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/DeleteStatusTool.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Mcp\Tool\TaskMeta; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\TaskMeta; -use App\Repository\TaskStatusRepository; +use App\Module\ProjectManagement\Domain\Repository\TaskStatusRepositoryInterface; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; use Mcp\Capability\Attribute\McpTool; @@ -17,7 +17,7 @@ use function sprintf; class DeleteStatusTool { public function __construct( - private readonly TaskStatusRepository $statusRepository, + private readonly TaskStatusRepositoryInterface $statusRepository, private readonly EntityManagerInterface $entityManager, private readonly Security $security, ) {} @@ -28,7 +28,7 @@ class DeleteStatusTool throw new AccessDeniedException('Access denied: ROLE_ADMIN required.'); } - $status = $this->statusRepository->find($id); + $status = $this->statusRepository->findById($id); if (null === $status) { throw new InvalidArgumentException(sprintf('TaskStatus with ID %d not found.', $id)); } diff --git a/src/Mcp/Tool/TaskMeta/DeleteTagTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/DeleteTagTool.php similarity index 80% rename from src/Mcp/Tool/TaskMeta/DeleteTagTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/DeleteTagTool.php index 78e2660..cc7538e 100644 --- a/src/Mcp/Tool/TaskMeta/DeleteTagTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/DeleteTagTool.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Mcp\Tool\TaskMeta; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\TaskMeta; -use App\Repository\TaskTagRepository; +use App\Module\ProjectManagement\Domain\Repository\TaskTagRepositoryInterface; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; use Mcp\Capability\Attribute\McpTool; @@ -17,7 +17,7 @@ use function sprintf; class DeleteTagTool { public function __construct( - private readonly TaskTagRepository $tagRepository, + private readonly TaskTagRepositoryInterface $tagRepository, private readonly EntityManagerInterface $entityManager, private readonly Security $security, ) {} @@ -28,7 +28,7 @@ class DeleteTagTool throw new AccessDeniedException('Access denied: ROLE_USER required.'); } - $tag = $this->tagRepository->find($id); + $tag = $this->tagRepository->findById($id); if (null === $tag) { throw new InvalidArgumentException(sprintf('TaskTag with ID %d not found.', $id)); } diff --git a/src/Mcp/Tool/TaskMeta/ListEffortsTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/ListEffortsTool.php similarity index 78% rename from src/Mcp/Tool/TaskMeta/ListEffortsTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/ListEffortsTool.php index c7d67d0..c47f201 100644 --- a/src/Mcp/Tool/TaskMeta/ListEffortsTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/ListEffortsTool.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Mcp\Tool\TaskMeta; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\TaskMeta; -use App\Repository\TaskEffortRepository; +use App\Module\ProjectManagement\Domain\Repository\TaskEffortRepositoryInterface; use Mcp\Capability\Attribute\McpTool; use Symfony\Bundle\SecurityBundle\Security; use Symfony\Component\Security\Core\Exception\AccessDeniedException; @@ -13,7 +13,7 @@ use Symfony\Component\Security\Core\Exception\AccessDeniedException; class ListEffortsTool { public function __construct( - private readonly TaskEffortRepository $taskEffortRepository, + private readonly TaskEffortRepositoryInterface $taskEffortRepository, private readonly Security $security, ) {} diff --git a/src/Mcp/Tool/TaskMeta/ListGroupsTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/ListGroupsTool.php similarity index 81% rename from src/Mcp/Tool/TaskMeta/ListGroupsTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/ListGroupsTool.php index 373e7f1..5b6f658 100644 --- a/src/Mcp/Tool/TaskMeta/ListGroupsTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/ListGroupsTool.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace App\Mcp\Tool\TaskMeta; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\TaskMeta; use App\Mcp\Tool\Serializer; -use App\Repository\TaskGroupRepository; +use App\Module\ProjectManagement\Domain\Repository\TaskGroupRepositoryInterface; use Mcp\Capability\Attribute\McpTool; use Symfony\Bundle\SecurityBundle\Security; use Symfony\Component\Security\Core\Exception\AccessDeniedException; @@ -14,7 +14,7 @@ use Symfony\Component\Security\Core\Exception\AccessDeniedException; class ListGroupsTool { public function __construct( - private readonly TaskGroupRepository $taskGroupRepository, + private readonly TaskGroupRepositoryInterface $taskGroupRepository, private readonly Security $security, ) {} diff --git a/src/Mcp/Tool/TaskMeta/ListPrioritiesTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/ListPrioritiesTool.php similarity index 79% rename from src/Mcp/Tool/TaskMeta/ListPrioritiesTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/ListPrioritiesTool.php index df06447..ed590ad 100644 --- a/src/Mcp/Tool/TaskMeta/ListPrioritiesTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/ListPrioritiesTool.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Mcp\Tool\TaskMeta; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\TaskMeta; -use App\Repository\TaskPriorityRepository; +use App\Module\ProjectManagement\Domain\Repository\TaskPriorityRepositoryInterface; use Mcp\Capability\Attribute\McpTool; use Symfony\Bundle\SecurityBundle\Security; use Symfony\Component\Security\Core\Exception\AccessDeniedException; @@ -13,7 +13,7 @@ use Symfony\Component\Security\Core\Exception\AccessDeniedException; class ListPrioritiesTool { public function __construct( - private readonly TaskPriorityRepository $taskPriorityRepository, + private readonly TaskPriorityRepositoryInterface $taskPriorityRepository, private readonly Security $security, ) {} diff --git a/src/Mcp/Tool/TaskMeta/ListStatusesTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/ListStatusesTool.php similarity index 85% rename from src/Mcp/Tool/TaskMeta/ListStatusesTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/ListStatusesTool.php index db6c8e3..709b60a 100644 --- a/src/Mcp/Tool/TaskMeta/ListStatusesTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/ListStatusesTool.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace App\Mcp\Tool\TaskMeta; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\TaskMeta; -use App\Entity\Project; -use App\Repository\TaskStatusRepository; +use App\Module\ProjectManagement\Domain\Entity\Project; +use App\Module\ProjectManagement\Domain\Repository\TaskStatusRepositoryInterface; use Doctrine\ORM\EntityManagerInterface; use Mcp\Capability\Attribute\McpTool; use Symfony\Bundle\SecurityBundle\Security; @@ -18,7 +18,7 @@ use Symfony\Component\Security\Core\Exception\AccessDeniedException; class ListStatusesTool { public function __construct( - private readonly TaskStatusRepository $taskStatusRepository, + private readonly TaskStatusRepositoryInterface $taskStatusRepository, private readonly EntityManagerInterface $entityManager, private readonly Security $security, ) {} diff --git a/src/Mcp/Tool/TaskMeta/ListTagsTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/ListTagsTool.php similarity index 79% rename from src/Mcp/Tool/TaskMeta/ListTagsTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/ListTagsTool.php index d43287d..0650400 100644 --- a/src/Mcp/Tool/TaskMeta/ListTagsTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/ListTagsTool.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Mcp\Tool\TaskMeta; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\TaskMeta; -use App\Repository\TaskTagRepository; +use App\Module\ProjectManagement\Domain\Repository\TaskTagRepositoryInterface; use Mcp\Capability\Attribute\McpTool; use Symfony\Bundle\SecurityBundle\Security; use Symfony\Component\Security\Core\Exception\AccessDeniedException; @@ -13,7 +13,7 @@ use Symfony\Component\Security\Core\Exception\AccessDeniedException; class ListTagsTool { public function __construct( - private readonly TaskTagRepository $taskTagRepository, + private readonly TaskTagRepositoryInterface $taskTagRepository, private readonly Security $security, ) {} diff --git a/src/Mcp/Tool/TaskMeta/UpdateEffortTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/UpdateEffortTool.php similarity index 78% rename from src/Mcp/Tool/TaskMeta/UpdateEffortTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/UpdateEffortTool.php index b317d6c..657495a 100644 --- a/src/Mcp/Tool/TaskMeta/UpdateEffortTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/UpdateEffortTool.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Mcp\Tool\TaskMeta; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\TaskMeta; -use App\Repository\TaskEffortRepository; +use App\Module\ProjectManagement\Domain\Repository\TaskEffortRepositoryInterface; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; use Mcp\Capability\Attribute\McpTool; @@ -17,7 +17,7 @@ use function sprintf; class UpdateEffortTool { public function __construct( - private readonly TaskEffortRepository $effortRepository, + private readonly TaskEffortRepositoryInterface $effortRepository, private readonly EntityManagerInterface $entityManager, private readonly Security $security, ) {} @@ -28,7 +28,7 @@ class UpdateEffortTool throw new AccessDeniedException('Access denied: ROLE_USER required.'); } - $effort = $this->effortRepository->find($id); + $effort = $this->effortRepository->findById($id); if (null === $effort) { throw new InvalidArgumentException(sprintf('TaskEffort with ID %d not found.', $id)); } diff --git a/src/Mcp/Tool/TaskMeta/UpdateGroupTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/UpdateGroupTool.php similarity index 84% rename from src/Mcp/Tool/TaskMeta/UpdateGroupTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/UpdateGroupTool.php index 1b78ac0..967ed42 100644 --- a/src/Mcp/Tool/TaskMeta/UpdateGroupTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/UpdateGroupTool.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace App\Mcp\Tool\TaskMeta; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\TaskMeta; use App\Mcp\Tool\Serializer; -use App\Repository\TaskGroupRepository; +use App\Module\ProjectManagement\Domain\Repository\TaskGroupRepositoryInterface; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; use Mcp\Capability\Attribute\McpTool; @@ -18,7 +18,7 @@ use function sprintf; class UpdateGroupTool { public function __construct( - private readonly TaskGroupRepository $taskGroupRepository, + private readonly TaskGroupRepositoryInterface $taskGroupRepository, private readonly EntityManagerInterface $entityManager, private readonly Security $security, ) {} @@ -34,7 +34,7 @@ class UpdateGroupTool throw new AccessDeniedException('Access denied: ROLE_USER required.'); } - $group = $this->taskGroupRepository->find($id); + $group = $this->taskGroupRepository->findById($id); if (null === $group) { throw new InvalidArgumentException(sprintf('TaskGroup with ID %d not found.', $id)); diff --git a/src/Mcp/Tool/TaskMeta/UpdatePriorityTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/UpdatePriorityTool.php similarity index 81% rename from src/Mcp/Tool/TaskMeta/UpdatePriorityTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/UpdatePriorityTool.php index 992feff..26c37db 100644 --- a/src/Mcp/Tool/TaskMeta/UpdatePriorityTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/UpdatePriorityTool.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Mcp\Tool\TaskMeta; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\TaskMeta; -use App\Repository\TaskPriorityRepository; +use App\Module\ProjectManagement\Domain\Repository\TaskPriorityRepositoryInterface; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; use Mcp\Capability\Attribute\McpTool; @@ -17,7 +17,7 @@ use function sprintf; class UpdatePriorityTool { public function __construct( - private readonly TaskPriorityRepository $priorityRepository, + private readonly TaskPriorityRepositoryInterface $priorityRepository, private readonly EntityManagerInterface $entityManager, private readonly Security $security, ) {} @@ -28,7 +28,7 @@ class UpdatePriorityTool throw new AccessDeniedException('Access denied: ROLE_USER required.'); } - $priority = $this->priorityRepository->find($id); + $priority = $this->priorityRepository->findById($id); if (null === $priority) { throw new InvalidArgumentException(sprintf('TaskPriority with ID %d not found.', $id)); } diff --git a/src/Mcp/Tool/TaskMeta/UpdateStatusTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/UpdateStatusTool.php similarity index 86% rename from src/Mcp/Tool/TaskMeta/UpdateStatusTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/UpdateStatusTool.php index 09e12cb..23b2f33 100644 --- a/src/Mcp/Tool/TaskMeta/UpdateStatusTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/UpdateStatusTool.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace App\Mcp\Tool\TaskMeta; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\TaskMeta; -use App\Enum\StatusCategory; -use App\Repository\TaskStatusRepository; +use App\Module\ProjectManagement\Domain\Enum\StatusCategory; +use App\Module\ProjectManagement\Domain\Repository\TaskStatusRepositoryInterface; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; use Mcp\Capability\Attribute\McpTool; @@ -18,7 +18,7 @@ use function sprintf; class UpdateStatusTool { public function __construct( - private readonly TaskStatusRepository $statusRepository, + private readonly TaskStatusRepositoryInterface $statusRepository, private readonly EntityManagerInterface $entityManager, private readonly Security $security, ) {} @@ -35,7 +35,7 @@ class UpdateStatusTool throw new AccessDeniedException('Access denied: ROLE_ADMIN required.'); } - $status = $this->statusRepository->find($id); + $status = $this->statusRepository->findById($id); if (null === $status) { throw new InvalidArgumentException(sprintf('TaskStatus with ID %d not found.', $id)); } diff --git a/src/Mcp/Tool/TaskMeta/UpdateTagTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/UpdateTagTool.php similarity index 82% rename from src/Mcp/Tool/TaskMeta/UpdateTagTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/UpdateTagTool.php index 60cff41..37482f2 100644 --- a/src/Mcp/Tool/TaskMeta/UpdateTagTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/TaskMeta/UpdateTagTool.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Mcp\Tool\TaskMeta; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\TaskMeta; -use App\Repository\TaskTagRepository; +use App\Module\ProjectManagement\Domain\Repository\TaskTagRepositoryInterface; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; use Mcp\Capability\Attribute\McpTool; @@ -17,7 +17,7 @@ use function sprintf; class UpdateTagTool { public function __construct( - private readonly TaskTagRepository $tagRepository, + private readonly TaskTagRepositoryInterface $tagRepository, private readonly EntityManagerInterface $entityManager, private readonly Security $security, ) {} @@ -28,7 +28,7 @@ class UpdateTagTool throw new AccessDeniedException('Access denied: ROLE_USER required.'); } - $tag = $this->tagRepository->find($id); + $tag = $this->tagRepository->findById($id); if (null === $tag) { throw new InvalidArgumentException(sprintf('TaskTag with ID %d not found.', $id)); } diff --git a/src/Mcp/Tool/Workflow/ListWorkflowsTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Workflow/ListWorkflowsTool.php similarity index 86% rename from src/Mcp/Tool/Workflow/ListWorkflowsTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Workflow/ListWorkflowsTool.php index 03701d2..b1d713c 100644 --- a/src/Mcp/Tool/Workflow/ListWorkflowsTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Workflow/ListWorkflowsTool.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Mcp\Tool\Workflow; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\Workflow; -use App\Repository\WorkflowRepository; +use App\Module\ProjectManagement\Domain\Repository\WorkflowRepositoryInterface; use Mcp\Capability\Attribute\McpTool; use Symfony\Bundle\SecurityBundle\Security; use Symfony\Component\Security\Core\Exception\AccessDeniedException; @@ -16,7 +16,7 @@ use Symfony\Component\Security\Core\Exception\AccessDeniedException; class ListWorkflowsTool { public function __construct( - private readonly WorkflowRepository $workflowRepository, + private readonly WorkflowRepositoryInterface $workflowRepository, private readonly Security $security, ) {} diff --git a/src/Mcp/Tool/Workflow/SwitchProjectWorkflowTool.php b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Workflow/SwitchProjectWorkflowTool.php similarity index 90% rename from src/Mcp/Tool/Workflow/SwitchProjectWorkflowTool.php rename to src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Workflow/SwitchProjectWorkflowTool.php index f0448f7..07f2b82 100644 --- a/src/Mcp/Tool/Workflow/SwitchProjectWorkflowTool.php +++ b/src/Module/ProjectManagement/Infrastructure/Mcp/Tool/Workflow/SwitchProjectWorkflowTool.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace App\Mcp\Tool\Workflow; +namespace App\Module\ProjectManagement\Infrastructure\Mcp\Tool\Workflow; use ApiPlatform\Metadata\Post; -use App\Entity\Project; -use App\State\SwitchProjectWorkflowProcessor; +use App\Module\ProjectManagement\Domain\Entity\Project; +use App\Module\ProjectManagement\Infrastructure\ApiPlatform\State\SwitchProjectWorkflowProcessor; use Doctrine\ORM\EntityManagerInterface; use Mcp\Capability\Attribute\McpTool; use Symfony\Bundle\SecurityBundle\Security; diff --git a/src/Service/CalDavService.php b/src/Module/ProjectManagement/Infrastructure/Service/CalDavService.php similarity index 97% rename from src/Service/CalDavService.php rename to src/Module/ProjectManagement/Infrastructure/Service/CalDavService.php index cd56476..15b4db6 100644 --- a/src/Service/CalDavService.php +++ b/src/Module/ProjectManagement/Infrastructure/Service/CalDavService.php @@ -2,12 +2,13 @@ declare(strict_types=1); -namespace App\Service; +namespace App\Module\ProjectManagement\Infrastructure\Service; -use App\Entity\Task; -use App\Entity\TaskRecurrence; -use App\Enum\RecurrenceType; +use App\Module\ProjectManagement\Domain\Entity\Task; +use App\Module\ProjectManagement\Domain\Entity\TaskRecurrence; +use App\Module\ProjectManagement\Domain\Enum\RecurrenceType; use App\Repository\ZimbraConfigurationRepository; +use App\Service\TokenEncryptor; use DateTimeZone; use Psr\Log\LoggerInterface; use Sabre\VObject\Component\VCalendar; diff --git a/src/Service/RecurrenceCalculator.php b/src/Module/ProjectManagement/Infrastructure/Service/RecurrenceCalculator.php similarity index 96% rename from src/Service/RecurrenceCalculator.php rename to src/Module/ProjectManagement/Infrastructure/Service/RecurrenceCalculator.php index f501a0b..fc67fca 100644 --- a/src/Service/RecurrenceCalculator.php +++ b/src/Module/ProjectManagement/Infrastructure/Service/RecurrenceCalculator.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace App\Service; +namespace App\Module\ProjectManagement\Infrastructure\Service; -use App\Entity\Task; -use App\Entity\TaskRecurrence; -use App\Enum\RecurrenceType; +use App\Module\ProjectManagement\Domain\Entity\Task; +use App\Module\ProjectManagement\Domain\Entity\TaskRecurrence; +use App\Module\ProjectManagement\Domain\Enum\RecurrenceType; use DateTimeImmutable; final class RecurrenceCalculator diff --git a/src/Module/ProjectManagement/ProjectManagementModule.php b/src/Module/ProjectManagement/ProjectManagementModule.php new file mode 100644 index 0000000..06dddd0 --- /dev/null +++ b/src/Module/ProjectManagement/ProjectManagementModule.php @@ -0,0 +1,43 @@ + + */ + public static function permissions(): array + { + return [ + ['code' => 'project-management.projects.view', 'label' => 'Voir les projets'], + ['code' => 'project-management.projects.manage', 'label' => 'Gérer les projets'], + ['code' => 'project-management.tasks.view', 'label' => 'Voir les tâches'], + ['code' => 'project-management.tasks.manage', 'label' => 'Gérer les tâches'], + ]; + } +} diff --git a/src/Module/TimeTracking/Infrastructure/Controller/TimeEntryExportController.php b/src/Module/TimeTracking/Infrastructure/Controller/TimeEntryExportController.php index 5dcf02e..6808436 100644 --- a/src/Module/TimeTracking/Infrastructure/Controller/TimeEntryExportController.php +++ b/src/Module/TimeTracking/Infrastructure/Controller/TimeEntryExportController.php @@ -4,8 +4,8 @@ declare(strict_types=1); namespace App\Module\TimeTracking\Infrastructure\Controller; -use App\Entity\Project; use App\Module\Core\Domain\Entity\User; +use App\Module\ProjectManagement\Domain\Entity\Project; use App\Module\TimeTracking\Domain\Repository\TimeEntryRepositoryInterface; use App\Module\TimeTracking\Infrastructure\Export\TimeEntryExportService; use DateTimeImmutable; diff --git a/src/Module/TimeTracking/Infrastructure/Mcp/Tool/CreateTimeEntryTool.php b/src/Module/TimeTracking/Infrastructure/Mcp/Tool/CreateTimeEntryTool.php index 1055472..0403015 100644 --- a/src/Module/TimeTracking/Infrastructure/Mcp/Tool/CreateTimeEntryTool.php +++ b/src/Module/TimeTracking/Infrastructure/Mcp/Tool/CreateTimeEntryTool.php @@ -6,11 +6,11 @@ namespace App\Module\TimeTracking\Infrastructure\Mcp\Tool; use App\Mcp\Tool\Serializer; use App\Module\Core\Infrastructure\Doctrine\DoctrineUserRepository; +use App\Module\ProjectManagement\Domain\Repository\ProjectRepositoryInterface; +use App\Module\ProjectManagement\Domain\Repository\TaskRepositoryInterface; +use App\Module\ProjectManagement\Domain\Repository\TaskTagRepositoryInterface; use App\Module\TimeTracking\Domain\Entity\TimeEntry; use App\Module\TimeTracking\Domain\Repository\TimeEntryRepositoryInterface; -use App\Repository\ProjectRepository; -use App\Repository\TaskRepository; -use App\Repository\TaskTagRepository; use DateTimeImmutable; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; @@ -26,9 +26,9 @@ class CreateTimeEntryTool public function __construct( private readonly EntityManagerInterface $entityManager, private readonly DoctrineUserRepository $userRepository, - private readonly ProjectRepository $projectRepository, - private readonly TaskRepository $taskRepository, - private readonly TaskTagRepository $taskTagRepository, + private readonly ProjectRepositoryInterface $projectRepository, + private readonly TaskRepositoryInterface $taskRepository, + private readonly TaskTagRepositoryInterface $taskTagRepository, private readonly TimeEntryRepositoryInterface $timeEntryRepository, private readonly Security $security, ) {} @@ -77,14 +77,14 @@ class CreateTimeEntryTool $entry->setDescription($description); } if (null !== $projectId) { - $project = $this->projectRepository->find($projectId); + $project = $this->projectRepository->findById($projectId); if (null === $project) { throw new InvalidArgumentException(sprintf('Project with ID %d not found.', $projectId)); } $entry->setProject($project); } if (null !== $taskId) { - $task = $this->taskRepository->find($taskId); + $task = $this->taskRepository->findById($taskId); if (null === $task) { throw new InvalidArgumentException(sprintf('Task with ID %d not found.', $taskId)); } @@ -92,7 +92,7 @@ class CreateTimeEntryTool } if (null !== $tagIds) { foreach ($tagIds as $tagId) { - $tag = $this->taskTagRepository->find($tagId); + $tag = $this->taskTagRepository->findById($tagId); if (null === $tag) { throw new InvalidArgumentException(sprintf('TaskTag with ID %d not found.', $tagId)); } diff --git a/src/Module/TimeTracking/Infrastructure/Mcp/Tool/UpdateTimeEntryTool.php b/src/Module/TimeTracking/Infrastructure/Mcp/Tool/UpdateTimeEntryTool.php index fa67cf1..e1f3a9c 100644 --- a/src/Module/TimeTracking/Infrastructure/Mcp/Tool/UpdateTimeEntryTool.php +++ b/src/Module/TimeTracking/Infrastructure/Mcp/Tool/UpdateTimeEntryTool.php @@ -5,10 +5,10 @@ declare(strict_types=1); namespace App\Module\TimeTracking\Infrastructure\Mcp\Tool; use App\Mcp\Tool\Serializer; +use App\Module\ProjectManagement\Domain\Repository\ProjectRepositoryInterface; +use App\Module\ProjectManagement\Domain\Repository\TaskRepositoryInterface; +use App\Module\ProjectManagement\Domain\Repository\TaskTagRepositoryInterface; use App\Module\TimeTracking\Domain\Repository\TimeEntryRepositoryInterface; -use App\Repository\ProjectRepository; -use App\Repository\TaskRepository; -use App\Repository\TaskTagRepository; use DateTimeImmutable; use Doctrine\ORM\EntityManagerInterface; use InvalidArgumentException; @@ -23,9 +23,9 @@ class UpdateTimeEntryTool { public function __construct( private readonly TimeEntryRepositoryInterface $timeEntryRepository, - private readonly ProjectRepository $projectRepository, - private readonly TaskRepository $taskRepository, - private readonly TaskTagRepository $taskTagRepository, + private readonly ProjectRepositoryInterface $projectRepository, + private readonly TaskRepositoryInterface $taskRepository, + private readonly TaskTagRepositoryInterface $taskTagRepository, private readonly EntityManagerInterface $entityManager, private readonly Security $security, ) {} @@ -66,14 +66,14 @@ class UpdateTimeEntryTool $entry->setDescription($description); } if (null !== $projectId) { - $project = $this->projectRepository->find($projectId); + $project = $this->projectRepository->findById($projectId); if (null === $project) { throw new InvalidArgumentException(sprintf('Project with ID %d not found.', $projectId)); } $entry->setProject($project); } if (null !== $taskId) { - $task = $this->taskRepository->find($taskId); + $task = $this->taskRepository->findById($taskId); if (null === $task) { throw new InvalidArgumentException(sprintf('Task with ID %d not found.', $taskId)); } @@ -84,7 +84,7 @@ class UpdateTimeEntryTool $entry->removeTag($existingTag); } foreach ($tagIds as $tagId) { - $tag = $this->taskTagRepository->find($tagId); + $tag = $this->taskTagRepository->findById($tagId); if (null === $tag) { throw new InvalidArgumentException(sprintf('TaskTag with ID %d not found.', $tagId)); } diff --git a/src/Repository/ProjectRepository.php b/src/Repository/ProjectRepository.php deleted file mode 100644 index 6455dae..0000000 --- a/src/Repository/ProjectRepository.php +++ /dev/null @@ -1,17 +0,0 @@ -