Browse Source

Merge branch 'develop'

master
Guillaume 2 years ago
parent
commit
1ec5949048
91 changed files with 641 additions and 170 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. +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 View File



namespace Lc\CaracoleBundle\Container\Address; namespace Lc\CaracoleBundle\Container\Address;


use App\Entity\Address\Address;
use Lc\CaracoleBundle\Builder\Address\AddressBuilder; use Lc\CaracoleBundle\Builder\Address\AddressBuilder;
use Lc\CaracoleBundle\Factory\Address\AddressFactory; use Lc\CaracoleBundle\Factory\Address\AddressFactory;
use Lc\CaracoleBundle\Repository\Address\AddressRepositoryQuery; use Lc\CaracoleBundle\Repository\Address\AddressRepositoryQuery;
$this->builder = $builder; $this->builder = $builder;
} }


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

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

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



namespace Lc\CaracoleBundle\Container\Config; namespace Lc\CaracoleBundle\Container\Config;


use App\Entity\Config\TaxRate;
use Lc\CaracoleBundle\Factory\Config\TaxRateFactory; use Lc\CaracoleBundle\Factory\Config\TaxRateFactory;
use Lc\CaracoleBundle\Repository\Config\TaxRateRepositoryQuery; use Lc\CaracoleBundle\Repository\Config\TaxRateRepositoryQuery;
use Lc\CaracoleBundle\Repository\Config\TaxRateStore; use Lc\CaracoleBundle\Repository\Config\TaxRateStore;
$this->store = $store; $this->store = $store;
} }



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

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

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



namespace Lc\CaracoleBundle\Container\Config; namespace Lc\CaracoleBundle\Container\Config;


use App\Entity\Config\Unit;
use Lc\CaracoleBundle\Factory\Config\UnitFactory; use Lc\CaracoleBundle\Factory\Config\UnitFactory;
use Lc\CaracoleBundle\Repository\Config\UnitRepositoryQuery; use Lc\CaracoleBundle\Repository\Config\UnitRepositoryQuery;
use Lc\CaracoleBundle\Repository\Config\UnitStore; use Lc\CaracoleBundle\Repository\Config\UnitStore;
$this->store = $store; $this->store = $store;
} }



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

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



namespace Lc\CaracoleBundle\Container\Credit; namespace Lc\CaracoleBundle\Container\Credit;


use App\Entity\Credit\CreditHistory;
use Lc\CaracoleBundle\Builder\Credit\CreditHistoryBuilder; use Lc\CaracoleBundle\Builder\Credit\CreditHistoryBuilder;
use Lc\CaracoleBundle\Definition\Field\Credit\CreditHistoryFieldDefinition; use Lc\CaracoleBundle\Definition\Field\Credit\CreditHistoryFieldDefinition;
use Lc\CaracoleBundle\Factory\Credit\CreditHistoryFactory; use Lc\CaracoleBundle\Factory\Credit\CreditHistoryFactory;
$this->fieldDefinition = $fieldDefinition; $this->fieldDefinition = $fieldDefinition;
} }


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

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

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

namespace Lc\CaracoleBundle\Container\Distribution; namespace Lc\CaracoleBundle\Container\Distribution;




use App\Entity\Distribution\Distribution;
use Lc\CaracoleBundle\Builder\Distribution\DistributionBuilder; use Lc\CaracoleBundle\Builder\Distribution\DistributionBuilder;
use Lc\CaracoleBundle\Factory\Distribution\DistributionFactory; use Lc\CaracoleBundle\Factory\Distribution\DistributionFactory;
use Lc\CaracoleBundle\Repository\Distribution\DistributionRepositoryQuery; use Lc\CaracoleBundle\Repository\Distribution\DistributionRepositoryQuery;
$this->builder = $builder; $this->builder = $builder;
} }



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

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



namespace Lc\CaracoleBundle\Container\File; namespace Lc\CaracoleBundle\Container\File;


use App\Entity\File\Document;
use Lc\CaracoleBundle\Factory\File\DocumentFactory; use Lc\CaracoleBundle\Factory\File\DocumentFactory;
use Lc\CaracoleBundle\Generator\DocumentReferenceGenerator; use Lc\CaracoleBundle\Generator\DocumentReferenceGenerator;
use Lc\CaracoleBundle\Repository\File\DocumentRepositoryQuery; use Lc\CaracoleBundle\Repository\File\DocumentRepositoryQuery;
$this->referenceGenerator = $referenceGenerator; $this->referenceGenerator = $referenceGenerator;
} }


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

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

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



namespace Lc\CaracoleBundle\Container\Merchant; namespace Lc\CaracoleBundle\Container\Merchant;


use App\Entity\Merchant\Merchant;
use Lc\CaracoleBundle\Builder\Merchant\MerchantBuilder; use Lc\CaracoleBundle\Builder\Merchant\MerchantBuilder;
use Lc\CaracoleBundle\Factory\Merchant\MerchantFactory; use Lc\CaracoleBundle\Factory\Merchant\MerchantFactory;
use Lc\CaracoleBundle\Repository\Merchant\MerchantRepositoryQuery; use Lc\CaracoleBundle\Repository\Merchant\MerchantRepositoryQuery;
$this->store = $store; $this->store = $store;
} }



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

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

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



namespace Lc\CaracoleBundle\Container\Order; namespace Lc\CaracoleBundle\Container\Order;


use App\Entity\Order\OrderPayment;
use Lc\CaracoleBundle\Factory\Order\OrderPaymentFactory; use Lc\CaracoleBundle\Factory\Order\OrderPaymentFactory;
use Lc\CaracoleBundle\Repository\Order\OrderPaymentRepositoryQuery; use Lc\CaracoleBundle\Repository\Order\OrderPaymentRepositoryQuery;
use Lc\CaracoleBundle\Repository\Order\OrderPaymentStore; use Lc\CaracoleBundle\Repository\Order\OrderPaymentStore;
$this->store = $store; $this->store = $store;
} }


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

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

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



namespace Lc\CaracoleBundle\Container\Order; namespace Lc\CaracoleBundle\Container\Order;


use App\Entity\Order\OrderProduct;
use Lc\CaracoleBundle\Builder\Order\OrderProductBuilder; use Lc\CaracoleBundle\Builder\Order\OrderProductBuilder;
use Lc\CaracoleBundle\Factory\Order\OrderProductFactory; use Lc\CaracoleBundle\Factory\Order\OrderProductFactory;
use Lc\CaracoleBundle\Repository\Order\OrderProductRepositoryQuery; use Lc\CaracoleBundle\Repository\Order\OrderProductRepositoryQuery;
$this->store = $store; $this->store = $store;
} }



public static function getEntityFqcn()
{
return OrderProduct::class;
}
public function getFactory(): OrderProductFactory public function getFactory(): OrderProductFactory
{ {
return $this->factory; return $this->factory;
{ {
return $this->store; return $this->store;
} }
}
}

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



namespace Lc\CaracoleBundle\Container\Order; namespace Lc\CaracoleBundle\Container\Order;


use App\Entity\Order\OrderProductReductionCatalog;
use Lc\CaracoleBundle\Factory\Order\OrderProductReductionCatalogFactory; use Lc\CaracoleBundle\Factory\Order\OrderProductReductionCatalogFactory;
use Lc\CaracoleBundle\Repository\Order\OrderProductReductionCatalogRepositoryQuery; use Lc\CaracoleBundle\Repository\Order\OrderProductReductionCatalogRepositoryQuery;
use Lc\CaracoleBundle\Repository\Order\OrderProductReductionCatalogStore; use Lc\CaracoleBundle\Repository\Order\OrderProductReductionCatalogStore;
$this->store = $store; $this->store = $store;
} }



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

