Browse Source

Merge branch 'feature/deleteUser' into develop

packProduct
Fabien Normand 2 years ago
parent
commit
ed9870e20f
88 changed files with 621 additions and 168 deletions
  1. +6
    -0
      Container/Address/AddressContainer.php
  2. +7
    -0
      Container/Config/TaxRateContainer.php
  3. +6
    -0
      Container/Config/UnitContainer.php
  4. +6
    -0
      Container/Credit/CreditHistoryContainer.php
  5. +6
    -0
      Container/Distribution/DistributionContainer.php
  6. +6
    -0
      Container/File/DocumentContainer.php
  7. +7
    -0
      Container/Merchant/MerchantContainer.php
  8. +6
    -0
      Container/Order/OrderPaymentContainer.php
  9. +7
    -1
      Container/Order/OrderProductContainer.php
  10. +8
    -1
      Container/Order/OrderProductReductionCatalogContainer.php
  11. +7
    -1
      Container/Order/OrderProductRefundContainer.php
  12. +9
    -1
      Container/Order/OrderReductionCartContainer.php
  13. +8
    -1
      Container/Order/OrderReductionCreditContainer.php
  14. +7
    -1
      Container/Order/OrderRefundContainer.php
  15. +7
    -1
      Container/Order/OrderShopContainer.php
  16. +7
    -1
      Container/Order/OrderStatusContainer.php
  17. +7
    -1
      Container/Order/OrderStatusHistoryContainer.php
  18. +6
    -1
      Container/PointSale/PointSaleContainer.php
  19. +7
    -1
      Container/PointSale/PointSaleSectionContainer.php
  20. +7
    -1
      Container/Product/ProductCategoryContainer.php
  21. +8
    -1
      Container/Product/ProductContainer.php
  22. +6
    -0
      Container/Product/ProductFamilyContainer.php
  23. +6
    -0
      Container/Product/ProductFamilySectionPropertyContainer.php
  24. +8
    -1
      Container/Product/QualityLabelContainer.php
  25. +8
    -1
      Container/Reduction/ReductionCartContainer.php
  26. +8
    -1
      Container/Reduction/ReductionCatalogContainer.php
  27. +8
    -1
      Container/Reduction/ReductionCreditContainer.php
  28. +8
    -1
      Container/Section/OpeningContainer.php
  29. +8
    -1
      Container/Section/SectionContainer.php
  30. +8
    -1
      Container/Setting/MerchantSettingContainer.php
  31. +8
    -1
      Container/Setting/SectionSettingContainer.php
  32. +6
    -0
      Container/User/UserMerchantContainer.php
  33. +7
    -1
      Container/User/UserPointSaleContainer.php
  34. +8
    -1
      Container/User/VisitorContainer.php
  35. +0
    -1
      Controller/AbstractAdminController.php
  36. +3
    -37
      Controller/ControllerTrait.php
  37. +66
    -4
      Controller/User/UserAdminController.php
  38. +84
    -0
      Definition/ApplicationDefinition.php
  39. +3
    -3
      Factory/Address/AddressFactory.php
  40. +3
    -2
      Factory/Config/TaxRateFactory.php
  41. +3
    -2
      Factory/Config/UnitFactory.php
  42. +4
    -3
      Factory/Credit/CreditHistoryFactory.php
  43. +5
    -4
      Factory/Distribution/DistributionFactory.php
  44. +3
    -6
      Factory/File/DocumentFactory.php
  45. +3
    -2
      Factory/Merchant/MerchantFactory.php
  46. +0
    -1
      Factory/Newsletter/NewsletterFactory.php
  47. +3
    -2
      Factory/Order/OrderPaymentFactory.php
  48. +4
    -2
      Factory/Order/OrderProductFactory.php
  49. +3
    -2
      Factory/Order/OrderProductReductionCatalogFactory.php
  50. +3
    -1
      Factory/Order/OrderProductRefundFactory.php
  51. +3
    -2
      Factory/Order/OrderReductionCartFactory.php
  52. +3
    -2
      Factory/Order/OrderReductionCreditFactory.php
  53. +3
    -2
      Factory/Order/OrderRefundFactory.php
  54. +3
    -7
      Factory/Order/OrderShopFactory.php
  55. +4
    -2
      Factory/Order/OrderStatusFactory.php
  56. +3
    -2
      Factory/Order/OrderStatusHistoryFactory.php
  57. +4
    -3
      Factory/PointSale/PointSaleFactory.php
  58. +3
    -2
      Factory/PointSale/PointSaleSectionFactory.php
  59. +3
    -5
      Factory/Product/ProductCategoryFactory.php
  60. +4
    -2
      Factory/Product/ProductFactory.php
  61. +3
    -4
      Factory/Product/ProductFamilyFactory.php
  62. +4
    -6
      Factory/Product/ProductFamilySectionPropertyFactory.php
  63. +3
    -1
      Factory/Product/QualityLabelFactory.php
  64. +3
    -1
      Factory/Reduction/ReductionCartFactory.php
  65. +3
    -1
      Factory/Reduction/ReductionCatalogFactory.php
  66. +3
    -1
      Factory/Reduction/ReductionCreditFactory.php
  67. +4
    -1
      Factory/Section/OpeningFactory.php
  68. +3
    -3
      Factory/Section/SectionFactory.php
  69. +3
    -1
      Factory/Setting/MerchantSettingFactory.php
  70. +3
    -3
      Factory/Setting/SectionSettingFactory.php
  71. +3
    -3
      Factory/User/UserMerchantFactory.php
  72. +3
    -1
      Factory/User/UserPointSaleFactory.php
  73. +3
    -1
      Factory/User/VisitorFactory.php
  74. +3
    -3
      Model/Address/AddressModel.php
  75. +21
    -3
      Model/Credit/CreditHistoryModel.php
  76. +2
    -2
      Model/File/DocumentModel.php
  77. +3
    -0
      Model/Order/OrderShopModel.php
  78. +1
    -0
      Model/Reduction/ReductionCreditModel.php
  79. +1
    -1
      Model/Section/SectionModel.php
  80. +1
    -1
      Model/User/UserMerchantModel.php
  81. +1
    -1
      Model/User/UserModel.php
  82. +8
    -0
      Repository/Reduction/ReductionCartRepositoryQuery.php
  83. +15
    -4
      Repository/Reduction/ReductionCartStore.php
  84. +8
    -0
      Repository/Reduction/ReductionCatalogRepositoryQuery.php
  85. +11
    -0
      Repository/Reduction/ReductionCatalogStore.php
  86. +21
    -0
      Repository/Reduction/ReductionCreditStore.php
  87. +8
    -1
      Repository/User/UserMerchantStore.php
  88. +11
    -1
      Resources/translations/admin.fr.yaml

+ 6
- 0
Container/Address/AddressContainer.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Container\Address;

use App\Entity\Address\Address;
use Lc\CaracoleBundle\Builder\Address\AddressBuilder;
use Lc\CaracoleBundle\Factory\Address\AddressFactory;
use Lc\CaracoleBundle\Repository\Address\AddressRepositoryQuery;
@@ -30,6 +31,11 @@ class AddressContainer
$this->builder = $builder;
}

public static function getEntityFqcn()
{
return Address::class;
}

public function getFactory(): AddressFactory
{
return $this->factory;

+ 7
- 0
Container/Config/TaxRateContainer.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Container\Config;

use App\Entity\Config\TaxRate;
use Lc\CaracoleBundle\Factory\Config\TaxRateFactory;
use Lc\CaracoleBundle\Repository\Config\TaxRateRepositoryQuery;
use Lc\CaracoleBundle\Repository\Config\TaxRateStore;
@@ -22,6 +23,12 @@ class TaxRateContainer
$this->store = $store;
}


public static function getEntityFqcn()
{
return TaxRate::class;
}

public function getFactory(): TaxRateFactory
{
return $this->factory;

+ 6
- 0
Container/Config/UnitContainer.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Container\Config;

use App\Entity\Config\Unit;
use Lc\CaracoleBundle\Factory\Config\UnitFactory;
use Lc\CaracoleBundle\Repository\Config\UnitRepositoryQuery;
use Lc\CaracoleBundle\Repository\Config\UnitStore;
@@ -22,6 +23,11 @@ class UnitContainer
$this->store = $store;
}


public static function getEntityFqcn()
{
return Unit::class;
}
public function getFactory(): UnitFactory
{
return $this->factory;

+ 6
- 0
Container/Credit/CreditHistoryContainer.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Container\Credit;

use App\Entity\Credit\CreditHistory;
use Lc\CaracoleBundle\Builder\Credit\CreditHistoryBuilder;
use Lc\CaracoleBundle\Definition\Field\Credit\CreditHistoryFieldDefinition;
use Lc\CaracoleBundle\Factory\Credit\CreditHistoryFactory;
@@ -34,6 +35,11 @@ class CreditHistoryContainer
$this->fieldDefinition = $fieldDefinition;
}

public static function getEntityFqcn()
{
return CreditHistory::class;
}

public function getFactory(): CreditHistoryFactory
{
return $this->factory;

+ 6
- 0
Container/Distribution/DistributionContainer.php View File

@@ -3,6 +3,7 @@
namespace Lc\CaracoleBundle\Container\Distribution;


use App\Entity\Distribution\Distribution;
use Lc\CaracoleBundle\Builder\Distribution\DistributionBuilder;
use Lc\CaracoleBundle\Factory\Distribution\DistributionFactory;
use Lc\CaracoleBundle\Repository\Distribution\DistributionRepositoryQuery;
@@ -31,6 +32,11 @@ class DistributionContainer
$this->builder = $builder;
}


public static function getEntityFqcn()
{
return Distribution::class;
}
public function getFactory(): DistributionFactory
{
return $this->factory;

+ 6
- 0
Container/File/DocumentContainer.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Container\File;

use App\Entity\File\Document;
use Lc\CaracoleBundle\Factory\File\DocumentFactory;
use Lc\CaracoleBundle\Generator\DocumentReferenceGenerator;
use Lc\CaracoleBundle\Repository\File\DocumentRepositoryQuery;
@@ -26,6 +27,11 @@ class DocumentContainer
$this->referenceGenerator = $referenceGenerator;
}

public static function getEntityFqcn()
{
return Document::class;
}

public function getFactory(): DocumentFactory
{
return $this->factory;

+ 7
- 0
Container/Merchant/MerchantContainer.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Container\Merchant;

use App\Entity\Merchant\Merchant;
use Lc\CaracoleBundle\Builder\Merchant\MerchantBuilder;
use Lc\CaracoleBundle\Factory\Merchant\MerchantFactory;
use Lc\CaracoleBundle\Repository\Merchant\MerchantRepositoryQuery;
@@ -35,6 +36,12 @@ class MerchantContainer
$this->store = $store;
}


