Browse Source

Refactoring services #885

refactoring
Guillaume 1 year ago
parent
commit
892cfaad7f
32 changed files with 42 additions and 39 deletions
  1. +1
    -1
      common/components/BusinessLogicTrait.php
  2. +1
    -1
      common/logic/Config/TaxRate/Model/TaxRate.php
  3. +1
    -1
      common/logic/Config/TaxRate/Repository/TaxRateRepository.php
  4. +1
    -1
      common/logic/Config/TaxRate/Repository/TaxRateRepositoryQuery.php
  5. +2
    -1
      common/logic/Config/TaxRate/Service/TaxRateBuilder.php
  6. +4
    -1
      common/logic/Config/TaxRate/Wrapper/TaxRateContainer.php
  7. +3
    -1
      common/logic/Config/TaxRate/Wrapper/TaxRateManager.php
  8. +4
    -0
      common/logic/Distribution/Distribution/Service/DistributionBuilder.php
  9. +2
    -2
      common/logic/Distribution/Distribution/Service/DistributionSolver.php
  10. +1
    -2
      common/logic/Distribution/Distribution/Wrapper/DistributionManager.php
  11. +1
    -1
      common/logic/Distribution/PointSaleDistribution/Model/PointSaleDistribution.php
  12. +1
    -1
      common/logic/Distribution/PointSaleDistribution/Repository/PointSaleDistributionRepository.php
  13. +1
    -0
      common/logic/Distribution/PointSaleDistribution/Service/PointSaleDistributionBuilder.php
  14. +1
    -1
      common/logic/Distribution/ProductDistribution/Model/ProductDistribution.php
  15. +1
    -1
      common/logic/Distribution/ProductDistribution/Repository/ProductDistributionRepository.php
  16. +1
    -1
      common/logic/Document/DeliveryNote/Model/DeliveryNote.php
  17. +1
    -1
      common/logic/Document/DeliveryNote/Service/DeliveryNoteBuilder.php
  18. +2
    -2
      common/logic/Document/DeliveryNote/Service/DeliveryNoteSolver.php
  19. +1
    -1
      common/logic/Document/DeliveryNote/Wrapper/DeliveryNoteManager.php
  20. +2
    -2
      common/logic/Document/Document/Service/DocumentSolver.php
  21. +3
    -0
      common/logic/Document/Document/Wrapper/DocumentManager.php
  22. +0
    -1
      common/logic/Document/Quotation/Model/Quotation.php
  23. +1
    -1
      common/logic/Order/Order/Service/OrderBuilder.php
  24. +0
    -1
      common/logic/Order/Order/Service/OrderSolver.php
  25. +2
    -2
      common/logic/Order/ProductOrder/Model/ProductOrder.php
  26. +1
    -1
      common/logic/PointSale/PointSale/Repository/PointSaleRepository.php
  27. +1
    -1
      common/logic/Producer/Producer/Model/Producer.php
  28. +2
    -2
      common/logic/Product/Product/Model/Product.php
  29. +0
    -1
      common/logic/Product/ProductCategory/Model/ProductCategory.php
  30. +0
    -1
      common/logic/Product/ProductCategory/Model/ProductCategorySearch.php
  31. +0
    -2
      common/logic/Subscription/ProductSubscription/Model/ProductSubscription.php
  32. +0
    -4
      common/logic/Subscription/Subscription/Event/SubscriptionEventSubscriber.php

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



use common\logic\Config\TaxRate\TaxRateContainer; use common\logic\Config\TaxRate\TaxRateContainer;
use common\logic\Config\TaxRate\TaxRateManager; use common\logic\Config\TaxRate\TaxRateManager;
use common\logic\Distribution\Distribution\DistributionManager;
use common\logic\Distribution\Distribution\Wrapper\DistributionManager;
use common\logic\Distribution\Distribution\Wrapper\DistributionContainer; use common\logic\Distribution\Distribution\Wrapper\DistributionContainer;
use common\logic\Distribution\PointSaleDistribution\Wrapper\PointSaleDistributionContainer; use common\logic\Distribution\PointSaleDistribution\Wrapper\PointSaleDistributionContainer;
use common\logic\Distribution\PointSaleDistribution\Wrapper\PointSaleDistributionManager; use common\logic\Distribution\PointSaleDistribution\Wrapper\PointSaleDistributionManager;

