diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 4cac70c2..c95a829d 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -24,9 +24,14 @@
+
+
+
+
-
-
+
+
+
@@ -252,7 +257,7 @@
"keyToString": {
"dart.analysis.tool.window.visible": "false",
"git-widget-placeholder": "main",
- "last_opened_file_path": "/home/poule/encrypted/stockage-syncable/www/development/html/caisse/templates/account",
+ "last_opened_file_path": "/home/poule/encrypted/stockage-syncable/www/development/html/caisse-bliss-frontend",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
@@ -312,7 +317,9 @@
-
+
+
+
diff --git a/migrations/Version20240716105848.php b/migrations/Version20240716105848.php
index d34b96a4..a7274b44 100644
--- a/migrations/Version20240716105848.php
+++ b/migrations/Version20240716105848.php
@@ -20,7 +20,7 @@ final class Version20240716105848 extends AbstractMigration
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
- $this->addSql('CREATE TABLE exepense_config (id INT AUTO_INCREMENT NOT NULL, owner_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, delay INT DEFAULT NULL, enabled TINYINT(1) DEFAULT NULL, amount INT NOT NULL, repeatitions INT DEFAULT NULL, INDEX IDX_4797F5B27E3C61F9 (owner_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
+ $this->addSql('CREATE TABLE Expense_config (id INT AUTO_INCREMENT NOT NULL, owner_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, delay INT DEFAULT NULL, enabled TINYINT(1) DEFAULT NULL, amount INT NOT NULL, repeatitions INT DEFAULT NULL, INDEX IDX_4797F5B27E3C61F9 (owner_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE festival (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, fond_de_caisse_avant INT NOT NULL, fond_de_caisse_apres INT NOT NULL, chiffre_affaire INT NOT NULL, frais_inscription INT DEFAULT NULL, frais_hebergement INT DEFAULT NULL, frais_transport INT DEFAULT NULL, frais_repas INT DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE product (id INT AUTO_INCREMENT NOT NULL, owner_id INT DEFAULT NULL, product_category_id INT DEFAULT NULL, stock_count INT NOT NULL, name VARCHAR(255) NOT NULL, image VARCHAR(255) DEFAULT NULL, INDEX IDX_D34A04AD7E3C61F9 (owner_id), INDEX IDX_D34A04ADBE6903FD (product_category_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE product_category (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
@@ -28,7 +28,7 @@ final class Version20240716105848 extends AbstractMigration
$this->addSql('CREATE TABLE product_sold (id INT AUTO_INCREMENT NOT NULL, owner_id INT DEFAULT NULL, name VARCHAR(255) DEFAULT NULL, image VARCHAR(255) DEFAULT NULL, INDEX IDX_153AFF387E3C61F9 (owner_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE sell_record (id INT AUTO_INCREMENT NOT NULL, owner_id INT DEFAULT NULL, festival_id INT DEFAULT NULL, customer_gender VARCHAR(255) DEFAULT NULL, date DATE NOT NULL, amount INT NOT NULL, paid_by_customer INT DEFAULT NULL, INDEX IDX_F9F12A027E3C61F9 (owner_id), INDEX IDX_F9F12A028AEBAF57 (festival_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE serie_festival (id INT AUTO_INCREMENT NOT NULL, owner_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, date_creation DATE NOT NULL, INDEX IDX_4DFA58B17E3C61F9 (owner_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
- $this->addSql('ALTER TABLE exepense_config ADD CONSTRAINT FK_4797F5B27E3C61F9 FOREIGN KEY (owner_id) REFERENCES `user` (id)');
+ $this->addSql('ALTER TABLE Expense_config ADD CONSTRAINT FK_4797F5B27E3C61F9 FOREIGN KEY (owner_id) REFERENCES `user` (id)');
$this->addSql('ALTER TABLE product ADD CONSTRAINT FK_D34A04AD7E3C61F9 FOREIGN KEY (owner_id) REFERENCES `user` (id)');
$this->addSql('ALTER TABLE product ADD CONSTRAINT FK_D34A04ADBE6903FD FOREIGN KEY (product_category_id) REFERENCES product_category (id)');
$this->addSql('ALTER TABLE product_category_user ADD CONSTRAINT FK_DCE5B0FCBE6903FD FOREIGN KEY (product_category_id) REFERENCES product_category (id) ON DELETE CASCADE');
@@ -46,7 +46,7 @@ final class Version20240716105848 extends AbstractMigration
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE `admin` (id INT AUTO_INCREMENT NOT NULL, username VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, email VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE user_account (id INT AUTO_INCREMENT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
- $this->addSql('ALTER TABLE exepense_config DROP FOREIGN KEY FK_4797F5B27E3C61F9');
+ $this->addSql('ALTER TABLE Expense_config DROP FOREIGN KEY FK_4797F5B27E3C61F9');
$this->addSql('ALTER TABLE product DROP FOREIGN KEY FK_D34A04AD7E3C61F9');
$this->addSql('ALTER TABLE product DROP FOREIGN KEY FK_D34A04ADBE6903FD');
$this->addSql('ALTER TABLE product_category_user DROP FOREIGN KEY FK_DCE5B0FCBE6903FD');
@@ -55,7 +55,7 @@ final class Version20240716105848 extends AbstractMigration
$this->addSql('ALTER TABLE sell_record DROP FOREIGN KEY FK_F9F12A027E3C61F9');
$this->addSql('ALTER TABLE sell_record DROP FOREIGN KEY FK_F9F12A028AEBAF57');
$this->addSql('ALTER TABLE serie_festival DROP FOREIGN KEY FK_4DFA58B17E3C61F9');
- $this->addSql('DROP TABLE exepense_config');
+ $this->addSql('DROP TABLE Expense_config');
$this->addSql('DROP TABLE festival');
$this->addSql('DROP TABLE product');
$this->addSql('DROP TABLE product_category');
diff --git a/src/Controller/AccountController.php b/src/Controller/AccountController.php
index c64d8ead..7d59ca3d 100644
--- a/src/Controller/AccountController.php
+++ b/src/Controller/AccountController.php
@@ -8,7 +8,7 @@ use Symfony\Component\Routing\Annotation\Route;
use Doctrine\ORM\EntityManagerInterface;
use App\Entity\User;
-use App\Entity\ExepenseConfig;
+use App\Entity\ExpenseConfig;
use App\Entity\SerieFestival;
use App\Entity\Festival;
use App\Entity\Product;
diff --git a/src/Controller/Admin/DashboardController.php b/src/Controller/Admin/DashboardController.php
index 0ae0d2d2..59c2a52e 100644
--- a/src/Controller/Admin/DashboardController.php
+++ b/src/Controller/Admin/DashboardController.php
@@ -8,12 +8,12 @@ use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractDashboardController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
-use ExepenseConfigCrudController;
+use ExpenseConfigCrudController;
use UserCrudController;
use ProductCrudController;
use App\Entity\User;
-use App\Entity\ExepenseConfig;
+use App\Entity\ExpenseConfig;
use App\Entity\SerieFestival;
use App\Entity\Festival;
use App\Entity\Product;
@@ -40,7 +40,7 @@ class DashboardController extends AbstractDashboardController
MenuItem::linkToDashboard('Dashboard', 'fa fa-home'),
MenuItem::section('Utilisatrices'),
MenuItem::linkToCrud('Gens', 'fa fa-user', User::class),
- MenuItem::linkToCrud('Dépenses', 'fa fa-user', ExepenseConfig::class),
+ MenuItem::linkToCrud('Dépenses', 'fa fa-user', ExpenseConfig::class),
MenuItem::section('Biens'),
MenuItem::linkToCrud('Produits', 'fa fa-user', Product::class),
MenuItem::linkToCrud('Ventes', 'fa fa-user', ProductSold::class),
diff --git a/src/Controller/Admin/ExepenseConfigCrudController.php b/src/Controller/Admin/ExpenseConfigCrudController.php
similarity index 81%
rename from src/Controller/Admin/ExepenseConfigCrudController.php
rename to src/Controller/Admin/ExpenseConfigCrudController.php
index fa96808b..7b1bd746 100644
--- a/src/Controller/Admin/ExepenseConfigCrudController.php
+++ b/src/Controller/Admin/ExpenseConfigCrudController.php
@@ -2,17 +2,17 @@
namespace App\Controller\Admin;
-use App\Entity\ExepenseConfig;
+use App\Entity\ExpenseConfig;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
use EasyCorp\Bundle\EasyAdminBundle\Field\IdField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextEditorField;
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField;
-class ExepenseConfigCrudController extends AbstractCrudController
+class ExpenseConfigCrudController extends AbstractCrudController
{
public static function getEntityFqcn(): string
{
- return ExepenseConfig::class;
+ return ExpenseConfig::class;
}
/*
diff --git a/src/DataFixtures/AppFixtures.php b/src/DataFixtures/AppFixtures.php
index 6e73ff75..ed2e41e5 100644
--- a/src/DataFixtures/AppFixtures.php
+++ b/src/DataFixtures/AppFixtures.php
@@ -4,39 +4,51 @@ namespace App\DataFixtures;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Persistence\ObjectManager;
+use App\Entity\ExpenseConfig as Expense;
+use App\Entity\Product;
+use App\Entity\User;
+use App\Entity\ProductCategory;
class AppFixtures extends Fixture
{
public function load(ObjectManager $manager): void
{
- $expense = new Exepense();
+ $expense = new Expense();
$expense->setName('courses au marché')
->setAmount(40);
- $expense2 = new Exepense();
+ $expense2 = new Expense();
$expense2->setName('abonnement service compta')
->setAmount(60);
- $expense3 = new Exepense();
+ $expense3 = new Expense();
$expense3->setName('plutonium récréatif')
->setAmount(15);
$product = new Product();
- $product->setName('Un Livre d\'exemple');
+ $product
+ ->setName('Un Livre d\'exemple')
+ ->setPrice(15)
+ ->setStockCount(12);
$product2 = new Product();
$product2->setName('Un poster')
- ->setPrice(12);
+ ->setPrice(12)
+ ->setStockCount(12);
$product3 = new Product();
- $product3->setName('Chaudière à sel fondus')->setPrice(120000000);
+ $product3
+ ->setName('Chaudière à sel fondus')
+ ->setPrice(120000000)
+ ->setStockCount(2);
- $categ = new Category();
+ $categ = new ProductCategory();
$categ->setName('Livres');
$demo_user = new User();
$demo_user
->setEmail('demo@demo.com')
- ->setRoles('ROLE_ADMIN')
+ ->setPassword('demo')
+ ->setRoles(['ROLE_ADMIN'])
->addExpenseConfig($expense)
->addExpenseConfig($expense2)
->addExpenseConfig($expense3)
@@ -50,7 +62,11 @@ class AppFixtures extends Fixture
$categ->addProduct($product);
$manager->persist($expense);
+ $manager->persist($expense2);
+ $manager->persist($expense3);
$manager->persist($product);
+ $manager->persist($product2);
+ $manager->persist($product3);
$manager->persist($categ);
$manager->persist($demo_user);
diff --git a/src/Entity/ExepenseConfig.php b/src/Entity/ExpenseConfig.php
similarity index 91%
rename from src/Entity/ExepenseConfig.php
rename to src/Entity/ExpenseConfig.php
index 89fd8573..a4d5a376 100644
--- a/src/Entity/ExepenseConfig.php
+++ b/src/Entity/ExpenseConfig.php
@@ -2,13 +2,13 @@
namespace App\Entity;
-use App\Repository\ExepenseConfigRepository;
+use App\Repository\ExpenseConfigRepository;
use Doctrine\ORM\Mapping as ORM;
use ApiPlatform\Metadata\ApiResource;
-#[ORM\Entity(repositoryClass: ExepenseConfigRepository::class)]
+#[ORM\Entity(repositoryClass: ExpenseConfigRepository::class)]
#[ApiResource]
-class ExepenseConfig
+class ExpenseConfig
{
#[ORM\Id]
#[ORM\GeneratedValue]
@@ -27,7 +27,7 @@ class ExepenseConfig
#[ORM\Column]
private ?int $amount = null;
- #[ORM\ManyToOne(inversedBy: 'exepenseConfigs')]
+ #[ORM\ManyToOne(inversedBy: 'ExpenseConfigs')]
private ?User $owner = null;
#[ORM\Column(nullable: true)]
diff --git a/src/Entity/User.php b/src/Entity/User.php
index 2df3b783..60105ea0 100644
--- a/src/Entity/User.php
+++ b/src/Entity/User.php
@@ -57,8 +57,8 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
#[ORM\OneToMany(targetEntity: ProductSold::class, mappedBy: 'owner')]
private Collection $product;
- #[ORM\OneToMany(targetEntity: ExepenseConfig::class, mappedBy: 'owner')]
- private Collection $exepenseConfigs;
+ #[ORM\OneToMany(targetEntity: ExpenseConfig::class, mappedBy: 'owner')]
+ private Collection $ExpenseConfigs;
#[ORM\OneToMany(targetEntity: SerieFestival::class, mappedBy: 'owner')]
private Collection $festivals;
@@ -69,7 +69,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
$this->sellRecords = new ArrayCollection();
$this->productCategories = new ArrayCollection();
$this->product = new ArrayCollection();
- $this->exepenseConfigs = new ArrayCollection();
+ $this->ExpenseConfigs = new ArrayCollection();
$this->festivals = new ArrayCollection();
}
@@ -275,29 +275,29 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
}
/**
- * @return Collection
+ * @return Collection
*/
- public function getExepenseConfigs(): Collection
+ public function getExpenseConfigs(): Collection
{
- return $this->exepenseConfigs;
+ return $this->ExpenseConfigs;
}
- public function addExepenseConfig(ExepenseConfig $exepenseConfig): static
+ public function addExpenseConfig(ExpenseConfig $ExpenseConfig): static
{
- if (!$this->exepenseConfigs->contains($exepenseConfig)) {
- $this->exepenseConfigs->add($exepenseConfig);
- $exepenseConfig->setOwner($this);
+ if (!$this->ExpenseConfigs->contains($ExpenseConfig)) {
+ $this->ExpenseConfigs->add($ExpenseConfig);
+ $ExpenseConfig->setOwner($this);
}
return $this;
}
- public function removeExepenseConfig(ExepenseConfig $exepenseConfig): static
+ public function removeExpenseConfig(ExpenseConfig $ExpenseConfig): static
{
- if ($this->exepenseConfigs->removeElement($exepenseConfig)) {
+ if ($this->ExpenseConfigs->removeElement($ExpenseConfig)) {
// set the owning side to null (unless already changed)
- if ($exepenseConfig->getOwner() === $this) {
- $exepenseConfig->setOwner(null);
+ if ($ExpenseConfig->getOwner() === $this) {
+ $ExpenseConfig->setOwner(null);
}
}
diff --git a/src/Repository/ExepenseConfigRepository.php b/src/Repository/ExepenseConfigRepository.php
index c81f4188..d25c3c23 100644
--- a/src/Repository/ExepenseConfigRepository.php
+++ b/src/Repository/ExepenseConfigRepository.php
@@ -2,27 +2,27 @@
namespace App\Repository;
-use App\Entity\ExepenseConfig;
+use App\Entity\ExpenseConfig;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
- * @extends ServiceEntityRepository
+ * @extends ServiceEntityRepository
*
- * @method ExepenseConfig|null find($id, $lockMode = null, $lockVersion = null)
- * @method ExepenseConfig|null findOneBy(array $criteria, array $orderBy = null)
- * @method ExepenseConfig[] findAll()
- * @method ExepenseConfig[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
+ * @method ExpenseConfig|null find($id, $lockMode = null, $lockVersion = null)
+ * @method ExpenseConfig|null findOneBy(array $criteria, array $orderBy = null)
+ * @method ExpenseConfig[] findAll()
+ * @method ExpenseConfig[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
-class ExepenseConfigRepository extends ServiceEntityRepository
+class ExpenseConfigRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
- parent::__construct($registry, ExepenseConfig::class);
+ parent::__construct($registry, ExpenseConfig::class);
}
// /**
-// * @return ExepenseConfig[] Returns an array of ExepenseConfig objects
+// * @return ExpenseConfig[] Returns an array of ExpenseConfig objects
// */
// public function findByExampleField($value): array
// {
@@ -36,7 +36,7 @@ class ExepenseConfigRepository extends ServiceEntityRepository
// ;
// }
-// public function findOneBySomeField($value): ?ExepenseConfig
+// public function findOneBySomeField($value): ?ExpenseConfig
// {
// return $this->createQueryBuilder('e')
// ->andWhere('e.exampleField = :val')