-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply value of transactions to the user's balance when they are applied
- Create Entity for Avatars - Create Entity for Category
- Loading branch information
Showing
28 changed files
with
770 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,3 +65,4 @@ Thumbs.db | |
/.phpcs-cache | ||
###< squizlabs/php_codesniffer ### | ||
public/build | ||
.fleet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?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 Version20230804194352 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 avatar (id INT AUTO_INCREMENT NOT NULL, url VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB'); | ||
$this->addSql('CREATE TABLE category (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB'); | ||
$this->addSql('ALTER TABLE transaction ADD category_id INT DEFAULT NULL, DROP type'); | ||
$this->addSql('ALTER TABLE transaction ADD CONSTRAINT FK_723705D112469DE2 FOREIGN KEY (category_id) REFERENCES category (id)'); | ||
$this->addSql('CREATE INDEX IDX_723705D112469DE2 ON transaction (category_id)'); | ||
$this->addSql('ALTER TABLE user ADD avatar_id INT DEFAULT NULL, DROP avatar'); | ||
$this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D64986383B10 FOREIGN KEY (avatar_id) REFERENCES avatar (id)'); | ||
$this->addSql('CREATE INDEX IDX_8D93D64986383B10 ON user (avatar_id)'); | ||
} | ||
|
||
public function down(Schema $schema): void | ||
{ | ||
// this down() migration is auto-generated, please modify it to your needs | ||
$this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D64986383B10'); | ||
$this->addSql('ALTER TABLE transaction DROP FOREIGN KEY FK_723705D112469DE2'); | ||
$this->addSql('DROP TABLE avatar'); | ||
$this->addSql('DROP TABLE category'); | ||
$this->addSql('DROP INDEX IDX_8D93D64986383B10 ON user'); | ||
$this->addSql('ALTER TABLE user ADD avatar VARCHAR(255) DEFAULT NULL, DROP avatar_id'); | ||
$this->addSql('DROP INDEX IDX_723705D112469DE2 ON transaction'); | ||
$this->addSql('ALTER TABLE transaction ADD type SMALLINT NOT NULL, DROP category_id'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Controller\Admin; | ||
|
||
use App\Entity\Avatar; | ||
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController; | ||
use EasyCorp\Bundle\EasyAdminBundle\Field\IdField; | ||
use EasyCorp\Bundle\EasyAdminBundle\Field\UrlField; | ||
|
||
class AvatarCrudController extends AbstractCrudController | ||
{ | ||
public static function getEntityFqcn(): string | ||
{ | ||
return Avatar::class; | ||
} | ||
|
||
public function configureFields(string $pageName): iterable | ||
{ | ||
yield IdField::new('id')->hideOnForm(); | ||
yield UrlField::new('url'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Controller\Admin; | ||
|
||
use App\Entity\Category; | ||
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController; | ||
use EasyCorp\Bundle\EasyAdminBundle\Field\IdField; | ||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | ||
|
||
class CategoryCrudController extends AbstractCrudController | ||
{ | ||
public static function getEntityFqcn(): string | ||
{ | ||
return Category::class; | ||
} | ||
|
||
public function configureFields(string $pageName): iterable | ||
{ | ||
yield IdField::new('id')->hideOnForm(); | ||
yield TextField::new('name'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.