I would like you to translate those php symfony objects into a kotlin spring boot with springdoc/swagger annotations, you will see a use of a commandbus, forget about it and directly use a handler like provided in the code (CreateGenericTrackingMethodCommandHandler), don't forget to migrate it also into kotlin + spring boot: 


class CreateGenericTrackingMethodAction
{
    public function __construct(
        private readonly CommandBus $commandBus,
        private readonly GetGenericTrackingMethodQueryHandler $queryHandler,
        private readonly SerializerInterface $serializer
    ) {
    }

    #[OA\Post(
        path: '/api/generic-tracking-methods',
        operationId: 'CreateGenericTrackingMethod',
        description: 'Create a new generic tracking method.
JWT Allowed:
BO Product Delivery: ROLE_BO_PRODUCT_DELIVERY_SUPER_ADMIN',
        summary: 'Create a new generic tracking method',
        security: [
            ['ManomanoBearer' => []],
        ],
        requestBody: new OA\RequestBody(
            required: true,
            content: new OA\JsonContent(ref: '#/components/schemas/CreateGenericTrackingMethodCommand')
        ),
        tags: ['Generic Tracking Methods'],
    )]
    #[OA\Response(
        response: 201,
        description: 'A GenericTrackingMethod instance has been created',
        content: new OA\JsonContent(
            properties: [
                new OA\Property(property: 'content', ref: '#/components/schemas/GenericTrackingMethodDTO', type: 'object'),
            ],
        )
    )]
    #[OA\Response(response: 400, description: 'Bad request, adjust before retrying')]
    #[OA\Response(ref: '#/components/responses/401', response: 401)]
    #[OA\Response(ref: '#/components/responses/403', response: 403)]
    #[OA\Response(
        response: 409,
        description: 'An entry already exists with the provided tracking platform and config',
        content: new OA\JsonContent(
            examples: [
                'TRACKING_METHOD_ALREADY_EXISTS' => new OA\Examples(example: 'TRACKING_METHOD_ALREADY_EXISTS', summary: 'The tracking method already exists'),
            ]
        )
    )]
    #[OA\Response(response: 500, description: 'Internal server error')]
    #[IsGranted('ROLE_BO_PRODUCT_DELIVERY_SUPER_ADMIN')]
    /**
     * @throws RestException
     */
    public function __invoke(Request $request): JsonResponse
    {
        try {
            /** @var CreateGenericTrackingMethodCommand $command */
            $command = $this->serializer->deserialize(
                $request->getContent(),
                CreateGenericTrackingMethodCommand::class,
                JsonEncoder::FORMAT
            );
        } catch (ExceptionInterface $exception) {
            throw RestException::fromThrowable($exception, Response::HTTP_BAD_REQUEST);
        }

        try {
            $this->commandBus->dispatch($command);

            $createdTrackingMethod = $this->queryHandler->__invoke(
                new GetGenericTrackingMethodQuery($command->getCreatedGenericTrackingMethodId())
            );
        } catch (GenericTrackingMethodAlreadyExistsException $e) {
            throw RestException::fromDomainException($e, Response::HTTP_CONFLICT);
        } catch (DomainExceptionInterface $e) {
            throw RestException::fromDomainException($e, Response::HTTP_BAD_REQUEST);
        } catch (InfraExceptionInterface $e) {
            throw RestException::fromInfraException($e);
        }

        return JsonResponse::fromJsonString(
            $this->serializer->serialize(
                GenericTrackingMethodDTO::fromGenericTrackingMethod($createdTrackingMethod),
                JsonEncoder::FORMAT
            ),
            Response::HTTP_CREATED
        );
    }
}


<?php

declare(strict_types=1);

namespace App\Domain\Application\Command\TrackingMethod;

use App\Domain\Application\Command\Command;
use OpenApi\Attributes as OA;

#[OA\Schema]
class CreateGenericTrackingMethodCommand implements Command
{
    private ?int $createdGenericTrackingMethodId = null;

    /**
     * @param array<string, mixed> $config
     */
    public function __construct(
        #[OA\Property(example: 'Colissimo', description: '')]
        private readonly string $label,
        #[OA\Property(enum: ['aftership', 'tdi'], example: 'aftership', description: '')]
        private readonly string $trackingPlatform,
        /** @var array<string, mixed> */
        #[OA\Property(ref: '#/components/schemas/TrackingMethodConfiguration', type: 'jsonType')]
        private readonly array $config = []
    ) {
    }

    public function setCreatedGenericTrackingMethodId(int $createdGenericTrackingMethodId): void
    {
        $this->createdGenericTrackingMethodId = $createdGenericTrackingMethodId;
    }

    public function getLabel(): string
    {
        return $this->label;
    }

    public function getTrackingPlatform(): string
    {
        return $this->trackingPlatform;
    }

    /**
     * @return array<string, mixed>
     */
    public function getConfig(): array
    {
        return $this->config;
    }

    /**
     * @throws \LogicException when called before the handler set the value
     */
    public function getCreatedGenericTrackingMethodId(): int
    {
        if (null === $this->createdGenericTrackingMethodId) {
            throw new \LogicException(sprintf('%s::getCreatedTrackingConfigurationId() called before the handler set the value', self::class));
        }

        return $this->createdGenericTrackingMethodId;
    }
}


class CreateGenericTrackingMethodCommandHandler
{
    public function __construct(
        private readonly GenericTrackingMethodRepository $repository,
        private readonly GenericTrackingMethodFactory $factory
    ) {
    }

    /**
     * @throws InfraExceptionInterface
     * @throws TrackingMethodNotFoundException
     */
    public function __invoke(CreateGenericTrackingMethodCommand $command): void
    {
        $method = $this->factory->create(
            TrackingPlatform::fromName($command->getTrackingPlatform()),
            $command->getLabel(),
            $command->getConfig()
        );

        if ($this->repository->methodAlreadyExists($method->getTrackingPlatform(), $method->getConfig())) {
            throw GenericTrackingMethodAlreadyExistsException::withTrackingPlatformAndConfig($method->getTrackingPlatform(), $method->getConfig());
        }

        $this->repository->add($method);

        if (null !== $method->getId()) {
            $command->setCreatedGenericTrackingMethodId($method->getId());
        }
    }
}