Browse Source

[Technique] Refactoring Feature

feature/souke
Guillaume Bourgeois 1 year ago
parent
commit
9222c2f34a
24 changed files with 33 additions and 96 deletions
  1. +1
    -1
      backend/views/layouts/left.php
  2. +2
    -2
      backend/views/producer/update.php
  3. +0
    -1
      common/components/BusinessLogic.php
  4. +1
    -7
      common/components/BusinessLogicTrait.php
  5. +3
    -3
      common/logic/Distribution/Distribution/Export/DistributionShoppingCartLabelsPdfGenerator.php
  6. +2
    -3
      common/logic/Feature/Feature/Feature.php
  7. +1
    -3
      common/logic/Feature/Feature/FeatureBuilder.php
  8. +2
    -3
      common/logic/Feature/Feature/FeatureChecker.php
  9. +1
    -2
      common/logic/Feature/Feature/FeatureDefinition.php
  10. +1
    -1
      common/logic/Feature/Feature/FeatureImporter.php
  11. +2
    -3
      common/logic/Feature/Feature/FeatureManager.php
  12. +1
    -7
      common/logic/Feature/Feature/FeatureModule.php
  13. +1
    -2
      common/logic/Feature/Feature/FeatureRepository.php
  14. +1
    -2
      common/logic/Feature/Feature/FeatureRepositoryQuery.php
  15. +2
    -2
      common/logic/Feature/FeatureProducer/FeatureProducer.php
  16. +2
    -5
      common/logic/Feature/FeatureProducer/FeatureProducerBuilder.php
  17. +1
    -3
      common/logic/Feature/FeatureProducer/FeatureProducerDefinition.php
  18. +2
    -3
      common/logic/Feature/FeatureProducer/FeatureProducerRepository.php
  19. +2
    -3
      common/logic/Feature/FeatureProducer/FeatureProducerRepositoryQuery.php
  20. +0
    -35
      common/logic/Feature/FeatureProducer/Module/FeatureProducerModule.php
  21. +1
    -1
      console/commands/ImportFeaturesController.php
  22. +1
    -1
      producer/controllers/CreditController.php
  23. +1
    -1
      producer/controllers/SiteController.php
  24. +2
    -2
      producer/views/credit/history.php

+ 1
- 1
backend/views/layouts/left.php View File

*/ */


use common\helpers\GlobalParam; use common\helpers\GlobalParam;
use common\logic\Feature\Feature\Model\Feature;
use common\logic\Feature\Feature\Feature;
use common\logic\User\User\Module\UserModule; use common\logic\User\User\Module\UserModule;


$producerModule = $this->getProducerModule(); $producerModule = $this->getProducerModule();

+ 2
- 2
backend/views/producer/update.php View File

use common\helpers\GlobalParam; use common\helpers\GlobalParam;
use common\logic\Distribution\Distribution\Module\DistributionModule; use common\logic\Distribution\Distribution\Module\DistributionModule;
use common\logic\Distribution\Distribution\Service\ExportManager; use common\logic\Distribution\Distribution\Service\ExportManager;
use common\logic\Feature\Feature\Model\Feature;
use common\logic\Feature\Feature\Module\FeatureModule;
use common\logic\Feature\Feature\Feature;
use common\logic\Feature\Feature\FeatureModule;
use common\logic\User\User\Module\UserModule; use common\logic\User\User\Module\UserModule;
use common\logic\User\UserGroup\Module\UserGroupModule; use common\logic\User\UserGroup\Module\UserGroupModule;
use yii\helpers\Html; use yii\helpers\Html;

+ 0
- 1
common/components/BusinessLogic.php View File

