Explorar el Código

Opening

develop
Guillaume hace 3 años
padre
commit
0f13018f25
Se han modificado 9 ficheros con 135 adiciones y 40 borrados
  1. +2
    -1
      config/packages/doctrine.yaml
  2. +47
    -0
      migrations/Version20210624083555.php
  3. +35
    -0
      migrations/Version20210624115842.php
  4. +2
    -0
      src/Controller/Dashboard/DashboardAdminController.php
  5. +14
    -0
      src/Controller/Section/OpeningAdminController.php
  6. +3
    -39
      src/Definition/SectionSettingDefinition.php
  7. +25
    -0
      src/Entity/Section/Opening.php
  8. +3
    -0
      src/Entity/Section/Section.php
  9. +4
    -0
      src/Entity/User/GroupUser.php

+ 2
- 1
config/packages/doctrine.yaml Ver fichero

@@ -56,4 +56,5 @@ doctrine:
Lc\CaracoleBundle\Model\User\VisitorInterface: App\Entity\User\Visitor
Lc\SovBundle\Model\Setting\SiteSettingInterface: App\Entity\Setting\SiteSetting
Lc\CaracoleBundle\Model\Setting\MerchantSettingInterface: App\Entity\Setting\MerchantSetting
Lc\CaracoleBundle\Model\Setting\SectionSettingInterface: App\Entity\Setting\SectionSetting
Lc\CaracoleBundle\Model\Setting\SectionSettingInterface: App\Entity\Setting\SectionSetting
Lc\CaracoleBundle\Model\Section\OpeningInterface: App\Entity\Section\Opening

+ 47
- 0
migrations/Version20210624083555.php Ver fichero

@@ -0,0 +1,47 @@
<?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 Version20210624083555 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 merchant DROP FOREIGN KEY FK_74AB25E1E511F091');
$this->addSql('CREATE TABLE opening (id INT AUTO_INCREMENT NOT NULL, section_id INT NOT NULL, day INT NOT NULL, time_start TIME DEFAULT NULL, time_end TIME DEFAULT NULL, INDEX IDX_E35D4C3D823E37A (section_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE opening ADD CONSTRAINT FK_E35D4C3D823E37A FOREIGN KEY (section_id) REFERENCES section (id)');
$this->addSql('DROP TABLE credit_config');
$this->addSql('DROP TABLE point_sale_day_info');
$this->addSql('DROP INDEX UNIQ_74AB25E1E511F091 ON merchant');
$this->addSql('ALTER TABLE merchant DROP credit_config_id');
$this->addSql('ALTER TABLE order_shop ADD cycle_id INT DEFAULT NULL');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE credit_config (id INT AUTO_INCREMENT NOT NULL, active TINYINT(1) NOT NULL, limit_amount DOUBLE PRECISION DEFAULT NULL, limit_reminder DOUBLE PRECISION DEFAULT NULL, behavior VARCHAR(31) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, process_order_checked_default TINYINT(1) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE point_sale_day_info (id INT AUTO_INCREMENT NOT NULL, point_sale_id INT NOT NULL, created_by_id INT NOT NULL, updated_by_id INT NOT NULL, active TINYINT(1) NOT NULL, day SMALLINT NOT NULL, description LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, dev_alias VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_34BC1A33896DBBDE (updated_by_id), INDEX IDX_34BC1A33FDAAB1A4 (point_sale_id), INDEX IDX_34BC1A33B03A8386 (created_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE point_sale_day_info ADD CONSTRAINT FK_34BC1A33896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE point_sale_day_info ADD CONSTRAINT FK_34BC1A33B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE point_sale_day_info ADD CONSTRAINT FK_34BC1A33FDAAB1A4 FOREIGN KEY (point_sale_id) REFERENCES point_sale (id)');
$this->addSql('DROP TABLE opening');
$this->addSql('ALTER TABLE merchant ADD credit_config_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE merchant ADD CONSTRAINT FK_74AB25E1E511F091 FOREIGN KEY (credit_config_id) REFERENCES credit_config (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_74AB25E1E511F091 ON merchant (credit_config_id)');
$this->addSql('ALTER TABLE order_shop DROP cycle_id');
}
}

+ 35
- 0
migrations/Version20210624115842.php Ver fichero

@@ -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 Version20210624115842 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 opening ADD group_user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE opening ADD CONSTRAINT FK_E35D4C3216E8799 FOREIGN KEY (group_user_id) REFERENCES group_user (id)');
$this->addSql('CREATE INDEX IDX_E35D4C3216E8799 ON opening (group_user_id)');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE opening DROP FOREIGN KEY FK_E35D4C3216E8799');
$this->addSql('DROP INDEX IDX_E35D4C3216E8799 ON opening');
$this->addSql('ALTER TABLE opening DROP group_user_id');
}
}