public function getFactory(): OrderProductReductionCatalogFactory public function getFactory(): OrderProductReductionCatalogFactory
{ {
return $this->factory; return $this->factory;
return $this->store; return $this->store;
} }


}
}

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



namespace Lc\CaracoleBundle\Container\Order; namespace Lc\CaracoleBundle\Container\Order;


use App\Entity\Order\OrderProductRefund;
use Lc\CaracoleBundle\Factory\Order\OrderProductRefundFactory; use Lc\CaracoleBundle\Factory\Order\OrderProductRefundFactory;
use Lc\CaracoleBundle\Repository\Order\OrderProductRefundRepositoryQuery; use Lc\CaracoleBundle\Repository\Order\OrderProductRefundRepositoryQuery;
use Lc\CaracoleBundle\Repository\Order\OrderProductRefundStore; use Lc\CaracoleBundle\Repository\Order\OrderProductRefundStore;
$this->store = $store; $this->store = $store;
} }


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

public function getFactory(): OrderProductRefundFactory public function getFactory(): OrderProductRefundFactory
{ {
return $this->factory; return $this->factory;
return $this->store; return $this->store;
} }


}
}

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



namespace Lc\CaracoleBundle\Container\Order; namespace Lc\CaracoleBundle\Container\Order;


use App\Entity\Newsletter\Newsletter;
use App\Entity\Order\OrderReductionCart;
use Lc\CaracoleBundle\Factory\Order\OrderReductionCartFactory; use Lc\CaracoleBundle\Factory\Order\OrderReductionCartFactory;
use Lc\CaracoleBundle\Repository\Order\OrderReductionCartRepositoryQuery; use Lc\CaracoleBundle\Repository\Order\OrderReductionCartRepositoryQuery;
use Lc\CaracoleBundle\Repository\Order\OrderReductionCartStore; use Lc\CaracoleBundle\Repository\Order\OrderReductionCartStore;
$this->store = $store; $this->store = $store;
} }



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

public function getFactory(): OrderReductionCartFactory public function getFactory(): OrderReductionCartFactory
{ {
return $this->factory; return $this->factory;
return $this->store; return $this->store;
} }


}
}

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



namespace Lc\CaracoleBundle\Container\Order; namespace Lc\CaracoleBundle\Container\Order;


use App\Entity\Order\OrderReductionCredit;
use Lc\CaracoleBundle\Factory\Order\OrderReductionCreditFactory; use Lc\CaracoleBundle\Factory\Order\OrderReductionCreditFactory;
use Lc\CaracoleBundle\Repository\Order\OrderReductionCreditRepositoryQuery; use Lc\CaracoleBundle\Repository\Order\OrderReductionCreditRepositoryQuery;
use Lc\CaracoleBundle\Repository\Order\OrderReductionCreditStore; use Lc\CaracoleBundle\Repository\Order\OrderReductionCreditStore;
$this->store = $store; $this->store = $store;
} }



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

public function getFactory(): OrderReductionCreditFactory public function getFactory(): OrderReductionCreditFactory
{ {
return $this->factory; return $this->factory;
return $this->store; return $this->store;
} }


}
}

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



namespace Lc\CaracoleBundle\Container\Order; namespace Lc\CaracoleBundle\Container\Order;


use App\Entity\Order\OrderRefund;
use Lc\CaracoleBundle\Factory\Order\OrderRefundFactory; use Lc\CaracoleBundle\Factory\Order\OrderRefundFactory;
use Lc\CaracoleBundle\Repository\Order\OrderRefundRepositoryQuery; use Lc\CaracoleBundle\Repository\Order\OrderRefundRepositoryQuery;
use Lc\CaracoleBundle\Repository\Order\OrderRefundStore; use Lc\CaracoleBundle\Repository\Order\OrderRefundStore;
$this->store = $store; $this->store = $store;
} }


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

public function getFactory(): OrderRefundFactory public function getFactory(): OrderRefundFactory
{ {
return $this->factory; return $this->factory;
return $this->store; return $this->store;
} }


}
}

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



namespace Lc\CaracoleBundle\Container\Order; namespace Lc\CaracoleBundle\Container\Order;


use App\Entity\Order\OrderShop;
use App\Resolver\OrderShopResolver; use App\Resolver\OrderShopResolver;
use Lc\CaracoleBundle\Builder\Order\OrderShopBuilder; use Lc\CaracoleBundle\Builder\Order\OrderShopBuilder;
use Lc\CaracoleBundle\Definition\Field\Order\OrderShopFieldDefinition; use Lc\CaracoleBundle\Definition\Field\Order\OrderShopFieldDefinition;
$this->fieldDefinition = $fieldDefinition; $this->fieldDefinition = $fieldDefinition;
} }


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

public function getFactory(): OrderShopFactory public function getFactory(): OrderShopFactory
{ {
return $this->factory; return $this->factory;
return $this->fieldDefinition; return $this->fieldDefinition;
} }


}
}

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



namespace Lc\CaracoleBundle\Container\Order; namespace Lc\CaracoleBundle\Container\Order;


use App\Entity\Order\OrderStatus;
use Lc\CaracoleBundle\Factory\Order\OrderStatusFactory; use Lc\CaracoleBundle\Factory\Order\OrderStatusFactory;
use Lc\CaracoleBundle\Repository\Order\OrderStatusRepositoryQuery; use Lc\CaracoleBundle\Repository\Order\OrderStatusRepositoryQuery;
use Lc\CaracoleBundle\Repository\Order\OrderStatusStore; use Lc\CaracoleBundle\Repository\Order\OrderStatusStore;
$this->store = $store; $this->store = $store;
} }


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

public function getFactory(): OrderStatusFactory public function getFactory(): OrderStatusFactory
{ {
return $this->factory; return $this->factory;
return $this->store; return $this->store;
} }


}
}

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



namespace Lc\CaracoleBundle\Container\Order; namespace Lc\CaracoleBundle\Container\Order;


use App\Entity\Order\OrderStatusHistory;
use Lc\CaracoleBundle\Factory\Order\OrderStatusHistoryFactory; use Lc\CaracoleBundle\Factory\Order\OrderStatusHistoryFactory;
use Lc\CaracoleBundle\Repository\Order\OrderStatusHistoryRepositoryQuery; use Lc\CaracoleBundle\Repository\Order\OrderStatusHistoryRepositoryQuery;
use Lc\CaracoleBundle\Repository\Order\OrderStatusHistoryStore; use Lc\CaracoleBundle\Repository\Order\OrderStatusHistoryStore;
$this->store = $store; $this->store = $store;
} }


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

public function getFactory(): OrderStatusHistoryFactory public function getFactory(): OrderStatusHistoryFactory
{ {
return $this->factory; return $this->factory;
return $this->store; return $this->store;
} }


}
}

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



namespace Lc\CaracoleBundle\Container\PointSale; namespace Lc\CaracoleBundle\Container\PointSale;


