diff --git a/app/.env b/app/.env index 0ccdf8b..31c3c21 100644 --- a/app/.env +++ b/app/.env @@ -9,9 +9,10 @@ TZ=Europe/Moscow # Postgres settings POSTGRES_HOST_SOCKET=postgres -POSTGRES_DB=POSTGRES_DB -POSTGRES_USER=POSTGRES_USER -POSTGRES_PASSWORD=POSTGRES_PASSWORD +POSTGRES_PORT=5432 +POSTGRES_DB=wizle +POSTGRES_USER=wizle +POSTGRES_PASSWORD=change_me # Telegram Bot Api settings TELEGRAM_BOT_API_TIMEOUT_SECONDS=60 diff --git a/app/composer.json b/app/composer.json index 6087d04..9e05de5 100644 --- a/app/composer.json +++ b/app/composer.json @@ -18,6 +18,7 @@ "symfony/http-client": "6.2.*", "symfony/monolog-bundle": "^3.10", "symfony/runtime": "6.2.*", + "symfony/workflow": "6.2.*", "symfony/yaml": "6.2.*" }, "config": { @@ -75,6 +76,7 @@ "phpunit/phpunit": "^9.5", "symfony/browser-kit": "6.2.*", "symfony/css-selector": "6.2.*", + "symfony/maker-bundle": "^1.50", "symfony/phpunit-bridge": "^6.2" } } diff --git a/app/composer.lock b/app/composer.lock index a6ecbec..e4a1b20 100644 --- a/app/composer.lock +++ b/app/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6fcb94a86cb6e138689974b7617f040e", + "content-hash": "44ae2e0914b1ed65d3d94299e2952a57", "packages": [ { "name": "doctrine/cache", @@ -4224,6 +4224,90 @@ ], "time": "2022-12-22T17:55:15+00:00" }, + { + "name": "symfony/workflow", + "version": "v6.2.13", + "source": { + "type": "git", + "url": "https://github.com/symfony/workflow.git", + "reference": "2cb0cf1b67891f069d1107deafeda128383ec86c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/workflow/zipball/2cb0cf1b67891f069d1107deafeda128383ec86c", + "reference": "2cb0cf1b67891f069d1107deafeda128383ec86c", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "conflict": { + "symfony/event-dispatcher": "<5.4" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/dependency-injection": "^5.4|^6.0", + "symfony/event-dispatcher": "^5.4|^6.0", + "symfony/expression-language": "^5.4|^6.0", + "symfony/security-core": "^5.4|^6.0", + "symfony/validator": "^5.4|^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Workflow\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Grégoire Pineau", + "email": "lyrixx@lyrixx.info" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools for managing a workflow or finite state machine", + "homepage": "https://symfony.com", + "keywords": [ + "petrinet", + "place", + "state", + "statemachine", + "transition", + "workflow" + ], + "support": { + "source": "https://github.com/symfony/workflow/tree/v6.2.13" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-07-25T12:48:54+00:00" + }, { "name": "symfony/yaml", "version": "v6.2.2", @@ -6185,6 +6269,100 @@ ], "time": "2022-12-22T17:55:15+00:00" }, + { + "name": "symfony/maker-bundle", + "version": "v1.50.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/maker-bundle.git", + "reference": "a1733f849b999460c308e66f6392fb09b621fa86" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/maker-bundle/zipball/a1733f849b999460c308e66f6392fb09b621fa86", + "reference": "a1733f849b999460c308e66f6392fb09b621fa86", + "shasum": "" + }, + "require": { + "doctrine/inflector": "^2.0", + "nikic/php-parser": "^4.11", + "php": ">=8.0", + "symfony/config": "^5.4.7|^6.0", + "symfony/console": "^5.4.7|^6.0", + "symfony/dependency-injection": "^5.4.7|^6.0", + "symfony/deprecation-contracts": "^2.2|^3", + "symfony/filesystem": "^5.4.7|^6.0", + "symfony/finder": "^5.4.3|^6.0", + "symfony/framework-bundle": "^5.4.7|^6.0", + "symfony/http-kernel": "^5.4.7|^6.0", + "symfony/process": "^5.4.7|^6.0" + }, + "conflict": { + "doctrine/doctrine-bundle": "<2.4", + "doctrine/orm": "<2.10", + "symfony/doctrine-bridge": "<5.4" + }, + "require-dev": { + "composer/semver": "^3.0", + "doctrine/doctrine-bundle": "^2.4", + "doctrine/orm": "^2.10.0", + "symfony/http-client": "^5.4.7|^6.0", + "symfony/phpunit-bridge": "^5.4.17|^6.0", + "symfony/polyfill-php80": "^1.16.0", + "symfony/security-core": "^5.4.7|^6.0", + "symfony/yaml": "^5.4.3|^6.0", + "twig/twig": "^2.0|^3.0" + }, + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-main": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Bundle\\MakerBundle\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.", + "homepage": "https://symfony.com/doc/current/bundles/SymfonyMakerBundle/index.html", + "keywords": [ + "code generator", + "dev", + "generator", + "scaffold", + "scaffolding" + ], + "support": { + "issues": "https://github.com/symfony/maker-bundle/issues", + "source": "https://github.com/symfony/maker-bundle/tree/v1.50.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-07-10T18:21:57+00:00" + }, { "name": "symfony/phpunit-bridge", "version": "v6.2.3", @@ -6268,6 +6446,67 @@ ], "time": "2022-12-28T14:26:22+00:00" }, + { + "name": "symfony/process", + "version": "v6.2.13", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "1603ae32487981c11b8d0bf5d7551b8b00f5a99b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/1603ae32487981c11b8d0bf5d7551b8b00f5a99b", + "reference": "1603ae32487981c11b8d0bf5d7551b8b00f5a99b", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v6.2.13" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-07-12T15:50:46+00:00" + }, { "name": "theseer/tokenizer", "version": "1.2.1", diff --git a/app/config/bundles.php b/app/config/bundles.php index 1b8981c..6bd0137 100644 --- a/app/config/bundles.php +++ b/app/config/bundles.php @@ -5,4 +5,5 @@ Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true], + Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], ]; diff --git a/app/config/packages/doctrine.yaml b/app/config/packages/doctrine.yaml index 6befe04..9e66e7a 100644 --- a/app/config/packages/doctrine.yaml +++ b/app/config/packages/doctrine.yaml @@ -8,21 +8,6 @@ doctrine: dbname: '%env(POSTGRES_DB)%' driver: 'pdo_pgsql' default_connection: docker - orm: - auto_generate_proxy_classes: true - enable_lazy_ghost_objects: true - report_fields_where_declared: true - validate_xml_mapping: true - naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware - auto_mapping: true - connection: docker - mappings: - App: - type: attribute - is_bundle: false - dir: '%kernel.project_dir%/src/Entity' - prefix: 'App\Entity' - alias: App when@test: doctrine: @@ -30,17 +15,6 @@ when@test: dbname_suffix: '_test%env(default::TEST_TOKEN)%' when@prod: - doctrine: - orm: - auto_generate_proxy_classes: false - proxy_dir: '%kernel.build_dir%/doctrine/orm/Proxies' - query_cache_driver: - type: pool - pool: doctrine.system_cache_pool - result_cache_driver: - type: pool - pool: doctrine.result_cache_pool - framework: cache: pools: diff --git a/app/config/packages/workflow.yaml b/app/config/packages/workflow.yaml new file mode 100644 index 0000000..c5803fd --- /dev/null +++ b/app/config/packages/workflow.yaml @@ -0,0 +1,2 @@ +framework: + workflows: diff --git a/app/migrations/Version20231217204759.php b/app/migrations/Version20231217204759.php new file mode 100644 index 0000000..477d42f --- /dev/null +++ b/app/migrations/Version20231217204759.php @@ -0,0 +1,29 @@ +addSql('CREATE SEQUENCE "customer_id_seq" INCREMENT BY 1 MINVALUE 1 START 1'); + $this->addSql('CREATE TABLE "customer" (id INT NOT NULL, telegram_id INT NOT NULL, current_place VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); + } + + public function down(Schema $schema): void + { + $this->addSql('CREATE SCHEMA public'); + $this->addSql('DROP SEQUENCE "customer_id_seq" CASCADE'); + $this->addSql('DROP TABLE "customer"'); + } +} diff --git a/app/symfony.lock b/app/symfony.lock index 0a2dcc8..c7718ac 100644 --- a/app/symfony.lock +++ b/app/symfony.lock @@ -83,6 +83,15 @@ "src/Kernel.php" ] }, + "symfony/maker-bundle": { + "version": "1.50", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "1.0", + "ref": "fadbfe33303a76e25cb63401050439aa9b1a9c7f" + } + }, "symfony/monolog-bundle": { "version": "3.10", "recipe": { @@ -122,5 +131,17 @@ "config/packages/routing.yaml", "config/routes.yaml" ] + }, + "symfony/workflow": { + "version": "6.2", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "main", + "version": "3.3", + "ref": "3b2f8ca32a07fcb00f899649053943fa3d8bbfb6" + }, + "files": [ + "config/packages/workflow.yaml" + ] } } diff --git a/docker-compose.yml b/docker-compose.yml index 3bc5118..2ef3ae4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,6 +20,8 @@ services: - ./app/.env.local networks: - backend + ports: + - '5432:5432' container_name: postgres restart: unless-stopped diff --git a/postgres/data/.gitkeep b/postgres/data/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/postgres/dump/.gitkeep b/postgres/dump/.gitkeep deleted file mode 100644 index e69de29..0000000