+ 2
- 0
src/Controller/Dashboard/DashboardAdminController.php Ver fichero

@@ -7,6 +7,7 @@ use App\Entity\Config\Unit;
use App\Entity\Merchant\Merchant;
use App\Entity\Newsletter\Newsletter;
use App\Entity\PointSale\PointSale;
use App\Entity\Section\Opening;
use App\Entity\Section\Section;
use App\Entity\Site\News;
use App\Entity\Site\Page;
@@ -40,6 +41,7 @@ class DashboardAdminController extends CaracDashboardController
[
MenuItem::linkToRoute('setting_merchant', '', 'carac_admin_setting_merchant'),
MenuItem::linkToRoute('setting_section', '', 'carac_admin_setting_section'),
MenuItem::linkToCrud('section_openings', '', Opening::class),
MenuItem::linkToRoute('setting_global', '', 'carac_admin_setting_site'),
]
);

+ 14
- 0
src/Controller/Section/OpeningAdminController.php Ver fichero

@@ -0,0 +1,14 @@
<?php

namespace App\Controller\Section;

use App\Entity\Section\Opening;
use Lc\CaracoleBundle\Controller\Section\OpeningAdminController as CaracOpeningAdminController;

class OpeningAdminController extends CaracOpeningAdminController
{
public static function getEntityFqcn(): string
{
return Opening::class;
}
}

+ 3
- 39
src/Definition/SectionSettingDefinition.php Ver fichero

@@ -2,57 +2,21 @@

namespace App\Definition;

use App\Entity\Section\Section;
use Lc\CaracoleBundle\Definition\SectionSettingDefinitionInterface;
use Lc\SovBundle\Definition\AbstractSettingDefinition;
use Lc\CaracoleBundle\Definition\SectionSettingDefinition as CaracSectionSettingDefinition;

class SectionSettingDefinition extends AbstractSettingDefinition implements SectionSettingDefinitionInterface
class SectionSettingDefinition extends CaracSectionSettingDefinition
{
const CATEGORY_GENERAL = 'general';
const CATEGORY_CONFIGURATION = 'configuration';
const CATEGORY_SPECIFIC = 'specific';

const SETTING_EXAMPLE_TEXT = 'exampleText';
const SETTING_EXAMPLE_TEXT2 = 'exampleText2';
const SETTING_EXAMPLE_SPECIFIC_SECTION = 'exampleSpecificSection';

public function __construct()
{
// général
$this
->addSettingText(
[
'name' => self::SETTING_EXAMPLE_TEXT,
'category' => self::CATEGORY_GENERAL
]
);

// configuration
$this
->addSettingText(
[
'name' => self::SETTING_EXAMPLE_TEXT2,
'category' => self::CATEGORY_CONFIGURATION
]
);

// spécifique
$this
->addSettingText(
[
'name' => self::SETTING_EXAMPLE_SPECIFIC_SECTION,
'category' => self::CATEGORY_SPECIFIC,
'section' => Section::SECTION_LUNCH
]
);
parent::__construct() ;
}

public function getCategories()
{
return [
self::CATEGORY_GENERAL,
self::CATEGORY_CONFIGURATION,
self::CATEGORY_SPECIFIC,
];
}


+ 25
- 0
src/Entity/Section/Opening.php Ver fichero

@@ -0,0 +1,25 @@
<?php

namespace App\Entity\Section;

use Lc\CaracoleBundle\Repository\Section\OpeningRepository;
use Doctrine\ORM\Mapping as ORM;
use Lc\CaracoleBundle\Model\Section\OpeningModel;

/**
* @ORM\Entity(repositoryClass=OpeningRepository::class)
*/
class Opening extends OpeningModel
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;

public function getId(): ?int
{
return $this->id;
}
}

+ 3
- 0
src/Entity/Section/Section.php Ver fichero

@@ -2,6 +2,9 @@

namespace App\Entity\Section;

use App\Entity\Section\Opening;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Lc\CaracoleBundle\Repository\Section\SectionRepository;
use Doctrine\ORM\Mapping as ORM;
use Lc\CaracoleBundle\Model\Section\SectionInterface;

+ 4
- 0
src/Entity/User/GroupUser.php Ver fichero

@@ -2,6 +2,10 @@

namespace App\Entity\User;

use App\Entity\Opening;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Lc\CaracoleBundle\Model\Section\OpeningInterface;
use Lc\CaracoleBundle\Repository\User\GroupUserRepository;
use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Model\User\GroupUserInterface;

Cargando…
Cancelar
Guardar