Skip to content

Commit 514260b

Browse files
committed
Removed deprecated leantime service, and project entity
1 parent ba9c112 commit 514260b

20 files changed

Lines changed: 519 additions & 732 deletions

.env

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,8 @@ VAULT_SECRET_ID="CHANGE_ME_IN_LOCAL_ENV"
6464

6565
# The number of old results for each server/result-type combination
6666
APP_KEEP_RESULTS=5
67-
APP_LEANTIME_URI=https://leantime.itkdev.dk
68-
APP_LEANTIME_API_KEY="CHANGE_ME_IN_LOCAL_ENV"
67+
68+
###> economics ###
69+
APP_ECONOMICS_URI=https://economics.itkdev.dk
70+
APP_ECONOMICS_API_KEY=changeme
71+
###< economics ###

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
"symfony/http-client": "^8.0",
3333
"symfony/messenger": "^8.0",
3434
"symfony/monolog-bundle": "^4.0",
35-
"symfony/object-mapper": "8.0.*",
3635
"symfony/property-access": "^8.0",
3736
"symfony/property-info": "^8.0",
3837
"symfony/runtime": "^8.0",

composer.lock

Lines changed: 1 addition & 74 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/packages/framework.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ framework:
1515

1616
http_client:
1717
scoped_clients:
18-
leantime.client:
19-
base_uri: '%env(APP_LEANTIME_URI)%'
20-
scope: '%env(APP_LEANTIME_URI)%'
18+
economics.client:
19+
base_uri: '%env(APP_ECONOMICS_URI)%'
20+
scope: '%env(APP_ECONOMICS_URI)%'
2121
headers:
22-
x-api-key: '%env(APP_LEANTIME_API_KEY)%'
22+
x-api-key: '%env(APP_ECONOMICS_API_KEY)%'
2323

2424
when@test:
2525
framework:

config/services.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,3 @@ services:
3636
arguments:
3737
$resultHandlers: !tagged_iterator app.handler.detection_result_handler
3838
$keepResults: '%env(int:APP_KEEP_RESULTS)%'
39-
40-
App\Service\Leantime\LeantimeProjectUrlFactory:
41-
arguments:
42-
$baseUrl: '%env(string:APP_LEANTIME_URI)%'
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace DoctrineMigrations;
6+
7+
use Doctrine\DBAL\Schema\Schema;
8+
use Doctrine\Migrations\AbstractMigration;
9+
10+
/**
11+
* Auto-generated Migration: Please modify to your needs!
12+
*/
13+
final class Version20260519061123 extends AbstractMigration
14+
{
15+
public function getDescription(): string
16+
{
17+
return '';
18+
}
19+
20+
public function up(Schema $schema): void
21+
{
22+
// this up() migration is auto-generated, please modify it to your needs
23+
$this->addSql('ALTER TABLE security_contract DROP FOREIGN KEY `FK_8AE4AF8B166D1F9C`');
24+
$this->addSql('DROP TABLE project');
25+
$this->addSql('DROP INDEX UNIQ_8AE4AF8B166D1F9C ON security_contract');
26+
$this->addSql('ALTER TABLE security_contract ADD economics_id INT NOT NULL, ADD project_name VARCHAR(255) NOT NULL, ADD hosting_provider VARCHAR(255) DEFAULT NULL, ADD document_url VARCHAR(255) DEFAULT NULL, ADD eol TINYINT NOT NULL, ADD leantime_url VARCHAR(255) DEFAULT NULL, ADD client_contact_name VARCHAR(255) DEFAULT NULL, ADD client_contact_email VARCHAR(255) DEFAULT NULL, ADD dedicated_server TINYINT NOT NULL, ADD server_size VARCHAR(255) DEFAULT NULL, ADD system_owner_notices JSON DEFAULT NULL, ADD project_tracker_key VARCHAR(255) DEFAULT NULL, ADD cybersecurity_price DOUBLE PRECISION DEFAULT NULL, ADD cybersecurity_note LONGTEXT DEFAULT NULL, DROP notes, DROP project_id, CHANGE valid_from valid_from DATE DEFAULT NULL, CHANGE valid_to valid_to DATE DEFAULT NULL, CHANGE economics_report_url client_name VARCHAR(255) DEFAULT NULL, CHANGE operational_contract_url git_repos LONGTEXT DEFAULT NULL');
27+
$this->addSql('CREATE UNIQUE INDEX UNIQ_8AE4AF8B4416F7E8 ON security_contract (economics_id)');
28+
}
29+
30+
public function down(Schema $schema): void
31+
{
32+
// this down() migration is auto-generated, please modify it to your needs
33+
$this->addSql('CREATE TABLE project (id BINARY(16) NOT NULL, created_at DATETIME NOT NULL, modified_at DATETIME NOT NULL, created_by VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \'\' NOT NULL COLLATE `utf8mb4_unicode_ci`, modified_by VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \'\' NOT NULL COLLATE `utf8mb4_unicode_ci`, leantime_id INT NOT NULL, name VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, leantime_url VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, economics_url VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, details LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, leantime_modified_at DATETIME NOT NULL, UNIQUE INDEX UNIQ_2FB3D0EE4B785F0C (leantime_id), PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
34+
$this->addSql('DROP INDEX UNIQ_8AE4AF8B4416F7E8 ON security_contract');
35+
$this->addSql('ALTER TABLE security_contract ADD economics_report_url VARCHAR(255) DEFAULT NULL, ADD operational_contract_url LONGTEXT DEFAULT NULL, ADD notes LONGTEXT NOT NULL, ADD project_id BINARY(16) NOT NULL, DROP economics_id, DROP project_name, DROP client_name, DROP hosting_provider, DROP document_url, DROP eol, DROP leantime_url, DROP client_contact_name, DROP client_contact_email, DROP dedicated_server, DROP server_size, DROP git_repos, DROP system_owner_notices, DROP project_tracker_key, DROP cybersecurity_price, DROP cybersecurity_note, CHANGE valid_from valid_from DATE NOT NULL, CHANGE valid_to valid_to DATE NOT NULL');
36+
$this->addSql('ALTER TABLE security_contract ADD CONSTRAINT `FK_8AE4AF8B166D1F9C` FOREIGN KEY (project_id) REFERENCES project (id)');
37+
$this->addSql('CREATE UNIQUE INDEX UNIQ_8AE4AF8B166D1F9C ON security_contract (project_id)');
38+
}
39+
}

src/Command/SyncLeantimeProjectsCommand.php

Lines changed: 0 additions & 54 deletions
This file was deleted.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
namespace App\Command;
4+
5+
use App\Service\ServiceAgreementSyncService;
6+
use Symfony\Component\Console\Attribute\AsCommand;
7+
use Symfony\Component\Console\Command\Command;
8+
use Symfony\Component\Console\Input\InputInterface;
9+
use Symfony\Component\Console\Output\OutputInterface;
10+
use Symfony\Component\Console\Style\SymfonyStyle;
11+
12+
#[AsCommand(
13+
name: 'app:economics:sync-agreements',
14+
description: 'Sync service agreements from Economics',
15+
)]
16+
class SyncServiceAgreementsCommand extends Command
17+
{
18+
public function __construct(
19+
private readonly ServiceAgreementSyncService $syncService,
20+
) {
21+
parent::__construct();
22+
}
23+
24+
protected function execute(InputInterface $input, OutputInterface $output): int
25+
{
26+
$io = new SymfonyStyle($input, $output);
27+
28+
try {
29+
$count = $this->syncService->syncAll();
30+
31+
$io->success(sprintf('Synced %d service agreements successfully.', $count));
32+
} catch (\Throwable $e) {
33+
$io->error($e->getMessage());
34+
35+
return Command::FAILURE;
36+
}
37+
38+
return Command::SUCCESS;
39+
}
40+
}

src/Controller/Admin/DashboardController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ public function configureDashboard(): Dashboard
4646
public function configureMenuItems(): iterable
4747
{
4848
yield MenuItem::linkToDashboard('Dashboard', 'fa fa-home');
49-
yield MenuItem::linkTo(SecurityContractCrudController::class, 'Hosting', 'fas fa-file-contract');
5049
yield MenuItem::linkTo(ServerCrudController::class, 'Servers', 'fas fa-server');
5150
yield MenuItem::linkTo(InstallationCrudController::class, 'Installations', 'fas fa-folder');
5251
yield MenuItem::linkTo(SiteCrudController::class, 'Sites', 'fas fa-bookmark');
5352
yield MenuItem::linkTo(DomainCrudController::class, 'Domains', 'fas fa-link');
5453
yield MenuItem::linkTo(OIDCCrudController::class, 'OIDC', 'fas fa-key');
5554
yield MenuItem::linkTo(ServiceCertificateCrudController::class, 'Service certificates', 'fas fa-lock');
55+
yield MenuItem::linkTo(SecurityContractCrudController::class, 'Service Agreements', 'fas fa-file-contract');
5656
yield MenuItem::section('Dependencies');
5757
yield MenuItem::linkTo(PackageCrudController::class, 'Packages', 'fas fa-cube');
5858
yield MenuItem::linkTo(PackageVersionCrudController::class, 'Package Versions', 'fas fa-cubes');

src/Controller/Admin/ProjectCrudController.php

Lines changed: 0 additions & 93 deletions
This file was deleted.

0 commit comments

Comments
 (0)