use App\Entity\PointSale\PointSale;
use Lc\CaracoleBundle\Definition\Field\PointSale\PointSaleFieldDefinition; use Lc\CaracoleBundle\Definition\Field\PointSale\PointSaleFieldDefinition;
use Lc\CaracoleBundle\Factory\PointSale\PointSaleFactory; use Lc\CaracoleBundle\Factory\PointSale\PointSaleFactory;
use Lc\CaracoleBundle\Repository\PointSale\PointSaleRepositoryQuery; use Lc\CaracoleBundle\Repository\PointSale\PointSaleRepositoryQuery;
$this->store = $store; $this->store = $store;
} }


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


return $this->store; return $this->store;
} }
}
}

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



namespace Lc\CaracoleBundle\Container\PointSale; namespace Lc\CaracoleBundle\Container\PointSale;


use App\Entity\PointSale\PointSaleSection;
use Lc\CaracoleBundle\Builder\PointSale\PointSaleSectionBuilder; use Lc\CaracoleBundle\Builder\PointSale\PointSaleSectionBuilder;
use Lc\CaracoleBundle\Factory\PointSale\PointSaleSectionFactory; use Lc\CaracoleBundle\Factory\PointSale\PointSaleSectionFactory;
use Lc\CaracoleBundle\Repository\PointSale\PointSaleSectionRepositoryQuery; use Lc\CaracoleBundle\Repository\PointSale\PointSaleSectionRepositoryQuery;
$this->builder = $builder; $this->builder = $builder;
} }



public static function getEntityFqcn()
{
return PointSaleSection::class;
}
public function getFactory(): PointSaleSectionFactory public function getFactory(): PointSaleSectionFactory
{ {
return $this->factory; return $this->factory;
{ {
return $this->builder; return $this->builder;
} }
}
}

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



namespace Lc\CaracoleBundle\Container\Product; namespace Lc\CaracoleBundle\Container\Product;


use App\Entity\Product\ProductCategory;
use Lc\CaracoleBundle\Builder\Product\ProductCategoryBuilder; use Lc\CaracoleBundle\Builder\Product\ProductCategoryBuilder;
use Lc\CaracoleBundle\Definition\Field\Product\ProductCategoryFieldDefinition; use Lc\CaracoleBundle\Definition\Field\Product\ProductCategoryFieldDefinition;
use Lc\CaracoleBundle\Factory\Product\ProductCategoryFactory; use Lc\CaracoleBundle\Factory\Product\ProductCategoryFactory;
$this->fieldDefinition = $fieldDefinition; $this->fieldDefinition = $fieldDefinition;
} }


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

public function getFactory(): ProductCategoryFactory public function getFactory(): ProductCategoryFactory
{ {
return $this->factory; return $this->factory;
return $this->fieldDefinition; return $this->fieldDefinition;
} }


}
}

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



namespace Lc\CaracoleBundle\Container\Product; namespace Lc\CaracoleBundle\Container\Product;


use App\Entity\Product\Product;
use Lc\CaracoleBundle\Factory\Product\ProductFactory; use Lc\CaracoleBundle\Factory\Product\ProductFactory;
use Lc\CaracoleBundle\Repository\Product\ProductRepositoryQuery; use Lc\CaracoleBundle\Repository\Product\ProductRepositoryQuery;
use Lc\CaracoleBundle\Repository\Product\ProductStore; use Lc\CaracoleBundle\Repository\Product\ProductStore;
$this->store = $store; $this->store = $store;
} }



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

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






}
}

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

namespace Lc\CaracoleBundle\Container\Product; namespace Lc\CaracoleBundle\Container\Product;


use App\Definition\Field\Product\ProductFamilyFieldDefinition; use App\Definition\Field\Product\ProductFamilyFieldDefinition;
use App\Entity\Product\ProductFamily;
use Lc\CaracoleBundle\Builder\Product\ProductFamilyBuilder; use Lc\CaracoleBundle\Builder\Product\ProductFamilyBuilder;
use Lc\CaracoleBundle\Factory\Product\ProductFamilyFactory; use Lc\CaracoleBundle\Factory\Product\ProductFamilyFactory;
use Lc\CaracoleBundle\Repository\Product\ProductFamilyRepositoryQuery; use Lc\CaracoleBundle\Repository\Product\ProductFamilyRepositoryQuery;
$this->fieldDefinition = $fieldDefinition; $this->fieldDefinition = $fieldDefinition;
} }


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

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

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

namespace Lc\CaracoleBundle\Container\Product; namespace Lc\CaracoleBundle\Container\Product;


use App\Definition\Field\Product\ProductFamilyFieldDefinition; use App\Definition\Field\Product\ProductFamilyFieldDefinition;
use App\Entity\Product\ProductFamilySectionProperty;
use Lc\CaracoleBundle\Builder\Product\ProductFamilyBuilder; use Lc\CaracoleBundle\Builder\Product\ProductFamilyBuilder;
use Lc\CaracoleBundle\Builder\Product\ProductFamilySectionPropertyBuilder; use Lc\CaracoleBundle\Builder\Product\ProductFamilySectionPropertyBuilder;
use Lc\CaracoleBundle\Factory\Product\ProductFamilyFactory; use Lc\CaracoleBundle\Factory\Product\ProductFamilyFactory;
$this->builder = $builder; $this->builder = $builder;
} }


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

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

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

namespace Lc\CaracoleBundle\Container\Product; namespace Lc\CaracoleBundle\Container\Product;


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


$this->store = $store; $this->store = $store;
} }



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

public function getFactory(): QualityLabelFactory public function getFactory(): QualityLabelFactory
{ {
return $this->factory; return $this->factory;
return $this->store; return $this->store;
} }


}
}

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



namespace Lc\CaracoleBundle\Container\Reduction; namespace Lc\CaracoleBundle\Container\Reduction;


use App\Entity\Reduction\ReductionCart;
use Lc\CaracoleBundle\Definition\Field\Reduction\ReductionCartFieldDefinition; use Lc\CaracoleBundle\Definition\Field\Reduction\ReductionCartFieldDefinition;
use Lc\CaracoleBundle\Factory\Reduction\ReductionCartFactory; use Lc\CaracoleBundle\Factory\Reduction\ReductionCartFactory;
use Lc\CaracoleBundle\Repository\Reduction\ReductionCartRepositoryQuery; use Lc\CaracoleBundle\Repository\Reduction\ReductionCartRepositoryQuery;
$this->fieldDefinition = $fieldDefinition; $this->fieldDefinition = $fieldDefinition;
} }



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

public function getFactory(): ReductionCartFactory public function getFactory(): ReductionCartFactory
{ {
return $this->factory; return $this->factory;
{ {
return $this->fieldDefinition; return $this->fieldDefinition;
} }
}
}

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



namespace Lc\CaracoleBundle\Container\Reduction; namespace Lc\CaracoleBundle\Container\Reduction;


use App\Entity\Reduction\ReductionCatalog;
use Lc\CaracoleBundle\Definition\Field\Reduction\ReductionCatalogFieldDefinition; use Lc\CaracoleBundle\Definition\Field\Reduction\ReductionCatalogFieldDefinition;
use Lc\CaracoleBundle\Factory\Reduction\ReductionCatalogFactory; use Lc\CaracoleBundle\Factory\Reduction\ReductionCatalogFactory;
use Lc\CaracoleBundle\Repository\Reduction\ReductionCatalogRepositoryQuery; use Lc\CaracoleBundle\Repository\Reduction\ReductionCatalogRepositoryQuery;
$this->fieldDefinition = $fieldDefinition; $this->fieldDefinition = $fieldDefinition;
} }



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