{ {
return [ return [
$this->getFeatureModule(), $this->getFeatureModule(),
$this->getFeatureProducerModule(),
$this->getUnitModule(), $this->getUnitModule(),
$this->getTaxRateModule(), $this->getTaxRateModule(),
$this->getUserUserGroupModule(), $this->getUserUserGroupModule(),

+ 1
- 7
common/components/BusinessLogicTrait.php View File

use common\logic\Document\Document\Module\DocumentModule; use common\logic\Document\Document\Module\DocumentModule;
use common\logic\Document\Invoice\Module\InvoiceModule; use common\logic\Document\Invoice\Module\InvoiceModule;
use common\logic\Document\Quotation\Module\QuotationModule; use common\logic\Document\Quotation\Module\QuotationModule;
use common\logic\Feature\Feature\Module\FeatureModule;
use common\logic\Feature\FeatureProducer\Module\FeatureProducerModule;
use common\logic\Feature\Feature\FeatureModule;
use common\logic\Opinion\Module\OpinionModule; use common\logic\Opinion\Module\OpinionModule;
use common\logic\Order\Order\Module\OrderModule; use common\logic\Order\Order\Module\OrderModule;
use common\logic\Order\ProductOrder\Module\ProductOrderModule; use common\logic\Order\ProductOrder\Module\ProductOrderModule;
{ {
return FeatureModule::getInstance(); return FeatureModule::getInstance();
} }

public function getFeatureProducerModule(): FeatureProducerModule
{
return FeatureProducerModule::getInstance();
}
} }

+ 3
- 3
common/logic/Distribution/Distribution/Export/DistributionShoppingCartLabelsPdfGenerator.php View File



use common\logic\AbstractGenerator; use common\logic\AbstractGenerator;
use common\logic\Distribution\Distribution\Model\Distribution; use common\logic\Distribution\Distribution\Model\Distribution;
use common\logic\Feature\Feature\Model\Feature;
use common\logic\Feature\Feature\Service\FeatureChecker;
use common\logic\Feature\Feature\Service\FeatureManager;
use common\logic\Feature\Feature\Feature;
use common\logic\Feature\Feature\FeatureChecker;
use common\logic\Feature\Feature\FeatureManager;
use common\logic\Order\Order\Model\Order; use common\logic\Order\Order\Model\Order;
use common\logic\Order\Order\Repository\OrderRepository; use common\logic\Order\Order\Repository\OrderRepository;
use common\logic\Order\Order\Service\OrderSolver; use common\logic\Order\Order\Service\OrderSolver;

common/logic/Feature/Feature/Model/Feature.php → common/logic/Feature/Feature/Feature.php View File

* termes. * termes.
*/ */


namespace common\logic\Feature\Feature\Model;
namespace common\logic\Feature\Feature;


use common\components\ActiveRecordCommon; use common\components\ActiveRecordCommon;
use common\logic\Feature\FeatureProducer\Model\FeatureProducer;
use common\logic\Feature\FeatureProducer\FeatureProducer;
use yii\db\ActiveQuery; use yii\db\ActiveQuery;
use yii\db\Schema;


class Feature extends ActiveRecordCommon class Feature extends ActiveRecordCommon
{ {

common/logic/Feature/Feature/Service/FeatureBuilder.php → common/logic/Feature/Feature/FeatureBuilder.php View File

<?php <?php


namespace common\logic\Feature\Feature\Service;
namespace common\logic\Feature\Feature;


use common\logic\AbstractBuilder; use common\logic\AbstractBuilder;
use common\logic\Feature\Feature\Model\Feature;
use common\logic\Feature\Feature\Repository\FeatureRepository;


class FeatureBuilder extends AbstractBuilder class FeatureBuilder extends AbstractBuilder
{ {

common/logic/Feature/Feature/Service/FeatureChecker.php → common/logic/Feature/Feature/FeatureChecker.php View File

<?php <?php


namespace common\logic\Feature\Feature\Service;
namespace common\logic\Feature\Feature;


use common\logic\AbstractChecker; use common\logic\AbstractChecker;
use common\logic\Feature\Feature\Repository\FeatureRepository;
use common\logic\Feature\FeatureProducer\Repository\FeatureProducerRepository;
use common\logic\Feature\FeatureProducer\FeatureProducerRepository;
use yii\base\ErrorException; use yii\base\ErrorException;


class FeatureChecker extends AbstractChecker class FeatureChecker extends AbstractChecker

common/logic/Feature/Feature/Service/FeatureDefinition.php → common/logic/Feature/Feature/FeatureDefinition.php View File

<?php <?php


namespace common\logic\Feature\Feature\Service;
namespace common\logic\Feature\Feature;


use common\logic\AbstractDefinition; use common\logic\AbstractDefinition;
use common\logic\Feature\Feature\Model\Feature;


class FeatureDefinition extends AbstractDefinition class FeatureDefinition extends AbstractDefinition
{ {

common/logic/Feature/Feature/Service/FeatureImporter.php → common/logic/Feature/Feature/FeatureImporter.php View File

<?php <?php


namespace common\logic\Feature\Feature\Service;
namespace common\logic\Feature\Feature;


use common\logic\AbstractManager; use common\logic\AbstractManager;



common/logic/Feature/Feature/Service/FeatureManager.php → common/logic/Feature/Feature/FeatureManager.php View File

<?php <?php


namespace common\logic\Feature\Feature\Service;
namespace common\logic\Feature\Feature;


use common\logic\AbstractManager; use common\logic\AbstractManager;
use common\logic\Feature\Feature\Model\Feature;
use common\logic\Feature\FeatureProducer\Service\FeatureProducerBuilder;
use common\logic\Feature\FeatureProducer\FeatureProducerBuilder;


class FeatureManager extends AbstractManager class FeatureManager extends AbstractManager
{ {

common/logic/Feature/Feature/Module/FeatureModule.php → common/logic/Feature/Feature/FeatureModule.php View File

<?php <?php


namespace common\logic\Feature\Feature\Module;
namespace common\logic\Feature\Feature;


use common\logic\AbstractModule; use common\logic\AbstractModule;
use common\logic\Feature\Feature\Repository\FeatureRepository;
use common\logic\Feature\Feature\Service\FeatureBuilder;
use common\logic\Feature\Feature\Service\FeatureChecker;
use common\logic\Feature\Feature\Service\FeatureDefinition;
use common\logic\Feature\Feature\Service\FeatureImporter;
use common\logic\Feature\Feature\Service\FeatureManager;


class FeatureModule extends AbstractModule class FeatureModule extends AbstractModule
{ {

common/logic/Feature/Feature/Repository/FeatureRepository.php → common/logic/Feature/Feature/FeatureRepository.php View File

<?php <?php


namespace common\logic\Feature\Feature\Repository;
namespace common\logic\Feature\Feature;


use common\logic\AbstractRepository; use common\logic\AbstractRepository;
use common\logic\Feature\Feature\Model\Feature;


class FeatureRepository extends AbstractRepository class FeatureRepository extends AbstractRepository
{ {

common/logic/Feature/Feature/Repository/FeatureRepositoryQuery.php → common/logic/Feature/Feature/FeatureRepositoryQuery.php View File

<?php <?php


namespace common\logic\Feature\Feature\Repository;
namespace common\logic\Feature\Feature;


use common\logic\AbstractRepositoryQuery; use common\logic\AbstractRepositoryQuery;
use common\logic\Feature\Feature\Service\FeatureDefinition;


class FeatureRepositoryQuery extends AbstractRepositoryQuery class FeatureRepositoryQuery extends AbstractRepositoryQuery
{ {

common/logic/Feature/FeatureProducer/Model/FeatureProducer.php → common/logic/Feature/FeatureProducer/FeatureProducer.php View File

* termes. * termes.
*/ */


namespace common\logic\Feature\FeatureProducer\Model;
namespace common\logic\Feature\FeatureProducer;


use common\components\ActiveRecordCommon; use common\components\ActiveRecordCommon;
use common\logic\Feature\Feature\Model\Feature;
use common\logic\Feature\Feature\Feature;
use common\logic\Producer\Producer\Model\Producer; use common\logic\Producer\Producer\Model\Producer;
use yii\db\ActiveQuery; use yii\db\ActiveQuery;



common/logic/Feature/FeatureProducer/Service/FeatureProducerBuilder.php → common/logic/Feature/FeatureProducer/FeatureProducerBuilder.php View File

<?php <?php


namespace common\logic\Feature\FeatureProducer\Service;
namespace common\logic\Feature\FeatureProducer;


use common\logic\AbstractBuilder; use common\logic\AbstractBuilder;
use common\logic\Feature\Feature\Model\Feature;
use common\logic\Feature\FeatureProducer\Model\FeatureProducer;
use common\logic\Feature\FeatureProducer\Repository\FeatureProducerRepository;
use common\logic\Producer\Producer\Model\Producer;
use common\logic\Feature\Feature\Feature;


class FeatureProducerBuilder extends AbstractBuilder class FeatureProducerBuilder extends AbstractBuilder
{ {

common/logic/Feature/FeatureProducer/Service/FeatureProducerDefinition.php → common/logic/Feature/FeatureProducer/FeatureProducerDefinition.php View File

<?php <?php


namespace common\logic\Feature\FeatureProducer\Service;
namespace common\logic\Feature\FeatureProducer;


use common\logic\AbstractDefinition; use common\logic\AbstractDefinition;
use common\logic\Feature\FeatureProducer\Model\FeatureProducer;
use common\logic\Feature\FeatureProducer\Repository\FeatureProducerRepository;


class FeatureProducerDefinition extends AbstractDefinition class FeatureProducerDefinition extends AbstractDefinition
{ {

common/logic/Feature/FeatureProducer/Repository/FeatureProducerRepository.php → common/logic/Feature/FeatureProducer/FeatureProducerRepository.php View File

<?php <?php


namespace common\logic\Feature\FeatureProducer\Repository;
namespace common\logic\Feature\FeatureProducer;


use common\logic\AbstractRepository; use common\logic\AbstractRepository;
use common\logic\Feature\Feature\Model\Feature;
use common\logic\Producer\Producer\Model\Producer;
use common\logic\Feature\Feature\Feature;


class FeatureProducerRepository extends AbstractRepository class FeatureProducerRepository extends AbstractRepository
{ {

common/logic/Feature/FeatureProducer/Repository/FeatureProducerRepositoryQuery.php → common/logic/Feature/FeatureProducer/FeatureProducerRepositoryQuery.php View File

<?php <?php


namespace common\logic\Feature\FeatureProducer\Repository;
namespace common\logic\Feature\FeatureProducer;


use common\logic\AbstractRepositoryQuery; use common\logic\AbstractRepositoryQuery;
use common\logic\Feature\Feature\Model\Feature;
use common\logic\Feature\FeatureProducer\Service\FeatureProducerDefinition;
use common\logic\Feature\Feature\Feature;


class FeatureProducerRepositoryQuery extends AbstractRepositoryQuery class FeatureProducerRepositoryQuery extends AbstractRepositoryQuery
{ {

+ 0
- 35
common/logic/Feature/FeatureProducer/Module/FeatureProducerModule.php View File

<?php

namespace common\logic\Feature\FeatureProducer\Module;

use common\logic\AbstractModule;
use common\logic\Feature\FeatureProducer\Repository\FeatureProducerRepository;
use common\logic\Feature\FeatureProducer\Service\FeatureProducerBuilder;
use common\logic\Feature\FeatureProducer\Service\FeatureProducerDefinition;

class FeatureProducerModule extends AbstractModule
{
public function getServices(): array
{
return [
FeatureProducerDefinition::class,
FeatureProducerRepository::class,
FeatureProducerBuilder::class
];
}

public function getDefinition(): FeatureProducerDefinition
{
return FeatureProducerDefinition::getInstance();
}

public function getRepository(): FeatureProducerRepository
{
return FeatureProducerRepository::getInstance();
}

public function getBuilder(): FeatureProducerBuilder
{
return FeatureProducerBuilder::getInstance();
}
}

+ 1
- 1
console/commands/ImportFeaturesController.php View File



namespace console\commands; namespace console\commands;


use common\logic\Feature\Feature\Module\FeatureModule;
use common\logic\Feature\Feature\FeatureModule;
use yii\console\Controller; use yii\console\Controller;


class ImportFeaturesController extends Controller class ImportFeaturesController extends Controller

+ 1
- 1
producer/controllers/CreditController.php View File



use common\helpers\GlobalParam; use common\helpers\GlobalParam;
use common\helpers\MeanPayment; use common\helpers\MeanPayment;
use common\logic\Feature\Feature\Model\Feature;
use common\logic\Feature\Feature\Feature;
use common\logic\Payment\Model\Payment; use common\logic\Payment\Model\Payment;
use producer\models\CreditForm; use producer\models\CreditForm;
use yii\filters\VerbFilter; use yii\filters\VerbFilter;

+ 1
- 1
producer/controllers/SiteController.php View File



use common\forms\ContactForm; use common\forms\ContactForm;
use common\helpers\GlobalParam; use common\helpers\GlobalParam;
use common\logic\Feature\Feature\Model\Feature;
use common\logic\Feature\Feature\Feature;
use common\logic\Product\Product\Model\Product; use common\logic\Product\Product\Model\Product;
use yii\data\ActiveDataProvider; use yii\data\ActiveDataProvider;
use yii\helpers\Html; use yii\helpers\Html;

+ 2
- 2
producer/views/credit/history.php View File

* termes. * termes.
*/ */


use common\logic\Feature\Feature\Model\Feature;
use common\logic\Feature\Feature\Module\FeatureModule;
use common\logic\Feature\Feature\Feature;
use common\logic\Feature\Feature\FeatureModule;
use common\logic\Payment\Module\PaymentModule; use common\logic\Payment\Module\PaymentModule;
use yii\grid\GridView; use yii\grid\GridView;



Loading…
Cancel
Save