Explorar el Código

Merge branch 'develop'

master
Guillaume hace 2 años
padre
commit
1ec5949048
Se han modificado 91 ficheros con 641 adiciones y 170 borrados
  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. +7
    -2
      Controller/AbstractAdminController.php
  36. +3
    -37
      Controller/ControllerTrait.php
  37. +66
    -4
      Controller/User/UserAdminController.php
  38. +84
    -0
      Definition/ApplicationDefinition.php
  39. +5
    -1
      Definition/Field/Site/NewsFieldDefinition.php
  40. +3
    -3
      Factory/Address/AddressFactory.php
  41. +3
    -2
      Factory/Config/TaxRateFactory.php
  42. +3
    -2
      Factory/Config/UnitFactory.php
  43. +4
    -3
      Factory/Credit/CreditHistoryFactory.php
  44. +5
    -4
      Factory/Distribution/DistributionFactory.php
  45. +3
    -6
      Factory/File/DocumentFactory.php
  46. +3
    -2
      Factory/Merchant/MerchantFactory.php
  47. +0
    -1
      Factory/Newsletter/NewsletterFactory.php
  48. +3
    -2
      Factory/Order/OrderPaymentFactory.php
  49. +4
    -2
      Factory/Order/OrderProductFactory.php
  50. +3
    -2
      Factory/Order/OrderProductReductionCatalogFactory.php
  51. +3
    -1
      Factory/Order/OrderProductRefundFactory.php
  52. +3
    -2
      Factory/Order/OrderReductionCartFactory.php
  53. +3
    -2
      Factory/Order/OrderReductionCreditFactory.php
  54. +3
    -2
      Factory/Order/OrderRefundFactory.php
  55. +3
    -7
      Factory/Order/OrderShopFactory.php
  56. +4
    -2
      Factory/Order/OrderStatusFactory.php
  57. +3
    -2
      Factory/Order/OrderStatusHistoryFactory.php
  58. +4
    -3
      Factory/PointSale/PointSaleFactory.php
  59. +3
    -2
      Factory/PointSale/PointSaleSectionFactory.php
  60. +3
    -5
      Factory/Product/ProductCategoryFactory.php
  61. +4
    -2
      Factory/Product/ProductFactory.php
  62. +3
    -4
      Factory/Product/ProductFamilyFactory.php
  63. +4
    -6
      Factory/Product/ProductFamilySectionPropertyFactory.php
  64. +3
    -1
      Factory/Product/QualityLabelFactory.php
  65. +3
    -1
      Factory/Reduction/ReductionCartFactory.php
  66. +3
    -1
      Factory/Reduction/ReductionCatalogFactory.php
  67. +3
    -1
      Factory/Reduction/ReductionCreditFactory.php
  68. +4
    -1
      Factory/Section/OpeningFactory.php
  69. +3
    -3
      Factory/Section/SectionFactory.php
  70. +3
    -1
      Factory/Setting/MerchantSettingFactory.php
  71. +3
    -3
      Factory/Setting/SectionSettingFactory.php
  72. +3
    -3
      Factory/User/UserMerchantFactory.php
  73. +3
    -1
      Factory/User/UserPointSaleFactory.php
  74. +3
    -1
      Factory/User/VisitorFactory.php
  75. +3
    -3
      Model/Address/AddressModel.php
  76. +21
    -3
      Model/Credit/CreditHistoryModel.php
  77. +2
    -2
      Model/File/DocumentModel.php
  78. +5
    -0
      Model/Newsletter/NewsletterModel.php
  79. +3
    -0
      Model/Order/OrderShopModel.php
  80. +1
    -0
      Model/Reduction/ReductionCreditModel.php
  81. +1
    -1
      Model/Section/SectionModel.php
  82. +1
    -1
      Model/User/UserMerchantModel.php
  83. +1
    -1
      Model/User/UserModel.php
  84. +3
    -0
      Repository/Newsletter/NewsletterStore.php
  85. +8
    -0
      Repository/Reduction/ReductionCartRepositoryQuery.php
  86. +15
    -4
      Repository/Reduction/ReductionCartStore.php
  87. +8
    -0
      Repository/Reduction/ReductionCatalogRepositoryQuery.php
  88. +11
    -0
      Repository/Reduction/ReductionCatalogStore.php
  89. +21
    -0
      Repository/Reduction/ReductionCreditStore.php
  90. +8
    -1
      Repository/User/UserMerchantStore.php
  91. +11
    -1
      Resources/translations/admin.fr.yaml