public static function getEntityFqcn()
{
return Merchant::class;
}

public function getFactory(): MerchantFactory
{
return $this->factory;

+ 6
- 0
Container/Order/OrderPaymentContainer.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Container\Order;

use App\Entity\Order\OrderPayment;
use Lc\CaracoleBundle\Factory\Order\OrderPaymentFactory;
use Lc\CaracoleBundle\Repository\Order\OrderPaymentRepositoryQuery;
use Lc\CaracoleBundle\Repository\Order\OrderPaymentStore;
@@ -22,6 +23,11 @@ class OrderPaymentContainer
$this->store = $store;
}

public static function getEntityFqcn()
{
return OrderPayment::class;
}

public function getFactory(): OrderPaymentFactory
{
return $this->factory;

+ 7
- 1
Container/Order/OrderProductContainer.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Container\Order;

use App\Entity\Order\OrderProduct;
use Lc\CaracoleBundle\Builder\Order\OrderProductBuilder;
use Lc\CaracoleBundle\Factory\Order\OrderProductFactory;
use Lc\CaracoleBundle\Repository\Order\OrderProductRepositoryQuery;
@@ -30,6 +31,11 @@ class OrderProductContainer
$this->store = $store;
}


public static function getEntityFqcn()
{
return OrderProduct::class;
}
public function getFactory(): OrderProductFactory
{
return $this->factory;
@@ -54,4 +60,4 @@ class OrderProductContainer
{
return $this->store;
}
}
}

+ 8
- 1
Container/Order/OrderProductReductionCatalogContainer.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Container\Order;

use App\Entity\Order\OrderProductReductionCatalog;
use Lc\CaracoleBundle\Factory\Order\OrderProductReductionCatalogFactory;
use Lc\CaracoleBundle\Repository\Order\OrderProductReductionCatalogRepositoryQuery;
use Lc\CaracoleBundle\Repository\Order\OrderProductReductionCatalogStore;
@@ -26,6 +27,12 @@ class OrderProductReductionCatalogContainer
$this->store = $store;
}


public static function getEntityFqcn()
{
return OrderProductReductionCatalog::class;
}

public function getFactory(): OrderProductReductionCatalogFactory
{
return $this->factory;
@@ -46,4 +53,4 @@ class OrderProductReductionCatalogContainer
return $this->store;
}

}
}

+ 7
- 1
Container/Order/OrderProductRefundContainer.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Container\Order;

use App\Entity\Order\OrderProductRefund;
use Lc\CaracoleBundle\Factory\Order\OrderProductRefundFactory;
use Lc\CaracoleBundle\Repository\Order\OrderProductRefundRepositoryQuery;
use Lc\CaracoleBundle\Repository\Order\OrderProductRefundStore;
@@ -22,6 +23,11 @@ class OrderProductRefundContainer
$this->store = $store;
}

public static function getEntityFqcn()
{
return OrderProductRefund::class;
}

public function getFactory(): OrderProductRefundFactory
{
return $this->factory;
@@ -37,4 +43,4 @@ class OrderProductRefundContainer
return $this->store;
}

}
}

+ 9
- 1
Container/Order/OrderReductionCartContainer.php View File

@@ -2,6 +2,8 @@

namespace Lc\CaracoleBundle\Container\Order;

use App\Entity\Newsletter\Newsletter;
use App\Entity\Order\OrderReductionCart;
use Lc\CaracoleBundle\Factory\Order\OrderReductionCartFactory;
use Lc\CaracoleBundle\Repository\Order\OrderReductionCartRepositoryQuery;
use Lc\CaracoleBundle\Repository\Order\OrderReductionCartStore;
@@ -22,6 +24,12 @@ class OrderReductionCartContainer
$this->store = $store;
}


public static function getEntityFqcn()
{
return OrderReductionCart::class;
}

public function getFactory(): OrderReductionCartFactory
{
return $this->factory;
@@ -37,4 +45,4 @@ class OrderReductionCartContainer
return $this->store;
}

}
}

+ 8
- 1
Container/Order/OrderReductionCreditContainer.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Container\Order;

use App\Entity\Order\OrderReductionCredit;
use Lc\CaracoleBundle\Factory\Order\OrderReductionCreditFactory;
use Lc\CaracoleBundle\Repository\Order\OrderReductionCreditRepositoryQuery;
use Lc\CaracoleBundle\Repository\Order\OrderReductionCreditStore;
@@ -22,6 +23,12 @@ class OrderReductionCreditContainer
$this->store = $store;
}


public static function getEntityFqcn()
{
return OrderReductionCredit::class;
}

public function getFactory(): OrderReductionCreditFactory
{
return $this->factory;
@@ -37,4 +44,4 @@ class OrderReductionCreditContainer
return $this->store;
}

}
}

+ 7
- 1
Container/Order/OrderRefundContainer.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Container\Order;

use App\Entity\Order\OrderRefund;
use Lc\CaracoleBundle\Factory\Order\OrderRefundFactory;
use Lc\CaracoleBundle\Repository\Order\OrderRefundRepositoryQuery;
use Lc\CaracoleBundle\Repository\Order\OrderRefundStore;
@@ -22,6 +23,11 @@ class OrderRefundContainer
$this->store = $store;
}

public static function getEntityFqcn()
{
return OrderRefund::class;
}

public function getFactory(): OrderRefundFactory
{
return $this->factory;
@@ -37,4 +43,4 @@ class OrderRefundContainer
return $this->store;
}

}
}

+ 7
- 1
Container/Order/OrderShopContainer.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Container\Order;

use App\Entity\Order\OrderShop;
use App\Resolver\OrderShopResolver;
use Lc\CaracoleBundle\Builder\Order\OrderShopBuilder;
use Lc\CaracoleBundle\Definition\Field\Order\OrderShopFieldDefinition;
@@ -42,6 +43,11 @@ class OrderShopContainer
$this->fieldDefinition = $fieldDefinition;
}

public static function getEntityFqcn()
{
return OrderShop::class;
}

public function getFactory(): OrderShopFactory
{
return $this->factory;
@@ -84,4 +90,4 @@ class OrderShopContainer
return $this->fieldDefinition;
}

}
}

+ 7
- 1
Container/Order/OrderStatusContainer.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Container\Order;

use App\Entity\Order\OrderStatus;
use Lc\CaracoleBundle\Factory\Order\OrderStatusFactory;
use Lc\CaracoleBundle\Repository\Order\OrderStatusRepositoryQuery;
use Lc\CaracoleBundle\Repository\Order\OrderStatusStore;
@@ -22,6 +23,11 @@ class OrderStatusContainer
$this->store = $store;
}

public static function getEntityFqcn()
{
return OrderStatus::class;
}

public function getFactory(): OrderStatusFactory
{
return $this->factory;
@@ -37,4 +43,4 @@ class OrderStatusContainer
return $this->store;
}

}
}

+ 7
- 1
Container/Order/OrderStatusHistoryContainer.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Container\Order;

use App\Entity\Order\OrderStatusHistory;
use Lc\CaracoleBundle\Factory\Order\OrderStatusHistoryFactory;
use Lc\CaracoleBundle\Repository\Order\OrderStatusHistoryRepositoryQuery;
use Lc\CaracoleBundle\Repository\Order\OrderStatusHistoryStore;
@@ -22,6 +23,11 @@ class OrderStatusHistoryContainer
$this->store = $store;
}

public static function getEntityFqcn()
{
return OrderStatusHistory::class;
}

public function getFactory(): OrderStatusHistoryFactory
{
return $this->factory;
@@ -37,4 +43,4 @@ class OrderStatusHistoryContainer
return $this->store;
}

}
}

+ 6
- 1
Container/PointSale/PointSaleContainer.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Container\PointSale;

use App\Entity\PointSale\PointSale;
use Lc\CaracoleBundle\Definition\Field\PointSale\PointSaleFieldDefinition;
use Lc\CaracoleBundle\Factory\PointSale\PointSaleFactory;
use Lc\CaracoleBundle\Repository\PointSale\PointSaleRepositoryQuery;
@@ -30,6 +31,10 @@ class PointSaleContainer
$this->store = $store;
}

public static function getEntityFqcn()
{
return PointSale::class;
}
public function getFactory(): PointSaleFactory
{
return $this->factory;
@@ -56,4 +61,4 @@ class PointSaleContainer

return $this->store;
}
}
}

+ 7
- 1
Container/PointSale/PointSaleSectionContainer.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Container\PointSale;

use App\Entity\PointSale\PointSaleSection;
use Lc\CaracoleBundle\Builder\PointSale\PointSaleSectionBuilder;
use Lc\CaracoleBundle\Factory\PointSale\PointSaleSectionFactory;
use Lc\CaracoleBundle\Repository\PointSale\PointSaleSectionRepositoryQuery;
@@ -26,6 +27,11 @@ class PointSaleSectionContainer
$this->builder = $builder;
}


public static function getEntityFqcn()
{
return PointSaleSection::class;
}
public function getFactory(): PointSaleSectionFactory
{
return $this->factory;
@@ -47,4 +53,4 @@ class PointSaleSectionContainer
{
return $this->builder;
}
}
}

+ 7
- 1
Container/Product/ProductCategoryContainer.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Container\Product;

use App\Entity\Product\ProductCategory;
use Lc\CaracoleBundle\Builder\Product\ProductCategoryBuilder;
use Lc\CaracoleBundle\Definition\Field\Product\ProductCategoryFieldDefinition;
use Lc\CaracoleBundle\Factory\Product\ProductCategoryFactory;
@@ -34,6 +35,11 @@ class ProductCategoryContainer
$this->fieldDefinition = $fieldDefinition;
}

public static function getEntityFqcn()
{
return ProductCategory::class;
}

public function getFactory(): ProductCategoryFactory
{
return $this->factory;
@@ -66,4 +72,4 @@ class ProductCategoryContainer
return $this->fieldDefinition;
}

}
}

+ 8
- 1
Container/Product/ProductContainer.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Container\Product;

use App\Entity\Product\Product;
use Lc\CaracoleBundle\Factory\Product\ProductFactory;
use Lc\CaracoleBundle\Repository\Product\ProductRepositoryQuery;
use Lc\CaracoleBundle\Repository\Product\ProductStore;
@@ -26,6 +27,12 @@ class ProductContainer
$this->store = $store;
}


public static function getEntityFqcn()
{
return Product::class;
}

public function getFactory(): ProductFactory
{
return $this->factory;
@@ -50,4 +57,4 @@ class ProductContainer



}
}

+ 6
- 0
Container/Product/ProductFamilyContainer.php View File

