From 54062ea98ddf8a3583c9c37ea8d926fa83e87a53 Mon Sep 17 00:00:00 2001 From: Firas <firas.bouzazi@imt-atlantique.net> Date: Thu, 20 Mar 2025 01:41:40 +0100 Subject: [PATCH] Added purchase proof's related things --- .idea/.gitignore | 8 - .idea/Wishlist-application.iml | 143 ---------------- .idea/modules.xml | 8 - .idea/php.xml | 161 ------------------ .idea/phpunit.xml | 10 -- .idea/vcs.xml | 6 - config/services.yaml | 1 + migrations/Version20250319232441.php | 37 ++++ migrations/Version20250319235558.php | 35 ++++ migrations/Version20250319235641.php | 39 +++++ migrations/Version20250320000820.php | 35 ++++ migrations/Version20250320000903.php | 35 ++++ migrations/Version20250320001018.php | 39 +++++ migrations/Version20250320001428.php | 41 +++++ migrations/Version20250320001458.php | 37 ++++ migrations/Version20250320001931.php | 41 +++++ migrations/Version20250320001951.php | 37 ++++ migrations/Version20250320002407.php | 37 ++++ public/css/style.css | 69 ++++++++ ...-02-14-09-20-02-67db63d057533675522937.png | Bin 0 -> 1945 bytes src/Controller/PurchaseProofController.php | 50 ++++++ src/Entity/Item.php | 8 +- src/Entity/PurchaseProof.php | 32 +++- src/Form/PurchaseProofType.php | 45 +++++ templates/purchase_proof/index.html.twig | 20 +++ templates/purchase_proof/new.html.twig | 40 +++++ .../PurchaseProofControllerTest.php | 16 ++ 27 files changed, 690 insertions(+), 340 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/Wishlist-application.iml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/php.xml delete mode 100644 .idea/phpunit.xml delete mode 100644 .idea/vcs.xml create mode 100644 migrations/Version20250319232441.php create mode 100644 migrations/Version20250319235558.php create mode 100644 migrations/Version20250319235641.php create mode 100644 migrations/Version20250320000820.php create mode 100644 migrations/Version20250320000903.php create mode 100644 migrations/Version20250320001018.php create mode 100644 migrations/Version20250320001428.php create mode 100644 migrations/Version20250320001458.php create mode 100644 migrations/Version20250320001931.php create mode 100644 migrations/Version20250320001951.php create mode 100644 migrations/Version20250320002407.php create mode 100644 public/uploads/images/screenshot-from-2025-02-14-09-20-02-67db63d057533675522937.png create mode 100644 src/Controller/PurchaseProofController.php create mode 100644 src/Form/PurchaseProofType.php create mode 100644 templates/purchase_proof/index.html.twig create mode 100644 templates/purchase_proof/new.html.twig create mode 100644 tests/Controller/PurchaseProofControllerTest.php diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 13566b81..00000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/Wishlist-application.iml b/.idea/Wishlist-application.iml deleted file mode 100644 index fc468d7d..00000000 --- a/.idea/Wishlist-application.iml +++ /dev/null @@ -1,143 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<module type="WEB_MODULE" version="4"> - <component name="NewModuleRootManager"> - <content url="file://$MODULE_DIR$"> - <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" packagePrefix="App\" /> - <sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" packagePrefix="App\Tests\" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/composer" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/cache" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/collections" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/dbal" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/deprecations" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/doctrine-bundle" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/doctrine-migrations-bundle" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/event-manager" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/inflector" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/instantiator" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/lexer" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/migrations" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/orm" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/persistence" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/doctrine/sql-formatter" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/egulias/email-validator" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/jms/metadata" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/masterminds/html5" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/monolog/monolog" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/myclabs/deep-copy" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/nikic/php-parser" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/phar-io/manifest" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/phar-io/version" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/phpdocumentor/reflection-common" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/phpdocumentor/reflection-docblock" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/phpdocumentor/type-resolver" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/phpstan/phpdoc-parser" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-code-coverage" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-file-iterator" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-invoker" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-text-template" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-timer" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/phpunit" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/psr/cache" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/psr/clock" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/psr/container" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/psr/event-dispatcher" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/psr/link" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/psr/log" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/cli-parser" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/code-unit" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/code-unit-reverse-lookup" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/comparator" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/complexity" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/diff" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/environment" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/exporter" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/global-state" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/lines-of-code" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/object-enumerator" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/object-reflector" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/recursion-context" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/resource-operations" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/type" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/version" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/asset" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/asset-mapper" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/browser-kit" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/cache" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/cache-contracts" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/clock" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/config" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/console" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/css-selector" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/debug-bundle" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/dependency-injection" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/deprecation-contracts" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/doctrine-bridge" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/doctrine-messenger" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/dom-crawler" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/dotenv" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/error-handler" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/event-dispatcher" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/event-dispatcher-contracts" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/expression-language" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/filesystem" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/finder" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/flex" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/form" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/framework-bundle" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/http-client" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/http-client-contracts" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/http-foundation" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/http-kernel" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/intl" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/mailer" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/maker-bundle" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/messenger" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/mime" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/monolog-bridge" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/monolog-bundle" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/notifier" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/options-resolver" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/password-hasher" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/phpunit-bridge" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-grapheme" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-icu" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-idn" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-intl-normalizer" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-mbstring" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php83" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/process" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/property-access" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/property-info" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/routing" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/runtime" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/security-bundle" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/security-core" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/security-csrf" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/security-http" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/serializer" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/service-contracts" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/stimulus-bundle" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/stopwatch" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/string" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/translation" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/translation-contracts" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/twig-bridge" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/twig-bundle" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/type-info" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/ux-turbo" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/validator" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/var-dumper" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/var-exporter" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/web-link" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/web-profiler-bundle" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/symfony/yaml" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/theseer/tokenizer" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/twig/extra-bundle" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/twig/twig" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/vich/uploader-bundle" /> - <excludeFolder url="file://$MODULE_DIR$/vendor/webmozart/assert" /> - </content> - <orderEntry type="inheritedJdk" /> - <orderEntry type="sourceFolder" forTests="false" /> - </component> -</module> \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index a225fb58..00000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="ProjectModuleManager"> - <modules> - <module fileurl="file://$PROJECT_DIR$/.idea/Wishlist-application.iml" filepath="$PROJECT_DIR$/.idea/Wishlist-application.iml" /> - </modules> - </component> -</project> \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml deleted file mode 100644 index 38b033e9..00000000 --- a/.idea/php.xml +++ /dev/null @@ -1,161 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="MessDetectorOptionsConfiguration"> - <option name="transferred" value="true" /> - </component> - <component name="PHPCSFixerOptionsConfiguration"> - <option name="transferred" value="true" /> - </component> - <component name="PHPCodeSnifferOptionsConfiguration"> - <option name="highlightLevel" value="WARNING" /> - <option name="transferred" value="true" /> - </component> - <component name="PhpIncludePathManager"> - <include_path> - <path value="$PROJECT_DIR$/vendor/doctrine/persistence" /> - <path value="$PROJECT_DIR$/vendor/doctrine/inflector" /> - <path value="$PROJECT_DIR$/vendor/doctrine/doctrine-migrations-bundle" /> - <path value="$PROJECT_DIR$/vendor/sebastian/global-state" /> - <path value="$PROJECT_DIR$/vendor/sebastian/complexity" /> - <path value="$PROJECT_DIR$/vendor/sebastian/recursion-context" /> - <path value="$PROJECT_DIR$/vendor/sebastian/object-reflector" /> - <path value="$PROJECT_DIR$/vendor/sebastian/object-enumerator" /> - <path value="$PROJECT_DIR$/vendor/sebastian/cli-parser" /> - <path value="$PROJECT_DIR$/vendor/sebastian/diff" /> - <path value="$PROJECT_DIR$/vendor/sebastian/lines-of-code" /> - <path value="$PROJECT_DIR$/vendor/sebastian/type" /> - <path value="$PROJECT_DIR$/vendor/sebastian/version" /> - <path value="$PROJECT_DIR$/vendor/sebastian/comparator" /> - <path value="$PROJECT_DIR$/vendor/sebastian/environment" /> - <path value="$PROJECT_DIR$/vendor/sebastian/exporter" /> - <path value="$PROJECT_DIR$/vendor/sebastian/code-unit" /> - <path value="$PROJECT_DIR$/vendor/sebastian/resource-operations" /> - <path value="$PROJECT_DIR$/vendor/sebastian/code-unit-reverse-lookup" /> - <path value="$PROJECT_DIR$/vendor/webmozart/assert" /> - <path value="$PROJECT_DIR$/vendor/masterminds/html5" /> - <path value="$PROJECT_DIR$/vendor/phpdocumentor/reflection-docblock" /> - <path value="$PROJECT_DIR$/vendor/phpdocumentor/type-resolver" /> - <path value="$PROJECT_DIR$/vendor/phpdocumentor/reflection-common" /> - <path value="$PROJECT_DIR$/vendor/composer" /> - <path value="$PROJECT_DIR$/vendor/psr/container" /> - <path value="$PROJECT_DIR$/vendor/psr/cache" /> - <path value="$PROJECT_DIR$/vendor/psr/event-dispatcher" /> - <path value="$PROJECT_DIR$/vendor/psr/log" /> - <path value="$PROJECT_DIR$/vendor/psr/link" /> - <path value="$PROJECT_DIR$/vendor/psr/clock" /> - <path value="$PROJECT_DIR$/vendor/twig/twig" /> - <path value="$PROJECT_DIR$/vendor/twig/extra-bundle" /> - <path value="$PROJECT_DIR$/vendor/nikic/php-parser" /> - <path value="$PROJECT_DIR$/vendor/egulias/email-validator" /> - <path value="$PROJECT_DIR$/vendor/monolog/monolog" /> - <path value="$PROJECT_DIR$/vendor/myclabs/deep-copy" /> - <path value="$PROJECT_DIR$/vendor/phar-io/manifest" /> - <path value="$PROJECT_DIR$/vendor/phar-io/version" /> - <path value="$PROJECT_DIR$/vendor/phpstan/phpdoc-parser" /> - <path value="$PROJECT_DIR$/vendor/phpunit/php-file-iterator" /> - <path value="$PROJECT_DIR$/vendor/phpunit/php-timer" /> - <path value="$PROJECT_DIR$/vendor/phpunit/php-text-template" /> - <path value="$PROJECT_DIR$/vendor/phpunit/php-invoker" /> - <path value="$PROJECT_DIR$/vendor/phpunit/php-code-coverage" /> - <path value="$PROJECT_DIR$/vendor/phpunit/phpunit" /> - <path value="$PROJECT_DIR$/vendor/symfony/deprecation-contracts" /> - <path value="$PROJECT_DIR$/vendor/symfony/dependency-injection" /> - <path value="$PROJECT_DIR$/vendor/symfony/security-bundle" /> - <path value="$PROJECT_DIR$/vendor/symfony/mime" /> - <path value="$PROJECT_DIR$/vendor/symfony/validator" /> - <path value="$PROJECT_DIR$/vendor/symfony/polyfill-php83" /> - <path value="$PROJECT_DIR$/vendor/symfony/browser-kit" /> - <path value="$PROJECT_DIR$/vendor/symfony/dom-crawler" /> - <path value="$PROJECT_DIR$/vendor/symfony/http-client-contracts" /> - <path value="$PROJECT_DIR$/vendor/symfony/css-selector" /> - <path value="$PROJECT_DIR$/vendor/symfony/property-access" /> - <path value="$PROJECT_DIR$/vendor/symfony/monolog-bundle" /> - <path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher-contracts" /> - <path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-grapheme" /> - <path value="$PROJECT_DIR$/vendor/symfony/yaml" /> - <path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-icu" /> - <path value="$PROJECT_DIR$/vendor/symfony/cache" /> - <path value="$PROJECT_DIR$/vendor/symfony/doctrine-bridge" /> - <path value="$PROJECT_DIR$/vendor/symfony/options-resolver" /> - <path value="$PROJECT_DIR$/vendor/symfony/asset-mapper" /> - <path value="$PROJECT_DIR$/vendor/symfony/twig-bundle" /> - <path value="$PROJECT_DIR$/vendor/symfony/doctrine-messenger" /> - <path value="$PROJECT_DIR$/vendor/symfony/runtime" /> - <path value="$PROJECT_DIR$/vendor/symfony/clock" /> - <path value="$PROJECT_DIR$/vendor/symfony/http-kernel" /> - <path value="$PROJECT_DIR$/vendor/symfony/mailer" /> - <path value="$PROJECT_DIR$/vendor/symfony/phpunit-bridge" /> - <path value="$PROJECT_DIR$/vendor/symfony/security-csrf" /> - <path value="$PROJECT_DIR$/vendor/symfony/finder" /> - <path value="$PROJECT_DIR$/vendor/symfony/expression-language" /> - <path value="$PROJECT_DIR$/vendor/symfony/maker-bundle" /> - <path value="$PROJECT_DIR$/vendor/symfony/security-core" /> - <path value="$PROJECT_DIR$/vendor/symfony/security-http" /> - <path value="$PROJECT_DIR$/vendor/symfony/web-link" /> - <path value="$PROJECT_DIR$/vendor/symfony/var-exporter" /> - <path value="$PROJECT_DIR$/vendor/symfony/web-profiler-bundle" /> - <path value="$PROJECT_DIR$/vendor/symfony/string" /> - <path value="$PROJECT_DIR$/vendor/symfony/service-contracts" /> - <path value="$PROJECT_DIR$/vendor/symfony/var-dumper" /> - <path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-idn" /> - <path value="$PROJECT_DIR$/vendor/symfony/serializer" /> - <path value="$PROJECT_DIR$/vendor/symfony/ux-turbo" /> - <path value="$PROJECT_DIR$/vendor/symfony/stimulus-bundle" /> - <path value="$PROJECT_DIR$/vendor/symfony/type-info" /> - <path value="$PROJECT_DIR$/vendor/symfony/debug-bundle" /> - <path value="$PROJECT_DIR$/vendor/symfony/routing" /> - <path value="$PROJECT_DIR$/vendor/symfony/event-dispatcher" /> - <path value="$PROJECT_DIR$/vendor/symfony/error-handler" /> - <path value="$PROJECT_DIR$/vendor/symfony/flex" /> - <path value="$PROJECT_DIR$/vendor/symfony/notifier" /> - <path value="$PROJECT_DIR$/vendor/symfony/cache-contracts" /> - <path value="$PROJECT_DIR$/vendor/symfony/property-info" /> - <path value="$PROJECT_DIR$/vendor/symfony/console" /> - <path value="$PROJECT_DIR$/vendor/symfony/framework-bundle" /> - <path value="$PROJECT_DIR$/vendor/symfony/process" /> - <path value="$PROJECT_DIR$/vendor/symfony/password-hasher" /> - <path value="$PROJECT_DIR$/vendor/symfony/polyfill-intl-normalizer" /> - <path value="$PROJECT_DIR$/vendor/symfony/intl" /> - <path value="$PROJECT_DIR$/vendor/symfony/filesystem" /> - <path value="$PROJECT_DIR$/vendor/symfony/twig-bridge" /> - <path value="$PROJECT_DIR$/vendor/symfony/http-client" /> - <path value="$PROJECT_DIR$/vendor/symfony/dotenv" /> - <path value="$PROJECT_DIR$/vendor/symfony/form" /> - <path value="$PROJECT_DIR$/vendor/symfony/messenger" /> - <path value="$PROJECT_DIR$/vendor/symfony/translation" /> - <path value="$PROJECT_DIR$/vendor/symfony/polyfill-mbstring" /> - <path value="$PROJECT_DIR$/vendor/symfony/monolog-bridge" /> - <path value="$PROJECT_DIR$/vendor/symfony/asset" /> - <path value="$PROJECT_DIR$/vendor/symfony/translation-contracts" /> - <path value="$PROJECT_DIR$/vendor/symfony/http-foundation" /> - <path value="$PROJECT_DIR$/vendor/symfony/config" /> - <path value="$PROJECT_DIR$/vendor/symfony/stopwatch" /> - <path value="$PROJECT_DIR$/vendor/theseer/tokenizer" /> - <path value="$PROJECT_DIR$/vendor/doctrine/cache" /> - <path value="$PROJECT_DIR$/vendor/doctrine/event-manager" /> - <path value="$PROJECT_DIR$/vendor/doctrine/dbal" /> - <path value="$PROJECT_DIR$/vendor/doctrine/orm" /> - <path value="$PROJECT_DIR$/vendor/doctrine/deprecations" /> - <path value="$PROJECT_DIR$/vendor/doctrine/lexer" /> - <path value="$PROJECT_DIR$/vendor/doctrine/sql-formatter" /> - <path value="$PROJECT_DIR$/vendor/doctrine/doctrine-bundle" /> - <path value="$PROJECT_DIR$/vendor/doctrine/migrations" /> - <path value="$PROJECT_DIR$/vendor/doctrine/collections" /> - <path value="$PROJECT_DIR$/vendor/doctrine/instantiator" /> - <path value="$PROJECT_DIR$/vendor/vich/uploader-bundle" /> - <path value="$PROJECT_DIR$/vendor/jms/metadata" /> - </include_path> - </component> - <component name="PhpProjectSharedConfiguration" php_language_level="8.2" /> - <component name="PhpStanOptionsConfiguration"> - <option name="transferred" value="true" /> - </component> - <component name="PhpUnit"> - <phpunit_settings> - <PhpUnitSettings configuration_file_path="$PROJECT_DIR$/phpunit.xml.dist" custom_loader_path="$PROJECT_DIR$/vendor/autoload.php" use_configuration_file="true" /> - </phpunit_settings> - </component> - <component name="PsalmOptionsConfiguration"> - <option name="transferred" value="true" /> - </component> -</project> \ No newline at end of file diff --git a/.idea/phpunit.xml b/.idea/phpunit.xml deleted file mode 100644 index 4f8104cf..00000000 --- a/.idea/phpunit.xml +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="PHPUnit"> - <option name="directories"> - <list> - <option value="$PROJECT_DIR$/tests" /> - </list> - </option> - </component> -</project> \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1ddf..00000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="VcsDirectoryMappings"> - <mapping directory="" vcs="Git" /> - </component> -</project> \ No newline at end of file diff --git a/config/services.yaml b/config/services.yaml index 2d6a76f9..8a31e80a 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -4,6 +4,7 @@ # Put parameters here that don't need to change on each machine where the app is deployed # https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration parameters: + uploads_directory: '%kernel.project_dir%/public/uploads' services: # default configuration for services in *this* file diff --git a/migrations/Version20250319232441.php b/migrations/Version20250319232441.php new file mode 100644 index 00000000..80297575 --- /dev/null +++ b/migrations/Version20250319232441.php @@ -0,0 +1,37 @@ +<?php + +declare(strict_types=1); + +namespace DoctrineMigrations; + +use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; + +/** + * Auto-generated Migration: Please modify to your needs! + */ +final class Version20250319232441 extends AbstractMigration +{ + public function getDescription(): string + { + return ''; + } + + public function up(Schema $schema): void + { + // this up() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE TABLE item (id INT AUTO_INCREMENT NOT NULL, purchase_proof_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, url VARCHAR(255) NOT NULL, image VARCHAR(255) DEFAULT NULL, price DOUBLE PRECISION NOT NULL, UNIQUE INDEX UNIQ_1F1B251EFECA7547 (purchase_proof_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('CREATE TABLE purchase_proof (id INT AUTO_INCREMENT NOT NULL, congrats_text VARCHAR(255) NOT NULL, image_path VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('CREATE TABLE messenger_messages (id BIGINT AUTO_INCREMENT NOT NULL, body LONGTEXT NOT NULL, headers LONGTEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', available_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', delivered_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_75EA56E0FB7336F0 (queue_name), INDEX IDX_75EA56E0E3BD61CE (available_at), INDEX IDX_75EA56E016BA31DB (delivered_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('ALTER TABLE item ADD CONSTRAINT FK_1F1B251EFECA7547 FOREIGN KEY (purchase_proof_id) REFERENCES purchase_proof (id)'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE item DROP FOREIGN KEY FK_1F1B251EFECA7547'); + $this->addSql('DROP TABLE item'); + $this->addSql('DROP TABLE purchase_proof'); + $this->addSql('DROP TABLE messenger_messages'); + } +} diff --git a/migrations/Version20250319235558.php b/migrations/Version20250319235558.php new file mode 100644 index 00000000..ff767113 --- /dev/null +++ b/migrations/Version20250319235558.php @@ -0,0 +1,35 @@ +<?php + +declare(strict_types=1); + +namespace DoctrineMigrations; + +use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; + +/** + * Auto-generated Migration: Please modify to your needs! + */ +final class Version20250319235558 extends AbstractMigration +{ + public function getDescription(): string + { + return ''; + } + + public function up(Schema $schema): void + { + // this up() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE purchase_proof ADD item_id INT NOT NULL'); + $this->addSql('ALTER TABLE purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_2F32C3F7126F525E ON purchase_proof (item_id)'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E'); + $this->addSql('DROP INDEX UNIQ_2F32C3F7126F525E ON purchase_proof'); + $this->addSql('ALTER TABLE purchase_proof DROP item_id'); + } +} diff --git a/migrations/Version20250319235641.php b/migrations/Version20250319235641.php new file mode 100644 index 00000000..328a77c4 --- /dev/null +++ b/migrations/Version20250319235641.php @@ -0,0 +1,39 @@ +<?php + +declare(strict_types=1); + +namespace DoctrineMigrations; + +use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; + +/** + * Auto-generated Migration: Please modify to your needs! + */ +final class Version20250319235641 extends AbstractMigration +{ + public function getDescription(): string + { + return ''; + } + + public function up(Schema $schema): void + { + // this up() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE TABLE item (id INT AUTO_INCREMENT NOT NULL, purchase_proof_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, url VARCHAR(255) NOT NULL, image VARCHAR(255) DEFAULT NULL, price DOUBLE PRECISION NOT NULL, UNIQUE INDEX UNIQ_1F1B251EFECA7547 (purchase_proof_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('ALTER TABLE item ADD CONSTRAINT FK_1F1B251EFECA7547 FOREIGN KEY (purchase_proof_id) REFERENCES purchase_proof (id)'); + $this->addSql('ALTER TABLE purchase_proof ADD item_id INT NOT NULL'); + $this->addSql('ALTER TABLE purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_2F32C3F7126F525E ON purchase_proof (item_id)'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E'); + $this->addSql('ALTER TABLE item DROP FOREIGN KEY FK_1F1B251EFECA7547'); + $this->addSql('DROP TABLE item'); + $this->addSql('DROP INDEX UNIQ_2F32C3F7126F525E ON purchase_proof'); + $this->addSql('ALTER TABLE purchase_proof DROP item_id'); + } +} diff --git a/migrations/Version20250320000820.php b/migrations/Version20250320000820.php new file mode 100644 index 00000000..d8e5490b --- /dev/null +++ b/migrations/Version20250320000820.php @@ -0,0 +1,35 @@ +<?php + +declare(strict_types=1); + +namespace DoctrineMigrations; + +use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; + +/** + * Auto-generated Migration: Please modify to your needs! + */ +final class Version20250320000820 extends AbstractMigration +{ + public function getDescription(): string + { + return ''; + } + + public function up(Schema $schema): void + { + // this up() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE TABLE purchase_proof (id INT AUTO_INCREMENT NOT NULL, item_id INT NOT NULL, congrats_text VARCHAR(255) NOT NULL, image_path VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_2F32C3F7126F525E (item_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('ALTER TABLE purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)'); + $this->addSql('ALTER TABLE item ADD CONSTRAINT FK_1F1B251EFECA7547 FOREIGN KEY (purchase_proof_id) REFERENCES purchase_proof (id)'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE item DROP FOREIGN KEY FK_1F1B251EFECA7547'); + $this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E'); + $this->addSql('DROP TABLE purchase_proof'); + } +} diff --git a/migrations/Version20250320000903.php b/migrations/Version20250320000903.php new file mode 100644 index 00000000..c4b987f4 --- /dev/null +++ b/migrations/Version20250320000903.php @@ -0,0 +1,35 @@ +<?php + +declare(strict_types=1); + +namespace DoctrineMigrations; + +use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; + +/** + * Auto-generated Migration: Please modify to your needs! + */ +final class Version20250320000903 extends AbstractMigration +{ + public function getDescription(): string + { + return ''; + } + + public function up(Schema $schema): void + { + // this up() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE TABLE purchase_proof (id INT AUTO_INCREMENT NOT NULL, item_id INT NOT NULL, congrats_text VARCHAR(255) NOT NULL, image_path VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_2F32C3F7126F525E (item_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('ALTER TABLE purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)'); + $this->addSql('ALTER TABLE item ADD CONSTRAINT FK_1F1B251EFECA7547 FOREIGN KEY (purchase_proof_id) REFERENCES purchase_proof (id)'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE item DROP FOREIGN KEY FK_1F1B251EFECA7547'); + $this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E'); + $this->addSql('DROP TABLE purchase_proof'); + } +} diff --git a/migrations/Version20250320001018.php b/migrations/Version20250320001018.php new file mode 100644 index 00000000..e292a9b8 --- /dev/null +++ b/migrations/Version20250320001018.php @@ -0,0 +1,39 @@ +<?php + +declare(strict_types=1); + +namespace DoctrineMigrations; + +use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; + +/** + * Auto-generated Migration: Please modify to your needs! + */ +final class Version20250320001018 extends AbstractMigration +{ + public function getDescription(): string + { + return ''; + } + + public function up(Schema $schema): void + { + // this up() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE TABLE item (id INT AUTO_INCREMENT NOT NULL, purchase_proof_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, url VARCHAR(255) NOT NULL, image VARCHAR(255) DEFAULT NULL, price DOUBLE PRECISION NOT NULL, UNIQUE INDEX UNIQ_1F1B251EFECA7547 (purchase_proof_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('CREATE TABLE purchase_proof (id INT AUTO_INCREMENT NOT NULL, item_id INT NOT NULL, congrats_text VARCHAR(255) NOT NULL, image_path VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_2F32C3F7126F525E (item_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('CREATE TABLE messenger_messages (id BIGINT AUTO_INCREMENT NOT NULL, body LONGTEXT NOT NULL, headers LONGTEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', available_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', delivered_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_75EA56E0FB7336F0 (queue_name), INDEX IDX_75EA56E0E3BD61CE (available_at), INDEX IDX_75EA56E016BA31DB (delivered_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('ALTER TABLE item ADD CONSTRAINT FK_1F1B251EFECA7547 FOREIGN KEY (purchase_proof_id) REFERENCES purchase_proof (id)'); + $this->addSql('ALTER TABLE purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE item DROP FOREIGN KEY FK_1F1B251EFECA7547'); + $this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E'); + $this->addSql('DROP TABLE item'); + $this->addSql('DROP TABLE purchase_proof'); + $this->addSql('DROP TABLE messenger_messages'); + } +} diff --git a/migrations/Version20250320001428.php b/migrations/Version20250320001428.php new file mode 100644 index 00000000..cba08978 --- /dev/null +++ b/migrations/Version20250320001428.php @@ -0,0 +1,41 @@ +<?php + +declare(strict_types=1); + +namespace DoctrineMigrations; + +use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; + +/** + * Auto-generated Migration: Please modify to your needs! + */ +final class Version20250320001428 extends AbstractMigration +{ + public function getDescription(): string + { + return ''; + } + + public function up(Schema $schema): void + { + // this up() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE item DROP FOREIGN KEY FK_1F1B251EFECA7547'); + $this->addSql('DROP INDEX UNIQ_1F1B251EFECA7547 ON item'); + $this->addSql('ALTER TABLE item DROP purchase_proof_id'); + $this->addSql('ALTER TABLE purchase_proof ADD item_id INT NOT NULL'); + $this->addSql('ALTER TABLE purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_2F32C3F7126F525E ON purchase_proof (item_id)'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE item ADD purchase_proof_id INT DEFAULT NULL'); + $this->addSql('ALTER TABLE item ADD CONSTRAINT FK_1F1B251EFECA7547 FOREIGN KEY (purchase_proof_id) REFERENCES purchase_proof (id) ON UPDATE NO ACTION ON DELETE NO ACTION'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_1F1B251EFECA7547 ON item (purchase_proof_id)'); + $this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E'); + $this->addSql('DROP INDEX UNIQ_2F32C3F7126F525E ON purchase_proof'); + $this->addSql('ALTER TABLE purchase_proof DROP item_id'); + } +} diff --git a/migrations/Version20250320001458.php b/migrations/Version20250320001458.php new file mode 100644 index 00000000..345d1e8f --- /dev/null +++ b/migrations/Version20250320001458.php @@ -0,0 +1,37 @@ +<?php + +declare(strict_types=1); + +namespace DoctrineMigrations; + +use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; + +/** + * Auto-generated Migration: Please modify to your needs! + */ +final class Version20250320001458 extends AbstractMigration +{ + public function getDescription(): string + { + return ''; + } + + public function up(Schema $schema): void + { + // this up() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE TABLE item (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, url VARCHAR(255) NOT NULL, image VARCHAR(255) DEFAULT NULL, price DOUBLE PRECISION NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('CREATE TABLE purchase_proof (id INT AUTO_INCREMENT NOT NULL, item_id INT NOT NULL, congrats_text VARCHAR(255) NOT NULL, image_path VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_2F32C3F7126F525E (item_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('CREATE TABLE messenger_messages (id BIGINT AUTO_INCREMENT NOT NULL, body LONGTEXT NOT NULL, headers LONGTEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', available_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', delivered_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_75EA56E0FB7336F0 (queue_name), INDEX IDX_75EA56E0E3BD61CE (available_at), INDEX IDX_75EA56E016BA31DB (delivered_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('ALTER TABLE purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E'); + $this->addSql('DROP TABLE item'); + $this->addSql('DROP TABLE purchase_proof'); + $this->addSql('DROP TABLE messenger_messages'); + } +} diff --git a/migrations/Version20250320001931.php b/migrations/Version20250320001931.php new file mode 100644 index 00000000..acff1075 --- /dev/null +++ b/migrations/Version20250320001931.php @@ -0,0 +1,41 @@ +<?php + +declare(strict_types=1); + +namespace DoctrineMigrations; + +use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; + +/** + * Auto-generated Migration: Please modify to your needs! + */ +final class Version20250320001931 extends AbstractMigration +{ + public function getDescription(): string + { + return ''; + } + + public function up(Schema $schema): void + { + // this up() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE item DROP FOREIGN KEY FK_1F1B251EFECA7547'); + $this->addSql('DROP INDEX UNIQ_1F1B251EFECA7547 ON item'); + $this->addSql('ALTER TABLE item DROP purchase_proof_id'); + $this->addSql('ALTER TABLE purchase_proof ADD item_id INT NOT NULL'); + $this->addSql('ALTER TABLE purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_2F32C3F7126F525E ON purchase_proof (item_id)'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE item ADD purchase_proof_id INT DEFAULT NULL'); + $this->addSql('ALTER TABLE item ADD CONSTRAINT FK_1F1B251EFECA7547 FOREIGN KEY (purchase_proof_id) REFERENCES purchase_proof (id) ON UPDATE NO ACTION ON DELETE NO ACTION'); + $this->addSql('CREATE UNIQUE INDEX UNIQ_1F1B251EFECA7547 ON item (purchase_proof_id)'); + $this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E'); + $this->addSql('DROP INDEX UNIQ_2F32C3F7126F525E ON purchase_proof'); + $this->addSql('ALTER TABLE purchase_proof DROP item_id'); + } +} diff --git a/migrations/Version20250320001951.php b/migrations/Version20250320001951.php new file mode 100644 index 00000000..97040f22 --- /dev/null +++ b/migrations/Version20250320001951.php @@ -0,0 +1,37 @@ +<?php + +declare(strict_types=1); + +namespace DoctrineMigrations; + +use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; + +/** + * Auto-generated Migration: Please modify to your needs! + */ +final class Version20250320001951 extends AbstractMigration +{ + public function getDescription(): string + { + return ''; + } + + public function up(Schema $schema): void + { + // this up() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE TABLE item (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, url VARCHAR(255) NOT NULL, image VARCHAR(255) DEFAULT NULL, price DOUBLE PRECISION NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('CREATE TABLE purchase_proof (id INT AUTO_INCREMENT NOT NULL, item_id INT NOT NULL, congrats_text VARCHAR(255) NOT NULL, image_path VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_2F32C3F7126F525E (item_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('CREATE TABLE messenger_messages (id BIGINT AUTO_INCREMENT NOT NULL, body LONGTEXT NOT NULL, headers LONGTEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', available_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', delivered_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_75EA56E0FB7336F0 (queue_name), INDEX IDX_75EA56E0E3BD61CE (available_at), INDEX IDX_75EA56E016BA31DB (delivered_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('ALTER TABLE purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E'); + $this->addSql('DROP TABLE item'); + $this->addSql('DROP TABLE purchase_proof'); + $this->addSql('DROP TABLE messenger_messages'); + } +} diff --git a/migrations/Version20250320002407.php b/migrations/Version20250320002407.php new file mode 100644 index 00000000..57bc4aed --- /dev/null +++ b/migrations/Version20250320002407.php @@ -0,0 +1,37 @@ +<?php + +declare(strict_types=1); + +namespace DoctrineMigrations; + +use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; + +/** + * Auto-generated Migration: Please modify to your needs! + */ +final class Version20250320002407 extends AbstractMigration +{ + public function getDescription(): string + { + return ''; + } + + public function up(Schema $schema): void + { + // this up() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE TABLE item (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, url VARCHAR(255) NOT NULL, image VARCHAR(255) DEFAULT NULL, price DOUBLE PRECISION NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('CREATE TABLE purchase_proof (id INT AUTO_INCREMENT NOT NULL, item_id INT NOT NULL, congrats_text VARCHAR(255) NOT NULL, image_path VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_2F32C3F7126F525E (item_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('CREATE TABLE messenger_messages (id BIGINT AUTO_INCREMENT NOT NULL, body LONGTEXT NOT NULL, headers LONGTEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', available_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', delivered_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_75EA56E0FB7336F0 (queue_name), INDEX IDX_75EA56E0E3BD61CE (available_at), INDEX IDX_75EA56E016BA31DB (delivered_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('ALTER TABLE purchase_proof ADD CONSTRAINT FK_2F32C3F7126F525E FOREIGN KEY (item_id) REFERENCES item (id)'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE purchase_proof DROP FOREIGN KEY FK_2F32C3F7126F525E'); + $this->addSql('DROP TABLE item'); + $this->addSql('DROP TABLE purchase_proof'); + $this->addSql('DROP TABLE messenger_messages'); + } +} diff --git a/public/css/style.css b/public/css/style.css index dfb0f604..5ecfcbfb 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -97,4 +97,73 @@ h1 a { justify-content: center; align-items: center; } +/* Add these styles to your existing CSS file */ + +.container { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + gap: 20px; + height: 100%; +} + +.item-section { + display: flex; + gap: 20px; + justify-content: center; + align-items: center; + width: 100%; +} + +.article-box, .upload-box { + border: 2px solid #99CC33; + padding: 20px; + background: white; + width: 200px; + text-align: center; + position: relative; + border-radius: 10px; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.upload-form { + display: flex; + flex-direction: column; + gap: 10px; + width: 100%; +} + +.form-group { + display: flex; + flex-direction: column; + gap: 5px; + width: 100%; +} + +.form-control { + padding: 8px; + border: 1px solid #99CC33; + border-radius: 5px; + outline: none; + width: 100%; +} + +.submit-button { + padding: 10px; + background-color: #00B8DE; + color: white; + border: none; + border-radius: 5px; + cursor: pointer; + font-size: 16px; + width: 100%; +} + +.submit-button:hover { + background-color: #0099B8; +} diff --git a/public/uploads/images/screenshot-from-2025-02-14-09-20-02-67db63d057533675522937.png b/public/uploads/images/screenshot-from-2025-02-14-09-20-02-67db63d057533675522937.png new file mode 100644 index 0000000000000000000000000000000000000000..142942288002c6363e8e11582cefeea2a3d1cd92 GIT binary patch literal 1945 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 literal 0 HcmV?d00001 diff --git a/src/Controller/PurchaseProofController.php b/src/Controller/PurchaseProofController.php new file mode 100644 index 00000000..b31218ca --- /dev/null +++ b/src/Controller/PurchaseProofController.php @@ -0,0 +1,50 @@ +<?php + +namespace App\Controller; + +use App\Entity\Item; +use App\Entity\PurchaseProof; +use App\Form\PurchaseProofType; +use Doctrine\ORM\EntityManagerInterface; +use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Routing\Annotation\Route; + +#[Route('/item/{id}/purchaseproof')] +class PurchaseProofController extends AbstractController +{ + #[Route('/new', name: 'purchaseproof_new', methods: ['GET', 'POST'])] + public function new(Item $item, Request $request, EntityManagerInterface $entityManager): Response + { + if ($item->getPurchaseProof()) { + $this->addFlash('warning', 'This item already has a purchase proof.'); + return $this->redirectToRoute('app_item_show', ['id' => $item->getId()]); + } + + $purchaseProof = new PurchaseProof(); + $purchaseProof->setItem($item); + + $form = $this->createForm(PurchaseProofType::class, $purchaseProof); + $form->handleRequest($request); + + if ($form->isSubmitted() && $form->isValid()) { + $imageFile = $form->get('imagePath')->getData(); + if ($imageFile) { + $newFilename = uniqid().'.'.$imageFile->guessExtension(); + $imageFile->move($this->getParameter('uploads_directory'), $newFilename); + $purchaseProof->setImagePath($newFilename); + } + + $entityManager->persist($purchaseProof); + $entityManager->flush(); + + return $this->redirectToRoute('app_item_show', ['id' => $item->getId()]); + } + + return $this->render('purchase_proof/new.html.twig', [ + 'form' => $form->createView(), + 'item' => $item, + ]); + } +} diff --git a/src/Entity/Item.php b/src/Entity/Item.php index 99263f33..7b6dba68 100644 --- a/src/Entity/Item.php +++ b/src/Entity/Item.php @@ -39,7 +39,7 @@ class Item #[ORM\Column] private ?float $price = null; - #[ORM\OneToOne(cascade: ['persist', 'remove'])] + #[ORM\OneToOne(mappedBy: 'item', cascade: ['persist', 'remove'])] private ?PurchaseProof $purchaseProof = null; public function getId(): ?int @@ -119,7 +119,11 @@ class Item public function setPurchaseProof(?PurchaseProof $purchaseProof): static { + // Ensure the relationship is bidirectional + if ($purchaseProof !== null && $purchaseProof->getItem() !== $this) { + $purchaseProof->setItem($this); + } $this->purchaseProof = $purchaseProof; return $this; } -} +} \ No newline at end of file diff --git a/src/Entity/PurchaseProof.php b/src/Entity/PurchaseProof.php index 1315adad..cbaf858b 100644 --- a/src/Entity/PurchaseProof.php +++ b/src/Entity/PurchaseProof.php @@ -19,6 +19,13 @@ class PurchaseProof #[ORM\Column(length: 255)] private ?string $imagePath = null; + #[ORM\OneToOne(inversedBy: "purchaseProof", cascade: ["persist", "remove"])] + #[ORM\JoinColumn(nullable: false)] + private ?Item $item = null; + + #[ORM\Column] + private ?int $item_id = null; // Explicit item_id column + public function getId(): ?int { return $this->id; @@ -32,7 +39,6 @@ class PurchaseProof public function setCongratsText(string $congratsText): static { $this->congratsText = $congratsText; - return $this; } @@ -44,7 +50,29 @@ class PurchaseProof public function setImagePath(string $imagePath): static { $this->imagePath = $imagePath; + return $this; + } + + public function getItem(): ?Item + { + return $this->item; + } + public function setItem(Item $item): static + { + $this->item = $item; + $this->item_id = $item->getId(); // Keep item_id in sync + return $this; + } + + public function getItemId(): ?int + { + return $this->item_id; + } + + public function setItemId(int $item_id): static + { + $this->item_id = $item_id; return $this; } -} +} \ No newline at end of file diff --git a/src/Form/PurchaseProofType.php b/src/Form/PurchaseProofType.php new file mode 100644 index 00000000..bc22634d --- /dev/null +++ b/src/Form/PurchaseProofType.php @@ -0,0 +1,45 @@ +<?php + +namespace App\Form; + +use App\Entity\PurchaseProof; +use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\Type\FileType; +use Symfony\Component\Form\Extension\Core\Type\SubmitType; +use Symfony\Component\Form\Extension\Core\Type\TextType; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\OptionsResolver\OptionsResolver; +use Symfony\Component\Validator\Constraints\File; + +class PurchaseProofType extends AbstractType +{ + public function buildForm(FormBuilderInterface $builder, array $options) + { + $builder + ->add('congratsText', TextType::class, [ + 'label' => 'Congratulations Message' + ]) + ->add('imagePath', FileType::class, [ + 'label' => 'Upload Image', + 'mapped' => false, + 'required' => false, + 'constraints' => [ + new File([ + 'maxSize' => '5M', + 'mimeTypes' => ['image/jpeg', 'image/png', 'image/webp'], + 'mimeTypesMessage' => 'Please upload a valid image file', + ]) + ] + ]) + ->add('save', SubmitType::class, [ + 'label' => 'Save Purchase Proof' + ]); + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver->setDefaults([ + 'data_class' => PurchaseProof::class, + ]); + } +} diff --git a/templates/purchase_proof/index.html.twig b/templates/purchase_proof/index.html.twig new file mode 100644 index 00000000..78a3a987 --- /dev/null +++ b/templates/purchase_proof/index.html.twig @@ -0,0 +1,20 @@ +{% extends 'base.html.twig' %} + +{% block title %}Hello PurchaseProofController!{% endblock %} + +{% block body %} +<style> + .example-wrapper { margin: 1em auto; max-width: 800px; width: 95%; font: 18px/1.5 sans-serif; } + .example-wrapper code { background: #F5F5F5; padding: 2px 6px; } +</style> + +<div class="example-wrapper"> + <h1>Hello {{ controller_name }}! ✅</h1> + + This friendly message is coming from: + <ul> + <li>Your controller at <code>/home/firas/Desktop/Wishlist-application/src/Controller/PurchaseProofController.php</code></li> + <li>Your template at <code>/home/firas/Desktop/Wishlist-application/templates/purchase_proof/index.html.twig</code></li> + </ul> +</div> +{% endblock %} diff --git a/templates/purchase_proof/new.html.twig b/templates/purchase_proof/new.html.twig new file mode 100644 index 00000000..d5622601 --- /dev/null +++ b/templates/purchase_proof/new.html.twig @@ -0,0 +1,40 @@ +{% extends 'base.html.twig' %} + +{% block title %}Add Purchase Proof{% endblock %} + +{% block body %} +<header> + <div class="user-icon"></div> + <h1><a href="#">Purchase proof</a></h1> + <input type="text" placeholder="Search…" class="search-bar"> + <div class="menu-icon"></div> +</header> + +<main> + <div class="container"> + <h2>Add Purchase Proof for {{ item.title }}</h2> + <section class="item-section"> + <div class="article-box"> + <p class="label">{{ item.title }}</p> + <div class="image-box"> + <img src="{{ asset('uploads/' ~ item.image) }}" alt="Item photo"> + </div> + </div> + + <div class="upload-box"> + {{ form_start(form, {'attr': {'enctype': 'multipart/form-data', 'class': 'upload-form'}}) }} + <div class="form-group"> + {{ form_label(form.congratsText) }} + {{ form_widget(form.congratsText, {'attr': {'class': 'form-control', 'placeholder': 'Write a message…'}}) }} + </div> + <div class="form-group"> + {{ form_label(form.imagePath) }} + {{ form_widget(form.imagePath, {'attr': {'class': 'form-control'}}) }} + </div> + <button type="submit" class="submit-button">Submit</button> + {{ form_end(form) }} + </div> + </section> + </div> +</main> +{% endblock %} \ No newline at end of file diff --git a/tests/Controller/PurchaseProofControllerTest.php b/tests/Controller/PurchaseProofControllerTest.php new file mode 100644 index 00000000..17136da8 --- /dev/null +++ b/tests/Controller/PurchaseProofControllerTest.php @@ -0,0 +1,16 @@ +<?php + +namespace App\Tests\Controller; + +use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; + +final class PurchaseProofControllerTest extends WebTestCase +{ + public function testIndex(): void + { + $client = static::createClient(); + $client->request('GET', '/purchase/proof'); + + self::assertResponseIsSuccessful(); + } +} -- GitLab