+ 6
- 0
Container/Address/AddressContainer.php Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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;
}

}
}

+ 7
- 2
Controller/AbstractAdminController.php Ver fichero

@@ -10,9 +10,11 @@ use EasyCorp\Bundle\EasyAdminBundle\Contracts\Controller\CrudControllerInterface
use EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto;
use EasyCorp\Bundle\EasyAdminBundle\Factory\ControllerFactory;
use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField;
use Lc\CaracoleBundle\Container\Section\SectionContainer;
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface;
use Lc\CaracoleBundle\Doctrine\Extension\FilterSectionInterface;
use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\CaracoleBundle\Resolver\SectionResolver;
use Lc\SovBundle\Controller\AbstractAdminController as SovAbstractAdminController;
use Lc\SovBundle\Definition\ActionDefinition;
use Lc\SovBundle\Doctrine\Extension\StatusInterface;
@@ -38,7 +40,11 @@ abstract class AbstractAdminController extends SovAbstractAdminController
$repositoryQuery->filterIsOnlineAndOffline();
}
if ($this->isInstanceOf(FilterSectionInterface::class)) {
$repositoryQuery->filterBySection($this->getSectionCurrent());
if($this->getSectionCurrent()){
$repositoryQuery->filterBySection($this->getSectionCurrent());
}else{
$repositoryQuery->filterBySection($this->get(SectionContainer::class)->getStore()->getOneDefault());
}
}

if ($this->isInstanceOf(FilterMerchantInterface::class)) {
@@ -62,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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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,
]);
}

}

+ 5
- 1
Definition/Field/Site/NewsFieldDefinition.php Ver fichero

@@ -36,7 +36,11 @@ class NewsFieldDefinition extends SovNewsFieldDefinition
{
$fieldArray = parent::configureFields();

$newsletterArray = $this->newsletterStore->setSection($this->section)->get();
$newsletterArray = $this->newsletterStore
->setSection($this->section)
->setMerchant($this->merchant)
->get();

$fieldArray['newsletter']->setFormTypeOption('choices', $newsletterArray);

return $fieldArray;

+ 3
- 3
Factory/Address/AddressFactory.php Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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;


+ 5
- 0
Model/Newsletter/NewsletterModel.php Ver fichero

@@ -17,6 +17,11 @@ abstract class NewsletterModel extends SovNewsletterModel implements FilterSecti
*/
protected $section;

public function __toString()
{
return $this->getTitle(). ' - '.$this->getSection()->getMerchant()->getTitle();
}

public function getSection(): SectionInterface
{
return $this->section;

+ 3
- 0
Model/Order/OrderShopModel.php Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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;


+ 3
- 0
Repository/Newsletter/NewsletterStore.php Ver fichero

@@ -3,6 +3,7 @@
namespace Lc\CaracoleBundle\Repository\Newsletter;

use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
use Lc\CaracoleBundle\Repository\SectionStoreTrait;
use Lc\CaracoleBundle\Repository\StoreTrait;
use Lc\SovBundle\Repository\Newsletter\NewsletterStore as SovNewsletterStore;
@@ -12,6 +13,7 @@ class NewsletterStore extends SovNewsletterStore
{
use StoreTrait;
use SectionStoreTrait;
use MerchantStoreTrait;

public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
{
@@ -22,6 +24,7 @@ class NewsletterStore extends SovNewsletterStore
public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
{
$this->addFilterBySectionOptionnal($query);
$this->addFilterByMerchantViaSectionOptionnal($query);
$query->filterIsOnlineAndOffline();
return $query;
}

+ 8
- 0
Repository/Reduction/ReductionCartRepositoryQuery.php Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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é

Cargando…
Cancelar
Guardar