common/logic/Config/TaxRate/TaxRate.php → common/logic/Config/TaxRate/Model/TaxRate.php View File

<?php <?php


namespace common\logic\Config\TaxRate;
namespace common\logic\Config\TaxRate\Model;


use common\components\ActiveRecordCommon; use common\components\ActiveRecordCommon;



common/logic/Config/TaxRate/TaxRateRepository.php → common/logic/Config/TaxRate/Repository/TaxRateRepository.php View File

<?php <?php


namespace common\logic\Config\TaxRate;
namespace common\logic\Config\TaxRate\Repository;


use common\logic\AbstractRepository; use common\logic\AbstractRepository;



common/logic/Config/TaxRate/TaxRateRepositoryQuery.php → common/logic/Config/TaxRate/Repository/TaxRateRepositoryQuery.php View File

<?php <?php


namespace common\logic\Config\TaxRate;
namespace common\logic\Config\TaxRate\Repository;


use common\logic\AbstractRepositoryQuery; use common\logic\AbstractRepositoryQuery;



common/logic/Config/TaxRate/TaxRateBuilder.php → common/logic/Config/TaxRate/Service/TaxRateBuilder.php View File

<?php <?php


namespace common\logic\Config\TaxRate;
namespace common\logic\Config\TaxRate\Service;


use common\logic\AbstractBuilder; use common\logic\AbstractBuilder;
use common\logic\Config\TaxRate\Model\TaxRate;


