diff --git a/config/modules.php b/config/modules.php index 95abc5b..27ca805 100644 --- a/config/modules.php +++ b/config/modules.php @@ -10,6 +10,7 @@ declare(strict_types=1); use App\Module\Absence\AbsenceModule; use App\Module\Core\CoreModule; use App\Module\Directory\DirectoryModule; +use App\Module\Integration\IntegrationModule; use App\Module\Mail\MailModule; use App\Module\ProjectManagement\ProjectManagementModule; use App\Module\TimeTracking\TimeTrackingModule; @@ -21,4 +22,5 @@ return [ AbsenceModule::class, DirectoryModule::class, MailModule::class, + IntegrationModule::class, ]; diff --git a/config/packages/doctrine.yaml b/config/packages/doctrine.yaml index fdb5142..51df119 100644 --- a/config/packages/doctrine.yaml +++ b/config/packages/doctrine.yaml @@ -63,6 +63,11 @@ doctrine: is_bundle: false dir: '%kernel.project_dir%/src/Module/Mail/Domain/Entity' prefix: 'App\Module\Mail\Domain\Entity' + Integration: + type: attribute + is_bundle: false + dir: '%kernel.project_dir%/src/Module/Integration/Domain/Entity' + prefix: 'App\Module\Integration\Domain\Entity' controller_resolver: auto_mapping: false diff --git a/config/services.yaml b/config/services.yaml index 3900610..773dc08 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -65,7 +65,17 @@ services: arguments: $uploadDir: '%absence_justification_upload_dir%' - App\Service\Share\FileSource: '@App\Service\Share\SmbFileSource' + App\Module\Integration\Domain\Service\FileSource: '@App\Module\Integration\Infrastructure\Service\SmbFileSource' + + App\Module\Integration\Domain\Repository\GiteaConfigurationRepositoryInterface: '@App\Module\Integration\Infrastructure\Doctrine\DoctrineGiteaConfigurationRepository' + + App\Module\Integration\Domain\Repository\BookStackConfigurationRepositoryInterface: '@App\Module\Integration\Infrastructure\Doctrine\DoctrineBookStackConfigurationRepository' + + App\Module\Integration\Domain\Repository\ZimbraConfigurationRepositoryInterface: '@App\Module\Integration\Infrastructure\Doctrine\DoctrineZimbraConfigurationRepository' + + App\Module\Integration\Domain\Repository\ShareConfigurationRepositoryInterface: '@App\Module\Integration\Infrastructure\Doctrine\DoctrineShareConfigurationRepository' + + App\Module\Integration\Domain\Repository\TaskBookStackLinkRepositoryInterface: '@App\Module\Integration\Infrastructure\Doctrine\DoctrineTaskBookStackLinkRepository' App\Module\Core\Domain\Repository\UserRepositoryInterface: '@App\Module\Core\Infrastructure\Doctrine\DoctrineUserRepository' diff --git a/migrations/Version20260620201000.php b/migrations/Version20260620201000.php new file mode 100644 index 0000000..5328ac5 --- /dev/null +++ b/migrations/Version20260620201000.php @@ -0,0 +1,125 @@ + "user"(id) ON DELETE SET NULL (Blamable) + * No DROP/ALTER on existing data. Columns are lowercase snake_case. FK/index + * names mirror Doctrine's generated identifiers so schema:validate stays clean. + * down() drops the new columns and their FKs/indexes. + */ +final class Version20260620201000 extends AbstractMigration +{ + public function getDescription(): string + { + return 'Integration: add Timestampable/Blamable columns on gitea/bookstack/zimbra/share configuration (additive)'; + } + + public function up(Schema $schema): void + { + // gitea_configuration + $this->addSql('ALTER TABLE gitea_configuration ADD created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL'); + $this->addSql('ALTER TABLE gitea_configuration ADD updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL'); + $this->addSql('ALTER TABLE gitea_configuration ADD created_by INT DEFAULT NULL'); + $this->addSql('ALTER TABLE gitea_configuration ADD updated_by INT DEFAULT NULL'); + $this->addSql('ALTER TABLE gitea_configuration ADD CONSTRAINT FK_901AB3BDDE12AB56 FOREIGN KEY (created_by) REFERENCES "user" (id) ON DELETE SET NULL NOT DEFERRABLE'); + $this->addSql('ALTER TABLE gitea_configuration ADD CONSTRAINT FK_901AB3BD16FE72E1 FOREIGN KEY (updated_by) REFERENCES "user" (id) ON DELETE SET NULL NOT DEFERRABLE'); + $this->addSql('CREATE INDEX IDX_901AB3BDDE12AB56 ON gitea_configuration (created_by)'); + $this->addSql('CREATE INDEX IDX_901AB3BD16FE72E1 ON gitea_configuration (updated_by)'); + $this->addSql("COMMENT ON COLUMN gitea_configuration.created_at IS 'Creation timestamp (Timestampable, set on prePersist)'"); + $this->addSql("COMMENT ON COLUMN gitea_configuration.updated_at IS 'Last update timestamp (Timestampable, set on prePersist/preUpdate)'"); + $this->addSql("COMMENT ON COLUMN gitea_configuration.created_by IS 'User who created the entry (Blamable, FK user.id, SET NULL on delete)'"); + $this->addSql("COMMENT ON COLUMN gitea_configuration.updated_by IS 'User who last updated the entry (Blamable, FK user.id, SET NULL on delete)'"); + + // book_stack_configuration + $this->addSql('ALTER TABLE book_stack_configuration ADD created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL'); + $this->addSql('ALTER TABLE book_stack_configuration ADD updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL'); + $this->addSql('ALTER TABLE book_stack_configuration ADD created_by INT DEFAULT NULL'); + $this->addSql('ALTER TABLE book_stack_configuration ADD updated_by INT DEFAULT NULL'); + $this->addSql('ALTER TABLE book_stack_configuration ADD CONSTRAINT FK_63A143E0DE12AB56 FOREIGN KEY (created_by) REFERENCES "user" (id) ON DELETE SET NULL NOT DEFERRABLE'); + $this->addSql('ALTER TABLE book_stack_configuration ADD CONSTRAINT FK_63A143E016FE72E1 FOREIGN KEY (updated_by) REFERENCES "user" (id) ON DELETE SET NULL NOT DEFERRABLE'); + $this->addSql('CREATE INDEX IDX_63A143E0DE12AB56 ON book_stack_configuration (created_by)'); + $this->addSql('CREATE INDEX IDX_63A143E016FE72E1 ON book_stack_configuration (updated_by)'); + $this->addSql("COMMENT ON COLUMN book_stack_configuration.created_at IS 'Creation timestamp (Timestampable, set on prePersist)'"); + $this->addSql("COMMENT ON COLUMN book_stack_configuration.updated_at IS 'Last update timestamp (Timestampable, set on prePersist/preUpdate)'"); + $this->addSql("COMMENT ON COLUMN book_stack_configuration.created_by IS 'User who created the entry (Blamable, FK user.id, SET NULL on delete)'"); + $this->addSql("COMMENT ON COLUMN book_stack_configuration.updated_by IS 'User who last updated the entry (Blamable, FK user.id, SET NULL on delete)'"); + + // zimbra_configuration + $this->addSql('ALTER TABLE zimbra_configuration ADD created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL'); + $this->addSql('ALTER TABLE zimbra_configuration ADD updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL'); + $this->addSql('ALTER TABLE zimbra_configuration ADD created_by INT DEFAULT NULL'); + $this->addSql('ALTER TABLE zimbra_configuration ADD updated_by INT DEFAULT NULL'); + $this->addSql('ALTER TABLE zimbra_configuration ADD CONSTRAINT FK_E97E3357DE12AB56 FOREIGN KEY (created_by) REFERENCES "user" (id) ON DELETE SET NULL NOT DEFERRABLE'); + $this->addSql('ALTER TABLE zimbra_configuration ADD CONSTRAINT FK_E97E335716FE72E1 FOREIGN KEY (updated_by) REFERENCES "user" (id) ON DELETE SET NULL NOT DEFERRABLE'); + $this->addSql('CREATE INDEX IDX_E97E3357DE12AB56 ON zimbra_configuration (created_by)'); + $this->addSql('CREATE INDEX IDX_E97E335716FE72E1 ON zimbra_configuration (updated_by)'); + $this->addSql("COMMENT ON COLUMN zimbra_configuration.created_at IS 'Creation timestamp (Timestampable, set on prePersist)'"); + $this->addSql("COMMENT ON COLUMN zimbra_configuration.updated_at IS 'Last update timestamp (Timestampable, set on prePersist/preUpdate)'"); + $this->addSql("COMMENT ON COLUMN zimbra_configuration.created_by IS 'User who created the entry (Blamable, FK user.id, SET NULL on delete)'"); + $this->addSql("COMMENT ON COLUMN zimbra_configuration.updated_by IS 'User who last updated the entry (Blamable, FK user.id, SET NULL on delete)'"); + + // share_configuration + $this->addSql('ALTER TABLE share_configuration ADD created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL'); + $this->addSql('ALTER TABLE share_configuration ADD updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL'); + $this->addSql('ALTER TABLE share_configuration ADD created_by INT DEFAULT NULL'); + $this->addSql('ALTER TABLE share_configuration ADD updated_by INT DEFAULT NULL'); + $this->addSql('ALTER TABLE share_configuration ADD CONSTRAINT FK_F73FE5CDDE12AB56 FOREIGN KEY (created_by) REFERENCES "user" (id) ON DELETE SET NULL NOT DEFERRABLE'); + $this->addSql('ALTER TABLE share_configuration ADD CONSTRAINT FK_F73FE5CD16FE72E1 FOREIGN KEY (updated_by) REFERENCES "user" (id) ON DELETE SET NULL NOT DEFERRABLE'); + $this->addSql('CREATE INDEX IDX_F73FE5CDDE12AB56 ON share_configuration (created_by)'); + $this->addSql('CREATE INDEX IDX_F73FE5CD16FE72E1 ON share_configuration (updated_by)'); + $this->addSql("COMMENT ON COLUMN share_configuration.created_at IS 'Creation timestamp (Timestampable, set on prePersist)'"); + $this->addSql("COMMENT ON COLUMN share_configuration.updated_at IS 'Last update timestamp (Timestampable, set on prePersist/preUpdate)'"); + $this->addSql("COMMENT ON COLUMN share_configuration.created_by IS 'User who created the entry (Blamable, FK user.id, SET NULL on delete)'"); + $this->addSql("COMMENT ON COLUMN share_configuration.updated_by IS 'User who last updated the entry (Blamable, FK user.id, SET NULL on delete)'"); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE gitea_configuration DROP CONSTRAINT FK_901AB3BDDE12AB56'); + $this->addSql('ALTER TABLE gitea_configuration DROP CONSTRAINT FK_901AB3BD16FE72E1'); + $this->addSql('DROP INDEX IDX_901AB3BDDE12AB56'); + $this->addSql('DROP INDEX IDX_901AB3BD16FE72E1'); + $this->addSql('ALTER TABLE gitea_configuration DROP created_at'); + $this->addSql('ALTER TABLE gitea_configuration DROP updated_at'); + $this->addSql('ALTER TABLE gitea_configuration DROP created_by'); + $this->addSql('ALTER TABLE gitea_configuration DROP updated_by'); + + $this->addSql('ALTER TABLE book_stack_configuration DROP CONSTRAINT FK_63A143E0DE12AB56'); + $this->addSql('ALTER TABLE book_stack_configuration DROP CONSTRAINT FK_63A143E016FE72E1'); + $this->addSql('DROP INDEX IDX_63A143E0DE12AB56'); + $this->addSql('DROP INDEX IDX_63A143E016FE72E1'); + $this->addSql('ALTER TABLE book_stack_configuration DROP created_at'); + $this->addSql('ALTER TABLE book_stack_configuration DROP updated_at'); + $this->addSql('ALTER TABLE book_stack_configuration DROP created_by'); + $this->addSql('ALTER TABLE book_stack_configuration DROP updated_by'); + + $this->addSql('ALTER TABLE zimbra_configuration DROP CONSTRAINT FK_E97E3357DE12AB56'); + $this->addSql('ALTER TABLE zimbra_configuration DROP CONSTRAINT FK_E97E335716FE72E1'); + $this->addSql('DROP INDEX IDX_E97E3357DE12AB56'); + $this->addSql('DROP INDEX IDX_E97E335716FE72E1'); + $this->addSql('ALTER TABLE zimbra_configuration DROP created_at'); + $this->addSql('ALTER TABLE zimbra_configuration DROP updated_at'); + $this->addSql('ALTER TABLE zimbra_configuration DROP created_by'); + $this->addSql('ALTER TABLE zimbra_configuration DROP updated_by'); + + $this->addSql('ALTER TABLE share_configuration DROP CONSTRAINT FK_F73FE5CDDE12AB56'); + $this->addSql('ALTER TABLE share_configuration DROP CONSTRAINT FK_F73FE5CD16FE72E1'); + $this->addSql('DROP INDEX IDX_F73FE5CDDE12AB56'); + $this->addSql('DROP INDEX IDX_F73FE5CD16FE72E1'); + $this->addSql('ALTER TABLE share_configuration DROP created_at'); + $this->addSql('ALTER TABLE share_configuration DROP updated_at'); + $this->addSql('ALTER TABLE share_configuration DROP created_by'); + $this->addSql('ALTER TABLE share_configuration DROP updated_by'); + } +} diff --git a/src/DataFixtures/AppFixtures.php b/src/DataFixtures/AppFixtures.php index 2cb0be1..d10ba67 100644 --- a/src/DataFixtures/AppFixtures.php +++ b/src/DataFixtures/AppFixtures.php @@ -4,7 +4,6 @@ declare(strict_types=1); namespace App\DataFixtures; -use App\Entity\ZimbraConfiguration; use App\Enum\ContractType; use App\Module\Absence\Domain\Entity\AbsenceBalance; use App\Module\Absence\Domain\Entity\AbsencePolicy; @@ -16,6 +15,7 @@ use App\Module\Core\Domain\Entity\User; use App\Module\Directory\Domain\Entity\Client; use App\Module\Directory\Domain\Entity\Prospect; use App\Module\Directory\Domain\Enum\ProspectStatus; +use App\Module\Integration\Domain\Entity\ZimbraConfiguration; use App\Module\Mail\Domain\Entity\MailConfiguration; use App\Module\ProjectManagement\Domain\Entity\Project; use App\Module\ProjectManagement\Domain\Entity\Task; diff --git a/src/Entity/BookStackConfiguration.php b/src/Module/Integration/Domain/Entity/BookStackConfiguration.php similarity index 72% rename from src/Entity/BookStackConfiguration.php rename to src/Module/Integration/Domain/Entity/BookStackConfiguration.php index 5bc546e..66ed20f 100644 --- a/src/Entity/BookStackConfiguration.php +++ b/src/Module/Integration/Domain/Entity/BookStackConfiguration.php @@ -2,15 +2,22 @@ declare(strict_types=1); -namespace App\Entity; +namespace App\Module\Integration\Domain\Entity; -use App\Repository\BookStackConfigurationRepository; +use App\Module\Integration\Infrastructure\Doctrine\DoctrineBookStackConfigurationRepository; +use App\Shared\Domain\Attribute\Auditable; +use App\Shared\Domain\Contract\BlamableInterface; +use App\Shared\Domain\Contract\TimestampableInterface; +use App\Shared\Domain\Trait\TimestampableBlamableTrait; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; -#[ORM\Entity(repositoryClass: BookStackConfigurationRepository::class)] -class BookStackConfiguration +#[Auditable] +#[ORM\Entity(repositoryClass: DoctrineBookStackConfigurationRepository::class)] +class BookStackConfiguration implements TimestampableInterface, BlamableInterface { + use TimestampableBlamableTrait; + #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] diff --git a/src/Entity/GiteaConfiguration.php b/src/Module/Integration/Domain/Entity/GiteaConfiguration.php similarity index 65% rename from src/Entity/GiteaConfiguration.php rename to src/Module/Integration/Domain/Entity/GiteaConfiguration.php index 45345ad..00e1f00 100644 --- a/src/Entity/GiteaConfiguration.php +++ b/src/Module/Integration/Domain/Entity/GiteaConfiguration.php @@ -2,15 +2,22 @@ declare(strict_types=1); -namespace App\Entity; +namespace App\Module\Integration\Domain\Entity; -use App\Repository\GiteaConfigurationRepository; +use App\Module\Integration\Infrastructure\Doctrine\DoctrineGiteaConfigurationRepository; +use App\Shared\Domain\Attribute\Auditable; +use App\Shared\Domain\Contract\BlamableInterface; +use App\Shared\Domain\Contract\TimestampableInterface; +use App\Shared\Domain\Trait\TimestampableBlamableTrait; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; -#[ORM\Entity(repositoryClass: GiteaConfigurationRepository::class)] -class GiteaConfiguration +#[Auditable] +#[ORM\Entity(repositoryClass: DoctrineGiteaConfigurationRepository::class)] +class GiteaConfiguration implements TimestampableInterface, BlamableInterface { + use TimestampableBlamableTrait; + #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] diff --git a/src/Entity/ShareConfiguration.php b/src/Module/Integration/Domain/Entity/ShareConfiguration.php similarity index 83% rename from src/Entity/ShareConfiguration.php rename to src/Module/Integration/Domain/Entity/ShareConfiguration.php index 3ff8ea5..f32bc26 100644 --- a/src/Entity/ShareConfiguration.php +++ b/src/Module/Integration/Domain/Entity/ShareConfiguration.php @@ -2,14 +2,21 @@ declare(strict_types=1); -namespace App\Entity; +namespace App\Module\Integration\Domain\Entity; -use App\Repository\ShareConfigurationRepository; +use App\Module\Integration\Infrastructure\Doctrine\DoctrineShareConfigurationRepository; +use App\Shared\Domain\Attribute\Auditable; +use App\Shared\Domain\Contract\BlamableInterface; +use App\Shared\Domain\Contract\TimestampableInterface; +use App\Shared\Domain\Trait\TimestampableBlamableTrait; use Doctrine\ORM\Mapping as ORM; -#[ORM\Entity(repositoryClass: ShareConfigurationRepository::class)] -class ShareConfiguration +#[Auditable] +#[ORM\Entity(repositoryClass: DoctrineShareConfigurationRepository::class)] +class ShareConfiguration implements TimestampableInterface, BlamableInterface { + use TimestampableBlamableTrait; + #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] diff --git a/src/Entity/TaskBookStackLink.php b/src/Module/Integration/Domain/Entity/TaskBookStackLink.php similarity index 81% rename from src/Entity/TaskBookStackLink.php rename to src/Module/Integration/Domain/Entity/TaskBookStackLink.php index a9c6519..56fffa5 100644 --- a/src/Entity/TaskBookStackLink.php +++ b/src/Module/Integration/Domain/Entity/TaskBookStackLink.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace App\Entity; +namespace App\Module\Integration\Domain\Entity; -use App\Module\ProjectManagement\Domain\Entity\Task; -use App\Repository\TaskBookStackLinkRepository; +use App\Module\Integration\Infrastructure\Doctrine\DoctrineTaskBookStackLinkRepository; +use App\Shared\Domain\Contract\TaskInterface; use DateTimeImmutable; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; -#[ORM\Entity(repositoryClass: TaskBookStackLinkRepository::class)] +#[ORM\Entity(repositoryClass: DoctrineTaskBookStackLinkRepository::class)] #[ORM\UniqueConstraint(name: 'UNIQ_task_bookstack_link', columns: ['task_id', 'bookstack_id', 'bookstack_type'])] class TaskBookStackLink { @@ -19,9 +19,9 @@ class TaskBookStackLink #[ORM\Column] private ?int $id = null; - #[ORM\ManyToOne(targetEntity: Task::class)] + #[ORM\ManyToOne(targetEntity: TaskInterface::class)] #[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')] - private Task $task; + private TaskInterface $task; #[ORM\Column] private int $bookstackId; @@ -49,12 +49,12 @@ class TaskBookStackLink return $this->id; } - public function getTask(): Task + public function getTask(): TaskInterface { return $this->task; } - public function setTask(Task $task): static + public function setTask(TaskInterface $task): static { $this->task = $task; diff --git a/src/Entity/ZimbraConfiguration.php b/src/Module/Integration/Domain/Entity/ZimbraConfiguration.php similarity index 78% rename from src/Entity/ZimbraConfiguration.php rename to src/Module/Integration/Domain/Entity/ZimbraConfiguration.php index d867920..c5c4925 100644 --- a/src/Entity/ZimbraConfiguration.php +++ b/src/Module/Integration/Domain/Entity/ZimbraConfiguration.php @@ -2,15 +2,22 @@ declare(strict_types=1); -namespace App\Entity; +namespace App\Module\Integration\Domain\Entity; -use App\Repository\ZimbraConfigurationRepository; +use App\Module\Integration\Infrastructure\Doctrine\DoctrineZimbraConfigurationRepository; +use App\Shared\Domain\Attribute\Auditable; +use App\Shared\Domain\Contract\BlamableInterface; +use App\Shared\Domain\Contract\TimestampableInterface; +use App\Shared\Domain\Trait\TimestampableBlamableTrait; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Validator\Constraints as Assert; -#[ORM\Entity(repositoryClass: ZimbraConfigurationRepository::class)] -class ZimbraConfiguration +#[Auditable] +#[ORM\Entity(repositoryClass: DoctrineZimbraConfigurationRepository::class)] +class ZimbraConfiguration implements TimestampableInterface, BlamableInterface { + use TimestampableBlamableTrait; + #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] diff --git a/src/Exception/BookStackApiException.php b/src/Module/Integration/Domain/Exception/BookStackApiException.php similarity index 70% rename from src/Exception/BookStackApiException.php rename to src/Module/Integration/Domain/Exception/BookStackApiException.php index 5b9691a..d288730 100644 --- a/src/Exception/BookStackApiException.php +++ b/src/Module/Integration/Domain/Exception/BookStackApiException.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Exception; +namespace App\Module\Integration\Domain\Exception; use RuntimeException; diff --git a/src/Exception/GiteaApiException.php b/src/Module/Integration/Domain/Exception/GiteaApiException.php similarity index 69% rename from src/Exception/GiteaApiException.php rename to src/Module/Integration/Domain/Exception/GiteaApiException.php index d5174f0..39e4c05 100644 --- a/src/Exception/GiteaApiException.php +++ b/src/Module/Integration/Domain/Exception/GiteaApiException.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Exception; +namespace App\Module\Integration\Domain\Exception; use RuntimeException; diff --git a/src/Service/Share/Exception/InvalidPathException.php b/src/Module/Integration/Domain/Exception/InvalidPathException.php similarity index 69% rename from src/Service/Share/Exception/InvalidPathException.php rename to src/Module/Integration/Domain/Exception/InvalidPathException.php index 49d1280..23e20fe 100644 --- a/src/Service/Share/Exception/InvalidPathException.php +++ b/src/Module/Integration/Domain/Exception/InvalidPathException.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Service\Share\Exception; +namespace App\Module\Integration\Domain\Exception; use RuntimeException; diff --git a/src/Service/Share/Exception/ShareConnectionException.php b/src/Module/Integration/Domain/Exception/ShareConnectionException.php similarity index 70% rename from src/Service/Share/Exception/ShareConnectionException.php rename to src/Module/Integration/Domain/Exception/ShareConnectionException.php index c3bb11d..d5c9a3f 100644 --- a/src/Service/Share/Exception/ShareConnectionException.php +++ b/src/Module/Integration/Domain/Exception/ShareConnectionException.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Service\Share\Exception; +namespace App\Module\Integration\Domain\Exception; use RuntimeException; diff --git a/src/Service/Share/Exception/ShareNotConfiguredException.php b/src/Module/Integration/Domain/Exception/ShareNotConfiguredException.php similarity index 71% rename from src/Service/Share/Exception/ShareNotConfiguredException.php rename to src/Module/Integration/Domain/Exception/ShareNotConfiguredException.php index b9a1406..67a1ff7 100644 --- a/src/Service/Share/Exception/ShareNotConfiguredException.php +++ b/src/Module/Integration/Domain/Exception/ShareNotConfiguredException.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Service\Share\Exception; +namespace App\Module\Integration\Domain\Exception; use RuntimeException; diff --git a/src/Module/Integration/Domain/Repository/BookStackConfigurationRepositoryInterface.php b/src/Module/Integration/Domain/Repository/BookStackConfigurationRepositoryInterface.php new file mode 100644 index 0000000..30ba42f --- /dev/null +++ b/src/Module/Integration/Domain/Repository/BookStackConfigurationRepositoryInterface.php @@ -0,0 +1,12 @@ +em->getRepository(Task::class)->find($taskId); + $task = $this->taskRepository->findById((int) $taskId); if (null === $task) { throw new NotFoundHttpException('Task not found.'); @@ -65,7 +66,7 @@ final readonly class BookStackLinkProcessor implements ProcessorInterface private function handleDelete(array $uriVariables): null { $linkId = $uriVariables['id'] ?? 0; - $link = $this->linkRepository->find($linkId); + $link = $this->linkRepository->findById((int) $linkId); if (null === $link) { throw new NotFoundHttpException('Link not found.'); diff --git a/src/State/BookStackLinkProvider.php b/src/Module/Integration/Infrastructure/ApiPlatform/State/BookStackLinkProvider.php similarity index 81% rename from src/State/BookStackLinkProvider.php rename to src/Module/Integration/Infrastructure/ApiPlatform/State/BookStackLinkProvider.php index e7a0cdf..33492b0 100644 --- a/src/State/BookStackLinkProvider.php +++ b/src/Module/Integration/Infrastructure/ApiPlatform/State/BookStackLinkProvider.php @@ -2,21 +2,21 @@ declare(strict_types=1); -namespace App\State; +namespace App\Module\Integration\Infrastructure\ApiPlatform\State; use ApiPlatform\Metadata\Delete; use ApiPlatform\Metadata\Operation; use ApiPlatform\Metadata\Post; use ApiPlatform\State\ProviderInterface; -use App\ApiResource\BookStackLink; -use App\Entity\TaskBookStackLink; -use App\Repository\TaskBookStackLinkRepository; +use App\Module\Integration\Domain\Entity\TaskBookStackLink; +use App\Module\Integration\Domain\Repository\TaskBookStackLinkRepositoryInterface; +use App\Module\Integration\Infrastructure\ApiPlatform\Resource\BookStackLink; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; final readonly class BookStackLinkProvider implements ProviderInterface { public function __construct( - private TaskBookStackLinkRepository $linkRepository, + private TaskBookStackLinkRepositoryInterface $linkRepository, ) {} public function provide(Operation $operation, array $uriVariables = [], array $context = []): array|BookStackLink diff --git a/src/State/BookStackSearchResultProvider.php b/src/Module/Integration/Infrastructure/ApiPlatform/State/BookStackSearchResultProvider.php similarity index 76% rename from src/State/BookStackSearchResultProvider.php rename to src/Module/Integration/Infrastructure/ApiPlatform/State/BookStackSearchResultProvider.php index 014965d..377b101 100644 --- a/src/State/BookStackSearchResultProvider.php +++ b/src/Module/Integration/Infrastructure/ApiPlatform/State/BookStackSearchResultProvider.php @@ -2,15 +2,14 @@ declare(strict_types=1); -namespace App\State; +namespace App\Module\Integration\Infrastructure\ApiPlatform\State; use ApiPlatform\Metadata\Operation; use ApiPlatform\State\ProviderInterface; -use App\ApiResource\BookStackSearchResult; -use App\Exception\BookStackApiException; -use App\Module\ProjectManagement\Domain\Entity\Task; -use App\Service\BookStackApiService; -use Doctrine\ORM\EntityManagerInterface; +use App\Module\Integration\Domain\Exception\BookStackApiException; +use App\Module\Integration\Infrastructure\ApiPlatform\Resource\BookStackSearchResult; +use App\Module\Integration\Infrastructure\Service\BookStackApiService; +use App\Module\ProjectManagement\Domain\Repository\TaskRepositoryInterface; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; @@ -18,14 +17,14 @@ final readonly class BookStackSearchResultProvider implements ProviderInterface { public function __construct( private BookStackApiService $bookStackApiService, - private EntityManagerInterface $em, + private TaskRepositoryInterface $taskRepository, private RequestStack $requestStack, ) {} public function provide(Operation $operation, array $uriVariables = [], array $context = []): array { $taskId = $uriVariables['taskId'] ?? 0; - $task = $this->em->getRepository(Task::class)->find($taskId); + $task = $this->taskRepository->findById((int) $taskId); if (null === $task || null === $task->getProject()) { return []; diff --git a/src/State/BookStackSettingsProcessor.php b/src/Module/Integration/Infrastructure/ApiPlatform/State/BookStackSettingsProcessor.php similarity index 78% rename from src/State/BookStackSettingsProcessor.php rename to src/Module/Integration/Infrastructure/ApiPlatform/State/BookStackSettingsProcessor.php index d7d2217..7c591c5 100644 --- a/src/State/BookStackSettingsProcessor.php +++ b/src/Module/Integration/Infrastructure/ApiPlatform/State/BookStackSettingsProcessor.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace App\State; +namespace App\Module\Integration\Infrastructure\ApiPlatform\State; use ApiPlatform\Metadata\Operation; use ApiPlatform\State\ProcessorInterface; -use App\ApiResource\BookStackSettings; -use App\Entity\BookStackConfiguration; -use App\Repository\BookStackConfigurationRepository; +use App\Module\Integration\Domain\Entity\BookStackConfiguration; +use App\Module\Integration\Domain\Repository\BookStackConfigurationRepositoryInterface; +use App\Module\Integration\Infrastructure\ApiPlatform\Resource\BookStackSettings; use App\Service\TokenEncryptor; use Doctrine\ORM\EntityManagerInterface; @@ -16,7 +16,7 @@ final readonly class BookStackSettingsProcessor implements ProcessorInterface { public function __construct( private EntityManagerInterface $em, - private BookStackConfigurationRepository $configRepository, + private BookStackConfigurationRepositoryInterface $configRepository, private TokenEncryptor $tokenEncryptor, ) {} diff --git a/src/State/BookStackSettingsProvider.php b/src/Module/Integration/Infrastructure/ApiPlatform/State/BookStackSettingsProvider.php similarity index 66% rename from src/State/BookStackSettingsProvider.php rename to src/Module/Integration/Infrastructure/ApiPlatform/State/BookStackSettingsProvider.php index 5d0db34..82a4012 100644 --- a/src/State/BookStackSettingsProvider.php +++ b/src/Module/Integration/Infrastructure/ApiPlatform/State/BookStackSettingsProvider.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace App\State; +namespace App\Module\Integration\Infrastructure\ApiPlatform\State; use ApiPlatform\Metadata\Operation; use ApiPlatform\State\ProviderInterface; -use App\ApiResource\BookStackSettings; -use App\Repository\BookStackConfigurationRepository; +use App\Module\Integration\Domain\Repository\BookStackConfigurationRepositoryInterface; +use App\Module\Integration\Infrastructure\ApiPlatform\Resource\BookStackSettings; final readonly class BookStackSettingsProvider implements ProviderInterface { public function __construct( - private BookStackConfigurationRepository $configRepository, + private BookStackConfigurationRepositoryInterface $configRepository, ) {} public function provide(Operation $operation, array $uriVariables = [], array $context = []): BookStackSettings diff --git a/src/State/BookStackShelfProvider.php b/src/Module/Integration/Infrastructure/ApiPlatform/State/BookStackShelfProvider.php similarity index 76% rename from src/State/BookStackShelfProvider.php rename to src/Module/Integration/Infrastructure/ApiPlatform/State/BookStackShelfProvider.php index 71252e2..6733740 100644 --- a/src/State/BookStackShelfProvider.php +++ b/src/Module/Integration/Infrastructure/ApiPlatform/State/BookStackShelfProvider.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace App\State; +namespace App\Module\Integration\Infrastructure\ApiPlatform\State; use ApiPlatform\Metadata\Operation; use ApiPlatform\State\ProviderInterface; -use App\ApiResource\BookStackShelf; -use App\Exception\BookStackApiException; -use App\Service\BookStackApiService; +use App\Module\Integration\Domain\Exception\BookStackApiException; +use App\Module\Integration\Infrastructure\ApiPlatform\Resource\BookStackShelf; +use App\Module\Integration\Infrastructure\Service\BookStackApiService; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; final readonly class BookStackShelfProvider implements ProviderInterface diff --git a/src/State/BookStackTestConnectionProvider.php b/src/Module/Integration/Infrastructure/ApiPlatform/State/BookStackTestConnectionProvider.php similarity index 78% rename from src/State/BookStackTestConnectionProvider.php rename to src/Module/Integration/Infrastructure/ApiPlatform/State/BookStackTestConnectionProvider.php index 1eb88ee..8dcafc5 100644 --- a/src/State/BookStackTestConnectionProvider.php +++ b/src/Module/Integration/Infrastructure/ApiPlatform/State/BookStackTestConnectionProvider.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace App\State; +namespace App\Module\Integration\Infrastructure\ApiPlatform\State; use ApiPlatform\Metadata\Operation; use ApiPlatform\State\ProcessorInterface; use ApiPlatform\State\ProviderInterface; -use App\ApiResource\BookStackTestConnection; -use App\Service\BookStackApiService; +use App\Module\Integration\Infrastructure\ApiPlatform\Resource\BookStackTestConnection; +use App\Module\Integration\Infrastructure\Service\BookStackApiService; final readonly class BookStackTestConnectionProvider implements ProviderInterface, ProcessorInterface { diff --git a/src/State/GiteaBranchNameProvider.php b/src/Module/Integration/Infrastructure/ApiPlatform/State/GiteaBranchNameProvider.php similarity index 72% rename from src/State/GiteaBranchNameProvider.php rename to src/Module/Integration/Infrastructure/ApiPlatform/State/GiteaBranchNameProvider.php index 377ec4d..21c9772 100644 --- a/src/State/GiteaBranchNameProvider.php +++ b/src/Module/Integration/Infrastructure/ApiPlatform/State/GiteaBranchNameProvider.php @@ -2,14 +2,13 @@ declare(strict_types=1); -namespace App\State; +namespace App\Module\Integration\Infrastructure\ApiPlatform\State; use ApiPlatform\Metadata\Operation; use ApiPlatform\State\ProviderInterface; -use App\ApiResource\GiteaBranchName; -use App\Module\ProjectManagement\Domain\Entity\Task; -use App\Service\GiteaApiService; -use Doctrine\ORM\EntityManagerInterface; +use App\Module\Integration\Infrastructure\ApiPlatform\Resource\GiteaBranchName; +use App\Module\Integration\Infrastructure\Service\GiteaApiService; +use App\Module\ProjectManagement\Domain\Repository\TaskRepositoryInterface; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; @@ -20,12 +19,12 @@ final readonly class GiteaBranchNameProvider implements ProviderInterface public function __construct( private GiteaApiService $giteaApiService, - private EntityManagerInterface $em, + private TaskRepositoryInterface $taskRepository, ) {} public function provide(Operation $operation, array $uriVariables = [], array $context = []): GiteaBranchName { - $task = $this->em->getRepository(Task::class)->find($uriVariables['taskId'] ?? 0); + $task = $this->taskRepository->findById((int) ($uriVariables['taskId'] ?? 0)); if (null === $task) { throw new NotFoundHttpException('Task not found.'); } diff --git a/src/State/GiteaBranchProcessor.php b/src/Module/Integration/Infrastructure/ApiPlatform/State/GiteaBranchProcessor.php similarity index 75% rename from src/State/GiteaBranchProcessor.php rename to src/Module/Integration/Infrastructure/ApiPlatform/State/GiteaBranchProcessor.php index 7496eba..b4771f1 100644 --- a/src/State/GiteaBranchProcessor.php +++ b/src/Module/Integration/Infrastructure/ApiPlatform/State/GiteaBranchProcessor.php @@ -2,15 +2,14 @@ declare(strict_types=1); -namespace App\State; +namespace App\Module\Integration\Infrastructure\ApiPlatform\State; use ApiPlatform\Metadata\Operation; use ApiPlatform\State\ProcessorInterface; -use App\ApiResource\GiteaBranch; -use App\Exception\GiteaApiException; -use App\Module\ProjectManagement\Domain\Entity\Task; -use App\Service\GiteaApiService; -use Doctrine\ORM\EntityManagerInterface; +use App\Module\Integration\Domain\Exception\GiteaApiException; +use App\Module\Integration\Infrastructure\ApiPlatform\Resource\GiteaBranch; +use App\Module\Integration\Infrastructure\Service\GiteaApiService; +use App\Module\ProjectManagement\Domain\Repository\TaskRepositoryInterface; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; @@ -20,14 +19,14 @@ final readonly class GiteaBranchProcessor implements ProcessorInterface public function __construct( private GiteaApiService $giteaApiService, - private EntityManagerInterface $em, + private TaskRepositoryInterface $taskRepository, ) {} public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = []): GiteaBranch { assert($data instanceof GiteaBranch); - $task = $this->em->getRepository(Task::class)->find($uriVariables['taskId'] ?? 0); + $task = $this->taskRepository->findById((int) ($uriVariables['taskId'] ?? 0)); if (null === $task || null === $task->getProject()) { throw new NotFoundHttpException('Task not found.'); } diff --git a/src/State/GiteaBranchProvider.php b/src/Module/Integration/Infrastructure/ApiPlatform/State/GiteaBranchProvider.php similarity index 80% rename from src/State/GiteaBranchProvider.php rename to src/Module/Integration/Infrastructure/ApiPlatform/State/GiteaBranchProvider.php index 908e49f..80d8abd 100644 --- a/src/State/GiteaBranchProvider.php +++ b/src/Module/Integration/Infrastructure/ApiPlatform/State/GiteaBranchProvider.php @@ -2,23 +2,22 @@ declare(strict_types=1); -namespace App\State; +namespace App\Module\Integration\Infrastructure\ApiPlatform\State; use ApiPlatform\Metadata\Operation; use ApiPlatform\Metadata\Post; use ApiPlatform\State\ProviderInterface; -use App\ApiResource\GiteaBranch; -use App\Exception\GiteaApiException; -use App\Module\ProjectManagement\Domain\Entity\Task; -use App\Service\GiteaApiService; -use Doctrine\ORM\EntityManagerInterface; +use App\Module\Integration\Domain\Exception\GiteaApiException; +use App\Module\Integration\Infrastructure\ApiPlatform\Resource\GiteaBranch; +use App\Module\Integration\Infrastructure\Service\GiteaApiService; +use App\Module\ProjectManagement\Domain\Repository\TaskRepositoryInterface; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; final readonly class GiteaBranchProvider implements ProviderInterface { public function __construct( private GiteaApiService $giteaApiService, - private EntityManagerInterface $em, + private TaskRepositoryInterface $taskRepository, ) {} public function provide(Operation $operation, array $uriVariables = [], array $context = []): array|GiteaBranch @@ -27,7 +26,7 @@ final readonly class GiteaBranchProvider implements ProviderInterface return new GiteaBranch(); } - $task = $this->em->getRepository(Task::class)->find($uriVariables['taskId'] ?? 0); + $task = $this->taskRepository->findById((int) ($uriVariables['taskId'] ?? 0)); if (null === $task || null === $task->getProject()) { return []; } diff --git a/src/State/GiteaPullRequestProvider.php b/src/Module/Integration/Infrastructure/ApiPlatform/State/GiteaPullRequestProvider.php similarity index 78% rename from src/State/GiteaPullRequestProvider.php rename to src/Module/Integration/Infrastructure/ApiPlatform/State/GiteaPullRequestProvider.php index 0ca9b4a..a4933ac 100644 --- a/src/State/GiteaPullRequestProvider.php +++ b/src/Module/Integration/Infrastructure/ApiPlatform/State/GiteaPullRequestProvider.php @@ -2,27 +2,26 @@ declare(strict_types=1); -namespace App\State; +namespace App\Module\Integration\Infrastructure\ApiPlatform\State; use ApiPlatform\Metadata\Operation; use ApiPlatform\State\ProviderInterface; -use App\ApiResource\GiteaPullRequest; -use App\Exception\GiteaApiException; -use App\Module\ProjectManagement\Domain\Entity\Task; -use App\Service\GiteaApiService; -use Doctrine\ORM\EntityManagerInterface; +use App\Module\Integration\Domain\Exception\GiteaApiException; +use App\Module\Integration\Infrastructure\ApiPlatform\Resource\GiteaPullRequest; +use App\Module\Integration\Infrastructure\Service\GiteaApiService; +use App\Module\ProjectManagement\Domain\Repository\TaskRepositoryInterface; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; final readonly class GiteaPullRequestProvider implements ProviderInterface { public function __construct( private GiteaApiService $giteaApiService, - private EntityManagerInterface $em, + private TaskRepositoryInterface $taskRepository, ) {} public function provide(Operation $operation, array $uriVariables = [], array $context = []): array { - $task = $this->em->getRepository(Task::class)->find($uriVariables['taskId'] ?? 0); + $task = $this->taskRepository->findById((int) ($uriVariables['taskId'] ?? 0)); if (null === $task || null === $task->getProject()) { return []; } diff --git a/src/State/GiteaRepositoryProvider.php b/src/Module/Integration/Infrastructure/ApiPlatform/State/GiteaRepositoryProvider.php similarity index 78% rename from src/State/GiteaRepositoryProvider.php rename to src/Module/Integration/Infrastructure/ApiPlatform/State/GiteaRepositoryProvider.php index e483897..5ecb119 100644 --- a/src/State/GiteaRepositoryProvider.php +++ b/src/Module/Integration/Infrastructure/ApiPlatform/State/GiteaRepositoryProvider.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace App\State; +namespace App\Module\Integration\Infrastructure\ApiPlatform\State; use ApiPlatform\Metadata\Operation; use ApiPlatform\State\ProviderInterface; -use App\ApiResource\GiteaRepository; -use App\Exception\GiteaApiException; -use App\Service\GiteaApiService; +use App\Module\Integration\Domain\Exception\GiteaApiException; +use App\Module\Integration\Infrastructure\ApiPlatform\Resource\GiteaRepository; +use App\Module\Integration\Infrastructure\Service\GiteaApiService; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; final readonly class GiteaRepositoryProvider implements ProviderInterface diff --git a/src/State/GiteaSettingsProcessor.php b/src/Module/Integration/Infrastructure/ApiPlatform/State/GiteaSettingsProcessor.php similarity index 76% rename from src/State/GiteaSettingsProcessor.php rename to src/Module/Integration/Infrastructure/ApiPlatform/State/GiteaSettingsProcessor.php index 48e59e8..60363a5 100644 --- a/src/State/GiteaSettingsProcessor.php +++ b/src/Module/Integration/Infrastructure/ApiPlatform/State/GiteaSettingsProcessor.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace App\State; +namespace App\Module\Integration\Infrastructure\ApiPlatform\State; use ApiPlatform\Metadata\Operation; use ApiPlatform\State\ProcessorInterface; -use App\ApiResource\GiteaSettings; -use App\Entity\GiteaConfiguration; -use App\Repository\GiteaConfigurationRepository; +use App\Module\Integration\Domain\Entity\GiteaConfiguration; +use App\Module\Integration\Domain\Repository\GiteaConfigurationRepositoryInterface; +use App\Module\Integration\Infrastructure\ApiPlatform\Resource\GiteaSettings; use App\Service\TokenEncryptor; use Doctrine\ORM\EntityManagerInterface; @@ -16,7 +16,7 @@ final readonly class GiteaSettingsProcessor implements ProcessorInterface { public function __construct( private EntityManagerInterface $em, - private GiteaConfigurationRepository $configRepository, + private GiteaConfigurationRepositoryInterface $configRepository, private TokenEncryptor $tokenEncryptor, ) {} diff --git a/src/State/GiteaSettingsProvider.php b/src/Module/Integration/Infrastructure/ApiPlatform/State/GiteaSettingsProvider.php similarity index 67% rename from src/State/GiteaSettingsProvider.php rename to src/Module/Integration/Infrastructure/ApiPlatform/State/GiteaSettingsProvider.php index 7b3c76a..3e90274 100644 --- a/src/State/GiteaSettingsProvider.php +++ b/src/Module/Integration/Infrastructure/ApiPlatform/State/GiteaSettingsProvider.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace App\State; +namespace App\Module\Integration\Infrastructure\ApiPlatform\State; use ApiPlatform\Metadata\Operation; use ApiPlatform\State\ProviderInterface; -use App\ApiResource\GiteaSettings; -use App\Repository\GiteaConfigurationRepository; +use App\Module\Integration\Domain\Repository\GiteaConfigurationRepositoryInterface; +use App\Module\Integration\Infrastructure\ApiPlatform\Resource\GiteaSettings; final readonly class GiteaSettingsProvider implements ProviderInterface { public function __construct( - private GiteaConfigurationRepository $configRepository, + private GiteaConfigurationRepositoryInterface $configRepository, ) {} public function provide(Operation $operation, array $uriVariables = [], array $context = []): GiteaSettings diff --git a/src/State/GiteaTestConnectionProvider.php b/src/Module/Integration/Infrastructure/ApiPlatform/State/GiteaTestConnectionProvider.php similarity index 78% rename from src/State/GiteaTestConnectionProvider.php rename to src/Module/Integration/Infrastructure/ApiPlatform/State/GiteaTestConnectionProvider.php index 608c60f..d7d90bf 100644 --- a/src/State/GiteaTestConnectionProvider.php +++ b/src/Module/Integration/Infrastructure/ApiPlatform/State/GiteaTestConnectionProvider.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace App\State; +namespace App\Module\Integration\Infrastructure\ApiPlatform\State; use ApiPlatform\Metadata\Operation; use ApiPlatform\State\ProcessorInterface; use ApiPlatform\State\ProviderInterface; -use App\ApiResource\GiteaTestConnection; -use App\Service\GiteaApiService; +use App\Module\Integration\Infrastructure\ApiPlatform\Resource\GiteaTestConnection; +use App\Module\Integration\Infrastructure\Service\GiteaApiService; final readonly class GiteaTestConnectionProvider implements ProviderInterface, ProcessorInterface { diff --git a/src/State/ShareSettingsProcessor.php b/src/Module/Integration/Infrastructure/ApiPlatform/State/ShareSettingsProcessor.php similarity index 81% rename from src/State/ShareSettingsProcessor.php rename to src/Module/Integration/Infrastructure/ApiPlatform/State/ShareSettingsProcessor.php index ce43f86..53a3868 100644 --- a/src/State/ShareSettingsProcessor.php +++ b/src/Module/Integration/Infrastructure/ApiPlatform/State/ShareSettingsProcessor.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace App\State; +namespace App\Module\Integration\Infrastructure\ApiPlatform\State; use ApiPlatform\Metadata\Operation; use ApiPlatform\State\ProcessorInterface; -use App\ApiResource\ShareSettings; -use App\Entity\ShareConfiguration; -use App\Repository\ShareConfigurationRepository; +use App\Module\Integration\Domain\Entity\ShareConfiguration; +use App\Module\Integration\Domain\Repository\ShareConfigurationRepositoryInterface; +use App\Module\Integration\Infrastructure\ApiPlatform\Resource\ShareSettings; use App\Service\TokenEncryptor; use Doctrine\ORM\EntityManagerInterface; @@ -16,7 +16,7 @@ final readonly class ShareSettingsProcessor implements ProcessorInterface { public function __construct( private EntityManagerInterface $em, - private ShareConfigurationRepository $configRepository, + private ShareConfigurationRepositoryInterface $configRepository, private TokenEncryptor $tokenEncryptor, ) {} diff --git a/src/State/ShareSettingsProvider.php b/src/Module/Integration/Infrastructure/ApiPlatform/State/ShareSettingsProvider.php similarity index 74% rename from src/State/ShareSettingsProvider.php rename to src/Module/Integration/Infrastructure/ApiPlatform/State/ShareSettingsProvider.php index 0b43e3c..3b8a316 100644 --- a/src/State/ShareSettingsProvider.php +++ b/src/Module/Integration/Infrastructure/ApiPlatform/State/ShareSettingsProvider.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace App\State; +namespace App\Module\Integration\Infrastructure\ApiPlatform\State; use ApiPlatform\Metadata\Operation; use ApiPlatform\State\ProviderInterface; -use App\ApiResource\ShareSettings; -use App\Repository\ShareConfigurationRepository; +use App\Module\Integration\Domain\Repository\ShareConfigurationRepositoryInterface; +use App\Module\Integration\Infrastructure\ApiPlatform\Resource\ShareSettings; final readonly class ShareSettingsProvider implements ProviderInterface { public function __construct( - private ShareConfigurationRepository $configRepository, + private ShareConfigurationRepositoryInterface $configRepository, ) {} public function provide(Operation $operation, array $uriVariables = [], array $context = []): ShareSettings diff --git a/src/State/ShareTestConnectionProvider.php b/src/Module/Integration/Infrastructure/ApiPlatform/State/ShareTestConnectionProvider.php similarity index 80% rename from src/State/ShareTestConnectionProvider.php rename to src/Module/Integration/Infrastructure/ApiPlatform/State/ShareTestConnectionProvider.php index 4e1d393..1a600d8 100644 --- a/src/State/ShareTestConnectionProvider.php +++ b/src/Module/Integration/Infrastructure/ApiPlatform/State/ShareTestConnectionProvider.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace App\State; +namespace App\Module\Integration\Infrastructure\ApiPlatform\State; use ApiPlatform\Metadata\Operation; use ApiPlatform\State\ProcessorInterface; use ApiPlatform\State\ProviderInterface; -use App\ApiResource\ShareTestConnection; -use App\Service\Share\FileSource; +use App\Module\Integration\Domain\Service\FileSource; +use App\Module\Integration\Infrastructure\ApiPlatform\Resource\ShareTestConnection; final readonly class ShareTestConnectionProvider implements ProviderInterface, ProcessorInterface { diff --git a/src/State/ZimbraSettingsProcessor.php b/src/Module/Integration/Infrastructure/ApiPlatform/State/ZimbraSettingsProcessor.php similarity index 80% rename from src/State/ZimbraSettingsProcessor.php rename to src/Module/Integration/Infrastructure/ApiPlatform/State/ZimbraSettingsProcessor.php index 7825a6b..3d940b7 100644 --- a/src/State/ZimbraSettingsProcessor.php +++ b/src/Module/Integration/Infrastructure/ApiPlatform/State/ZimbraSettingsProcessor.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace App\State; +namespace App\Module\Integration\Infrastructure\ApiPlatform\State; use ApiPlatform\Metadata\Operation; use ApiPlatform\State\ProcessorInterface; -use App\ApiResource\ZimbraSettings; -use App\Entity\ZimbraConfiguration; -use App\Repository\ZimbraConfigurationRepository; +use App\Module\Integration\Domain\Entity\ZimbraConfiguration; +use App\Module\Integration\Domain\Repository\ZimbraConfigurationRepositoryInterface; +use App\Module\Integration\Infrastructure\ApiPlatform\Resource\ZimbraSettings; use App\Service\TokenEncryptor; use Doctrine\ORM\EntityManagerInterface; @@ -16,7 +16,7 @@ final readonly class ZimbraSettingsProcessor implements ProcessorInterface { public function __construct( private EntityManagerInterface $em, - private ZimbraConfigurationRepository $configRepository, + private ZimbraConfigurationRepositoryInterface $configRepository, private TokenEncryptor $tokenEncryptor, ) {} diff --git a/src/State/ZimbraSettingsProvider.php b/src/Module/Integration/Infrastructure/ApiPlatform/State/ZimbraSettingsProvider.php similarity index 72% rename from src/State/ZimbraSettingsProvider.php rename to src/Module/Integration/Infrastructure/ApiPlatform/State/ZimbraSettingsProvider.php index fe95719..a33f45d 100644 --- a/src/State/ZimbraSettingsProvider.php +++ b/src/Module/Integration/Infrastructure/ApiPlatform/State/ZimbraSettingsProvider.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace App\State; +namespace App\Module\Integration\Infrastructure\ApiPlatform\State; use ApiPlatform\Metadata\Operation; use ApiPlatform\State\ProviderInterface; -use App\ApiResource\ZimbraSettings; -use App\Repository\ZimbraConfigurationRepository; +use App\Module\Integration\Domain\Repository\ZimbraConfigurationRepositoryInterface; +use App\Module\Integration\Infrastructure\ApiPlatform\Resource\ZimbraSettings; final readonly class ZimbraSettingsProvider implements ProviderInterface { public function __construct( - private ZimbraConfigurationRepository $configRepository, + private ZimbraConfigurationRepositoryInterface $configRepository, ) {} public function provide(Operation $operation, array $uriVariables = [], array $context = []): ZimbraSettings diff --git a/src/State/ZimbraTestConnectionProvider.php b/src/Module/Integration/Infrastructure/ApiPlatform/State/ZimbraTestConnectionProvider.php similarity index 86% rename from src/State/ZimbraTestConnectionProvider.php rename to src/Module/Integration/Infrastructure/ApiPlatform/State/ZimbraTestConnectionProvider.php index 0148f82..f10f72a 100644 --- a/src/State/ZimbraTestConnectionProvider.php +++ b/src/Module/Integration/Infrastructure/ApiPlatform/State/ZimbraTestConnectionProvider.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace App\State; +namespace App\Module\Integration\Infrastructure\ApiPlatform\State; use ApiPlatform\Metadata\Operation; use ApiPlatform\State\ProcessorInterface; use ApiPlatform\State\ProviderInterface; -use App\ApiResource\ZimbraTestConnection; +use App\Module\Integration\Infrastructure\ApiPlatform\Resource\ZimbraTestConnection; use App\Module\ProjectManagement\Infrastructure\Service\CalDavService; use Throwable; diff --git a/src/Controller/Share/ShareBrowseController.php b/src/Module/Integration/Infrastructure/Controller/ShareBrowseController.php similarity index 83% rename from src/Controller/Share/ShareBrowseController.php rename to src/Module/Integration/Infrastructure/Controller/ShareBrowseController.php index ce44962..dca367e 100644 --- a/src/Controller/Share/ShareBrowseController.php +++ b/src/Module/Integration/Infrastructure/Controller/ShareBrowseController.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace App\Controller\Share; +namespace App\Module\Integration\Infrastructure\Controller; -use App\Service\Share\Exception\InvalidPathException; -use App\Service\Share\Exception\ShareConnectionException; -use App\Service\Share\Exception\ShareNotConfiguredException; -use App\Service\Share\FileEntry; -use App\Service\Share\FileSource; -use App\Service\Share\SharePathResolver; +use App\Module\Integration\Domain\Exception\InvalidPathException; +use App\Module\Integration\Domain\Exception\ShareConnectionException; +use App\Module\Integration\Domain\Exception\ShareNotConfiguredException; +use App\Module\Integration\Domain\Service\FileEntry; +use App\Module\Integration\Domain\Service\FileSource; +use App\Module\Integration\Domain\Service\SharePathResolver; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; diff --git a/src/Controller/Share/ShareDownloadController.php b/src/Module/Integration/Infrastructure/Controller/ShareDownloadController.php similarity index 88% rename from src/Controller/Share/ShareDownloadController.php rename to src/Module/Integration/Infrastructure/Controller/ShareDownloadController.php index b3eb5bd..9973f4f 100644 --- a/src/Controller/Share/ShareDownloadController.php +++ b/src/Module/Integration/Infrastructure/Controller/ShareDownloadController.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace App\Controller\Share; +namespace App\Module\Integration\Infrastructure\Controller; -use App\Service\Share\Exception\InvalidPathException; -use App\Service\Share\Exception\ShareConnectionException; -use App\Service\Share\Exception\ShareNotConfiguredException; -use App\Service\Share\FileSource; -use App\Service\Share\SharePathResolver; +use App\Module\Integration\Domain\Exception\InvalidPathException; +use App\Module\Integration\Domain\Exception\ShareConnectionException; +use App\Module\Integration\Domain\Exception\ShareNotConfiguredException; +use App\Module\Integration\Domain\Service\FileSource; +use App\Module\Integration\Domain\Service\SharePathResolver; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\HeaderUtils; use Symfony\Component\HttpFoundation\Request; diff --git a/src/Controller/Share/ShareSearchController.php b/src/Module/Integration/Infrastructure/Controller/ShareSearchController.php similarity index 85% rename from src/Controller/Share/ShareSearchController.php rename to src/Module/Integration/Infrastructure/Controller/ShareSearchController.php index aa5512b..7a955f9 100644 --- a/src/Controller/Share/ShareSearchController.php +++ b/src/Module/Integration/Infrastructure/Controller/ShareSearchController.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace App\Controller\Share; +namespace App\Module\Integration\Infrastructure\Controller; -use App\Service\Share\Exception\ShareConnectionException; -use App\Service\Share\Exception\ShareNotConfiguredException; -use App\Service\Share\FileEntry; -use App\Service\Share\FileSource; +use App\Module\Integration\Domain\Exception\ShareConnectionException; +use App\Module\Integration\Domain\Exception\ShareNotConfiguredException; +use App\Module\Integration\Domain\Service\FileEntry; +use App\Module\Integration\Domain\Service\FileSource; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; diff --git a/src/Controller/Share/ShareStatusController.php b/src/Module/Integration/Infrastructure/Controller/ShareStatusController.php similarity index 75% rename from src/Controller/Share/ShareStatusController.php rename to src/Module/Integration/Infrastructure/Controller/ShareStatusController.php index 4c226cb..3776160 100644 --- a/src/Controller/Share/ShareStatusController.php +++ b/src/Module/Integration/Infrastructure/Controller/ShareStatusController.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace App\Controller\Share; +namespace App\Module\Integration\Infrastructure\Controller; -use App\Repository\ShareConfigurationRepository; +use App\Module\Integration\Domain\Repository\ShareConfigurationRepositoryInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Routing\Attribute\Route; @@ -13,7 +13,7 @@ use Symfony\Component\Security\Http\Attribute\IsGranted; class ShareStatusController extends AbstractController { public function __construct( - private readonly ShareConfigurationRepository $configRepository, + private readonly ShareConfigurationRepositoryInterface $configRepository, ) {} #[Route('/api/share/status', name: 'share_status', methods: ['GET'], priority: 1)] diff --git a/src/Module/Integration/Infrastructure/Doctrine/DoctrineBookStackConfigurationRepository.php b/src/Module/Integration/Infrastructure/Doctrine/DoctrineBookStackConfigurationRepository.php new file mode 100644 index 0000000..32a5eb4 --- /dev/null +++ b/src/Module/Integration/Infrastructure/Doctrine/DoctrineBookStackConfigurationRepository.php @@ -0,0 +1,26 @@ + + */ +class DoctrineBookStackConfigurationRepository extends ServiceEntityRepository implements BookStackConfigurationRepositoryInterface +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, BookStackConfiguration::class); + } + + public function findSingleton(): ?BookStackConfiguration + { + return $this->findOneBy([]); + } +} diff --git a/src/Repository/GiteaConfigurationRepository.php b/src/Module/Integration/Infrastructure/Doctrine/DoctrineGiteaConfigurationRepository.php similarity index 50% rename from src/Repository/GiteaConfigurationRepository.php rename to src/Module/Integration/Infrastructure/Doctrine/DoctrineGiteaConfigurationRepository.php index 4f1096e..2b81fda 100644 --- a/src/Repository/GiteaConfigurationRepository.php +++ b/src/Module/Integration/Infrastructure/Doctrine/DoctrineGiteaConfigurationRepository.php @@ -2,13 +2,17 @@ declare(strict_types=1); -namespace App\Repository; +namespace App\Module\Integration\Infrastructure\Doctrine; -use App\Entity\GiteaConfiguration; +use App\Module\Integration\Domain\Entity\GiteaConfiguration; +use App\Module\Integration\Domain\Repository\GiteaConfigurationRepositoryInterface; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Persistence\ManagerRegistry; -class GiteaConfigurationRepository extends ServiceEntityRepository +/** + * @extends ServiceEntityRepository + */ +class DoctrineGiteaConfigurationRepository extends ServiceEntityRepository implements GiteaConfigurationRepositoryInterface { public function __construct(ManagerRegistry $registry) { diff --git a/src/Repository/ShareConfigurationRepository.php b/src/Module/Integration/Infrastructure/Doctrine/DoctrineShareConfigurationRepository.php similarity index 56% rename from src/Repository/ShareConfigurationRepository.php rename to src/Module/Integration/Infrastructure/Doctrine/DoctrineShareConfigurationRepository.php index 066236b..13038bf 100644 --- a/src/Repository/ShareConfigurationRepository.php +++ b/src/Module/Integration/Infrastructure/Doctrine/DoctrineShareConfigurationRepository.php @@ -2,13 +2,17 @@ declare(strict_types=1); -namespace App\Repository; +namespace App\Module\Integration\Infrastructure\Doctrine; -use App\Entity\ShareConfiguration; +use App\Module\Integration\Domain\Entity\ShareConfiguration; +use App\Module\Integration\Domain\Repository\ShareConfigurationRepositoryInterface; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Persistence\ManagerRegistry; -class ShareConfigurationRepository extends ServiceEntityRepository +/** + * @extends ServiceEntityRepository + */ +class DoctrineShareConfigurationRepository extends ServiceEntityRepository implements ShareConfigurationRepositoryInterface { public function __construct(ManagerRegistry $registry) { diff --git a/src/Module/Integration/Infrastructure/Doctrine/DoctrineTaskBookStackLinkRepository.php b/src/Module/Integration/Infrastructure/Doctrine/DoctrineTaskBookStackLinkRepository.php new file mode 100644 index 0000000..00eef16 --- /dev/null +++ b/src/Module/Integration/Infrastructure/Doctrine/DoctrineTaskBookStackLinkRepository.php @@ -0,0 +1,34 @@ + + */ +class DoctrineTaskBookStackLinkRepository extends ServiceEntityRepository implements TaskBookStackLinkRepositoryInterface +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, TaskBookStackLink::class); + } + + public function findById(int $id): ?TaskBookStackLink + { + return $this->find($id); + } + + /** + * @return TaskBookStackLink[] + */ + public function findByTaskId(int $taskId): array + { + return $this->findBy(['task' => $taskId], ['createdAt' => 'DESC']); + } +} diff --git a/src/Repository/ZimbraConfigurationRepository.php b/src/Module/Integration/Infrastructure/Doctrine/DoctrineZimbraConfigurationRepository.php similarity index 56% rename from src/Repository/ZimbraConfigurationRepository.php rename to src/Module/Integration/Infrastructure/Doctrine/DoctrineZimbraConfigurationRepository.php index 24a9b6c..fd5529a 100644 --- a/src/Repository/ZimbraConfigurationRepository.php +++ b/src/Module/Integration/Infrastructure/Doctrine/DoctrineZimbraConfigurationRepository.php @@ -2,13 +2,17 @@ declare(strict_types=1); -namespace App\Repository; +namespace App\Module\Integration\Infrastructure\Doctrine; -use App\Entity\ZimbraConfiguration; +use App\Module\Integration\Domain\Entity\ZimbraConfiguration; +use App\Module\Integration\Domain\Repository\ZimbraConfigurationRepositoryInterface; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Persistence\ManagerRegistry; -class ZimbraConfigurationRepository extends ServiceEntityRepository +/** + * @extends ServiceEntityRepository + */ +class DoctrineZimbraConfigurationRepository extends ServiceEntityRepository implements ZimbraConfigurationRepositoryInterface { public function __construct(ManagerRegistry $registry) { diff --git a/src/Service/BookStackApiService.php b/src/Module/Integration/Infrastructure/Service/BookStackApiService.php similarity index 94% rename from src/Service/BookStackApiService.php rename to src/Module/Integration/Infrastructure/Service/BookStackApiService.php index cf4b66c..2589dd4 100644 --- a/src/Service/BookStackApiService.php +++ b/src/Module/Integration/Infrastructure/Service/BookStackApiService.php @@ -2,11 +2,12 @@ declare(strict_types=1); -namespace App\Service; +namespace App\Module\Integration\Infrastructure\Service; -use App\Entity\BookStackConfiguration; -use App\Exception\BookStackApiException; -use App\Repository\BookStackConfigurationRepository; +use App\Module\Integration\Domain\Entity\BookStackConfiguration; +use App\Module\Integration\Domain\Exception\BookStackApiException; +use App\Module\Integration\Domain\Repository\BookStackConfigurationRepositoryInterface; +use App\Service\TokenEncryptor; use Symfony\Contracts\HttpClient\Exception\ExceptionInterface; use Symfony\Contracts\HttpClient\Exception\HttpExceptionInterface; use Symfony\Contracts\HttpClient\HttpClientInterface; @@ -19,7 +20,7 @@ final class BookStackApiService public function __construct( private readonly HttpClientInterface $httpClient, - private readonly BookStackConfigurationRepository $configRepository, + private readonly BookStackConfigurationRepositoryInterface $configRepository, private readonly TokenEncryptor $tokenEncryptor, ) {} diff --git a/src/Service/GiteaApiService.php b/src/Module/Integration/Infrastructure/Service/GiteaApiService.php similarity index 95% rename from src/Service/GiteaApiService.php rename to src/Module/Integration/Infrastructure/Service/GiteaApiService.php index 95b6741..7162121 100644 --- a/src/Service/GiteaApiService.php +++ b/src/Module/Integration/Infrastructure/Service/GiteaApiService.php @@ -2,13 +2,14 @@ declare(strict_types=1); -namespace App\Service; +namespace App\Module\Integration\Infrastructure\Service; -use App\Entity\GiteaConfiguration; -use App\Exception\GiteaApiException; +use App\Module\Integration\Domain\Entity\GiteaConfiguration; +use App\Module\Integration\Domain\Exception\GiteaApiException; +use App\Module\Integration\Domain\Repository\GiteaConfigurationRepositoryInterface; use App\Module\ProjectManagement\Domain\Entity\Project; use App\Module\ProjectManagement\Domain\Entity\Task; -use App\Repository\GiteaConfigurationRepository; +use App\Service\TokenEncryptor; use Symfony\Component\String\Slugger\AsciiSlugger; use Symfony\Component\String\Slugger\SluggerInterface; use Symfony\Contracts\HttpClient\Exception\ExceptionInterface; @@ -22,7 +23,7 @@ final readonly class GiteaApiService public function __construct( private HttpClientInterface $httpClient, - private GiteaConfigurationRepository $configRepository, + private GiteaConfigurationRepositoryInterface $configRepository, private TokenEncryptor $tokenEncryptor, ) { $this->slugger = new AsciiSlugger('fr'); diff --git a/src/Service/Share/SmbFileSource.php b/src/Module/Integration/Infrastructure/Service/SmbFileSource.php similarity index 90% rename from src/Service/Share/SmbFileSource.php rename to src/Module/Integration/Infrastructure/Service/SmbFileSource.php index d4f29fd..71dbe8b 100644 --- a/src/Service/Share/SmbFileSource.php +++ b/src/Module/Integration/Infrastructure/Service/SmbFileSource.php @@ -2,12 +2,16 @@ declare(strict_types=1); -namespace App\Service\Share; +namespace App\Module\Integration\Infrastructure\Service; -use App\Entity\ShareConfiguration; -use App\Repository\ShareConfigurationRepository; -use App\Service\Share\Exception\ShareConnectionException; -use App\Service\Share\Exception\ShareNotConfiguredException; +use App\Module\Integration\Domain\Entity\ShareConfiguration; +use App\Module\Integration\Domain\Exception\ShareConnectionException; +use App\Module\Integration\Domain\Exception\ShareNotConfiguredException; +use App\Module\Integration\Domain\Repository\ShareConfigurationRepositoryInterface; +use App\Module\Integration\Domain\Service\FileEntry; +use App\Module\Integration\Domain\Service\FileSource; +use App\Module\Integration\Domain\Service\SharePathResolver; +use App\Module\Integration\Domain\Service\ShareTestResult; use App\Service\TokenEncryptor; use Icewind\SMB\BasicAuth; use Icewind\SMB\IFileInfo; @@ -24,7 +28,7 @@ final class SmbFileSource implements FileSource private const int SEARCH_MAX_DIRS = 2000; public function __construct( - private readonly ShareConfigurationRepository $configRepository, + private readonly ShareConfigurationRepositoryInterface $configRepository, private readonly TokenEncryptor $tokenEncryptor, private readonly SharePathResolver $pathResolver, ) {} diff --git a/src/Module/Integration/IntegrationModule.php b/src/Module/Integration/IntegrationModule.php new file mode 100644 index 0000000..1aacd90 --- /dev/null +++ b/src/Module/Integration/IntegrationModule.php @@ -0,0 +1,41 @@ + + */ + public static function permissions(): array + { + return [ + ['code' => 'integration.settings.manage', 'label' => 'Gérer les intégrations externes'], + ['code' => 'integration.share.access', 'label' => 'Accéder au partage de fichiers'], + ]; + } +} diff --git a/src/Module/ProjectManagement/Infrastructure/ApiPlatform/State/TaskDocumentProcessor.php b/src/Module/ProjectManagement/Infrastructure/ApiPlatform/State/TaskDocumentProcessor.php index 47adceb..5c579c9 100644 --- a/src/Module/ProjectManagement/Infrastructure/ApiPlatform/State/TaskDocumentProcessor.php +++ b/src/Module/ProjectManagement/Infrastructure/ApiPlatform/State/TaskDocumentProcessor.php @@ -6,14 +6,14 @@ namespace App\Module\ProjectManagement\Infrastructure\ApiPlatform\State; use ApiPlatform\Metadata\Operation; use ApiPlatform\State\ProcessorInterface; +use App\Module\Integration\Domain\Exception\InvalidPathException; +use App\Module\Integration\Domain\Exception\ShareConnectionException; +use App\Module\Integration\Domain\Exception\ShareNotConfiguredException; +use App\Module\Integration\Domain\Service\FileEntry; +use App\Module\Integration\Domain\Service\FileSource; +use App\Module\Integration\Domain\Service\SharePathResolver; 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; -use App\Service\Share\FileEntry; -use App\Service\Share\FileSource; -use App\Service\Share\SharePathResolver; use DateTimeImmutable; use Doctrine\ORM\EntityManagerInterface; use Symfony\Bundle\SecurityBundle\Security; diff --git a/src/Module/ProjectManagement/Infrastructure/Controller/TaskDocumentDownloadController.php b/src/Module/ProjectManagement/Infrastructure/Controller/TaskDocumentDownloadController.php index 6c93a7f..9d8e2b7 100644 --- a/src/Module/ProjectManagement/Infrastructure/Controller/TaskDocumentDownloadController.php +++ b/src/Module/ProjectManagement/Infrastructure/Controller/TaskDocumentDownloadController.php @@ -4,10 +4,10 @@ declare(strict_types=1); namespace App\Module\ProjectManagement\Infrastructure\Controller; +use App\Module\Integration\Domain\Exception\ShareConnectionException; +use App\Module\Integration\Domain\Exception\ShareNotConfiguredException; +use App\Module\Integration\Domain\Service\FileSource; use App\Module\ProjectManagement\Domain\Entity\TaskDocument; -use App\Service\Share\Exception\ShareConnectionException; -use App\Service\Share\Exception\ShareNotConfiguredException; -use App\Service\Share\FileSource; use Doctrine\ORM\EntityManagerInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\BinaryFileResponse; diff --git a/src/Module/ProjectManagement/Infrastructure/Service/CalDavService.php b/src/Module/ProjectManagement/Infrastructure/Service/CalDavService.php index 15b4db6..8cfbbe4 100644 --- a/src/Module/ProjectManagement/Infrastructure/Service/CalDavService.php +++ b/src/Module/ProjectManagement/Infrastructure/Service/CalDavService.php @@ -4,10 +4,10 @@ declare(strict_types=1); namespace App\Module\ProjectManagement\Infrastructure\Service; +use App\Module\Integration\Domain\Repository\ZimbraConfigurationRepositoryInterface; 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; @@ -21,7 +21,7 @@ use const ENT_QUOTES; final class CalDavService { public function __construct( - private readonly ZimbraConfigurationRepository $configRepository, + private readonly ZimbraConfigurationRepositoryInterface $configRepository, private readonly TokenEncryptor $tokenEncryptor, private readonly HttpClientInterface $httpClient, private readonly LoggerInterface $logger, diff --git a/src/Repository/BookStackConfigurationRepository.php b/src/Repository/BookStackConfigurationRepository.php deleted file mode 100644 index 648321d..0000000 --- a/src/Repository/BookStackConfigurationRepository.php +++ /dev/null @@ -1,22 +0,0 @@ -findOneBy([]); - } -} diff --git a/src/Repository/TaskBookStackLinkRepository.php b/src/Repository/TaskBookStackLinkRepository.php deleted file mode 100644 index 8096ccb..0000000 --- a/src/Repository/TaskBookStackLinkRepository.php +++ /dev/null @@ -1,23 +0,0 @@ -findBy(['task' => $taskId], ['createdAt' => 'DESC']); - } -} diff --git a/tests/Unit/Service/SharePathResolverTest.php b/tests/Unit/Service/SharePathResolverTest.php index bc344ee..8e73819 100644 --- a/tests/Unit/Service/SharePathResolverTest.php +++ b/tests/Unit/Service/SharePathResolverTest.php @@ -4,8 +4,8 @@ declare(strict_types=1); namespace App\Tests\Unit\Service; -use App\Service\Share\Exception\InvalidPathException; -use App\Service\Share\SharePathResolver; +use App\Module\Integration\Domain\Exception\InvalidPathException; +use App\Module\Integration\Domain\Service\SharePathResolver; use PHPUnit\Framework\TestCase; /**