public function getFactory(): ReductionCatalogFactory public function getFactory(): ReductionCatalogFactory
{ {
return $this->factory; return $this->factory;
return $this->fieldDefinition; return $this->fieldDefinition;
} }


}
}

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

namespace Lc\CaracoleBundle\Container\Reduction; namespace Lc\CaracoleBundle\Container\Reduction;


use App\Definition\Field\Reduction\ReductionCreditFieldDefinition; use App\Definition\Field\Reduction\ReductionCreditFieldDefinition;
use App\Entity\Reduction\ReductionCredit;
use Lc\CaracoleBundle\Factory\Reduction\ReductionCreditFactory; use Lc\CaracoleBundle\Factory\Reduction\ReductionCreditFactory;
use Lc\CaracoleBundle\Repository\Reduction\ReductionCreditRepositoryQuery; use Lc\CaracoleBundle\Repository\Reduction\ReductionCreditRepositoryQuery;
use Lc\CaracoleBundle\Repository\Reduction\ReductionCreditStore; use Lc\CaracoleBundle\Repository\Reduction\ReductionCreditStore;
$this->fieldDefinition = $fieldDefinition; $this->fieldDefinition = $fieldDefinition;
} }



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

public function getFactory(): ReductionCreditFactory public function getFactory(): ReductionCreditFactory
{ {
return $this->factory; return $this->factory;
return $this->fieldDefinition; return $this->fieldDefinition;
} }


}
}

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



namespace Lc\CaracoleBundle\Container\Section; namespace Lc\CaracoleBundle\Container\Section;


use App\Entity\Section\Opening;
use Lc\CaracoleBundle\Factory\Section\OpeningFactory; use Lc\CaracoleBundle\Factory\Section\OpeningFactory;
use Lc\CaracoleBundle\Repository\Section\OpeningRepositoryQuery; use Lc\CaracoleBundle\Repository\Section\OpeningRepositoryQuery;
use Lc\CaracoleBundle\Repository\Section\OpeningStore; use Lc\CaracoleBundle\Repository\Section\OpeningStore;
$this->store = $store; $this->store = $store;
} }



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

public function getFactory(): OpeningFactory public function getFactory(): OpeningFactory
{ {
return $this->factory; return $this->factory;
return $this->store; return $this->store;
} }


}
}

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



namespace Lc\CaracoleBundle\Container\Section; namespace Lc\CaracoleBundle\Container\Section;


use App\Entity\Section\Section;
use Lc\CaracoleBundle\Factory\Section\SectionFactory; use Lc\CaracoleBundle\Factory\Section\SectionFactory;
use Lc\CaracoleBundle\Repository\Section\SectionRepositoryQuery; use Lc\CaracoleBundle\Repository\Section\SectionRepositoryQuery;
use Lc\CaracoleBundle\Repository\Section\SectionStore; use Lc\CaracoleBundle\Repository\Section\SectionStore;
$this->store = $store; $this->store = $store;
} }



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

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


return $this->store; return $this->store;
} }
}
}

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



namespace Lc\CaracoleBundle\Container\Setting; namespace Lc\CaracoleBundle\Container\Setting;


use App\Entity\Setting\MerchantSetting;
use Lc\CaracoleBundle\Definition\MerchantSettingDefinition; use Lc\CaracoleBundle\Definition\MerchantSettingDefinition;
use Lc\CaracoleBundle\Factory\Setting\MerchantSettingFactory; use Lc\CaracoleBundle\Factory\Setting\MerchantSettingFactory;
use Lc\CaracoleBundle\Repository\Setting\MerchantSettingRepositoryQuery; use Lc\CaracoleBundle\Repository\Setting\MerchantSettingRepositoryQuery;
$this->settingSolver = $settingSolver; $this->settingSolver = $settingSolver;
} }



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

public function getFactory(): MerchantSettingFactory public function getFactory(): MerchantSettingFactory
{ {
return $this->factory; return $this->factory;
return $this->settingSolver; return $this->settingSolver;
} }


}
}

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



namespace Lc\CaracoleBundle\Container\Setting; namespace Lc\CaracoleBundle\Container\Setting;


use App\Entity\Setting\SectionSetting;
use Lc\CaracoleBundle\Definition\SectionSettingDefinition; use Lc\CaracoleBundle\Definition\SectionSettingDefinition;
use Lc\CaracoleBundle\Factory\Setting\SectionSettingFactory; use Lc\CaracoleBundle\Factory\Setting\SectionSettingFactory;
use Lc\CaracoleBundle\Repository\Setting\SectionSettingRepositoryQuery; use Lc\CaracoleBundle\Repository\Setting\SectionSettingRepositoryQuery;
$this->settingSolver = $settingSolver; $this->settingSolver = $settingSolver;
} }



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

public function getFactory(): SectionSettingFactory public function getFactory(): SectionSettingFactory
{ {
return $this->factory; return $this->factory;
return $this->settingSolver; return $this->settingSolver;
} }


}
}

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



namespace Lc\CaracoleBundle\Container\User; namespace Lc\CaracoleBundle\Container\User;


use App\Entity\User\UserMerchant;
use Lc\CaracoleBundle\Builder\User\UserMerchantBuilder; use Lc\CaracoleBundle\Builder\User\UserMerchantBuilder;
use Lc\CaracoleBundle\Definition\Field\User\UserMerchantFieldDefinition; use Lc\CaracoleBundle\Definition\Field\User\UserMerchantFieldDefinition;
use Lc\CaracoleBundle\Factory\User\UserMerchantFactory; use Lc\CaracoleBundle\Factory\User\UserMerchantFactory;
$this->fieldDefinition = $fieldDefinition; $this->fieldDefinition = $fieldDefinition;
} }


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

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

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



namespace Lc\CaracoleBundle\Container\User; namespace Lc\CaracoleBundle\Container\User;


use App\Entity\User\UserPointSale;
use Lc\CaracoleBundle\Factory\User\UserPointSaleFactory; use Lc\CaracoleBundle\Factory\User\UserPointSaleFactory;
use Lc\CaracoleBundle\Repository\User\UserPointSaleRepositoryQuery; use Lc\CaracoleBundle\Repository\User\UserPointSaleRepositoryQuery;
use Lc\CaracoleBundle\Repository\User\UserPointSaleStore; use Lc\CaracoleBundle\Repository\User\UserPointSaleStore;
$this->store = $store; $this->store = $store;
} }


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

public function getFactory(): UserPointSaleFactory public function getFactory(): UserPointSaleFactory
{ {
return $this->factory; return $this->factory;
return $this->store; return $this->store;
} }


}
}

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



namespace Lc\CaracoleBundle\Container\User; namespace Lc\CaracoleBundle\Container\User;


use App\Entity\User\Visitor;
use Lc\CaracoleBundle\Builder\User\VisitorBuilder; use Lc\CaracoleBundle\Builder\User\VisitorBuilder;
use Lc\CaracoleBundle\Factory\User\VisitorFactory; use Lc\CaracoleBundle\Factory\User\VisitorFactory;
use Lc\CaracoleBundle\Repository\User\VisitorRepositoryQuery; use Lc\CaracoleBundle\Repository\User\VisitorRepositoryQuery;
$this->builder = $builder; $this->builder = $builder;
} }



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

public function getFactory(): VisitorFactory public function getFactory(): VisitorFactory
{ {
return $this->factory; return $this->factory;
return $this->builder; return $this->builder;
} }


}
}

+ 7
- 2
Controller/AbstractAdminController.php View File

use EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto; use EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto;
use EasyCorp\Bundle\EasyAdminBundle\Factory\ControllerFactory; use EasyCorp\Bundle\EasyAdminBundle\Factory\ControllerFactory;
use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField; use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField;
use Lc\CaracoleBundle\Container\Section\SectionContainer;
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface; use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface;
use Lc\CaracoleBundle\Doctrine\Extension\FilterSectionInterface; use Lc\CaracoleBundle\Doctrine\Extension\FilterSectionInterface;
use Lc\CaracoleBundle\Model\Section\SectionInterface; use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\CaracoleBundle\Resolver\SectionResolver;
use Lc\SovBundle\Controller\AbstractAdminController as SovAbstractAdminController; use Lc\SovBundle\Controller\AbstractAdminController as SovAbstractAdminController;
use Lc\SovBundle\Definition\ActionDefinition; use Lc\SovBundle\Definition\ActionDefinition;
use Lc\SovBundle\Doctrine\Extension\StatusInterface; use Lc\SovBundle\Doctrine\Extension\StatusInterface;
$repositoryQuery->filterIsOnlineAndOffline(); $repositoryQuery->filterIsOnlineAndOffline();
} }
if ($this->isInstanceOf(FilterSectionInterface::class)) { 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)) { if ($this->isInstanceOf(FilterMerchantInterface::class)) {
$filteredValue = ['value' => $context->getRequest()->query->get('q')]; $filteredValue = ['value' => $context->getRequest()->query->get('q')];
$filterManager->applyFilter($repositoryQuery, $field, $filteredValue); $filterManager->applyFilter($repositoryQuery, $field, $filteredValue);
$repositoryQuery->select('.' . $autocompleteContext['propertyName']); $repositoryQuery->select('.' . $autocompleteContext['propertyName']);
//dump($repositoryQuery->getQueryBuilder()->getQuery()->getDQL());


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

+ 3
- 37
Controller/ControllerTrait.php View File

use Lc\CaracoleBundle\Container\Config\TaxRateContainer; use Lc\CaracoleBundle\Container\Config\TaxRateContainer;
use Lc\CaracoleBundle\Container\Config\UnitContainer; use Lc\CaracoleBundle\Container\Config\UnitContainer;
use Lc\CaracoleBundle\Container\Credit\CreditHistoryContainer; use Lc\CaracoleBundle\Container\Credit\CreditHistoryContainer;
use Lc\CaracoleBundle\Container\Distribution\DistributionContainer;
use Lc\CaracoleBundle\Container\File\DocumentContainer; use Lc\CaracoleBundle\Container\File\DocumentContainer;
use Lc\CaracoleBundle\Container\Merchant\MerchantContainer; use Lc\CaracoleBundle\Container\Merchant\MerchantContainer;
use Lc\CaracoleBundle\Container\Order\OrderPaymentContainer; use Lc\CaracoleBundle\Container\Order\OrderPaymentContainer;
use Lc\CaracoleBundle\Container\Product\ProductCategoryContainer; use Lc\CaracoleBundle\Container\Product\ProductCategoryContainer;
use Lc\CaracoleBundle\Container\Product\ProductContainer; use Lc\CaracoleBundle\Container\Product\ProductContainer;
use Lc\CaracoleBundle\Container\Product\ProductFamilyContainer; use Lc\CaracoleBundle\Container\Product\ProductFamilyContainer;
use Lc\CaracoleBundle\Container\Product\ProductFamilySectionPropertyContainer;
use Lc\CaracoleBundle\Container\Product\QualityLabelContainer; use Lc\CaracoleBundle\Container\Product\QualityLabelContainer;
use Lc\CaracoleBundle\Container\Reduction\ReductionCartContainer; use Lc\CaracoleBundle\Container\Reduction\ReductionCartContainer;
use Lc\CaracoleBundle\Container\Reduction\ReductionCatalogContainer; use Lc\CaracoleBundle\Container\Reduction\ReductionCatalogContainer;
use Lc\CaracoleBundle\Container\User\UserMerchantContainer; use Lc\CaracoleBundle\Container\User\UserMerchantContainer;
use Lc\CaracoleBundle\Container\User\UserPointSaleContainer; use Lc\CaracoleBundle\Container\User\UserPointSaleContainer;
use Lc\CaracoleBundle\Container\User\VisitorContainer; use Lc\CaracoleBundle\Container\User\VisitorContainer;
use Lc\CaracoleBundle\Definition\ApplicationDefinition;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Order\OrderShopInterface; use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
use Lc\CaracoleBundle\Model\Section\SectionInterface; use Lc\CaracoleBundle\Model\Section\SectionInterface;
{ {
return array_merge( return array_merge(
parent::getSubscribedServices(), parent::getSubscribedServices(),
ApplicationDefinition::getSubscribedContainerServices(),
[ [
MailMailjetNotification::class => MailMailjetNotification::class, MailMailjetNotification::class => MailMailjetNotification::class,
PriceSolver::class => PriceSolver::class, PriceSolver::class => PriceSolver::class,
MerchantResolver::class => MerchantResolver::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

use Lc\SovBundle\Container\User\UserContainer; use Lc\SovBundle\Container\User\UserContainer;
use Lc\SovBundle\Controller\User\UserAdminController as SovUserAdminController; use Lc\SovBundle\Controller\User\UserAdminController as SovUserAdminController;
use Lc\SovBundle\Definition\ActionDefinition; use Lc\SovBundle\Definition\ActionDefinition;
use Lc\SovBundle\Model\User\UserInterface;
use Lc\SovBundle\Repository\RepositoryQueryInterface; use Lc\SovBundle\Repository\RepositoryQueryInterface;


abstract class UserAdminController extends SovUserAdminController abstract class UserAdminController extends SovUserAdminController


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


public function createEntity(string $entityFqcn) public function createEntity(string $entityFqcn)
public function overrideEntitiesActions(?EntityCollection $entities, string $pageName): void public function overrideEntitiesActions(?EntityCollection $entities, string $pageName): void
{ {
foreach ($entities as $entity) { 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(); $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); $action->setLinkUrl($url);
} }
} }
} }




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

<?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 View File

{ {
$fieldArray = parent::configureFields(); $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); $fieldArray['newsletter']->setFormTypeOption('choices', $newsletterArray);


return $fieldArray; return $fieldArray;

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



namespace Lc\CaracoleBundle\Factory\Address; 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\Address\AddressInterface;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\SovBundle\Factory\AbstractFactory; use Lc\SovBundle\Factory\AbstractFactory;


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


$address->setMerchant($merchant); $address->setMerchant($merchant);



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



namespace Lc\CaracoleBundle\Factory\Config; namespace Lc\CaracoleBundle\Factory\Config;


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


{ {
public function create(): TaxRateInterface public function create(): TaxRateInterface
{ {
$taxRate = new TaxRate();
$class = TaxRateContainer::getEntityFqcn();
$taxRate = new $class;


return $taxRate; return $taxRate;
} }

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



namespace Lc\CaracoleBundle\Factory\Config; namespace Lc\CaracoleBundle\Factory\Config;


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


{ {
public function create(): UnitInterface public function create(): UnitInterface
{ {
$unit = new Unit();
$class = UnitContainer::getEntityFqcn();
$unit = new $class;


return $unit; return $unit;
} }

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



namespace Lc\CaracoleBundle\Factory\Credit; 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\Credit\CreditHistoryInterface;
use Lc\CaracoleBundle\Model\User\UserMerchantInterface; use Lc\CaracoleBundle\Model\User\UserMerchantInterface;
use Lc\SovBundle\Factory\AbstractFactory; use Lc\SovBundle\Factory\AbstractFactory;
use Lc\SovBundle\Model\User\UserInterface;


class CreditHistoryFactory extends AbstractFactory class CreditHistoryFactory extends AbstractFactory
{ {


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


return $creditHistory; return $creditHistory;
} }

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



namespace Lc\CaracoleBundle\Factory\Distribution; 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; use Lc\SovBundle\Factory\AbstractFactory;


class DistributionFactory extends 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->setCycleNumber($cycleNumber);
$distribution->setCycleType($cycleType); $distribution->setCycleType($cycleType);

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



namespace Lc\CaracoleBundle\Factory\File; 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\File\DocumentInterface;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\SovBundle\Factory\AbstractFactory; use Lc\SovBundle\Factory\AbstractFactory;
use Lc\SovBundle\Model\User\UserInterface;


class DocumentFactory extends AbstractFactory class DocumentFactory extends AbstractFactory
{ {


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


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

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



namespace Lc\CaracoleBundle\Factory\Merchant; namespace Lc\CaracoleBundle\Factory\Merchant;


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


{ {
public function create(): MerchantInterface public function create(): MerchantInterface
{ {
$merchant = new Merchant();
$class = MerchantContainer::getEntityFqcn();
$merchant = new $class;


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



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



namespace Lc\CaracoleBundle\Factory\Newsletter; namespace Lc\CaracoleBundle\Factory\Newsletter;


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

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



namespace Lc\CaracoleBundle\Factory\Order; 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\OrderPaymentInterface;
use Lc\CaracoleBundle\Model\Order\OrderShopInterface; use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
use Lc\SovBundle\Factory\AbstractFactory; use Lc\SovBundle\Factory\AbstractFactory;
} }


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

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



namespace Lc\CaracoleBundle\Factory\Order; 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\Order\OrderProductInterface;
use Lc\CaracoleBundle\Model\Product\ProductInterface; use Lc\CaracoleBundle\Model\Product\ProductInterface;
use Lc\SovBundle\Factory\AbstractFactory; use Lc\SovBundle\Factory\AbstractFactory;
} }


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


} }

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



namespace Lc\CaracoleBundle\Factory\Order; namespace Lc\CaracoleBundle\Factory\Order;


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


{ {
public function create(string $title, float $value, string $unit, string $behaviorTaxRate): OrderProductReductionCatalogInterface 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->setTitle($title);
$orderProductReductionCatalog->setValue($value); $orderProductReductionCatalog->setValue($value);

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

namespace Lc\CaracoleBundle\Factory\Order; namespace Lc\CaracoleBundle\Factory\Order;


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


{ {
public function create(): OrderProductRefundInterface public function create(): OrderProductRefundInterface
{ {
$orderProductRefund = new OrderProductRefund();
$class = OrderProductRefundContainer::getEntityFqcn();
$orderProductRefund = new $class;


return $orderProductRefund; return $orderProductRefund;
} }

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



namespace Lc\CaracoleBundle\Factory\Order; 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\OrderReductionCartInterface;
use Lc\CaracoleBundle\Model\Order\OrderShopInterface; use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionCartInterface; use Lc\CaracoleBundle\Model\Reduction\ReductionCartInterface;
// createOrderReductionCart // createOrderReductionCart
public function create(OrderShopInterface $orderShop, ReductionCartInterface $reductionCart, $code = null): OrderReductionCartInterface public function create(OrderShopInterface $orderShop, ReductionCartInterface $reductionCart, $code = null): OrderReductionCartInterface
{ {
$orderReductionCart = new OrderReductionCart();
$class = OrderReductionCartContainer::getEntityFqcn();
$orderReductionCart = new $class;


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

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



namespace Lc\CaracoleBundle\Factory\Order; 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\OrderReductionCreditInterface;
use Lc\CaracoleBundle\Model\Order\OrderShopInterface; use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface; use Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface;
{ {
public function create(OrderShopInterface $orderShop, ReductionCreditInterface $reductionCredit): OrderReductionCreditInterface public function create(OrderShopInterface $orderShop, ReductionCreditInterface $reductionCredit): OrderReductionCreditInterface
{ {
$orderReductionCredit = new OrderReductionCredit();
$class = OrderReductionCreditContainer::getEntityFqcn();
$orderReductionCredit = new $class;


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

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



namespace Lc\CaracoleBundle\Factory\Order; namespace Lc\CaracoleBundle\Factory\Order;


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


{ {
public function create(): OrderRefundInterface public function create(): OrderRefundInterface
{ {
$orderRefund = new OrderRefund();
$class = OrderRefundContainer::getEntityFqcn();
$orderRefund = new $class;


return $orderRefund; return $orderRefund;
} }

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



namespace Lc\CaracoleBundle\Factory\Order; 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\OrderShopInterface;
use Lc\CaracoleBundle\Model\Order\OrderStatusModel;
use Lc\CaracoleBundle\Model\Section\SectionInterface; use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\CaracoleBundle\Model\User\VisitorInterface; use Lc\CaracoleBundle\Model\User\VisitorInterface;
use Lc\SovBundle\Factory\AbstractFactory; use Lc\SovBundle\Factory\AbstractFactory;
use Lc\SovBundle\Model\User\UserInterface; use Lc\SovBundle\Model\User\UserInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;


class OrderShopFactory extends AbstractFactory class OrderShopFactory extends AbstractFactory
{ {


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

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



namespace Lc\CaracoleBundle\Factory\Order; namespace Lc\CaracoleBundle\Factory\Order;


use App\Entity\Order\OrderStatus;

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


{ {
public function create(): OrderStatusInterface public function create(): OrderStatusInterface
{ {
$orderStatus = new OrderStatus();
$class = OrderStatusContainer::getEntityFqcn();
$orderStatus = new $class;


return $orderStatus; return $orderStatus;
} }

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



namespace Lc\CaracoleBundle\Factory\Order; 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\OrderShopInterface;
use Lc\CaracoleBundle\Model\Order\OrderStatusHistoryInterface; use Lc\CaracoleBundle\Model\Order\OrderStatusHistoryInterface;
use Lc\CaracoleBundle\Model\Order\OrderStatusHistoryModel; use Lc\CaracoleBundle\Model\Order\OrderStatusHistoryModel;
{ {
public function create(OrderShopInterface $orderShop, OrderStatusInterface $status, string $origin = OrderStatusHistoryModel::ORIGIN_USER): OrderStatusHistoryInterface 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->setOrderShop($orderShop);
$orderStatusHistory->setOrderStatus($status); $orderStatusHistory->setOrderStatus($status);

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



namespace Lc\CaracoleBundle\Factory\PointSale; 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\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\PointSale\PointSaleInterface; use Lc\CaracoleBundle\Model\PointSale\PointSaleInterface;
use Lc\SovBundle\Factory\AbstractFactory; use Lc\SovBundle\Factory\AbstractFactory;


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



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

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



namespace Lc\CaracoleBundle\Factory\PointSale; 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\PointSaleInterface;
use Lc\CaracoleBundle\Model\PointSale\PointSaleSectionInterface; use Lc\CaracoleBundle\Model\PointSale\PointSaleSectionInterface;
use Lc\CaracoleBundle\Model\Section\SectionInterface; use Lc\CaracoleBundle\Model\Section\SectionInterface;


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


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

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



namespace Lc\CaracoleBundle\Factory\Product; 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\Product\ProductCategoryInterface;
use Lc\CaracoleBundle\Model\Section\SectionInterface; use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\SovBundle\Factory\AbstractFactory; use Lc\SovBundle\Factory\AbstractFactory;
{ {
public function create(SectionInterface $section): ProductCategoryInterface public function create(SectionInterface $section): ProductCategoryInterface
{ {
$productCategory = new ProductCategory();
$class = ProductCategoryContainer::getEntityFqcn();
$productCategory = new $class;


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

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



namespace Lc\CaracoleBundle\Factory\Product; namespace Lc\CaracoleBundle\Factory\Product;


use App\Entity\Product\Product;

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


{ {
public function create(): ProductInterface public function create(): ProductInterface
{ {
$product = new Product();
$class = ProductContainer::getEntityFqcn();
$product = new $class;


return $product; return $product;
} }

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



namespace Lc\CaracoleBundle\Factory\Product; 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\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface; use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface;
use Lc\CaracoleBundle\Model\Product\ProductFamilyModel; use Lc\CaracoleBundle\Model\Product\ProductFamilyModel;
use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\SovBundle\Factory\AbstractFactory; use Lc\SovBundle\Factory\AbstractFactory;


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


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

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



namespace Lc\CaracoleBundle\Factory\Product; namespace Lc\CaracoleBundle\Factory\Product;


use App\Entity\Product\ProductCategory;
use App\Entity\Product\ProductFamilySectionProperty; 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\Product\ProductFamilyInterface;
use Lc\CaracoleBundle\Model\Section\SectionInterface; use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\SovBundle\Factory\AbstractFactory; use Lc\SovBundle\Factory\AbstractFactory;


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



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

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

namespace Lc\CaracoleBundle\Factory\Product; namespace Lc\CaracoleBundle\Factory\Product;


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


{ {
public function create(): QualityLabelInterface public function create(): QualityLabelInterface
{ {
$qualityLabel = new QualityLabel();
$class = QualityLabelContainer::getEntityFqcn();
$qualityLabel = new $class;
$qualityLabel->setStatus(1); $qualityLabel->setStatus(1);


return $qualityLabel; return $qualityLabel;

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

namespace Lc\CaracoleBundle\Factory\Reduction; namespace Lc\CaracoleBundle\Factory\Reduction;


use App\Entity\Reduction\ReductionCart; use App\Entity\Reduction\ReductionCart;
use Lc\CaracoleBundle\Container\Reduction\ReductionCartContainer;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionCartInterface; use Lc\CaracoleBundle\Model\Reduction\ReductionCartInterface;
use Lc\SovBundle\Factory\AbstractFactory; use Lc\SovBundle\Factory\AbstractFactory;


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


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

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

namespace Lc\CaracoleBundle\Factory\Reduction; namespace Lc\CaracoleBundle\Factory\Reduction;


use App\Entity\Reduction\ReductionCatalog; use App\Entity\Reduction\ReductionCatalog;
use Lc\CaracoleBundle\Container\Reduction\ReductionCatalogContainer;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionCatalogInterface; use Lc\CaracoleBundle\Model\Reduction\ReductionCatalogInterface;
use Lc\SovBundle\Factory\AbstractFactory; use Lc\SovBundle\Factory\AbstractFactory;


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


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

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

namespace Lc\CaracoleBundle\Factory\Reduction; namespace Lc\CaracoleBundle\Factory\Reduction;


use App\Entity\Reduction\ReductionCredit; use App\Entity\Reduction\ReductionCredit;
use Lc\CaracoleBundle\Container\Reduction\ReductionCreditContainer;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface; use Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionCreditModel; use Lc\CaracoleBundle\Model\Reduction\ReductionCreditModel;


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


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

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

namespace Lc\CaracoleBundle\Factory\Section; namespace Lc\CaracoleBundle\Factory\Section;


use App\Entity\Section\Opening; use App\Entity\Section\Opening;
use Lc\CaracoleBundle\Container\Section\OpeningContainer;
use Lc\CaracoleBundle\Context\SectionContextTrait; use Lc\CaracoleBundle\Context\SectionContextTrait;
use Lc\CaracoleBundle\Model\Section\SectionInterface; use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\SovBundle\Factory\AbstractFactory; use Lc\SovBundle\Factory\AbstractFactory;
\DateTime $timeEnd = null, \DateTime $timeEnd = null,
GroupUserInterface $groupUser = null GroupUserInterface $groupUser = null
): Opening { ): Opening {
$opening = new Opening();

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


$opening->setSection($section); $opening->setSection($section);



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



namespace Lc\CaracoleBundle\Factory\Section; 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\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Section\SectionInterface; use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\SovBundle\Factory\AbstractFactory; use Lc\SovBundle\Factory\AbstractFactory;


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


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

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

namespace Lc\CaracoleBundle\Factory\Setting; namespace Lc\CaracoleBundle\Factory\Setting;


use App\Entity\Setting\MerchantSetting; use App\Entity\Setting\MerchantSetting;
use Lc\CaracoleBundle\Container\Setting\MerchantSettingContainer;
use Lc\CaracoleBundle\Context\MerchantContextTrait; use Lc\CaracoleBundle\Context\MerchantContextTrait;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\SovBundle\Factory\AbstractFactory; use Lc\SovBundle\Factory\AbstractFactory;


public function create(MerchantInterface $merchant, string $name, string $text = null, \DateTime $date = null, FileInterface $file = null) 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->setMerchant($merchant);
$merchantSetting->setName($name); $merchantSetting->setName($name);

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



namespace Lc\CaracoleBundle\Factory\Setting; 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\CaracoleBundle\Model\Section\SectionInterface;
use Lc\SovBundle\Factory\AbstractFactory; use Lc\SovBundle\Factory\AbstractFactory;
use Lc\SovBundle\Model\File\FileInterface; use Lc\SovBundle\Model\File\FileInterface;
\DateTime $date = null, \DateTime $date = null,
FileInterface $file = null FileInterface $file = null
) { ) {
$merchantSetting = new SectionSetting();
$class = SectionSettingContainer::getEntityFqcn();
$merchantSetting = new $class;


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

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



namespace Lc\CaracoleBundle\Factory\User; 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\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\User\UserMerchantInterface; use Lc\CaracoleBundle\Model\User\UserMerchantInterface;
use Lc\SovBundle\Factory\AbstractFactory; use Lc\SovBundle\Factory\AbstractFactory;
{ {
public function createBase(MerchantInterface $merchant): UserMerchantInterface public function createBase(MerchantInterface $merchant): UserMerchantInterface
{ {
$userMerchant = new UserMerchant();
$class = UserMerchantContainer::getEntityFqcn();
$userMerchant = new $class;
$userMerchant->setMerchant($merchant); $userMerchant->setMerchant($merchant);


return $userMerchant; return $userMerchant;

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

namespace Lc\CaracoleBundle\Factory\User; namespace Lc\CaracoleBundle\Factory\User;


use App\Entity\User\UserPointSale; use App\Entity\User\UserPointSale;
use Lc\CaracoleBundle\Container\User\UserPointSaleContainer;
use Lc\CaracoleBundle\Model\PointSale\PointSaleInterface; use Lc\CaracoleBundle\Model\PointSale\PointSaleInterface;
use Lc\CaracoleBundle\Model\User\UserPointSaleInterface; use Lc\CaracoleBundle\Model\User\UserPointSaleInterface;
use Lc\SovBundle\Factory\AbstractFactory; use Lc\SovBundle\Factory\AbstractFactory;
{ {
public function create(UserInterface $user, PointSaleInterface $pointSale): UserPointSaleInterface public function create(UserInterface $user, PointSaleInterface $pointSale): UserPointSaleInterface
{ {
$userPointSale = new UserPointSale();
$class = UserPointSaleContainer::getEntityFqcn();
$userPointSale = new $class;


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

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

namespace Lc\CaracoleBundle\Factory\User; namespace Lc\CaracoleBundle\Factory\User;


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


{ {
public static function create(string $cookie, string $ip): VisitorInterface public static function create(string $cookie, string $ip): VisitorInterface
{ {
$visitor = new Visitor();
$class = VisitorContainer::getEntityFqcn();
$visitor = new $class;


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

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



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


protected $comment; 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; 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; protected $merchant;



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



use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\CaracoleBundle\Doctrine\Extension\PayoffTrait; use Lc\CaracoleBundle\Doctrine\Extension\PayoffTrait;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Order\OrderPaymentInterface; use Lc\CaracoleBundle\Model\Order\OrderPaymentInterface;
use Lc\CaracoleBundle\Model\Order\OrderRefundInterface; use Lc\CaracoleBundle\Model\Order\OrderRefundInterface;
use Lc\CaracoleBundle\Doctrine\Extension\PayoffInterface; use Lc\CaracoleBundle\Doctrine\Extension\PayoffInterface;


/** /**
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserMerchantInterface", inversedBy="creditHistories") * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\User\UserMerchantInterface", inversedBy="creditHistories")
* @ORM\JoinColumn(nullable=false)
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
*/ */
protected $userMerchant; 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; 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; protected $orderRefund;




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

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

return $this;
}


public function getOrderPayment(): ?OrderPaymentInterface public function getOrderPayment(): ?OrderPaymentInterface
{ {

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



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


protected $orderShops; 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; protected $orderRefund;



+ 5
- 0
Model/Newsletter/NewsletterModel.php View File

*/ */
protected $section; protected $section;


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

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

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



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




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


protected $idValidOrder; protected $idValidOrder;
/** /**
* @ORM\ManyToOne(targetEntity="App\Entity\Address\Address") * @ORM\ManyToOne(targetEntity="App\Entity\Address\Address")
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
*/ */
protected $deliveryAddress; protected $deliveryAddress;



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



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



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

protected $productCategories; 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; protected $news;



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

protected $creditActive = false; 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; protected $creditHistories;



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

protected $favoriteMerchant; 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; protected $addresses;



+ 3
- 0
Repository/Newsletter/NewsletterStore.php View File

namespace Lc\CaracoleBundle\Repository\Newsletter; namespace Lc\CaracoleBundle\Repository\Newsletter;


use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
use Lc\CaracoleBundle\Repository\SectionStoreTrait; use Lc\CaracoleBundle\Repository\SectionStoreTrait;
use Lc\CaracoleBundle\Repository\StoreTrait; use Lc\CaracoleBundle\Repository\StoreTrait;
use Lc\SovBundle\Repository\Newsletter\NewsletterStore as SovNewsletterStore; use Lc\SovBundle\Repository\Newsletter\NewsletterStore as SovNewsletterStore;
{ {
use StoreTrait; use StoreTrait;
use SectionStoreTrait; use SectionStoreTrait;
use MerchantStoreTrait;


public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
{ {
public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
{ {
$this->addFilterBySectionOptionnal($query); $this->addFilterBySectionOptionnal($query);
$this->addFilterByMerchantViaSectionOptionnal($query);
$query->filterIsOnlineAndOffline(); $query->filterIsOnlineAndOffline();
return $query; return $query;
} }

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



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


class ReductionCartRepositoryQuery extends AbstractRepositoryQuery class ReductionCartRepositoryQuery extends AbstractRepositoryQuery
->andWhere('.codes LIKE :code') ->andWhere('.codes LIKE :code')
->setParameter('code', '%'.$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

use Lc\CaracoleBundle\Solver\Price\PriceSolver; use Lc\CaracoleBundle\Solver\Price\PriceSolver;
use Lc\CaracoleBundle\Solver\Reduction\ReductionCartSolver; use Lc\CaracoleBundle\Solver\Reduction\ReductionCartSolver;
use Lc\CaracoleBundle\Repository\AbstractStore; use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Model\User\UserInterface;
use Lc\SovBundle\Repository\RepositoryQueryInterface; use Lc\SovBundle\Repository\RepositoryQueryInterface;


class ReductionCartStore extends AbstractStore class ReductionCartStore extends AbstractStore
protected PriceSolver $priceSolver; protected PriceSolver $priceSolver;


public function __construct( public function __construct(
ReductionCartRepositoryQuery $query,
ReductionCartSolver $reductionCartSolver,
PriceSolver $priceSolver
) {
ReductionCartRepositoryQuery $query,
ReductionCartSolver $reductionCartSolver,
PriceSolver $priceSolver
)
{
$this->query = $query; $this->query = $query;
$this->reductionCartSolver = $reductionCartSolver; $this->reductionCartSolver = $reductionCartSolver;
$this->priceSolver = $priceSolver; $this->priceSolver = $priceSolver;
} }
return $findReductionCart; 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

} }
} }


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

}

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

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

use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface; use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface;
use Lc\CaracoleBundle\Repository\MerchantStoreTrait; use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
use Lc\CaracoleBundle\Repository\AbstractStore; use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Model\User\UserInterface;
use Lc\SovBundle\Repository\RepositoryQueryInterface; use Lc\SovBundle\Repository\RepositoryQueryInterface;


class ReductionCatalogStore extends AbstractStore class ReductionCatalogStore extends AbstractStore
$query->filterProductFamily($productFamily); $query->filterProductFamily($productFamily);
return $query->findOne(); 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



namespace Lc\CaracoleBundle\Repository\Reduction; namespace Lc\CaracoleBundle\Repository\Reduction;


use Lc\CaracoleBundle\Model\Reduction\ReductionCreditModel;
use Lc\CaracoleBundle\Repository\MerchantStoreTrait; use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
use Lc\CaracoleBundle\Repository\SectionStoreTrait; use Lc\CaracoleBundle\Repository\SectionStoreTrait;
use Lc\SovBundle\Model\User\UserInterface; use Lc\SovBundle\Model\User\UserInterface;
return $query->find(); 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

$userMerchant = $this->getOneByUser($user, $query); $userMerchant = $this->getOneByUser($user, $query);
return $this->userMerchantSolver->isCreditActive($userMerchant); 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

boxes: boxes:
visitor: Visiteur visitor: Visiteur
user: Utilisateur user: Utilisateur

UserPointSale:
label_plurial: Liens avec une ambassade
PointSale: PointSale:
label: Point de vente label: Point de vente
label_plurial: Points de vente label_plurial: Points de vente
orderAmountMin: Montant minimum de commande orderAmountMin: Montant minimum de commande


Address: Address:
label_plurial: Adresses
fields: fields:
type: Type type: Type
typeOptions: typeOptions:
countOrder: Commandes countOrder: Commandes
totalSpent: Ventes totalSpent: Ventes
lastLogin: Dernière connexion 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: CreditHistory:
label: Historique de compte prépayé label: Historique de compte prépayé
label_plurial: Historiques de compte prépayé label_plurial: Historiques de compte prépayé

Loading…
Cancel
Save