Skip to content

Commit 3ca94e7

Browse files
Added commands and orm annotations
1 parent 1700b75 commit 3ca94e7

File tree

86 files changed

+1771
-399
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+1771
-399
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: 'Test'
22

33
on:
44
push:
5-
# pull_request:
5+
pull_request:
66

77
jobs:
88
analyse:

config/packages/doctrine.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ doctrine:
2727
dir: '%kernel.project_dir%/src/Skills/Infrastructure/Database/ORM/Aggregate'
2828
prefix: 'App\Skills\Domain\Aggregate'
2929
alias: Skills
30+
Testing:
31+
is_bundle: false
32+
type: xml
33+
dir: '%kernel.project_dir%/src/Testing/Infrastructure/Database/ORM/Aggregate'
34+
prefix: 'App\Testing\Domain\Aggregate'
35+
alias: Testing
3036

3137
#when@test:
3238
# doctrine:

deptrac-modules.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ parameters:
99
collectors:
1010
- type: directory
1111
regex: /src/Shared/.*
12-
- name: Company
13-
collectors:
14-
- type: directory
15-
regex: /src/Company/.*
1612
- name: Skills
1713
collectors:
1814
- type: directory
@@ -26,8 +22,6 @@ parameters:
2622
- type: directory
2723
regex: /src/Users/.*
2824
ruleset:
29-
Company:
30-
- Shared
3125
Skills:
3226
- Shared
3327
Testing:

src/Company/Domain/Entity/Company/Company.php

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

src/Company/Domain/Entity/Company/ContactPerson.php

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

src/Shared/Domain/Entity/Aggregate.php