class TaxRateBuilder extends AbstractBuilder class TaxRateBuilder extends AbstractBuilder
{ {

common/logic/Config/TaxRate/TaxRateContainer.php → common/logic/Config/TaxRate/Wrapper/TaxRateContainer.php View File

<?php <?php


namespace common\logic\Config\TaxRate;
namespace common\logic\Config\TaxRate\Wrapper;


use common\logic\AbstractContainer; use common\logic\AbstractContainer;
use common\logic\Config\TaxRate\Model\TaxRate;
use common\logic\Config\TaxRate\Repository\TaxRateRepository;
use common\logic\Config\TaxRate\Service\TaxRateBuilder;


class TaxRateContainer extends AbstractContainer class TaxRateContainer extends AbstractContainer
{ {

common/logic/Config/TaxRate/TaxRateManager.php → common/logic/Config/TaxRate/Wrapper/TaxRateManager.php View File

<?php <?php


namespace common\logic\Config\TaxRate;
namespace common\logic\Config\TaxRate\Wrapper;


use common\logic\AbstractManager; use common\logic\AbstractManager;
use common\logic\Config\TaxRate\Repository\TaxRateRepository;
use common\logic\Config\TaxRate\Service\TaxRateBuilder;


/** /**
* @mixin TaxRateRepository * @mixin TaxRateRepository

+ 4
- 0
common/logic/Distribution/Distribution/Service/DistributionBuilder.php View File

use common\logic\Distribution\Distribution\Event\DistributionActiveEvent; use common\logic\Distribution\Distribution\Event\DistributionActiveEvent;
use common\logic\Distribution\Distribution\Model\Distribution; use common\logic\Distribution\Distribution\Model\Distribution;
use common\logic\Distribution\Distribution\Repository\DistributionRepository; use common\logic\Distribution\Distribution\Repository\DistributionRepository;
use common\logic\Distribution\PointSaleDistribution\Model\PointSaleDistribution;
use common\logic\Distribution\PointSaleDistribution\Repository\PointSaleDistributionRepository; use common\logic\Distribution\PointSaleDistribution\Repository\PointSaleDistributionRepository;
use common\logic\Distribution\PointSaleDistribution\Service\PointSaleDistributionBuilder; use common\logic\Distribution\PointSaleDistribution\Service\PointSaleDistributionBuilder;
use common\logic\Distribution\ProductDistribution\Model\ProductDistribution;
use common\logic\Distribution\ProductDistribution\Repository\ProductDistributionRepository; use common\logic\Distribution\ProductDistribution\Repository\ProductDistributionRepository;
use common\logic\Distribution\ProductDistribution\Service\ProductDistributionBuilder; use common\logic\Distribution\ProductDistribution\Service\ProductDistributionBuilder;
use common\logic\Order\Order\Repository\OrderRepository; use common\logic\Order\Order\Repository\OrderRepository;
use common\logic\Order\ProductOrder\Service\ProductOrderBuilder; use common\logic\Order\ProductOrder\Service\ProductOrderBuilder;
use common\logic\PointSale\PointSale\Model\PointSale;
use common\logic\Product\Product\Model\Product;
use common\logic\Product\Product\Repository\ProductRepository; use common\logic\Product\Product\Repository\ProductRepository;
use common\logic\User\UserProducer\Repository\UserProducerRepository; use common\logic\User\UserProducer\Repository\UserProducerRepository;



+ 2
- 2
common/logic/Distribution/Distribution/Service/DistributionSolver.php View File

use common\helpers\GlobalParam; use common\helpers\GlobalParam;
use common\logic\AbstractService; use common\logic\AbstractService;
use common\logic\Distribution\Distribution\Model\Distribution; use common\logic\Distribution\Distribution\Model\Distribution;
use common\logic\PointSale\PointSale\PointSale;
use common\logic\Product\Product\Product;
use common\logic\PointSale\PointSale\Model\PointSale;
use common\logic\Product\Product\Model\Product;
use common\logic\SolverInterface; use common\logic\SolverInterface;


class DistributionSolver extends AbstractService implements SolverInterface class DistributionSolver extends AbstractService implements SolverInterface

+ 1
- 2
common/logic/Distribution/Distribution/Wrapper/DistributionManager.php View File

<?php <?php


namespace common\logic\Distribution\Distribution;
namespace common\logic\Distribution\Distribution\Wrapper;


use common\logic\AbstractManager; use common\logic\AbstractManager;
use common\logic\Distribution\Distribution\Repository\DistributionRepository; use common\logic\Distribution\Distribution\Repository\DistributionRepository;
use common\logic\Distribution\Distribution\Service\DistributionBuilder; use common\logic\Distribution\Distribution\Service\DistributionBuilder;
use common\logic\Distribution\Distribution\Service\DistributionSolver; use common\logic\Distribution\Distribution\Service\DistributionSolver;
use common\logic\Distribution\Distribution\Wrapper\DistributionContainer;


/** /**
* @mixin DistributionSolver * @mixin DistributionSolver

+ 1
- 1
common/logic/Distribution/PointSaleDistribution/Model/PointSaleDistribution.php View File



use common\components\ActiveRecordCommon ; use common\components\ActiveRecordCommon ;
use common\logic\Distribution\Distribution\Model\Distribution; use common\logic\Distribution\Distribution\Model\Distribution;
use common\logic\PointSale\PointSale\PointSale;
use common\logic\PointSale\PointSale\Model\PointSale;


class PointSaleDistribution extends ActiveRecordCommon class PointSaleDistribution extends ActiveRecordCommon
{ {

+ 1
- 1
common/logic/Distribution/PointSaleDistribution/Repository/PointSaleDistributionRepository.php View File

use common\logic\AbstractRepository; use common\logic\AbstractRepository;
use common\logic\Distribution\Distribution\Model\Distribution; use common\logic\Distribution\Distribution\Model\Distribution;
use common\logic\Distribution\PointSaleDistribution\Model\PointSaleDistribution; use common\logic\Distribution\PointSaleDistribution\Model\PointSaleDistribution;
use common\logic\PointSale\PointSale\PointSale;
use common\logic\PointSale\PointSale\Model\PointSale;


class PointSaleDistributionRepository extends AbstractRepository class PointSaleDistributionRepository extends AbstractRepository
{ {

+ 1
- 0
common/logic/Distribution/PointSaleDistribution/Service/PointSaleDistributionBuilder.php View File

use common\logic\Distribution\Distribution\Repository\DistributionRepository; use common\logic\Distribution\Distribution\Repository\DistributionRepository;
use common\logic\Distribution\PointSaleDistribution\Model\PointSaleDistribution; use common\logic\Distribution\PointSaleDistribution\Model\PointSaleDistribution;
use common\logic\Distribution\PointSaleDistribution\Repository\PointSaleDistributionRepository; use common\logic\Distribution\PointSaleDistribution\Repository\PointSaleDistributionRepository;
use common\logic\PointSale\PointSale\Model\PointSale;
use common\logic\PointSale\PointSale\Repository\PointSaleRepository; use common\logic\PointSale\PointSale\Repository\PointSaleRepository;


class PointSaleDistributionBuilder extends AbstractBuilder class PointSaleDistributionBuilder extends AbstractBuilder

+ 1
- 1
common/logic/Distribution/ProductDistribution/Model/ProductDistribution.php View File



use common\components\ActiveRecordCommon ; use common\components\ActiveRecordCommon ;
use common\logic\Distribution\Distribution\Model\Distribution; use common\logic\Distribution\Distribution\Model\Distribution;
use common\logic\Product\Product\Product;
use common\logic\Product\Product\Model\Product;


class ProductDistribution extends ActiveRecordCommon class ProductDistribution extends ActiveRecordCommon
{ {

+ 1
- 1
common/logic/Distribution/ProductDistribution/Repository/ProductDistributionRepository.php View File

use common\logic\AbstractRepository; use common\logic\AbstractRepository;
use common\logic\Distribution\Distribution\Model\Distribution; use common\logic\Distribution\Distribution\Model\Distribution;
use common\logic\Distribution\ProductDistribution\Model\ProductDistribution; use common\logic\Distribution\ProductDistribution\Model\ProductDistribution;
use common\logic\Product\Product\Product;
use common\logic\Product\Product\Model\Product;


class ProductDistributionRepository extends AbstractRepository class ProductDistributionRepository extends AbstractRepository
{ {

+ 1
- 1
common/logic/Document/DeliveryNote/Model/DeliveryNote.php View File



namespace common\logic\Document\DeliveryNote\Model; namespace common\logic\Document\DeliveryNote\Model;


use common\logic\Document\Document\Document;
use common\logic\Document\Document\Model\Document;


class DeliveryNote extends Document class DeliveryNote extends Document
{ {

+ 1
- 1
common/logic/Document/DeliveryNote/Service/DeliveryNoteBuilder.php View File

namespace common\logic\Document\DeliveryNote\Service; namespace common\logic\Document\DeliveryNote\Service;


use common\logic\Document\DeliveryNote\Model\DeliveryNote; use common\logic\Document\DeliveryNote\Model\DeliveryNote;
use common\logic\Document\Document\DocumentBuilder;
use common\logic\Document\Document\Service\DocumentBuilder;


class DeliveryNoteBuilder extends DocumentBuilder class DeliveryNoteBuilder extends DocumentBuilder
{ {

+ 2
- 2
common/logic/Document/DeliveryNote/Service/DeliveryNoteSolver.php View File

namespace common\logic\Document\DeliveryNote\Service; namespace common\logic\Document\DeliveryNote\Service;


use common\logic\Document\DeliveryNote\Model\DeliveryNote; use common\logic\Document\DeliveryNote\Model\DeliveryNote;
use common\logic\Document\Document\DocumentSolver;
use common\logic\Document\Invoice\Invoice;
use common\logic\Document\Document\Service\DocumentSolver;
use common\logic\Document\Invoice\Model\Invoice;
use common\logic\SolverInterface; use common\logic\SolverInterface;


class DeliveryNoteSolver extends DocumentSolver implements SolverInterface class DeliveryNoteSolver extends DocumentSolver implements SolverInterface

+ 1
- 1
common/logic/Document/DeliveryNote/Wrapper/DeliveryNoteManager.php View File

use common\logic\Document\DeliveryNote\Repository\DeliveryNoteRepository; use common\logic\Document\DeliveryNote\Repository\DeliveryNoteRepository;
use common\logic\Document\DeliveryNote\Service\DeliveryNoteBuilder; use common\logic\Document\DeliveryNote\Service\DeliveryNoteBuilder;
use common\logic\Document\DeliveryNote\Service\DeliveryNoteSolver; use common\logic\Document\DeliveryNote\Service\DeliveryNoteSolver;
use common\logic\Document\Document\DocumentManager;
use common\logic\Document\Document\Wrapper\DocumentManager;


/** /**
* @mixin DeliveryNoteSolver * @mixin DeliveryNoteSolver

+ 2
- 2
common/logic/Document/Document/Service/DocumentSolver.php View File

use common\logic\AbstractService; use common\logic\AbstractService;
use common\logic\Document\Document\Model\Document; use common\logic\Document\Document\Model\Document;
use common\logic\Document\Document\Model\DocumentInterface; use common\logic\Document\Document\Model\DocumentInterface;
use common\logic\Order\Order\Order;
use common\logic\PointSale\PointSale\PointSale;
use common\logic\Order\Order\Model\Order;
use common\logic\PointSale\PointSale\Model\PointSale;
use common\logic\SolverInterface; use common\logic\SolverInterface;


class DocumentSolver extends AbstractService implements SolverInterface class DocumentSolver extends AbstractService implements SolverInterface

+ 3
- 0
common/logic/Document/Document/Wrapper/DocumentManager.php View File

namespace common\logic\Document\Document\Wrapper; namespace common\logic\Document\Document\Wrapper;


use common\logic\AbstractManager; use common\logic\AbstractManager;
use common\logic\Document\Document\Service\DocumentBuilder;
use common\logic\Document\Document\Service\DocumentSolver;
use common\logic\Document\Document\Service\DocumentUtils;


/** /**
* @mixin DocumentSolver * @mixin DocumentSolver

+ 0
- 1
common/logic/Document/Quotation/Model/Quotation.php View File

*/ */
class Quotation extends Document class Quotation extends Document
{ {

/** /**
* @inheritdoc * @inheritdoc
*/ */

+ 1
- 1
common/logic/Order/Order/Service/OrderBuilder.php View File

use common\helpers\MeanPayment; use common\helpers\MeanPayment;
use common\helpers\Price; use common\helpers\Price;
use common\logic\AbstractBuilder; use common\logic\AbstractBuilder;
use common\logic\Config\TaxRate\TaxRate;
use common\logic\Config\TaxRate\Model\TaxRate;
use common\logic\Distribution\Distribution\Repository\DistributionRepository; use common\logic\Distribution\Distribution\Repository\DistributionRepository;
use common\logic\Document\Document\Model\Document; use common\logic\Document\Document\Model\Document;
use common\logic\Order\Order\Model\Order; use common\logic\Order\Order\Model\Order;

+ 0
- 1
common/logic/Order/Order/Service/OrderSolver.php View File

use common\logic\User\User\Service\UserSolver; use common\logic\User\User\Service\UserSolver;
use yii\helpers\Html; use yii\helpers\Html;



class OrderSolver extends AbstractService implements SolverInterface class OrderSolver extends AbstractService implements SolverInterface
{ {
protected UserSolver $userSolver; protected UserSolver $userSolver;

+ 2
- 2
common/logic/Order/ProductOrder/Model/ProductOrder.php View File



use common\helpers\GlobalParam; use common\helpers\GlobalParam;
use common\components\ActiveRecordCommon; use common\components\ActiveRecordCommon;
use common\logic\Config\TaxRate\TaxRate;
use common\logic\Config\TaxRate\Model\TaxRate;
use common\logic\Order\Order\Model\Order; use common\logic\Order\Order\Model\Order;
use common\logic\Product\Product\Product;
use common\logic\Product\Product\Model\Product;


/** /**
* This is the model class for table "product_order". * This is the model class for table "product_order".

+ 1
- 1
common/logic/PointSale/PointSale/Repository/PointSaleRepository.php View File

use common\logic\AbstractRepository; use common\logic\AbstractRepository;
use common\logic\Distribution\Distribution\Model\Distribution; use common\logic\Distribution\Distribution\Model\Distribution;
use common\logic\PointSale\PointSale\Model\PointSale; use common\logic\PointSale\PointSale\Model\PointSale;
use common\logic\Producer\Producer\Producer;
use common\logic\Producer\Producer\Model\Producer;


class PointSaleRepository extends AbstractRepository class PointSaleRepository extends AbstractRepository
{ {

+ 1
- 1
common/logic/Producer/Producer/Model/Producer.php View File



namespace common\logic\Producer\Producer\Model; namespace common\logic\Producer\Producer\Model;


use common\logic\Config\TaxRate\Model\TaxRate;
use common\logic\User\User\Model\User; use common\logic\User\User\Model\User;
use common\logic\Config\TaxRate\TaxRate;
use common\logic\User\UserProducer\Model\UserProducer; use common\logic\User\UserProducer\Model\UserProducer;
use common\components\ActiveRecordCommon; use common\components\ActiveRecordCommon;



+ 2
- 2
common/logic/Product/Product/Model/Product.php View File

namespace common\logic\Product\Product\Model; namespace common\logic\Product\Product\Model;


use common\helpers\GlobalParam; use common\helpers\GlobalParam;
use common\logic\Config\TaxRate\TaxRate;
use common\logic\Config\TaxRate\Model\TaxRate;
use common\logic\Distribution\ProductDistribution\Model\ProductDistribution; use common\logic\Distribution\ProductDistribution\Model\ProductDistribution;
use common\logic\Producer\Producer\Model\Producer; use common\logic\Producer\Producer\Model\Producer;
use common\logic\Product\Product\Service\ProductSolver; use common\logic\Product\Product\Service\ProductSolver;
use common\logic\Product\ProductCategory\Model\ProductCategory; use common\logic\Product\ProductCategory\Model\ProductCategory;
use common\logic\Product\ProductPointSale\Model\ProductPointSale; use common\logic\Product\ProductPointSale\Model\ProductPointSale;
use common\logic\Product\ProductPrice\Model\ProductPrice; use common\logic\Product\ProductPrice\Model\ProductPrice;
use common\logic\Subscription\ProductSubscription\ProductSubscription;
use common\components\ActiveRecordCommon; use common\components\ActiveRecordCommon;
use common\logic\Subscription\ProductSubscription\Model\ProductSubscription;


/** /**
* This is the model class for table "product". * This is the model class for table "product".

+ 0
- 1
common/logic/Product/ProductCategory/Model/ProductCategory.php View File



/** /**
* This is the model class for table "product_category". * This is the model class for table "product_category".
*
*/ */
class ProductCategory extends ActiveRecordCommon class ProductCategory extends ActiveRecordCommon
{ {

+ 0
- 1
common/logic/Product/ProductCategory/Model/ProductCategorySearch.php View File



class ProductCategorySearch extends ProductCategory class ProductCategorySearch extends ProductCategory
{ {
public function rules() public function rules()
{ {
return [ return [

+ 0
- 2
common/logic/Subscription/ProductSubscription/Model/ProductSubscription.php View File



/** /**
* This is the model class for table "commande_auto_produit". * This is the model class for table "commande_auto_produit".
*
*/ */
class ProductSubscription extends ActiveRecordCommon class ProductSubscription extends ActiveRecordCommon
{ {

/** /**
* @inheritdoc * @inheritdoc
*/ */

+ 0
- 4
common/logic/Subscription/Subscription/Event/SubscriptionEventSubscriber.php View File



class SubscriptionEventSubscriber class SubscriptionEventSubscriber
{ {
/**
* @param Distribution $distribution
* @return void
*/
public static function onActiveDistribution(Distribution $distribution): void public static function onActiveDistribution(Distribution $distribution): void
{ {
$orderManager = OrderManager::getInstance(); $orderManager = OrderManager::getInstance();

Loading…
Cancel
Save