@@ -3,6 +3,7 @@
namespace Lc\CaracoleBundle\Container\Product;

use App\Definition\Field\Product\ProductFamilyFieldDefinition;
use App\Entity\Product\ProductFamily;
use Lc\CaracoleBundle\Builder\Product\ProductFamilyBuilder;
use Lc\CaracoleBundle\Factory\Product\ProductFamilyFactory;
use Lc\CaracoleBundle\Repository\Product\ProductFamilyRepositoryQuery;
@@ -38,6 +39,11 @@ class ProductFamilyContainer
$this->fieldDefinition = $fieldDefinition;
}

public static function getEntityFqcn()
{
return ProductFamily::class;
}

public function getFactory(): ProductFamilyFactory
{
return $this->factory;

+ 6
- 0
Container/Product/ProductFamilySectionPropertyContainer.php View File

@@ -3,6 +3,7 @@
namespace Lc\CaracoleBundle\Container\Product;

use App\Definition\Field\Product\ProductFamilyFieldDefinition;
use App\Entity\Product\ProductFamilySectionProperty;
use Lc\CaracoleBundle\Builder\Product\ProductFamilyBuilder;
use Lc\CaracoleBundle\Builder\Product\ProductFamilySectionPropertyBuilder;
use Lc\CaracoleBundle\Factory\Product\ProductFamilyFactory;
@@ -37,6 +38,11 @@ class ProductFamilySectionPropertyContainer
$this->builder = $builder;
}

public static function getEntityFqcn()
{
return ProductFamilySectionProperty::class;
}

public function getFactory(): ProductFamilySectionPropertyFactory
{
return $this->factory;

+ 8
- 1
Container/Product/QualityLabelContainer.php View File

@@ -3,6 +3,7 @@
namespace Lc\CaracoleBundle\Container\Product;

use Lc\CaracoleBundle\Factory\Product\QualityLabelFactory;
use Lc\CaracoleBundle\Model\Product\QualityLabel;
use Lc\CaracoleBundle\Repository\Product\QualityLabelRepositoryQuery;
use Lc\CaracoleBundle\Repository\Product\QualityLabelStore;

@@ -22,6 +23,12 @@ class QualityLabelContainer
$this->store = $store;
}


public static function getEntityFqcn()
{
return QualityLabel::class;
}

public function getFactory(): QualityLabelFactory
{
return $this->factory;
@@ -37,4 +44,4 @@ class QualityLabelContainer
return $this->store;
}

}
}

+ 8
- 1
Container/Reduction/ReductionCartContainer.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Container\Reduction;

use App\Entity\Reduction\ReductionCart;
use Lc\CaracoleBundle\Definition\Field\Reduction\ReductionCartFieldDefinition;
use Lc\CaracoleBundle\Factory\Reduction\ReductionCartFactory;
use Lc\CaracoleBundle\Repository\Reduction\ReductionCartRepositoryQuery;
@@ -26,6 +27,12 @@ class ReductionCartContainer
$this->fieldDefinition = $fieldDefinition;
}


public static function getEntityFqcn()
{
return ReductionCart::class;
}

public function getFactory(): ReductionCartFactory
{
return $this->factory;
@@ -47,4 +54,4 @@ class ReductionCartContainer
{
return $this->fieldDefinition;
}
}
}

+ 8
- 1
Container/Reduction/ReductionCatalogContainer.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Container\Reduction;

use App\Entity\Reduction\ReductionCatalog;
use Lc\CaracoleBundle\Definition\Field\Reduction\ReductionCatalogFieldDefinition;
use Lc\CaracoleBundle\Factory\Reduction\ReductionCatalogFactory;
use Lc\CaracoleBundle\Repository\Reduction\ReductionCatalogRepositoryQuery;
@@ -26,6 +27,12 @@ class ReductionCatalogContainer
$this->fieldDefinition = $fieldDefinition;
}


public static function getEntityFqcn()
{
return ReductionCatalog::class;
}

public function getFactory(): ReductionCatalogFactory
{
return $this->factory;
@@ -48,4 +55,4 @@ class ReductionCatalogContainer
return $this->fieldDefinition;
}

}
}

+ 8
- 1
Container/Reduction/ReductionCreditContainer.php View File

@@ -3,6 +3,7 @@
namespace Lc\CaracoleBundle\Container\Reduction;

use App\Definition\Field\Reduction\ReductionCreditFieldDefinition;
use App\Entity\Reduction\ReductionCredit;
use Lc\CaracoleBundle\Factory\Reduction\ReductionCreditFactory;
use Lc\CaracoleBundle\Repository\Reduction\ReductionCreditRepositoryQuery;
use Lc\CaracoleBundle\Repository\Reduction\ReductionCreditStore;
@@ -26,6 +27,12 @@ class ReductionCreditContainer
$this->fieldDefinition = $fieldDefinition;
}


public static function getEntityFqcn()
{
return ReductionCredit::class;
}

public function getFactory(): ReductionCreditFactory
{
return $this->factory;
@@ -46,4 +53,4 @@ class ReductionCreditContainer
return $this->fieldDefinition;
}

}
}

+ 8
- 1
Container/Section/OpeningContainer.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Container\Section;

use App\Entity\Section\Opening;
use Lc\CaracoleBundle\Factory\Section\OpeningFactory;
use Lc\CaracoleBundle\Repository\Section\OpeningRepositoryQuery;
use Lc\CaracoleBundle\Repository\Section\OpeningStore;
@@ -26,6 +27,12 @@ class OpeningContainer
$this->store = $store;
}


public static function getEntityFqcn()
{
return Opening::class;
}

public function getFactory(): OpeningFactory
{
return $this->factory;
@@ -48,4 +55,4 @@ class OpeningContainer
return $this->store;
}

}
}

+ 8
- 1
Container/Section/SectionContainer.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Container\Section;

use App\Entity\Section\Section;
use Lc\CaracoleBundle\Factory\Section\SectionFactory;
use Lc\CaracoleBundle\Repository\Section\SectionRepositoryQuery;
use Lc\CaracoleBundle\Repository\Section\SectionStore;
@@ -30,6 +31,12 @@ class SectionContainer
$this->store = $store;
}


public static function getEntityFqcn()
{
return Section::class;
}

public function getFactory(): SectionFactory
{
return $this->factory;
@@ -56,4 +63,4 @@ class SectionContainer

return $this->store;
}
}
}

+ 8
- 1
Container/Setting/MerchantSettingContainer.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Container\Setting;

use App\Entity\Setting\MerchantSetting;
use Lc\CaracoleBundle\Definition\MerchantSettingDefinition;
use Lc\CaracoleBundle\Factory\Setting\MerchantSettingFactory;
use Lc\CaracoleBundle\Repository\Setting\MerchantSettingRepositoryQuery;
@@ -30,6 +31,12 @@ class MerchantSettingContainer
$this->settingSolver = $settingSolver;
}


public static function getEntityFqcn()
{
return MerchantSetting::class;
}

public function getFactory(): MerchantSettingFactory
{
return $this->factory;
@@ -57,4 +64,4 @@ class MerchantSettingContainer
return $this->settingSolver;
}

}
}

+ 8
- 1
Container/Setting/SectionSettingContainer.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Container\Setting;

use App\Entity\Setting\SectionSetting;
use Lc\CaracoleBundle\Definition\SectionSettingDefinition;
use Lc\CaracoleBundle\Factory\Setting\SectionSettingFactory;
use Lc\CaracoleBundle\Repository\Setting\SectionSettingRepositoryQuery;
@@ -30,6 +31,12 @@ class SectionSettingContainer
$this->settingSolver = $settingSolver;
}


public static function getEntityFqcn()
{
return SectionSetting::class;
}

public function getFactory(): SectionSettingFactory
{
return $this->factory;
@@ -57,4 +64,4 @@ class SectionSettingContainer
return $this->settingSolver;
}

}
}

+ 6
- 0
Container/User/UserMerchantContainer.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Container\User;

use App\Entity\User\UserMerchant;
use Lc\CaracoleBundle\Builder\User\UserMerchantBuilder;
use Lc\CaracoleBundle\Definition\Field\User\UserMerchantFieldDefinition;
use Lc\CaracoleBundle\Factory\User\UserMerchantFactory;
@@ -34,6 +35,11 @@ class UserMerchantContainer
$this->fieldDefinition = $fieldDefinition;
}

public static function getEntityFqcn()
{
return UserMerchant::class;
}

public function getFactory(): UserMerchantFactory
{
return $this->factory;

+ 7
- 1
Container/User/UserPointSaleContainer.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Container\User;

use App\Entity\User\UserPointSale;
use Lc\CaracoleBundle\Factory\User\UserPointSaleFactory;
use Lc\CaracoleBundle\Repository\User\UserPointSaleRepositoryQuery;
use Lc\CaracoleBundle\Repository\User\UserPointSaleStore;
@@ -22,6 +23,11 @@ class UserPointSaleContainer
$this->store = $store;
}

public static function getEntityFqcn()
{
return UserPointSale::class;
}

public function getFactory(): UserPointSaleFactory
{
return $this->factory;
@@ -37,4 +43,4 @@ class UserPointSaleContainer
return $this->store;
}

}
}

+ 8
- 1
Container/User/VisitorContainer.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Container\User;

use App\Entity\User\Visitor;
use Lc\CaracoleBundle\Builder\User\VisitorBuilder;
use Lc\CaracoleBundle\Factory\User\VisitorFactory;
use Lc\CaracoleBundle\Repository\User\VisitorRepositoryQuery;
@@ -34,6 +35,12 @@ class VisitorContainer
$this->builder = $builder;
}


public static function getEntityFqcn()
{
return Visitor::class;
}

public function getFactory(): VisitorFactory
{
return $this->factory;
@@ -64,4 +71,4 @@ class VisitorContainer
return $this->builder;
}

}
}

+ 0
- 1
Controller/AbstractAdminController.php View File

@@ -68,7 +68,6 @@ abstract class AbstractAdminController extends SovAbstractAdminController
$filteredValue = ['value' => $context->getRequest()->query->get('q')];
$filterManager->applyFilter($repositoryQuery, $field, $filteredValue);
$repositoryQuery->select('.' . $autocompleteContext['propertyName']);
//dump($repositoryQuery->getQueryBuilder()->getQuery()->getDQL());