Lines changed: 0 additions & 33 deletions
This file was deleted.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\Shared\Infrastructure\Database\Migrations;
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 Version20231114004337 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('CREATE TABLE testing_answer_option (id VARCHAR(26) NOT NULL, question_id VARCHAR(26) DEFAULT NULL, description VARCHAR(255) NOT NULL, correct BOOLEAN NOT NULL, PRIMARY KEY(id))');
24+
$this->addSql('CREATE INDEX IDX_62DD1EDE1E27F6BF ON testing_answer_option (question_id)');
25+
$this->addSql('CREATE TABLE testing_question (id VARCHAR(26) NOT NULL, test_id VARCHAR(26) DEFAULT NULL, name VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, position_number INT DEFAULT NULL, published BOOLEAN NOT NULL, type VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
26+
$this->addSql('CREATE INDEX IDX_804A23011E5D0459 ON testing_question (test_id)');
27+
$this->addSql('CREATE TABLE testing_test (id VARCHAR(26) NOT NULL, owner_id VARCHAR(26) NOT NULL, name VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, correct_answers_percentage INT DEFAULT 0 NOT NULL, published BOOLEAN NOT NULL, skill_id VARCHAR(26) DEFAULT NULL, difficulty_level VARCHAR(255) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
28+
$this->addSql('CREATE UNIQUE INDEX UNIQ_8F8FA01C5E237E06 ON testing_test (name)');
29+
$this->addSql('COMMENT ON COLUMN testing_test.created_at IS \'(DC2Type:datetime_immutable)\'');
30+
$this->addSql('COMMENT ON COLUMN testing_test.updated_at IS \'(DC2Type:datetime_immutable)\'');
31+
$this->addSql('COMMENT ON COLUMN testing_test.deleted_at IS \'(DC2Type:datetime_immutable)\'');
32+
$this->addSql('CREATE TABLE testing_testing_session (id VARCHAR(26) NOT NULL, test_id VARCHAR(26) DEFAULT NULL, user_id VARCHAR(26) NOT NULL, correct_answers_percentage INT DEFAULT 0 NOT NULL, is_passed_successfully BOOLEAN NOT NULL, started_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, completed_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
33+
$this->addSql('CREATE INDEX IDX_485F2E0A1E5D0459 ON testing_testing_session (test_id)');
34+
$this->addSql('COMMENT ON COLUMN testing_testing_session.started_at IS \'(DC2Type:datetime_immutable)\'');
35+
$this->addSql('COMMENT ON COLUMN testing_testing_session.completed_at IS \'(DC2Type:datetime_immutable)\'');
36+
$this->addSql('CREATE TABLE testing_user_answer (id VARCHAR(26) NOT NULL, testing_session_id VARCHAR(26) DEFAULT NULL, question_id VARCHAR(26) DEFAULT NULL, answered_options TEXT DEFAULT \'[]\' NOT NULL, PRIMARY KEY(id))');
37+
$this->addSql('CREATE INDEX IDX_EE8BD7CFBBB901EE ON testing_user_answer (testing_session_id)');
38+
$this->addSql('CREATE INDEX IDX_EE8BD7CF1E27F6BF ON testing_user_answer (question_id)');
39+
$this->addSql('COMMENT ON COLUMN testing_user_answer.answered_options IS \'(DC2Type:array)\'');
40+
$this->addSql('ALTER TABLE testing_answer_option ADD CONSTRAINT FK_62DD1EDE1E27F6BF FOREIGN KEY (question_id) REFERENCES testing_question (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
41+
$this->addSql('ALTER TABLE testing_question ADD CONSTRAINT FK_804A23011E5D0459 FOREIGN KEY (test_id) REFERENCES testing_test (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
42+
$this->addSql('ALTER TABLE testing_testing_session ADD CONSTRAINT FK_485F2E0A1E5D0459 FOREIGN KEY (test_id) REFERENCES testing_test (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
43+
$this->addSql('ALTER TABLE testing_user_answer ADD CONSTRAINT FK_EE8BD7CFBBB901EE FOREIGN KEY (testing_session_id) REFERENCES testing_testing_session (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
44+
$this->addSql('ALTER TABLE testing_user_answer ADD CONSTRAINT FK_EE8BD7CF1E27F6BF FOREIGN KEY (question_id) REFERENCES testing_question (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
45+
}
46+
47+
public function down(Schema $schema): void
48+
{
49+
// this down() migration is auto-generated, please modify it to your needs
50+
$this->addSql('CREATE SCHEMA public');
51+
$this->addSql('ALTER TABLE testing_answer_option DROP CONSTRAINT FK_62DD1EDE1E27F6BF');
52+
$this->addSql('ALTER TABLE testing_question DROP CONSTRAINT FK_804A23011E5D0459');
53+
$this->addSql('ALTER TABLE testing_testing_session DROP CONSTRAINT FK_485F2E0A1E5D0459');
54+
$this->addSql('ALTER TABLE testing_user_answer DROP CONSTRAINT FK_EE8BD7CFBBB901EE');
55+
$this->addSql('ALTER TABLE testing_user_answer DROP CONSTRAINT FK_EE8BD7CF1E27F6BF');
56+
$this->addSql('DROP TABLE testing_answer_option');
57+
$this->addSql('DROP TABLE testing_question');
58+
$this->addSql('DROP TABLE testing_test');
59+
$this->addSql('DROP TABLE testing_testing_session');
60+
$this->addSql('DROP TABLE testing_user_answer');
61+
}
62+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\Shared\Infrastructure\Database\Migrations;
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 Version20231114221513 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 testing_testing_session ALTER is_passed_successfully DROP NOT NULL');
24+
}
25+
26+
public function down(Schema $schema): void
27+
{
28+
// this down() migration is auto-generated, please modify it to your needs
29+
$this->addSql('CREATE SCHEMA public');
30+
$this->addSql('ALTER TABLE testing_testing_session ALTER is_passed_successfully SET NOT NULL');
31+
}
32+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\Shared\Infrastructure\Database\Migrations;
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 Version20231114224929 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('CREATE TABLE skills_skill_confirmation (id VARCHAR(26) NOT NULL, specialist_id VARCHAR(26) DEFAULT NULL, skill_id VARCHAR(26) DEFAULT NULL, level VARCHAR(50) NOT NULL, PRIMARY KEY(id))');
24+
$this->addSql('CREATE INDEX IDX_722F1C197B100C1A ON skills_skill_confirmation (specialist_id)');
25+
$this->addSql('CREATE INDEX IDX_722F1C195585C142 ON skills_skill_confirmation (skill_id)');
26+
$this->addSql('CREATE TABLE skills_skill_confirmation_proof (id VARCHAR(26) NOT NULL, skill_confirmation_id VARCHAR(26) DEFAULT NULL, test_id VARCHAR(26) NOT NULL, PRIMARY KEY(id))');
27+
$this->addSql('CREATE INDEX IDX_5F2C86C75D6D96DB ON skills_skill_confirmation_proof (skill_confirmation_id)');
28+
$this->addSql('ALTER TABLE skills_skill_confirmation ADD CONSTRAINT FK_722F1C197B100C1A FOREIGN KEY (specialist_id) REFERENCES skills_specialist (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
29+
$this->addSql('ALTER TABLE skills_skill_confirmation ADD CONSTRAINT FK_722F1C195585C142 FOREIGN KEY (skill_id) REFERENCES skills_skill (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
30+
$this->addSql('ALTER TABLE skills_skill_confirmation_proof ADD CONSTRAINT FK_5F2C86C75D6D96DB FOREIGN KEY (skill_confirmation_id) REFERENCES skills_skill_confirmation (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
31+
}
32+
33+
public function down(Schema $schema): void
34+
{
35+
// this down() migration is auto-generated, please modify it to your needs
36+
$this->addSql('CREATE SCHEMA public');
37+
$this->addSql('ALTER TABLE skills_skill_confirmation DROP CONSTRAINT FK_722F1C197B100C1A');
38+
$this->addSql('ALTER TABLE skills_skill_confirmation DROP CONSTRAINT FK_722F1C195585C142');
39+
$this->addSql('ALTER TABLE skills_skill_confirmation_proof DROP CONSTRAINT FK_5F2C86C75D6D96DB');
40+
$this->addSql('DROP TABLE skills_skill_confirmation');
41+
$this->addSql('DROP TABLE skills_skill_confirmation_proof');
42+
}
43+
}

src/Shared/Infrastructure/Security/UserFetcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
use App\Shared\Domain\Security\AuthUserInterface;
88
use App\Shared\Domain\Security\UserFetcherInterface;
9+
use Symfony\Bundle\SecurityBundle\Security;
910
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
10-
use Symfony\Component\Security\Core\Security;
1111
use Webmozart\Assert\Assert;
1212

1313
readonly class UserFetcher implements UserFetcherInterface

0 commit comments

Comments
 (0)