$responses = array();
foreach ($repositoryQuery->find() as $result) {

+ 3
- 37
Controller/ControllerTrait.php View File

@@ -6,7 +6,6 @@ use Lc\CaracoleBundle\Container\Address\AddressContainer;
use Lc\CaracoleBundle\Container\Config\TaxRateContainer;
use Lc\CaracoleBundle\Container\Config\UnitContainer;
use Lc\CaracoleBundle\Container\Credit\CreditHistoryContainer;
use Lc\CaracoleBundle\Container\Distribution\DistributionContainer;
use Lc\CaracoleBundle\Container\File\DocumentContainer;
use Lc\CaracoleBundle\Container\Merchant\MerchantContainer;
use Lc\CaracoleBundle\Container\Order\OrderPaymentContainer;
@@ -24,7 +23,6 @@ use Lc\CaracoleBundle\Container\PointSale\PointSaleSectionContainer;
use Lc\CaracoleBundle\Container\Product\ProductCategoryContainer;
use Lc\CaracoleBundle\Container\Product\ProductContainer;
use Lc\CaracoleBundle\Container\Product\ProductFamilyContainer;
use Lc\CaracoleBundle\Container\Product\ProductFamilySectionPropertyContainer;
use Lc\CaracoleBundle\Container\Product\QualityLabelContainer;
use Lc\CaracoleBundle\Container\Reduction\ReductionCartContainer;
use Lc\CaracoleBundle\Container\Reduction\ReductionCatalogContainer;
@@ -36,6 +34,7 @@ use Lc\CaracoleBundle\Container\Setting\SectionSettingContainer;
use Lc\CaracoleBundle\Container\User\UserMerchantContainer;
use Lc\CaracoleBundle\Container\User\UserPointSaleContainer;
use Lc\CaracoleBundle\Container\User\VisitorContainer;
use Lc\CaracoleBundle\Definition\ApplicationDefinition;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
use Lc\CaracoleBundle\Model\Section\SectionInterface;
@@ -55,45 +54,12 @@ trait ControllerTrait
{
return array_merge(
parent::getSubscribedServices(),
ApplicationDefinition::getSubscribedContainerServices(),
[
MailMailjetNotification::class => MailMailjetNotification::class,
PriceSolver::class => PriceSolver::class,
MerchantResolver::class => MerchantResolver::class,
SectionResolver::class => SectionResolver::class,
OrderShopContainer::class => OrderShopContainer::class,
AddressContainer::class => AddressContainer::class,
TaxRateContainer::class => TaxRateContainer::class,
UnitContainer::class => UnitContainer::class,
CreditHistoryContainer::class => CreditHistoryContainer::class,
DocumentContainer::class => DocumentContainer::class,
MerchantContainer::class => MerchantContainer::class,
OrderPaymentContainer::class => OrderPaymentContainer::class,
OrderProductContainer::class => OrderProductContainer::class,
OrderProductReductionCatalogContainer::class => OrderProductReductionCatalogContainer::class,
OrderProductRefundContainer::class => OrderProductRefundContainer::class,
OrderReductionCartContainer::class => OrderReductionCartContainer::class,
OrderReductionCreditContainer::class => OrderReductionCreditContainer::class,
OrderRefundContainer::class => OrderRefundContainer::class,
OrderStatusContainer::class => OrderStatusContainer::class,
OrderStatusHistoryContainer::class => OrderStatusHistoryContainer::class,
PointSaleContainer::class => PointSaleContainer::class,
ProductCategoryContainer::class => ProductCategoryContainer::class,
ProductContainer::class => ProductContainer::class,
ProductFamilyContainer::class => ProductFamilyContainer::class,
ReductionCartContainer::class => ReductionCartContainer::class,
ReductionCatalogContainer::class => ReductionCatalogContainer::class,
ReductionCreditContainer::class => ReductionCreditContainer::class,
OpeningContainer::class => OpeningContainer::class,
SectionContainer::class => SectionContainer::class,
MerchantSettingContainer::class => MerchantSettingContainer::class,
SectionSettingContainer::class => SectionSettingContainer::class,
UserMerchantContainer::class => UserMerchantContainer::class,
UserPointSaleContainer::class => UserPointSaleContainer::class,
VisitorContainer::class => VisitorContainer::class,
DistributionContainer::class => DistributionContainer::class,
ProductFamilySectionPropertyContainer::class => ProductFamilySectionPropertyContainer::class,
QualityLabelContainer::class => QualityLabelContainer::class,
PointSaleSectionContainer::class => PointSaleSectionContainer::class,
SectionResolver::class => SectionResolver::class
]
);
}

+ 66
- 4
Controller/User/UserAdminController.php View File

@@ -9,6 +9,7 @@ use Lc\CaracoleBundle\Controller\ControllerTrait;
use Lc\SovBundle\Container\User\UserContainer;
use Lc\SovBundle\Controller\User\UserAdminController as SovUserAdminController;
use Lc\SovBundle\Definition\ActionDefinition;
use Lc\SovBundle\Model\User\UserInterface;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

abstract class UserAdminController extends SovUserAdminController
@@ -17,7 +18,7 @@ abstract class UserAdminController extends SovUserAdminController

public function getRepositoryQuery(): RepositoryQueryInterface
{
return $this->getUserContainer()->getRepositoryQuery();
return $this->container->get($this->getContainerFqcn())->getRepositoryQuery();
}

public function createEntity(string $entityFqcn)
@@ -28,11 +29,11 @@ abstract class UserAdminController extends SovUserAdminController
public function overrideEntitiesActions(?EntityCollection $entities, string $pageName): void
{
foreach ($entities as $entity) {
foreach ($entity->getActions() as $action){
if($action->getName() == ActionDefinition::SWITCH_USER){
foreach ($entity->getActions() as $action) {
if ($action->getName() == ActionDefinition::SWITCH_USER) {
$sectionDefault = $this->getSectionContainer()->getStore()->setMerchant($this->getMerchantCurrent())->getOneDefault();

$url = $this->generateUrl($this->getParameter('lc_sov.homepage_route'), array('_switch_user' => $entity->getInstance()->getEmail(), 'section'=> $sectionDefault->getSlug()));
$url = $this->generateUrl($this->getParameter('lc_sov.homepage_route'), array('_switch_user' => $entity->getInstance()->getEmail(), 'section' => $sectionDefault->getSlug()));
$action->setLinkUrl($url);
}
}
@@ -41,6 +42,67 @@ abstract class UserAdminController extends SovUserAdminController
}


public function getDeleteUserWarningMessageList(UserInterface $user): array
{
$warningMessages = parent::getDeleteUserWarningMessageList($user);

foreach ($this->getUserMerchantContainer()->getStore()->getByUserOutOfContext($user) as $userMerchant) {
if ($this->getUserMerchantContainer()->getSolver()->isCreditActive($userMerchant) && $userMerchant->getCredit() != 0) {
$warningMessages['danger'][] = $this->getTranslatorAdmin()->transFlashMessage('error', 'deleteHasCredit', 'User', array('%merchant%' => $userMerchant->getMerchant()));
}
}

foreach ($this->getReductionCatalogContainer()->getStore()->getByUserOutOfContext($user) as $reductionCatalog) {
$warningMessages['danger'][] = $this->getTranslatorAdmin()->transFlashMessage(
'error',
'deleteHasReductionCatalog',
'User',
array(
'%merchant%' => $reductionCatalog->getMerchant(),
'%id%' => $reductionCatalog->getId()
)
);
}

foreach ($this->getReductionCartContainer()->getStore()->getByUserOutOfContext($user) as $reductionCart) {
$warningMessages['danger'][] = $this->getTranslatorAdmin()->transFlashMessage(
'error',
'deleteHasReductionCart',
'User',
array(
'%merchant%' => $reductionCart->getMerchant(),
'%id%' => $reductionCart->getId()
)
);
}

foreach ($this->getReductionCreditContainer()->getStore()->getReductionCreditByUserOutOfContext($user) as $reductionCredit) {
$warningMessages['warning'][] = $this->getTranslatorAdmin()->transFlashMessage(
'error',
'deleteHasReductionCredit',
'User',
array(
'%merchant%' => $reductionCredit->getMerchant(),
'%id%' => $reductionCredit->getId()
)
);
}

foreach ($this->getReductionCreditContainer()->getStore()->getReductionGiftByUserOutOfContext($user) as $reductionGift) {
$warningMessages['warning'][] = $this->getTranslatorAdmin()->transFlashMessage(
'error',
'deleteHasReductionGift',
'User',
array(
'%merchant%' => $reductionGift->getMerchant(),
'%id%' => $reductionGift->getId()
)
);
}


return $warningMessages;
}


}

+ 84
- 0
Definition/ApplicationDefinition.php View File

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

namespace Lc\CaracoleBundle\Definition;

use Lc\CaracoleBundle\Container\Address\AddressContainer;
use Lc\CaracoleBundle\Container\Config\TaxRateContainer;
use Lc\CaracoleBundle\Container\Config\UnitContainer;
use Lc\CaracoleBundle\Container\Credit\CreditHistoryContainer;
use Lc\CaracoleBundle\Container\Distribution\DistributionContainer;
use Lc\CaracoleBundle\Container\File\DocumentContainer;
use Lc\CaracoleBundle\Container\Merchant\MerchantContainer;
use Lc\CaracoleBundle\Container\Order\OrderPaymentContainer;
use Lc\CaracoleBundle\Container\Order\OrderProductContainer;
use Lc\CaracoleBundle\Container\Order\OrderProductReductionCatalogContainer;
use Lc\CaracoleBundle\Container\Order\OrderProductRefundContainer;
use Lc\CaracoleBundle\Container\Order\OrderReductionCartContainer;
use Lc\CaracoleBundle\Container\Order\OrderReductionCreditContainer;
use Lc\CaracoleBundle\Container\Order\OrderRefundContainer;
use Lc\CaracoleBundle\Container\Order\OrderShopContainer;
use Lc\CaracoleBundle\Container\Order\OrderStatusContainer;
use Lc\CaracoleBundle\Container\Order\OrderStatusHistoryContainer;
use Lc\CaracoleBundle\Container\PointSale\PointSaleContainer;
use Lc\CaracoleBundle\Container\PointSale\PointSaleSectionContainer;
use Lc\CaracoleBundle\Container\Product\ProductCategoryContainer;
use Lc\CaracoleBundle\Container\Product\ProductContainer;
use Lc\CaracoleBundle\Container\Product\ProductFamilyContainer;
use Lc\CaracoleBundle\Container\Product\ProductFamilySectionPropertyContainer;
use Lc\CaracoleBundle\Container\Product\QualityLabelContainer;
use Lc\CaracoleBundle\Container\Reduction\ReductionCartContainer;
use Lc\CaracoleBundle\Container\Reduction\ReductionCatalogContainer;
use Lc\CaracoleBundle\Container\Reduction\ReductionCreditContainer;
use Lc\CaracoleBundle\Container\Section\OpeningContainer;
use Lc\CaracoleBundle\Container\Section\SectionContainer;
use Lc\CaracoleBundle\Container\Setting\MerchantSettingContainer;
use Lc\CaracoleBundle\Container\Setting\SectionSettingContainer;
use Lc\CaracoleBundle\Container\User\UserMerchantContainer;
use Lc\CaracoleBundle\Container\User\UserPointSaleContainer;
use Lc\CaracoleBundle\Container\User\VisitorContainer;
use Lc\SovBundle\Definition\ApplicationDefinition as SovAbstractApplicationDefinition;

class ApplicationDefinition extends SovAbstractApplicationDefinition
{

public static function getContainerList(): array
{
return array_merge(parent::getContainerList(), [
OrderShopContainer::class,
AddressContainer::class,
TaxRateContainer::class,
UnitContainer::class,
CreditHistoryContainer::class,
DocumentContainer::class,
MerchantContainer::class,
OrderPaymentContainer::class,
OrderProductContainer::class,
OrderProductReductionCatalogContainer::class,
OrderProductRefundContainer::class,
OrderReductionCartContainer::class,
OrderReductionCreditContainer::class,
OrderRefundContainer::class,
OrderStatusContainer::class,
OrderStatusHistoryContainer::class,
PointSaleContainer::class,
ProductCategoryContainer::class,
ProductContainer::class,
ProductFamilyContainer::class,
ReductionCartContainer::class,
ReductionCatalogContainer::class,
ReductionCreditContainer::class,
OpeningContainer::class,
SectionContainer::class,
MerchantSettingContainer::class,
SectionSettingContainer::class,
UserMerchantContainer::class,
UserPointSaleContainer::class,
VisitorContainer::class,
DistributionContainer::class,
ProductFamilySectionPropertyContainer::class,
QualityLabelContainer::class,
PointSaleSectionContainer::class,
]);
}

}

+ 3
- 3
Factory/Address/AddressFactory.php View File

@@ -2,8 +2,7 @@

namespace Lc\CaracoleBundle\Factory\Address;

use App\Entity\Address\Address;
use Lc\CaracoleBundle\Context\MerchantContextTrait;
use Lc\CaracoleBundle\Container\Address\AddressContainer;
use Lc\CaracoleBundle\Model\Address\AddressInterface;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\SovBundle\Factory\AbstractFactory;
@@ -13,7 +12,8 @@ class AddressFactory extends AbstractFactory

public function create(MerchantInterface $merchant): AddressInterface
{
$address = new Address();
$class = AddressContainer::getEntityFqcn();
$address = new $class;

$address->setMerchant($merchant);


+ 3
- 2
Factory/Config/TaxRateFactory.php View File

@@ -2,7 +2,7 @@

namespace Lc\CaracoleBundle\Factory\Config;

use App\Entity\Config\TaxRate;
use Lc\CaracoleBundle\Container\Config\TaxRateContainer;
use Lc\CaracoleBundle\Model\Config\TaxRateInterface;
use Lc\SovBundle\Factory\AbstractFactory;

@@ -10,7 +10,8 @@ class TaxRateFactory extends AbstractFactory
{
public function create(): TaxRateInterface
{
$taxRate = new TaxRate();
$class = TaxRateContainer::getEntityFqcn();
$taxRate = new $class;

return $taxRate;
}

+ 3
- 2
Factory/Config/UnitFactory.php View File

@@ -2,7 +2,7 @@

namespace Lc\CaracoleBundle\Factory\Config;

use App\Entity\Config\Unit;
use Lc\CaracoleBundle\Container\Config\UnitContainer;
use Lc\CaracoleBundle\Model\Config\UnitInterface;
use Lc\SovBundle\Factory\AbstractFactory;

@@ -10,7 +10,8 @@ class UnitFactory extends AbstractFactory
{
public function create(): UnitInterface
{
$unit = new Unit();
$class = UnitContainer::getEntityFqcn();
$unit = new $class;

return $unit;
}

+ 4
- 3
Factory/Credit/CreditHistoryFactory.php View File

@@ -2,11 +2,10 @@

namespace Lc\CaracoleBundle\Factory\Credit;

use App\Entity\Credit\CreditHistory;
use Lc\CaracoleBundle\Container\Credit\CreditHistoryContainer;
use Lc\CaracoleBundle\Model\Credit\CreditHistoryInterface;
use Lc\CaracoleBundle\Model\User\UserMerchantInterface;
use Lc\SovBundle\Factory\AbstractFactory;
use Lc\SovBundle\Model\User\UserInterface;

class CreditHistoryFactory extends AbstractFactory
{
@@ -22,8 +21,10 @@ class CreditHistoryFactory extends AbstractFactory

public function createBase(UserMerchantInterface $userMerchant): CreditHistoryInterface
{
$creditHistory = new CreditHistory();
$class = CreditHistoryContainer::getEntityFqcn();
$creditHistory = new $class;
$creditHistory->setUserMerchant($userMerchant) ;
$creditHistory->setMerchant($userMerchant->getMerchant()) ;

return $creditHistory;
}

+ 5
- 4
Factory/Distribution/DistributionFactory.php View File

@@ -2,16 +2,17 @@

namespace Lc\CaracoleBundle\Factory\Distribution;

use App\Entity\Distribution\Distribution;
use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\CaracoleBundle\Container\Distribution\DistributionContainer;
use Lc\CaracoleBundle\Model\Distribution\DistributionInterface;
use Lc\SovBundle\Factory\AbstractFactory;

class DistributionFactory extends AbstractFactory
{

public function create(int $cycleNumber, int $year, string $cycleType):Distribution
public function create(int $cycleNumber, int $year, string $cycleType):DistributionInterface
{
$distribution = new Distribution();
$class = DistributionContainer::getEntityFqcn();
$distribution = new $class;

$distribution->setCycleNumber($cycleNumber);
$distribution->setCycleType($cycleType);

+ 3
- 6
Factory/File/DocumentFactory.php View File

@@ -2,21 +2,18 @@

namespace Lc\CaracoleBundle\Factory\File;

use App\Entity\File\Document;
use Lc\CaracoleBundle\Context\MerchantContextTrait;
use Lc\CaracoleBundle\Model\Address\AddressInterface;
use Lc\CaracoleBundle\Container\File\DocumentContainer;
use Lc\CaracoleBundle\Model\File\DocumentInterface;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\SovBundle\Factory\AbstractFactory;
use Lc\SovBundle\Model\User\UserInterface;

class DocumentFactory extends AbstractFactory
{

public function create(MerchantInterface $merchant, string $type): DocumentInterface
{
$document = new Document();
$class = DocumentContainer::getEntityFqcn();
$document = new $class;

$document->setMerchant($merchant);
$document->setType($type);

+ 3
- 2
Factory/Merchant/MerchantFactory.php View File

@@ -2,7 +2,7 @@

namespace Lc\CaracoleBundle\Factory\Merchant;

use App\Entity\Merchant\Merchant;
use Lc\CaracoleBundle\Container\Merchant\MerchantContainer;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\SovBundle\Factory\AbstractFactory;

@@ -10,7 +10,8 @@ class MerchantFactory extends AbstractFactory
{
public function create(): MerchantInterface
{
$merchant = new Merchant();
$class = MerchantContainer::getEntityFqcn();
$merchant = new $class;

$merchant->setStatus(1);


+ 0
- 1
Factory/Newsletter/NewsletterFactory.php View File

@@ -2,7 +2,6 @@

namespace Lc\CaracoleBundle\Factory\Newsletter;

use Lc\CaracoleBundle\Context\MerchantContextTrait;
use Lc\CaracoleBundle\Context\SectionContextTrait;
use Lc\SovBundle\Model\Newsletter\NewsletterInterface;
use Lc\SovBundle\Factory\Newsletter\NewsletterFactory as SovNewsletterFactory;

+ 3
- 2
Factory/Order/OrderPaymentFactory.php View File

@@ -2,7 +2,7 @@

namespace Lc\CaracoleBundle\Factory\Order;

use App\Entity\Order\OrderPayment;
use Lc\CaracoleBundle\Container\Order\OrderPaymentContainer;
use Lc\CaracoleBundle\Model\Order\OrderPaymentInterface;
use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
use Lc\SovBundle\Factory\AbstractFactory;
@@ -21,7 +21,8 @@ class OrderPaymentFactory extends AbstractFactory
}

public function createBase($orderShop){
$orderPayment = new OrderPayment();
$class = OrderPaymentContainer::getEntityFqcn();
$orderPayment = new $class;
$orderPayment->setOrderShop($orderShop);
return $orderPayment;
}

+ 4
- 2
Factory/Order/OrderProductFactory.php View File

@@ -2,7 +2,8 @@

namespace Lc\CaracoleBundle\Factory\Order;

use App\Entity\Order\OrderProduct;

use Lc\CaracoleBundle\Container\Order\OrderProductContainer;
use Lc\CaracoleBundle\Model\Order\OrderProductInterface;
use Lc\CaracoleBundle\Model\Product\ProductInterface;
use Lc\SovBundle\Factory\AbstractFactory;
@@ -20,7 +21,8 @@ class OrderProductFactory extends AbstractFactory
}

public function createBase(){
return new OrderProduct();
$class = OrderProductContainer::getEntityFqcn();
return new $class;
}

}

+ 3
- 2
Factory/Order/OrderProductReductionCatalogFactory.php View File

@@ -2,7 +2,7 @@

namespace Lc\CaracoleBundle\Factory\Order;

use App\Entity\Order\OrderProductReductionCatalog;
use Lc\CaracoleBundle\Container\Order\OrderProductReductionCatalogContainer;
use Lc\CaracoleBundle\Model\Order\OrderProductReductionCatalogInterface;
use Lc\SovBundle\Factory\AbstractFactory;

@@ -10,7 +10,8 @@ class OrderProductReductionCatalogFactory extends AbstractFactory
{
public function create(string $title, float $value, string $unit, string $behaviorTaxRate): OrderProductReductionCatalogInterface
{
$orderProductReductionCatalog = new OrderProductReductionCatalog();
$class = OrderProductReductionCatalogContainer::getEntityFqcn();
$orderProductReductionCatalog = new $class;

$orderProductReductionCatalog->setTitle($title);
$orderProductReductionCatalog->setValue($value);

+ 3
- 1
Factory/Order/OrderProductRefundFactory.php View File

@@ -3,6 +3,7 @@
namespace Lc\CaracoleBundle\Factory\Order;

use App\Entity\Order\OrderProductRefund;
use Lc\CaracoleBundle\Container\Order\OrderProductRefundContainer;
use Lc\CaracoleBundle\Model\Order\OrderProductRefundInterface;
use Lc\SovBundle\Factory\AbstractFactory;

@@ -10,7 +11,8 @@ class OrderProductRefundFactory extends AbstractFactory
{
public function create(): OrderProductRefundInterface
{
$orderProductRefund = new OrderProductRefund();
$class = OrderProductRefundContainer::getEntityFqcn();
$orderProductRefund = new $class;

return $orderProductRefund;
}

+ 3
- 2
Factory/Order/OrderReductionCartFactory.php View File

@@ -2,7 +2,7 @@

namespace Lc\CaracoleBundle\Factory\Order;

use App\Entity\Order\OrderReductionCart;
use Lc\CaracoleBundle\Container\Order\OrderReductionCartContainer;
use Lc\CaracoleBundle\Model\Order\OrderReductionCartInterface;
use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionCartInterface;
@@ -13,7 +13,8 @@ class OrderReductionCartFactory extends AbstractFactory
// createOrderReductionCart
public function create(OrderShopInterface $orderShop, ReductionCartInterface $reductionCart, $code = null): OrderReductionCartInterface
{
$orderReductionCart = new OrderReductionCart();
$class = OrderReductionCartContainer::getEntityFqcn();
$orderReductionCart = new $class;

$orderReductionCart->setOrderShop($orderShop);
$orderReductionCart->setReductionCart($reductionCart);

+ 3
- 2
Factory/Order/OrderReductionCreditFactory.php View File

@@ -2,7 +2,7 @@

namespace Lc\CaracoleBundle\Factory\Order;

use App\Entity\Order\OrderReductionCredit;
use Lc\CaracoleBundle\Container\Order\OrderReductionCreditContainer;
use Lc\CaracoleBundle\Model\Order\OrderReductionCreditInterface;
use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface;
@@ -12,7 +12,8 @@ class OrderReductionCreditFactory extends AbstractFactory
{
public function create(OrderShopInterface $orderShop, ReductionCreditInterface $reductionCredit): OrderReductionCreditInterface
{
$orderReductionCredit = new OrderReductionCredit();
$class = OrderReductionCreditContainer::getEntityFqcn();
$orderReductionCredit = new $class;

$orderReductionCredit->setOrderShop($orderShop);
$orderReductionCredit->setReductionCredit($reductionCredit);

+ 3
- 2
Factory/Order/OrderRefundFactory.php View File

@@ -2,7 +2,7 @@

namespace Lc\CaracoleBundle\Factory\Order;

use App\Entity\Order\OrderRefund;
use Lc\CaracoleBundle\Container\Order\OrderRefundContainer;
use Lc\CaracoleBundle\Model\Order\OrderRefundInterface;
use Lc\SovBundle\Factory\AbstractFactory;

@@ -10,7 +10,8 @@ class OrderRefundFactory extends AbstractFactory
{
public function create(): OrderRefundInterface
{
$orderRefund = new OrderRefund();
$class = OrderRefundContainer::getEntityFqcn();
$orderRefund = new $class;

return $orderRefund;
}

+ 3
- 7
Factory/Order/OrderShopFactory.php View File

@@ -2,17 +2,12 @@

namespace Lc\CaracoleBundle\Factory\Order;

use App\Entity\Order\OrderShop;
use Lc\CaracoleBundle\Event\Order\OrderShopChangeStatusEvent;
use Lc\CaracoleBundle\Context\SectionContextTrait;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Container\Order\OrderShopContainer;
use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
use Lc\CaracoleBundle\Model\Order\OrderStatusModel;
use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\CaracoleBundle\Model\User\VisitorInterface;
use Lc\SovBundle\Factory\AbstractFactory;
use Lc\SovBundle\Model\User\UserInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;

class OrderShopFactory extends AbstractFactory
{
@@ -50,7 +45,8 @@ class OrderShopFactory extends AbstractFactory

public function createBase(SectionInterface $section): OrderShopInterface
{
$orderShop = new OrderShop();
$class = OrderShopContainer::getEntityFqcn();
$orderShop = new $class;
$orderShop->setSection($section);
return $orderShop;
}

+ 4
- 2
Factory/Order/OrderStatusFactory.php View File

@@ -2,7 +2,8 @@

namespace Lc\CaracoleBundle\Factory\Order;

use App\Entity\Order\OrderStatus;

use Lc\CaracoleBundle\Container\Order\OrderStatusContainer;
use Lc\CaracoleBundle\Model\Order\OrderStatusInterface;
use Lc\SovBundle\Factory\AbstractFactory;

@@ -10,7 +11,8 @@ class OrderStatusFactory extends AbstractFactory
{
public function create(): OrderStatusInterface
{
$orderStatus = new OrderStatus();
$class = OrderStatusContainer::getEntityFqcn();
$orderStatus = new $class;

return $orderStatus;
}

+ 3
- 2
Factory/Order/OrderStatusHistoryFactory.php View File

@@ -2,7 +2,7 @@

namespace Lc\CaracoleBundle\Factory\Order;

use App\Entity\Order\OrderStatusHistory;
use Lc\CaracoleBundle\Container\Order\OrderStatusHistoryContainer;
use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
use Lc\CaracoleBundle\Model\Order\OrderStatusHistoryInterface;
use Lc\CaracoleBundle\Model\Order\OrderStatusHistoryModel;
@@ -13,7 +13,8 @@ class OrderStatusHistoryFactory extends AbstractFactory
{
public function create(OrderShopInterface $orderShop, OrderStatusInterface $status, string $origin = OrderStatusHistoryModel::ORIGIN_USER): OrderStatusHistoryInterface
{
$orderStatusHistory = new OrderStatusHistory();
$class = OrderStatusHistoryContainer::getEntityFqcn();
$orderStatusHistory = new $class;

$orderStatusHistory->setOrderShop($orderShop);
$orderStatusHistory->setOrderStatus($status);

+ 4
- 3
Factory/PointSale/PointSaleFactory.php View File

@@ -2,8 +2,7 @@

namespace Lc\CaracoleBundle\Factory\PointSale;

use App\Entity\PointSale\PointSale;
use Lc\CaracoleBundle\Context\MerchantContextTrait;
use Lc\CaracoleBundle\Container\PointSale\PointSaleContainer;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\PointSale\PointSaleInterface;
use Lc\SovBundle\Factory\AbstractFactory;
@@ -13,7 +12,9 @@ class PointSaleFactory extends AbstractFactory

public function create(MerchantInterface $merchant): PointSaleInterface
{
$pointSale = new PointSale();
$class = PointSaleContainer::getEntityFqcn();
$pointSale = new $class;


$pointSale->addMerchant($merchant);
$pointSale->setStatus(1);

+ 3
- 2
Factory/PointSale/PointSaleSectionFactory.php View File

@@ -2,7 +2,7 @@

namespace Lc\CaracoleBundle\Factory\PointSale;

use App\Entity\PointSale\PointSaleSection;
use Lc\CaracoleBundle\Container\PointSale\PointSaleSectionContainer;
use Lc\CaracoleBundle\Model\PointSale\PointSaleInterface;
use Lc\CaracoleBundle\Model\PointSale\PointSaleSectionInterface;
use Lc\CaracoleBundle\Model\Section\SectionInterface;
@@ -13,7 +13,8 @@ class PointSaleSectionFactory extends AbstractFactory

public function create(PointSaleInterface $pointSale, SectionInterface $section): PointSaleSectionInterface
{
$pointSaleSection = new PointSaleSection();
$class = PointSaleSectionContainer::getEntityFqcn();
$pointSaleSection = new $class;

$pointSaleSection->setPointSale($pointSale);
$pointSaleSection->setSection($section);

+ 3
- 5
Factory/Product/ProductCategoryFactory.php View File

@@ -2,10 +2,7 @@

namespace Lc\CaracoleBundle\Factory\Product;

use App\Entity\Product\ProductCategory;
use Lc\CaracoleBundle\Context\MerchantContextTrait;
use Lc\CaracoleBundle\Context\SectionContextTrait;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Container\Product\ProductCategoryContainer;
use Lc\CaracoleBundle\Model\Product\ProductCategoryInterface;
use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\SovBundle\Factory\AbstractFactory;
@@ -14,7 +11,8 @@ class ProductCategoryFactory extends AbstractFactory
{
public function create(SectionInterface $section): ProductCategoryInterface
{
$productCategory = new ProductCategory();
$class = ProductCategoryContainer::getEntityFqcn();
$productCategory = new $class;

$productCategory->setSection($section);
$productCategory->setSaleStatus(true);

+ 4
- 2
Factory/Product/ProductFactory.php View File

@@ -2,7 +2,8 @@

namespace Lc\CaracoleBundle\Factory\Product;

use App\Entity\Product\Product;

use Lc\CaracoleBundle\Container\Product\ProductContainer;
use Lc\CaracoleBundle\Model\Product\ProductInterface;
use Lc\SovBundle\Factory\AbstractFactory;

@@ -10,7 +11,8 @@ class ProductFactory extends AbstractFactory
{
public function create(): ProductInterface
{
$product = new Product();
$class = ProductContainer::getEntityFqcn();
$product = new $class;

return $product;
}

+ 3
- 4
Factory/Product/ProductFamilyFactory.php View File

@@ -2,19 +2,18 @@

namespace Lc\CaracoleBundle\Factory\Product;

use App\Entity\Product\ProductFamily;
use Lc\CaracoleBundle\Context\SectionContextTrait;
use Lc\CaracoleBundle\Container\Product\ProductFamilyContainer;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface;
use Lc\CaracoleBundle\Model\Product\ProductFamilyModel;
use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\SovBundle\Factory\AbstractFactory;

class ProductFamilyFactory extends AbstractFactory
{
public function create(MerchantInterface $merchant): ProductFamilyInterface
{
$productFamily = new ProductFamily();
$class = ProductFamilyContainer::getEntityFqcn();
$productFamily = new $class;

$productFamily->setBehaviorAddToCart(ProductFamilyModel::BEHAVIOR_ADD_TO_CART_SIMPLE);
$productFamily->setSaleStatus(true);

+ 4
- 6
Factory/Product/ProductFamilySectionPropertyFactory.php View File

@@ -2,12 +2,8 @@

namespace Lc\CaracoleBundle\Factory\Product;

use App\Entity\Product\ProductCategory;
use App\Entity\Product\ProductFamilySectionProperty;
use Lc\CaracoleBundle\Context\MerchantContextTrait;
use Lc\CaracoleBundle\Context\SectionContextTrait;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Product\ProductCategoryInterface;
use Lc\CaracoleBundle\Container\Product\ProductFamilySectionPropertyContainer;
use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface;
use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\SovBundle\Factory\AbstractFactory;
@@ -17,7 +13,9 @@ class ProductFamilySectionPropertyFactory extends AbstractFactory

public function create(SectionInterface $section, ProductFamilyInterface $productFamily): ProductFamilySectionProperty
{
$productFamilySectionProperty = new ProductFamilySectionProperty();
$class = ProductFamilySectionPropertyContainer::getEntityFqcn();
$productFamilySectionProperty = new $class;


$productFamilySectionProperty->setSection($section);
$productFamilySectionProperty->setProductFamily($productFamily);

+ 3
- 1
Factory/Product/QualityLabelFactory.php View File

@@ -3,6 +3,7 @@
namespace Lc\CaracoleBundle\Factory\Product;

use App\Entity\Product\QualityLabel;
use Lc\CaracoleBundle\Container\Product\QualityLabelContainer;
use Lc\CaracoleBundle\Model\Product\QualityLabelInterface;
use Lc\SovBundle\Factory\AbstractFactory;

@@ -10,7 +11,8 @@ class QualityLabelFactory extends AbstractFactory
{
public function create(): QualityLabelInterface
{
$qualityLabel = new QualityLabel();
$class = QualityLabelContainer::getEntityFqcn();
$qualityLabel = new $class;
$qualityLabel->setStatus(1);

return $qualityLabel;

+ 3
- 1
Factory/Reduction/ReductionCartFactory.php View File

@@ -3,6 +3,7 @@
namespace Lc\CaracoleBundle\Factory\Reduction;

use App\Entity\Reduction\ReductionCart;
use Lc\CaracoleBundle\Container\Reduction\ReductionCartContainer;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionCartInterface;
use Lc\SovBundle\Factory\AbstractFactory;
@@ -12,7 +13,8 @@ class ReductionCartFactory extends AbstractFactory

public function create(MerchantInterface $merchant): ReductionCartInterface
{
$reductionCart = new ReductionCart();
$class = ReductionCartContainer::getEntityFqcn();
$reductionCart = new $class;

$reductionCart->setMerchant($merchant);
$reductionCart->setStatus(1);

+ 3
- 1
Factory/Reduction/ReductionCatalogFactory.php View File

@@ -3,6 +3,7 @@
namespace Lc\CaracoleBundle\Factory\Reduction;

use App\Entity\Reduction\ReductionCatalog;
use Lc\CaracoleBundle\Container\Reduction\ReductionCatalogContainer;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionCatalogInterface;
use Lc\SovBundle\Factory\AbstractFactory;
@@ -12,7 +13,8 @@ class ReductionCatalogFactory extends AbstractFactory

public function create(MerchantInterface $merchant, int $status = 1): ReductionCatalogInterface
{
$reductionCatalog = new ReductionCatalog();
$class = ReductionCatalogContainer::getEntityFqcn();
$reductionCatalog = new $class;

$reductionCatalog->setMerchant($merchant);
$reductionCatalog->setStatus($status);

+ 3
- 1
Factory/Reduction/ReductionCreditFactory.php View File

@@ -3,6 +3,7 @@
namespace Lc\CaracoleBundle\Factory\Reduction;

use App\Entity\Reduction\ReductionCredit;
use Lc\CaracoleBundle\Container\Reduction\ReductionCreditContainer;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionCreditModel;
@@ -13,7 +14,8 @@ class ReductionCreditFactory extends AbstractFactory

public function create(MerchantInterface $merchant, string $type = ReductionCreditModel::TYPE_CREDIT): ReductionCreditInterface
{
$reductionCredit = new ReductionCredit();
$class = ReductionCreditContainer::getEntityFqcn();
$reductionCredit = new $class;

$reductionCredit->setMerchant($merchant);
$reductionCredit->setType($type);

+ 4
- 1
Factory/Section/OpeningFactory.php View File

@@ -3,6 +3,7 @@
namespace Lc\CaracoleBundle\Factory\Section;

use App\Entity\Section\Opening;
use Lc\CaracoleBundle\Container\Section\OpeningContainer;
use Lc\CaracoleBundle\Context\SectionContextTrait;
use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\SovBundle\Factory\AbstractFactory;
@@ -18,7 +19,9 @@ class OpeningFactory extends AbstractFactory
\DateTime $timeEnd = null,
GroupUserInterface $groupUser = null
): Opening {
$opening = new Opening();

$class = OpeningContainer::getEntityFqcn();
$opening = new $class;

$opening->setSection($section);


+ 3
- 3
Factory/Section/SectionFactory.php View File

@@ -2,8 +2,7 @@

namespace Lc\CaracoleBundle\Factory\Section;

use App\Entity\Section\Section;
use Lc\CaracoleBundle\Context\MerchantContextTrait;
use Lc\CaracoleBundle\Container\Section\SectionContainer;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\SovBundle\Factory\AbstractFactory;
@@ -13,7 +12,8 @@ class SectionFactory extends AbstractFactory

public function create(MerchantInterface $merchant): SectionInterface
{
$section = new Section();
$class = SectionContainer::getEntityFqcn();
$section = new $class;

$section->setMerchant($merchant);
$section->setStatus(1);

+ 3
- 1
Factory/Setting/MerchantSettingFactory.php View File

@@ -3,6 +3,7 @@
namespace Lc\CaracoleBundle\Factory\Setting;

use App\Entity\Setting\MerchantSetting;
use Lc\CaracoleBundle\Container\Setting\MerchantSettingContainer;
use Lc\CaracoleBundle\Context\MerchantContextTrait;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\SovBundle\Factory\AbstractFactory;
@@ -13,7 +14,8 @@ class MerchantSettingFactory extends AbstractFactory

public function create(MerchantInterface $merchant, string $name, string $text = null, \DateTime $date = null, FileInterface $file = null)
{
$merchantSetting = new MerchantSetting();
$class = MerchantSettingContainer::getEntityFqcn();
$merchantSetting = new $class;

$merchantSetting->setMerchant($merchant);
$merchantSetting->setName($name);

+ 3
- 3
Factory/Setting/SectionSettingFactory.php View File

@@ -2,8 +2,7 @@

namespace Lc\CaracoleBundle\Factory\Setting;

use App\Entity\Setting\SectionSetting;
use Lc\CaracoleBundle\Context\SectionContextTrait;
use Lc\CaracoleBundle\Container\Setting\SectionSettingContainer;
use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\SovBundle\Factory\AbstractFactory;
use Lc\SovBundle\Model\File\FileInterface;
@@ -18,7 +17,8 @@ class SectionSettingFactory extends AbstractFactory
\DateTime $date = null,
FileInterface $file = null
) {
$merchantSetting = new SectionSetting();
$class = SectionSettingContainer::getEntityFqcn();
$merchantSetting = new $class;

$merchantSetting->setSection($section);
$merchantSetting->setName($name);

+ 3
- 3
Factory/User/UserMerchantFactory.php View File

@@ -2,8 +2,7 @@

namespace Lc\CaracoleBundle\Factory\User;

use App\Entity\User\UserMerchant;
use Lc\CaracoleBundle\Context\MerchantContextTrait;
use Lc\CaracoleBundle\Container\User\UserMerchantContainer;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\User\UserMerchantInterface;
use Lc\SovBundle\Factory\AbstractFactory;
@@ -13,7 +12,8 @@ class UserMerchantFactory extends AbstractFactory
{
public function createBase(MerchantInterface $merchant): UserMerchantInterface
{
$userMerchant = new UserMerchant();
$class = UserMerchantContainer::getEntityFqcn();
$userMerchant = new $class;
$userMerchant->setMerchant($merchant);

return $userMerchant;

+ 3
- 1
Factory/User/UserPointSaleFactory.php View File

@@ -3,6 +3,7 @@
namespace Lc\CaracoleBundle\Factory\User;

use App\Entity\User\UserPointSale;
use Lc\CaracoleBundle\Container\User\UserPointSaleContainer;
use Lc\CaracoleBundle\Model\PointSale\PointSaleInterface;
use Lc\CaracoleBundle\Model\User\UserPointSaleInterface;
use Lc\SovBundle\Factory\AbstractFactory;
@@ -12,7 +13,8 @@ class UserPointSaleFactory extends AbstractFactory
{
public function create(UserInterface $user, PointSaleInterface $pointSale): UserPointSaleInterface
{
$userPointSale = new UserPointSale();
$class = UserPointSaleContainer::getEntityFqcn();
$userPointSale = new $class;

$userPointSale->setUser($user);
$userPointSale->setPointSale($pointSale);

+ 3
- 1
Factory/User/VisitorFactory.php View File

@@ -3,6 +3,7 @@
namespace Lc\CaracoleBundle\Factory\User;

use App\Entity\User\Visitor;
use Lc\CaracoleBundle\Container\User\VisitorContainer;
use Lc\CaracoleBundle\Model\User\VisitorInterface;
use Lc\SovBundle\Factory\AbstractFactory;

@@ -10,7 +11,8 @@ class VisitorFactory extends AbstractFactory
{
public static function create(string $cookie, string $ip): VisitorInterface
{
$visitor = new Visitor();
$class = VisitorContainer::getEntityFqcn();
$visitor = new $class;

$visitor->setCookie($cookie);
$visitor->setIp($ip);

+ 3
- 3
Model/Address/AddressModel.php View File

@@ -22,7 +22,7 @@ abstract class AddressModel extends AbstractLightEntity implements StatusInterfa

/**
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface", inversedBy="addresses")
* @ORM\JoinColumn(nullable=true)
* @ORM\JoinColumn(nullable=true, onDelete="cascade")
*/
protected $user;

@@ -118,12 +118,12 @@ abstract class AddressModel extends AbstractLightEntity implements StatusInterfa
protected $comment;

/**
* @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\PointSale\PointSaleInterface", mappedBy="address", cascade={"persist", "remove"})
* @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\PointSale\PointSaleInterface", mappedBy="address", cascade={"persist"})
*/
protected $pointSale;

/**
* @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface", mappedBy="address", cascade={"persist", "remove"})
* @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface", mappedBy="address", cascade={"persist"})
*/
protected $merchant;


+ 21
- 3
Model/Credit/CreditHistoryModel.php View File

@@ -4,6 +4,7 @@ namespace Lc\CaracoleBundle\Model\Credit;

use Doctrine\ORM\Mapping as ORM;
use Lc\CaracoleBundle\Doctrine\Extension\PayoffTrait;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Order\OrderPaymentInterface;
use Lc\CaracoleBundle\Model\Order\OrderRefundInterface;
use Lc\CaracoleBundle\Doctrine\Extension\PayoffInterface;
@@ -34,17 +35,23 @@ abstract class CreditHistoryModel extends AbstractLightEntity implements PayoffI

/**
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserMerchantInterface", inversedBy="creditHistories")
* @ORM\JoinColumn(nullable=false)
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
*/
protected $userMerchant;

/**
* @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderPaymentInterface", cascade={"persist", "remove"})
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface")
* @ORM\JoinColumn(nullable=false)
*/
protected $merchant;

/**
* @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderPaymentInterface", cascade={"persist"})
*/
protected $orderPayment;

/**
* @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderRefundInterface", cascade={"persist", "remove"})
* @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderRefundInterface", cascade={"persist"})
*/
protected $orderRefund;

@@ -89,6 +96,17 @@ abstract class CreditHistoryModel extends AbstractLightEntity implements PayoffI

return $this;
}
public function getMerchant(): MerchantInterface
{
return $this->merchant;
}

public function setMerchant(MerchantInterface $merchant): self
{
$this->merchant = $merchant;

return $this;
}

public function getOrderPayment(): ?OrderPaymentInterface
{

+ 2
- 2
Model/File/DocumentModel.php View File

@@ -51,7 +51,7 @@ abstract class DocumentModel extends AbstractFullEntity implements FilterMerchan

/**
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Address\AddressInterface")
* @ORM\JoinColumn(nullable=true)
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
*/
protected $buyerAddress;

@@ -82,7 +82,7 @@ abstract class DocumentModel extends AbstractFullEntity implements FilterMerchan
protected $orderShops;

/**
* @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderRefundInterface", mappedBy="document", cascade={"persist", "remove"})
* @ORM\OneToOne(targetEntity="Lc\CaracoleBundle\Model\Order\OrderRefundInterface", mappedBy="document", cascade={"persist"})
*/
protected $orderRefund;


+ 3
- 0
Model/Order/OrderShopModel.php View File

@@ -25,6 +25,7 @@ abstract class OrderShopModel extends AbstractLightEntity implements FilterSecti

/**
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface", inversedBy="orderShops", fetch="EAGER")
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
*/
protected $user;

@@ -35,6 +36,7 @@ abstract class OrderShopModel extends AbstractLightEntity implements FilterSecti

/**
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Address\AddressInterface")
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
*/
protected $invoiceAddress;

@@ -132,6 +134,7 @@ abstract class OrderShopModel extends AbstractLightEntity implements FilterSecti
protected $idValidOrder;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Address\Address")
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
*/
protected $deliveryAddress;


+ 1
- 0
Model/Reduction/ReductionCreditModel.php View File

@@ -56,6 +56,7 @@ abstract class ReductionCreditModel extends AbstractLightEntity implements Reduc

/**
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface")
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
*/
protected $owner;


+ 1
- 1
Model/Section/SectionModel.php View File

@@ -68,7 +68,7 @@ abstract class SectionModel extends AbstractFullEntity implements FilterMerchant
protected $productCategories;

/**
* @ORM\OneToMany(targetEntity="Lc\SovBundle\Model\Site\NewsInterface", mappedBy="section", orphanRemoval=true)
* @ORM\OneToMany(targetEntity="Lc\SovBundle\Model\Site\NewsInterface", mappedBy="section")
*/
protected $news;


+ 1
- 1
Model/User/UserMerchantModel.php View File

@@ -45,7 +45,7 @@ abstract class UserMerchantModel implements FilterMerchantInterface, EntityInter
protected $creditActive = false;

/**
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Credit\CreditHistoryInterface", mappedBy="userMerchant", orphanRemoval=true)
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Credit\CreditHistoryInterface", mappedBy="userMerchant")
*/
protected $creditHistories;


+ 1
- 1
Model/User/UserModel.php View File

@@ -35,7 +35,7 @@ abstract class UserModel extends SovUserModel
protected $favoriteMerchant;

/**
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Address\AddressInterface", mappedBy="user", cascade={"persist"})
* @ORM\OneToMany(targetEntity="Lc\CaracoleBundle\Model\Address\AddressInterface", mappedBy="user", cascade={"persist", "remove"})
*/
protected $addresses;


+ 8
- 0
Repository/Reduction/ReductionCartRepositoryQuery.php View File

@@ -4,6 +4,7 @@ namespace Lc\CaracoleBundle\Repository\Reduction;

use Knp\Component\Pager\PaginatorInterface;
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait;
use Lc\SovBundle\Model\User\UserInterface;
use Lc\SovBundle\Repository\AbstractRepositoryQuery;

class ReductionCartRepositoryQuery extends AbstractRepositoryQuery
@@ -21,4 +22,11 @@ class ReductionCartRepositoryQuery extends AbstractRepositoryQuery
->andWhere('.codes LIKE :code')
->setParameter('code', '%'.$code.'%') ;
}

public function filterByUser(UserInterface $user)
{
return $this
->andWhere(':user MEMBER OF .users')
->setParameter('user', $user);
}
}

+ 15
- 4
Repository/Reduction/ReductionCartStore.php View File

@@ -6,6 +6,7 @@ use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
use Lc\CaracoleBundle\Solver\Price\PriceSolver;
use Lc\CaracoleBundle\Solver\Reduction\ReductionCartSolver;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Model\User\UserInterface;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class ReductionCartStore extends AbstractStore
@@ -17,10 +18,11 @@ class ReductionCartStore extends AbstractStore
protected PriceSolver $priceSolver;

public function __construct(
ReductionCartRepositoryQuery $query,
ReductionCartSolver $reductionCartSolver,
PriceSolver $priceSolver
) {
ReductionCartRepositoryQuery $query,
ReductionCartSolver $reductionCartSolver,
PriceSolver $priceSolver
)
{
$this->query = $query;
$this->reductionCartSolver = $reductionCartSolver;
$this->priceSolver = $priceSolver;
@@ -60,4 +62,13 @@ class ReductionCartStore extends AbstractStore
}
return $findReductionCart;
}

//Toutes les reductionCart d'un utilisateur inter/merchant
public function getByUserOutOfContext(UserInterface $user, $query = null)
{
$query = $this->createQuery($query);
$query->filterIsOnlineAndOffline();
$query->filterByUser($user);
return $query->find();
}
}

+ 8
- 0
Repository/Reduction/ReductionCatalogRepositoryQuery.php View File

@@ -114,6 +114,14 @@ class ReductionCatalogRepositoryQuery extends AbstractRepositoryQuery
}
}

public function filterByUser(UserInterface $user = null)
{
return $this
->andWhere(':user MEMBER OF .users')
->setParameter('user', $user);

}

public function filterConditionGroupUser(UserInterface $user = null)
{
$this->joinGroupUsers();

+ 11
- 0
Repository/Reduction/ReductionCatalogStore.php View File

@@ -5,6 +5,7 @@ namespace Lc\CaracoleBundle\Repository\Reduction;
use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface;
use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Model\User\UserInterface;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class ReductionCatalogStore extends AbstractStore
@@ -42,4 +43,14 @@ class ReductionCatalogStore extends AbstractStore
$query->filterProductFamily($productFamily);
return $query->findOne();
}


//Toutes les reductionCatalog d'un utilisateur inter/merchant
public function getByUserOutOfContext(UserInterface $user, $query = null)
{
$query = $this->createQuery($query);
$query->filterIsOnlineAndOffline();
$query->filterByUser($user);
return $query->find();
}
}

+ 21
- 0
Repository/Reduction/ReductionCreditStore.php View File

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Repository\Reduction;

use Lc\CaracoleBundle\Model\Reduction\ReductionCreditModel;
use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
use Lc\CaracoleBundle\Repository\SectionStoreTrait;
use Lc\SovBundle\Model\User\UserInterface;
@@ -83,4 +84,24 @@ class ReductionCreditStore extends AbstractStore
return $query->find();
}

//Toutes les reductionGift d'un utilisateur inter/merchant
public function getReductionGiftByUserOutOfContext(UserInterface $user, $query = null)
{
$query = $this->createQuery($query);
$query->filterIsOnlineAndOffline();
$query->filterByUser($user);
$query->filterByType(ReductionCreditModel::TYPE_GIFT);
return $query->find();
}

//Toutes les reductionCredit d'un utilisateur inter/merchant
public function getReductionCreditByUserOutOfContext(UserInterface $user, $query = null)
{
$query = $this->createQuery($query);
$query->filterIsOnlineAndOffline();
$query->filterByUser($user);
$query->filterByType(ReductionCreditModel::TYPE_CREDIT);
return $query->find();
}

}

+ 8
- 1
Repository/User/UserMerchantStore.php View File

@@ -52,5 +52,12 @@ class UserMerchantStore extends AbstractStore
$userMerchant = $this->getOneByUser($user, $query);
return $this->userMerchantSolver->isCreditActive($userMerchant);
}

public function getByUserOutOfContext(UserInterface $user, $query = null): ?array
{
$query = $this->createQuery($query);
$query->filterByUser($user);
return $query->find();

}
}

+ 11
- 1
Resources/translations/admin.fr.yaml View File

@@ -76,7 +76,8 @@ entity:
boxes:
visitor: Visiteur
user: Utilisateur

UserPointSale:
label_plurial: Liens avec une ambassade
PointSale:
label: Point de vente
label_plurial: Points de vente
@@ -95,6 +96,7 @@ entity:
orderAmountMin: Montant minimum de commande

Address:
label_plurial: Adresses
fields:
type: Type
typeOptions:
@@ -147,6 +149,14 @@ entity:
countOrder: Commandes
totalSpent: Ventes
lastLogin: Dernière connexion
flashes:
error:
deleteHasCredit: "L'utilisateur possède du crédit sur <strong>%merchant%</strong>, débiter son compte pour pouvoir le supprimer"
deleteHasReductionCatalog: "L'utilisateur possède une réduction catalogue sur %merchant%, supprimer ou modifier cette réduction pour pouvoir le supprimer<br /> <strong>Réduction catalogue : #%id% sur %merchant%</strong>"
deleteHasReductionCart: "L'utilisateur possède une réduction panier sur %merchant%, supprimer ou modifier cette réduction pour pouvoir le supprimer<br /> <strong>Réduction panier : #%id% sur %merchant%</strong>"
deleteHasReductionCredit: "L'utilisateur possède un avoir sur %merchant%, il ne sera pas supprimé mais non attribué<br /> <strong>Avoir : #%id% sur %merchant%</strong>"
deleteHasReductionGift: "L'utilisateur possède un bon cadeau sur %merchant%, il ne sera pas supprimé mais non attribué<br /> <strong>Bon cadeau : #%id% sur %merchant%</strong>"
deleteEntityCascade: "%count% %entity% liés à l'utilisateur seront supprimés"
CreditHistory:
label: Historique de compte prépayé
label_plurial: Historiques de compte prépayé

Loading…
Cancel
Save