Browse Source

Merge branch 'develop'

master
Fabien Normand 2 years ago
parent
commit
5d3b5724f5
95 changed files with 2586 additions and 504 deletions
  1. +4
    -3
      Builder/Order/OrderShopBuilder.php
  2. +3
    -6
      Builder/Reduction/ReductionCreditBuilder.php
  3. +2
    -0
      Container/Product/ProductContainer.php
  4. +6
    -3
      Controller/Order/CartController.php
  5. +1
    -1
      Controller/Reduction/ReductionCartAdminController.php
  6. +1
    -1
      Controller/Reduction/ReductionCatalogAdminController.php
  7. +1
    -1
      Controller/Reduction/ReductionCreditAdminController.php
  8. +29
    -1
      Definition/MerchantSettingDefinitionInterface.php
  9. +2
    -0
      Doctrine/Extension/OrderAmountMinInterface.php
  10. +11
    -0
      Doctrine/Extension/OrderPayoffInterface.php
  11. +19
    -0
      Doctrine/Extension/PayoffInterface.php
  12. +42
    -21
      Doctrine/Extension/PriceInterface.php
  13. +22
    -0
      Doctrine/Extension/ProductPropertyInterface.php
  14. +11
    -0
      Doctrine/Extension/ReductionCartPropertyInterface.php
  15. +11
    -8
      Doctrine/Extension/ReductionInterface.php
  16. +26
    -0
      Doctrine/Extension/ReductionPropertyInterface.php
  17. +33
    -37
      EventSubscriber/Product/UpdateProductfamilyEventSubscriber.php
  18. +2
    -4
      Factory/Reduction/ReductionCartFactory.php
  19. +2
    -4
      Factory/Reduction/ReductionCatalogFactory.php
  20. +2
    -4
      Factory/Reduction/ReductionCreditFactory.php
  21. +0
    -1
      Field/Filter/ProductCategoriesFilter.php
  22. +47
    -22
      Model/Address/AddressInterface.php
  23. +3
    -13
      Model/Config/TaxRateInterface.php
  24. +8
    -15
      Model/Config/UnitInterface.php
  25. +1
    -1
      Model/Config/UnitModel.php
  26. +55
    -8
      Model/Credit/CreditHistoryInterface.php
  27. +12
    -1
      Model/Distribution/DistributionInterface.php
  28. +1
    -11
      Model/Distribution/DistributionModel.php
  29. +117
    -1
      Model/File/DocumentInterface.php
  30. +1
    -5
      Model/File/DocumentModel.php
  31. +111
    -1
      Model/Merchant/MerchantInterface.php
  32. +1
    -1
      Model/Merchant/MerchantModel.php
  33. +53
    -2
      Model/Order/OrderPaymentInterface.php
  34. +1
    -1
      Model/Order/OrderPaymentModel.php
  35. +53
    -1
      Model/Order/OrderProductInterface.php
  36. +1
    -1
      Model/Order/OrderProductModel.php
  37. +17
    -1
      Model/Order/OrderProductReductionCatalogInterface.php
  38. +2
    -1
      Model/Order/OrderProductReductionCatalogModel.php
  39. +20
    -1
      Model/Order/OrderProductRefundInterface.php
  40. +2
    -1
      Model/Order/OrderProductRefundModel.php
  41. +45
    -1
      Model/Order/OrderReductionCartInterface.php
  42. +1
    -1
      Model/Order/OrderReductionCartModel.php
  43. +33
    -1
      Model/Order/OrderReductionCreditInterface.php
  44. +2
    -1
      Model/Order/OrderReductionCreditModel.php
  45. +63
    -1
      Model/Order/OrderRefundInterface.php
  46. +1
    -1
      Model/Order/OrderRefundModel.php
  47. +47
    -47
      Model/Order/OrderShopInterface.php
  48. +36
    -1
      Model/Order/OrderStatusHistoryInterface.php
  49. +1
    -3
      Model/Order/OrderStatusHistoryModel.php
  50. +24
    -1
      Model/Order/OrderStatusInterface.php
  51. +3
    -3
      Model/Order/OrderStatusModel.php
  52. +112
    -1
      Model/PointSale/PointSaleInterface.php
  53. +1
    -1
      Model/PointSale/PointSaleModel.php
  54. +69
    -13
      Model/Product/ProductCategoryInterface.php
  55. +3
    -3
      Model/Product/ProductCategoryModel.php
  56. +307
    -0
      Model/Product/ProductFamilyInterface.php
  57. +15
    -1
      Model/Product/ProductFamilySectionPropertyInterface.php
  58. +88
    -6
      Model/Product/ProductInterface.php
  59. +60
    -0
      Model/Product/QualityLabelInterface.php
  60. +134
    -2
      Model/Reduction/ReductionCartInterface.php
  61. +11
    -14
      Model/Reduction/ReductionCartModel.php
  62. +115
    -1
      Model/Reduction/ReductionCatalogInterface.php
  63. +9
    -10
      Model/Reduction/ReductionCatalogModel.php
  64. +86
    -1
      Model/Reduction/ReductionCreditInterface.php
  65. +9
    -10
      Model/Reduction/ReductionCreditModel.php
  66. +22
    -1
      Model/Section/OpeningInterface.php
  67. +159
    -1
      Model/Section/SectionInterface.php
  68. +1
    -1
      Model/Section/SectionModel.php
  69. +22
    -0
      Model/Setting/MerchantSettingInterface.php
  70. +1
    -1
      Model/Setting/MerchantSettingModel.php
  71. +22
    -0
      Model/Setting/SectionSettingInterface.php
  72. +1
    -1
      Model/Setting/SectionSettingModel.php
  73. +1
    -1
      Model/Site/PageModel.php
  74. +49
    -1
      Model/User/UserMerchantInterface.php
  75. +1
    -1
      Model/User/UserMerchantModel.php
  76. +15
    -1
      Model/User/UserPointSaleInterface.php
  77. +1
    -1
      Model/User/UserPointSaleModel.php
  78. +30
    -1
      Model/User/VisitorInterface.php
  79. +1
    -1
      Model/User/VisitorModel.php
  80. +1
    -1
      Repository/Credit/CreditHistoryStore.php
  81. +161
    -146
      Repository/Order/OrderShopStore.php
  82. +1
    -0
      Repository/Product/ProductFamilyStore.php
  83. +13
    -0
      Repository/Product/ProductRepositoryQuery.php
  84. +10
    -0
      Repository/Product/ProductStore.php
  85. +1
    -2
      Repository/Reduction/ReductionCartRepositoryQuery.php
  86. +4
    -5
      Repository/Reduction/ReductionCartStore.php
  87. +1
    -2
      Repository/Reduction/ReductionCatalogRepositoryQuery.php
  88. +3
    -3
      Repository/Reduction/ReductionCatalogStore.php
  89. +2
    -2
      Repository/Reduction/ReductionCreditRepositoryQuery.php
  90. +1
    -4
      Repository/Reduction/ReductionCreditStore.php
  91. +1
    -1
      Repository/User/UserRepositoryQuery.php
  92. +2
    -1
      Repository/User/UserStore.php
  93. +16
    -4
      Solver/Price/PriceSolverTrait.php
  94. +15
    -1
      Solver/Section/OpeningSolver.php
  95. +17
    -13
      Transformer/Order/OrderShopTransformer.php

+ 4
- 3
Builder/Order/OrderShopBuilder.php View File

@@ -241,7 +241,7 @@ class OrderShopBuilder
if ($orderProductAdd->getQuantityOrder() > 0) {
$updated = false;
$this->orderProductBuilder->init($orderProductAdd);
$productFamily = $this->productFamilyStore->getOneBySlug(
$productFamily = $this->productFamilyStore->setSection($orderShop->getSection())->getOneBySlug(
$orderProductAdd->getProduct()->getProductFamily()->getSlug()
);

@@ -478,8 +478,9 @@ class OrderShopBuilder

$orderShop->addOrderReductionCredit($orderReductionCredit);

if ($this->isOrderShopPositiveAmount($orderShop)
&& $this->isOrderShopPositiveAmountRemainingToBePaid($orderShop)) {
if ($this->orderShopResolver->isPositiveAmount($orderShop)
&& $this->orderShopResolver->isPositiveAmountRemainingToBePaid($orderShop)) {

$this->entityManager->create($orderReductionCredit);
$this->entityManager->flush();


+ 3
- 6
Builder/Reduction/ReductionCreditBuilder.php View File

@@ -47,23 +47,20 @@ class ReductionCreditBuilder
$user = $orderShop->getUser();
$orderProductsGiftVouchers = $this->orderProductStore->getGiftVouchersByOrder($orderShop);

$sectionMarket = $this->sectionStore
->setMerchant($orderShop->getSection()->getMerchant())
->getOneMarket();

foreach ($orderProductsGiftVouchers as $orderProductsGiftVoucher) {
$i = 1;

// création de la reductionCredit
while ($i <= $orderProductsGiftVoucher->getQuantityOrder()) {
$reductionGift = $this->reductionCreditFactory->create($sectionMarket, ReductionCreditModel::TYPE_GIFT);
$reductionGift = $this->reductionCreditFactory->create($orderShop->getSection()->getMerchant(), ReductionCreditModel::TYPE_GIFT);
$reductionGift->setTitle($orderProductsGiftVoucher->getTitle());
$reductionGift->setOwner($user);
$reductionGift->setCreatedBy($user);
$reductionGift->setUpdatedBy($user);
$reductionGift->setValue($this->priceSolver->getPriceWithTax($orderProductsGiftVoucher->getProduct()));
$reductionGift->setBehaviorTaxRate(TaxRateModel::BEHAVIOR_TAX_RATE_INCLUDED);
$this->entityManager->persist($reductionGift);

$this->entityManager->create($reductionGift);

$i++;
}

+ 2
- 0
Container/Product/ProductContainer.php View File

@@ -48,4 +48,6 @@ class ProductContainer
return $this->store;
}



}

+ 6
- 3
Controller/Order/CartController.php View File

@@ -11,6 +11,9 @@ use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;

/**
* @Route("/{section}/panier", name="frontend_cart_")
*/
class CartController extends AbstractController
{
protected ProductFamilyInterface $productFamily;
@@ -79,7 +82,7 @@ class CartController extends AbstractController
}

/**
* @Route("/order-reduction-cart/delete/{id}", name="frontend_cart_delete_reduction_cart")
* @Route("/order-reduction-cart/delete/{id}", name="delete_reduction_cart")
*/
public function deleteReductionCart(Request $request): RedirectResponse
{
@@ -102,7 +105,7 @@ class CartController extends AbstractController
}

/**
* @Route("/reduction-credit/add/{id}", name="frontend_order_cart_reduction_credit")
* @Route("/reduction-credit/add/{id}", name="order_reduction_credit")
*/
public function addReductionCredit(Request $request): RedirectResponse
{
@@ -133,7 +136,7 @@ class CartController extends AbstractController
}

/**
* @Route("/order-reduction-credit/delete/{id}", name="frontend_cart_delete_reduction_credit")
* @Route("/order-reduction-credit/delete/{id}", name="delete_reduction_credit")
*/
public function deleteReductionCredit(Request $request): RedirectResponse
{

+ 1
- 1
Controller/Reduction/ReductionCartAdminController.php View File

@@ -16,7 +16,7 @@ abstract class ReductionCartAdminController extends AbstractAdminController

public function createEntity(string $entityFqcn)
{
return $this->getReductionCartContainer()->getFactory()->create($this->getSectionCurrent());
return $this->getReductionCartContainer()->getFactory()->create($this->getMerchantCurrent());
}

}

+ 1
- 1
Controller/Reduction/ReductionCatalogAdminController.php View File

@@ -14,6 +14,6 @@ abstract class ReductionCatalogAdminController extends AbstractAdminController

public function createEntity(string $entityFqcn)
{
return $this->getReductionCatalogContainer()->getFactory()->create($this->getSectionCurrent());
return $this->getReductionCatalogContainer()->getFactory()->create($this->getMerchantCurrent());
}
}

+ 1
- 1
Controller/Reduction/ReductionCreditAdminController.php View File

@@ -15,6 +15,6 @@ abstract class ReductionCreditAdminController extends AbstractAdminController

public function createEntity(string $entityFqcn)
{
return $this->getReductionCreditContainer()->getFactory()->create($this->getSectionCurrent());
return $this->getReductionCreditContainer()->getFactory()->create($this->getMerchantCurrent());
}
}

+ 29
- 1
Definition/MerchantSettingDefinitionInterface.php View File

@@ -1,10 +1,38 @@
<?php


namespace Lc\CaracoleBundle\Definition;

use Lc\SovBundle\Definition\AbstractSettingDefinition;

interface MerchantSettingDefinitionInterface
{
public function addSettingText(array $params);

public function addSettingTextarea(array $params);

public function addSettingTextareaAdvanced(array $params);

public function addSettingDate(array $params);

public function addSettingTime(array $params);

public function addSettingFile(array $params);

public function addSettingImage(array $params);

public function addSettingSelect(array $params);

public function addSettingRadio(array $params);

public function addSetting($params);

public function getSettings(): array;

public function getSettingsByCategory($category);

public function getSettingByName($name): ?array;

public function getSettingType($name): ?string;

public function getCategories();
}

+ 2
- 0
Doctrine/Extension/OrderAmountMinInterface.php View File

@@ -4,5 +4,7 @@ namespace Lc\CaracoleBundle\Doctrine\Extension;

interface OrderAmountMinInterface
{
public function getOrderAmountMin(): ?float;

public function setOrderAmountMin(float $orderAmountMin);
}

+ 11
- 0
Doctrine/Extension/OrderPayoffInterface.php View File

@@ -2,6 +2,17 @@

namespace Lc\CaracoleBundle\Doctrine\Extension;

use Lc\CaracoleBundle\Model\Order\OrderShopInterface;

interface OrderPayoffInterface
{
public function getOrderShop(): ?OrderShopInterface;

public function setOrderShop(?OrderShopInterface $orderShop);

public function setEditable(bool $editable);

public function getEditable(): ?bool;

public function isEditable(): ?bool;
}

+ 19
- 0
Doctrine/Extension/PayoffInterface.php View File

@@ -4,4 +4,23 @@ namespace Lc\CaracoleBundle\Doctrine\Extension;

interface PayoffInterface
{
public function setMeanPayment(?string $meanPayment);

public function getMeanPayment(): ?string;

public function getReference(): ?string;

public function setReference(?string $reference);

public function getPaidAt(): ?\DateTimeInterface;

public function setPaidAt(?\DateTimeInterface $paidAt);

public function getAmount(): ?float;

public function setAmount(float $amount);

public function getComment(): ?string;

public function setComment(?string $comment);
}

+ 42
- 21
Doctrine/Extension/PriceInterface.php View File

@@ -1,27 +1,48 @@
<?php

namespace Lc\CaracoleBundle\Doctrine\Extension ;
namespace Lc\CaracoleBundle\Doctrine\Extension;

use Lc\CaracoleBundle\Model\Config\TaxRateInterface;
use Lc\CaracoleBundle\Model\Config\UnitInterface;

interface PriceInterface
{
/**
* Retourne le prix hérité
*
* @return float
*/
public function getPriceInherited();

/**
* Retourne le TaxRate hérité
*
* @return entity
*/
public function getTaxRateInherited();

/**
* Retourne le Unit hérité
*
* @return float
*/
public function getUnitInherited();
/**
* Retourne le prix hérité
*
* @return float
*/
public function getPriceInherited(): ?float;

/**
* Retourne le TaxRate hérité
*
* @return TaxRateInterface
*/
public function getTaxRateInherited(): ?TaxRateInterface;

/**
* Retourne le Unit hérité
*
* @return UnitInterface
*/
public function getUnitInherited(): ?UnitInterface;

public function getBuyingPriceInherited(): ?float;

public function getBuyingPrice(): ?float;

public function setBuyingPrice(?float $buyingPrice);

public function getPrice(): ?float;

public function setPrice(?float $price);

public function getUnit(): ?UnitInterface;

public function setUnit(?UnitInterface $unit);

public function getTaxRate(): ?TaxRateInterface;

public function setTaxRate(?TaxRateInterface $taxRate);
}

+ 22
- 0
Doctrine/Extension/ProductPropertyInterface.php View File

@@ -4,5 +4,27 @@ namespace Lc\CaracoleBundle\Doctrine\Extension;

interface ProductPropertyInterface
{
public function getBuyingPriceByRefUnit(): ?float;

public function setBuyingPriceByRefUnit(?float $buyingPriceByRefUnit);

public function getPriceByRefUnit(): ?float;

public function setPriceByRefUnit(?float $priceByRefUnit);

public function getQuantity(): ?float;

public function setQuantity(?float $quantity);

public function getAvailableQuantity(): ?float;

public function setAvailableQuantity(?float $availableQuantity);

public function getAvailableQuantityDefault(): ?float;

public function setAvailableQuantityDefault(?float $availableQuantityDefault);

public function getPropertyExpirationDate(): ?string;

public function setPropertyExpirationDate(?string $propertyExpirationDate);
}

+ 11
- 0
Doctrine/Extension/ReductionCartPropertyInterface.php View File

@@ -4,4 +4,15 @@ namespace Lc\CaracoleBundle\Doctrine\Extension;

interface ReductionCartPropertyInterface
{
public function getFreeShipping(): ?bool;

public function setFreeShipping(?bool $freeShipping);

public function getAppliedTo(): ?string;

public function setAppliedTo(string $appliedTo);

public function getType(): ?string;

public function setType(string $type);
}

+ 11
- 8
Doctrine/Extension/ReductionInterface.php View File

@@ -4,12 +4,15 @@ namespace Lc\CaracoleBundle\Doctrine\Extension;

interface ReductionInterface
{
/**
* Retourne le merchant courant en fonction du user ou du cookie du visitor
*
* @return MerchantInterface
*/
public function getUnit();
public function getValue();
public function getBehaviorTaxRate();
public function getValue(): ?float;

public function setValue(?float $value);

public function getUnit(): ?string;

public function setUnit(?string $unit);

public function getBehaviorTaxRate(): ?string;

public function setBehaviorTaxRate(?string $behaviorTaxRate);
}

+ 26
- 0
Doctrine/Extension/ReductionPropertyInterface.php View File

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

namespace Lc\CaracoleBundle\Doctrine\Extension;

use Doctrine\Common\Collections\Collection;
use Lc\SovBundle\Model\User\GroupUserInterface;
use Lc\SovBundle\Model\User\UserInterface;

interface ReductionPropertyInterface
{
public function getUsers(): Collection;

public function addUser(UserInterface $user);

public function removeUser(UserInterface $user);

public function getGroupUsers(): Collection;

public function addGroupUser(GroupUserInterface $groupUser);

public function removeGroupUser(GroupUserInterface $groupUser);

public function getDateStart(): ?\DateTimeInterface;

public function setDateStart(?\DateTimeInterface $dateStart);

public function getDateEnd(): ?\DateTimeInterface;

public function setDateEnd(?\DateTimeInterface $dateEnd);

public function getPermanent(): ?bool;

public function setPermanent(bool $permanent);
}

+ 33
- 37
EventSubscriber/Product/UpdateProductfamilyEventSubscriber.php View File

@@ -78,50 +78,46 @@ class UpdateProductfamilyEventSubscriber implements EventSubscriberInterface
protected function processProducts($entity)
{

//Récupère le product origin
$originProducts = $this->em->getRepository(ProductInterface::class)
->findBy(
array(
'productFamily' => $entity->getId(),
'originProduct' => true,
)
);

if (count($originProducts) > 1) {
throw new \ErrorException('Plusieurs OriginProduct pour un même produit... Contacter fab');
// Case Nouveau product family
} else {
if (count($originProducts) == 0) {
$entityClassName = $this->em->getEntityName(ProductInterface::class);
$originProduct = new $entityClassName();
$originProduct->setProductFamily($entity);
$originProduct->setOriginProduct(true);
$entity->addProduct($originProduct);
if($entity->getId()) {
//Récupère le product origin
$originProducts = $this->productContainer->getStore()->getOriginByProductFamily($entity);

if (count($originProducts) > 1) {
throw new \ErrorException('Plusieurs OriginProduct pour un même produit... Contacter fab');
// Case Nouveau product family
} else {
$originProduct = $originProducts[0];
if (count($originProducts) == 0) {
$entityClassName = $this->em->getEntityName(ProductInterface::class);
$originProduct = new $entityClassName();
$originProduct->setProductFamily($entity);
$originProduct->setOriginProduct(true);
$entity->addProduct($originProduct);
} else {
$originProduct = $originProducts[0];
}
}
}

if ($entity->getActiveProducts()) {
$originProduct->setStatus(-1);
} else {
$originProduct->setStatus(1);
}
if ($entity->getActiveProducts()) {
$originProduct->setStatus(-1);
} else {
$originProduct->setStatus(1);
}

//Enregistrement
$entity->addProduct($originProduct);
//Enregistrement
$entity->addProduct($originProduct);

foreach ($entity->getProducts() as $product) {
$product->setProductFamily($entity);
foreach ($entity->getProducts() as $product) {
$product->setProductFamily($entity);

if ($entity->getProductsQuantityAsTitle() && $product->getStatus() >= 1) {
$product->setTitle(
str_replace('.', ',', $this->productContainer->getSolver()->getQuantityInherited($product)) . $this->productContainer->getSolver()->getUnitInherited($product)->getWording()
);
}
if ($entity->getProductsQuantityAsTitle() && $product->getStatus() >= 1) {
$product->setTitle(
str_replace('.', ',', $this->productContainer->getSolver()->getQuantityInherited($product)) . $this->productContainer->getSolver()->getUnitInherited($product)->getWording()
);
}

$this->em->persist($product);
$entity->addProduct($product);
$this->em->persist($product);
$entity->addProduct($product);
}
}
}


+ 2
- 4
Factory/Reduction/ReductionCartFactory.php View File

@@ -3,20 +3,18 @@
namespace Lc\CaracoleBundle\Factory\Reduction;

use App\Entity\Reduction\ReductionCart;
use Lc\CaracoleBundle\Context\MerchantContextTrait;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionCartInterface;
use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\SovBundle\Factory\AbstractFactory;

class ReductionCartFactory extends AbstractFactory
{

public function create(SectionInterface $section): ReductionCartInterface
public function create(MerchantInterface $merchant): ReductionCartInterface
{
$reductionCart = new ReductionCart();

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

return $reductionCart;

+ 2
- 4
Factory/Reduction/ReductionCatalogFactory.php View File

@@ -3,20 +3,18 @@
namespace Lc\CaracoleBundle\Factory\Reduction;

use App\Entity\Reduction\ReductionCatalog;
use Lc\CaracoleBundle\Context\MerchantContextTrait;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionCatalogInterface;
use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\SovBundle\Factory\AbstractFactory;

class ReductionCatalogFactory extends AbstractFactory
{

public function create(SectionInterface $section): ReductionCatalogInterface
public function create(MerchantInterface $merchant): ReductionCatalogInterface
{
$reductionCatalog = new ReductionCatalog();

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

return $reductionCatalog;

+ 2
- 4
Factory/Reduction/ReductionCreditFactory.php View File

@@ -3,21 +3,19 @@
namespace Lc\CaracoleBundle\Factory\Reduction;

use App\Entity\Reduction\ReductionCredit;
use Lc\CaracoleBundle\Context\MerchantContextTrait;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionCreditModel;
use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\SovBundle\Factory\AbstractFactory;

class ReductionCreditFactory extends AbstractFactory
{

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

$reductionCredit->setSection($section);
$reductionCredit->setMerchant($merchant);
$reductionCredit->setType($type);
$reductionCredit->setStatus(1);


+ 0
- 1
Field/Filter/ProductCategoriesFilter.php View File

@@ -40,7 +40,6 @@ class ProductCategoriesFilter extends AssociationFilter
}
$section = ' ['.$category->getSection()->getTitle().']' ;;
return $category . $section. $isOffline;

}
)
);

+ 47
- 22
Model/Address/AddressInterface.php View File

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

namespace Lc\CaracoleBundle\Model\Address;


use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\PointSale\PointSaleInterface;
use Lc\SovBundle\Model\User\UserInterface;
@@ -10,89 +11,113 @@ interface AddressInterface
{
public function getUser(): ?UserInterface;

public function setUser(?UserInterface $user): AddressModel;
public function setUser(?UserInterface $user): AddressInterface;

public function getTitle(): ?string;

public function setTitle(string $title): AddressModel;
public function setTitle(string $title): AddressInterface;

public function getType(): ?string;

public function setType(string $type): AddressModel;
public function setType(string $type): AddressInterface;

public function getCivility(): ?bool;

public function setCivility(?bool $civility): AddressModel;
public function setCivility(?bool $civility): AddressInterface;

public function getLastname(): ?string;

public function setLastname(?string $lastname): AddressModel;
public function setLastname(?string $lastname): AddressInterface;

public function getFirstname(): ?string;

public function setFirstname(?string $firstname): AddressModel;
public function setFirstname(?string $firstname): AddressInterface;

public function getAddress(): ?string;

public function setAddress(string $address): AddressModel;
public function setAddress(string $address): AddressInterface;

public function getZip(): ?string;

public function setZip(string $zip): AddressModel;
public function setZip(string $zip): AddressInterface;

public function getCity(): ?string;

public function setCity(string $city): AddressModel;
public function setCity(string $city): AddressInterface;

public function getCountry(): ?string;

public function setCountry(string $country): AddressModel;
public function setCountry(string $country): AddressInterface;

public function getLatitude(): ?string;

public function setLatitude(?string $latitude): AddressModel;
public function setLatitude(?string $latitude): AddressInterface;

public function getLongitude(): ?string;

public function setLongitude(?string $longitude): AddressModel;
public function setLongitude(?string $longitude): AddressInterface;

public function getLatitudeOverride(): ?string;

public function setLatitudeOverride(?string $latitudeOverride): AddressModel;
public function setLatitudeOverride(?string $latitudeOverride): AddressInterface;

public function getLongitudeOverride(): ?string;

public function setLongitudeOverride(?string $longitudeOverride): AddressModel;
public function setLongitudeOverride(?string $longitudeOverride): AddressInterface;

public function getCompany(): ?string;

public function setCompany(?string $company): AddressModel;
public function setCompany(?string $company): AddressInterface;

public function getSiret(): ?string;

public function setSiret(?string $siret): AddressModel;
public function setSiret(?string $siret): AddressInterface;

public function getTva(): ?string;

public function setTva(?string $tva): AddressModel;
public function setTva(?string $tva): AddressInterface;

public function getPhone(): ?array;

public function setPhone(?array $phone): AddressModel;
public function setPhone(?array $phone): AddressInterface;

public function getComment(): ?string;

public function setComment(?string $comment): AddressModel;
public function setComment(?string $comment): AddressInterface;

public function getPointSale(): ?PointSaleInterface;

public function setPointSale(PointSaleInterface $pointSale): AddressModel;
public function setPointSale(PointSaleInterface $pointSale): AddressInterface;

public function getMerchant(): ?MerchantInterface;

public function setMerchant(MerchantInterface $merchant): AddressModel;
public function setMerchant(MerchantInterface $merchant): AddressInterface;

public function getDeliveryInfos(): ?string;

public function setDeliveryInfos(?string $deliveryInfos): AddressModel;
public function setDeliveryInfos(?string $deliveryInfos): AddressInterface;

public function getCreatedBy(): ?UserInterface;

public function setCreatedBy(?UserInterface $createdBy);

public function getUpdatedBy(): ?UserInterface;

public function setUpdatedBy(?UserInterface $updatedBy);

public function getDevAlias(): ?string;

public function setDevAlias(?string $devAlias);

public function getStatus(): ?float;

public function setStatus(float $status): AddressInterface;

public function getCreatedAt(): ?\DateTimeInterface;

public function setCreatedAt(\DateTimeInterface $createdAt);

public function getUpdatedAt(): ?\DateTimeInterface;

public function setUpdatedAt(\DateTimeInterface $updatedAt);
}

+ 3
- 13
Model/Config/TaxRateInterface.php View File

@@ -1,19 +1,11 @@
<?php
/**
* @author La clic ! <contact@laclic.fr>
*/

namespace Lc\CaracoleBundle\Model\Config;


use Lc\SovBundle\Doctrine\Extension\BlameableTrait;
use Lc\SovBundle\Doctrine\Extension\DevAliasTrait;
use Lc\SovBundle\Doctrine\Extension\TimestampableTrait;
use Lc\SovBundle\Model\User\UserInterface;

/**
* @ORM\MappedSuperclass()
*/

interface TaxRateInterface
{
public function getCreatedBy(): ?UserInterface;
@@ -30,15 +22,13 @@ interface TaxRateInterface

public function getBehaviorTaxRateChoices(): array;

public function __toString();

public function getTitle(): ?string;

public function setTitle(string $title);
public function setTitle(string $title): TaxRateInterface;

public function getValue(): ?float;

public function setValue(float $value): TaxRateModel;
public function setValue(float $value): TaxRateInterface;

public function getCreatedAt(): ?\DateTimeInterface;


+ 8
- 15
Model/Config/UnitInterface.php View File

@@ -1,16 +1,11 @@
<?php
/**
* @author La clic ! <contact@laclic.fr>
*/

namespace Lc\CaracoleBundle\Model\Config;


use Lc\SovBundle\Doctrine\Extension\BlameableTrait;
use Lc\SovBundle\Doctrine\Extension\DevAliasTrait;
use Lc\SovBundle\Doctrine\Extension\TimestampableTrait;
use Lc\SovBundle\Model\User\UserInterface;


interface UnitInterface
{
public function getCreatedBy(): ?UserInterface;
@@ -35,29 +30,27 @@ interface UnitInterface

public function getUnitAmountChoices(): array;

public function __toString();

public function getUnit(): ?string;

public function setUnit(string $unit): UnitModel;
public function setUnit(string $unit): UnitInterface;

public function getWording(): ?string;

public function setWording(string $wording): UnitModel;
public function setWording(string $wording): UnitInterface;

public function getWordingUnit(): ?string;

public function setWordingUnit(string $wordingUnit): UnitModel;
public function setWordingUnit(string $wordingUnit): UnitInterface;

public function getWordingShort(): ?string;

public function setWordingShort(string $wordingShort): UnitModel;
public function setWordingShort(string $wordingShort): UnitInterface;

public function getCoefficient(): ?int;

public function setCoefficient(int $coefficient): UnitModel;
public function setCoefficient(int $coefficient): UnitInterface;

public function getUnitReference(): ?self;
public function getUnitReference(): ?UnitInterface;

public function setUnitReference(?UnitModel $unitReference);
public function setUnitReference(?UnitInterface $unitReference);
}

+ 1
- 1
Model/Config/UnitModel.php View File

@@ -124,7 +124,7 @@ abstract class UnitModel extends AbstractLightEntity implements UnitInterface
return $this->unitReference;
}

public function setUnitReference(?self $unitReference): self
public function setUnitReference(?UnitInterface $unitReference): self
{
$this->unitReference = $unitReference;


+ 55
- 8
Model/Credit/CreditHistoryInterface.php View File

@@ -1,21 +1,68 @@
<?php
/**
* @author La clic ! <contact@laclic.fr>
*/

namespace Lc\CaracoleBundle\Model\Credit;


use Lc\CaracoleBundle\Doctrine\Extension\PayoffTrait;
use Lc\CaracoleBundle\Model\Order\OrderPaymentInterface;
use Lc\CaracoleBundle\Model\Order\OrderRefundInterface;
use Lc\CaracoleBundle\Model\User\UserMerchantInterface;
use Lc\SovBundle\Doctrine\Extension\BlameableTrait;
use Lc\SovBundle\Doctrine\Extension\DevAliasTrait;
use Lc\SovBundle\Doctrine\Extension\TimestampableTrait;
use Lc\SovBundle\Model\User\UserInterface;

interface CreditHistoryInterface
{
public function getCreatedBy(): ?UserInterface;

}
public function setCreatedBy(?UserInterface $createdBy);

public function getUpdatedBy(): ?UserInterface;

public function setUpdatedBy(?UserInterface $updatedBy);

public function getAmount(): ?float;

public function setAmount(?float $amount): CreditHistoryInterface;

public function getType(): ?string;

public function setType(string $type): CreditHistoryInterface;

public function getUserMerchant(): ?UserMerchantInterface;

public function setUserMerchant(?UserMerchantInterface $userMerchant): CreditHistoryInterface;

public function getOrderPayment(): ?OrderPaymentInterface;

public function setOrderPayment(?OrderPaymentInterface $orderPayment): CreditHistoryInterface;

public function getOrderRefund(): ?OrderRefundInterface;

public function setOrderRefund(?OrderRefundInterface $orderRefund): CreditHistoryInterface;

public function getDevAlias(): ?string;

public function setDevAlias(?string $devAlias);

public function setMeanPayment(?string $meanPayment): CreditHistoryInterface;

public function getMeanPayment(): ?string;

public function getReference(): ?string;

public function setReference(?string $reference): CreditHistoryInterface;

public function getPaidAt(): ?\DateTimeInterface;

public function setPaidAt(?\DateTimeInterface $paidAt): CreditHistoryInterface;

public function getComment(): ?string;

public function setComment(?string $comment): CreditHistoryInterface;

public function getCreatedAt(): ?\DateTimeInterface;

public function setCreatedAt(\DateTimeInterface $createdAt);

public function getUpdatedAt(): ?\DateTimeInterface;

public function setUpdatedAt(\DateTimeInterface $updatedAt);
}

+ 12
- 1
Model/Distribution/DistributionInterface.php View File

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

namespace Lc\CaracoleBundle\Model\Distribution;


interface DistributionInterface
{
public function getCycleNumber(): ?int;

public function setCycleNumber(int $cycleNumber): DistributionInterface;

public function getYear(): ?int;

public function setYear(int $year): DistributionInterface;

public function getCycleType(): ?string;

}
public function setCycleType(string $cycleType): DistributionInterface;
}

+ 1
- 11
Model/Distribution/DistributionModel.php View File

@@ -3,16 +3,7 @@
namespace Lc\CaracoleBundle\Model\Distribution;

use Doctrine\ORM\Mapping as ORM;
use Lc\CaracoleBundle\Doctrine\Extension\PayoffTrait;
use Lc\CaracoleBundle\Model\Order\OrderPaymentInterface;
use Lc\CaracoleBundle\Model\Order\OrderRefundInterface;
use Lc\CaracoleBundle\Doctrine\Extension\PayoffInterface;
use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\CaracoleBundle\Model\User\UserMerchantInterface;
use Gedmo\Mapping\Annotation as Gedmo;
use Lc\SovBundle\Doctrine\EntityInterface;
use Lc\SovBundle\Doctrine\Extension\BlameableNullableTrait;
use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;

/**
* @ORM\MappedSuperclass()
@@ -36,7 +27,7 @@ abstract class DistributionModel implements DistributionInterface, EntityInterfa

public function __toString()
{
return $this->getCycleNumber().'/'.$this->getYear();
return $this->getCycleNumber() . '/' . $this->getYear();
}

public function getCycleNumber(): ?int
@@ -63,7 +54,6 @@ abstract class DistributionModel implements DistributionInterface, EntityInterfa
return $this;
}


public function getCycleType(): ?string
{
return $this->cycleType;

+ 117
- 1
Model/File/DocumentInterface.php View File

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

namespace Lc\CaracoleBundle\Model\File;


use Doctrine\Common\Collections\Collection;
use Lc\CaracoleBundle\Model\Address\AddressInterface;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Order\OrderRefundInterface;
use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
use Lc\SovBundle\Model\User\UserInterface;


interface DocumentInterface
{
public function getTitle(): ?string;

public function setTitle(string $title);

public function getDescription(): ?string;

public function setDescription(?string $description);

public function getCreatedBy(): ?UserInterface;

public function setCreatedBy(?UserInterface $createdBy);

public function getUpdatedBy(): ?UserInterface;

public function setUpdatedBy(?UserInterface $updatedBy);

public function getDevAlias(): ?string;

public function setDevAlias(?string $devAlias);

public function getMerchant(): ?MerchantInterface;

public function setMerchant(?MerchantInterface $merchant): DocumentInterface;

public function getLabel();

public function getType(): ?string;

public function setType(string $type): DocumentInterface;

public function getReference(): ?string;

public function setReference(?string $reference): DocumentInterface;

public function getLogo(): ?string;

public function setLogo(string $logo): DocumentInterface;

public function getMerchantAddress(): ?AddressInterface;

public function setMerchantAddress(?AddressInterface $merchantAddress): DocumentInterface;

public function getBuyerAddress(): ?AddressInterface;

public function setBuyerAddress(?AddressInterface $buyerAddress): DocumentInterface;

public function getMerchantAddressText(): ?string;

public function setMerchantAddressText(string $merchantAddressText): DocumentInterface;

public function getBuyerAddressText(): ?string;

public function setBuyerAddressText(?string $buyerAddressText): DocumentInterface;

public function getDeliveryAddressText(): ?string;

public function setDeliveryAddressText(?string $deliveryAddressText): DocumentInterface;

public function getIsSent(): ?bool;

public function setIsSent(?bool $isSent): DocumentInterface;

/**
* @return Collection|OrderShopInterface[]
*/
public function getOrderShops(): Collection;

public function addOrderShop(OrderShopInterface $orderShop): DocumentInterface;

public function removeOrderShop(OrderShopInterface $orderShop): DocumentInterface;

public function getOrderRefund(): ?OrderRefundInterface;

public function setOrderRefund(OrderRefundInterface $orderRefund): DocumentInterface;

public function getMetaTitle(): ?string;

public function setMetaTitle(?string $metaTitle);

public function getMetaDescription(): ?string;

public function setMetaDescription(?string $metaDescription);

public function setOldUrls($oldUrls);

public function getOldUrls(): ?array;

public function getSlug(): ?string;

public function setSlug(?string $slug);

public function getPosition(): float;

public function setPosition(float $position);

public function clearPosition();

public function getStatus(): ?float;

public function setStatus(float $status);

public function getCreatedAt(): ?\DateTimeInterface;

public function setCreatedAt(\DateTimeInterface $createdAt);

public function getUpdatedAt(): ?\DateTimeInterface;

}
public function setUpdatedAt(\DateTimeInterface $updatedAt);
}

+ 1
- 5
Model/File/DocumentModel.php View File

@@ -6,20 +6,16 @@ use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface;
use Gedmo\Mapping\Annotation as Gedmo;
use Lc\CaracoleBundle\Doctrine\Extension\FilterSectionInterface;
use Lc\CaracoleBundle\Model\Address\AddressInterface;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Order\OrderRefundInterface;
use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\SovBundle\Doctrine\Extension\BlameableNullableTrait;
use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity;

/**
* @ORM\MappedSuperclass()
*/
abstract class DocumentModel extends AbstractFullEntity implements FilterMerchantInterface
abstract class DocumentModel extends AbstractFullEntity implements FilterMerchantInterface, DocumentInterface
{
const TYPE_INVOICE = 'invoice';
const TYPE_QUOTATION = 'quotation';

+ 111
- 1
Model/Merchant/MerchantInterface.php View File

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

namespace Lc\CaracoleBundle\Model\Merchant;


use Doctrine\Common\Collections\Collection;
use Lc\CaracoleBundle\Model\Address\AddressInterface;
use Lc\CaracoleBundle\Model\Config\TaxRateInterface;
use Lc\CaracoleBundle\Model\PointSale\PointSaleInterface;
use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\CaracoleBundle\Model\Setting\MerchantSettingInterface;
use Lc\SovBundle\Doctrine\Extension\SortableTrait;
use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity;
use Lc\SovBundle\Model\User\GroupUserInterface;
use Lc\SovBundle\Model\User\UserInterface;

interface MerchantInterface
{
public function getTitle(): ?string;

public function setTitle(string $title);

public function getDescription(): ?string;

public function setDescription(?string $description);

public function getCreatedBy(): ?UserInterface;

public function setCreatedBy(?UserInterface $createdBy);

public function getUpdatedBy(): ?UserInterface;

public function setUpdatedBy(?UserInterface $updatedBy);

public function getDevAlias(): ?string;

public function setDevAlias(?string $devAlias);

public function getTaxRate(): ?TaxRateInterface;

public function setTaxRate(?TaxRateInterface $taxRate): MerchantInterface;

/**
* @return Collection|PointSaleInterface[]
*/
public function getPointSales(): Collection;

public function addPointSale(PointSaleInterface $pointSale): MerchantInterface;

public function removePointSale(PointSaleInterface $pointSale): MerchantInterface;

/**
* @return Collection|MerchantSettingInterface[]
*/
public function getSettings(): ?Collection;

public function addSetting(MerchantSettingInterface $merchantSetting
): MerchantInterface;

public function removeSetting(MerchantSettingInterface $merchantSetting
): MerchantInterface;

public function getAddress(): ?AddressInterface;

public function setAddress(AddressInterface $address): MerchantInterface;

/**
* @return Collection|GroupUserInterface[]
*/
public function getGroupUsers(): Collection;

public function addGroupUser(GroupUserInterface $groupUser): MerchantInterface;

public function removeGroupUser(GroupUserInterface $groupUser): MerchantInterface;

/**
* @return Collection|SectionInterface[]
*/
public function getSections(): ?Collection;

public function addSection(SectionInterface $section): MerchantInterface;

public function removeSection(SectionInterface $section): MerchantInterface;

public function getMetaTitle(): ?string;

public function setMetaTitle(?string $metaTitle);

public function getMetaDescription(): ?string;

public function setMetaDescription(?string $metaDescription);

public function setOldUrls($oldUrls);

public function getOldUrls(): ?array;

public function getSlug(): ?string;

public function setSlug(?string $slug);

public function getPosition(): float;

public function setPosition(float $position);

public function clearPosition();

public function getStatus(): ?float;

public function setStatus(float $status);

public function getCreatedAt(): ?\DateTimeInterface;

public function setCreatedAt(\DateTimeInterface $createdAt);

public function getUpdatedAt(): ?\DateTimeInterface;

}
public function setUpdatedAt(\DateTimeInterface $updatedAt);
}

+ 1
- 1
Model/Merchant/MerchantModel.php View File

@@ -16,7 +16,7 @@ use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity;
/**
* @ORM\MappedSuperclass()
*/
abstract class MerchantModel extends AbstractFullEntity
abstract class MerchantModel extends AbstractFullEntity implements MerchantInterface
{

/**

+ 53
- 2
Model/Order/OrderPaymentInterface.php View File

@@ -1,8 +1,59 @@
<?php

namespace Lc\CaracoleBundle\Model\Order ;
namespace Lc\CaracoleBundle\Model\Order;


use Lc\SovBundle\Model\User\UserInterface;

interface OrderPaymentInterface
{
public function getCreatedBy(): ?UserInterface;

public function setCreatedBy(?UserInterface $createdBy);

public function getUpdatedBy(): ?UserInterface;

public function setUpdatedBy(?UserInterface $updatedBy);

public function getDevAlias(): ?string;

public function setDevAlias(?string $devAlias);

public function getOrderShop(): ?OrderShopInterface;

public function setOrderShop(?OrderShopInterface $orderShop): OrderPaymentInterface;

public function setEditable(bool $editable): OrderPaymentInterface;

public function getEditable(): ?bool;

public function isEditable(): ?bool;

public function setMeanPayment(?string $meanPayment);

public function getMeanPayment(): ?string;

public function getReference(): ?string;

public function setReference(?string $reference);

public function getPaidAt(): ?\DateTimeInterface;

public function setPaidAt(?\DateTimeInterface $paidAt);

public function getAmount(): ?float;

public function setAmount(float $amount);

public function getComment(): ?string;

public function setComment(?string $comment);

public function getCreatedAt(): ?\DateTimeInterface;

public function setCreatedAt(\DateTimeInterface $createdAt);

public function getUpdatedAt(): ?\DateTimeInterface;

}
public function setUpdatedAt(\DateTimeInterface $updatedAt);
}

+ 1
- 1
Model/Order/OrderPaymentModel.php View File

@@ -10,7 +10,7 @@ use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;
/**
* @ORM\MappedSuperclass()
*/
abstract class OrderPaymentModel extends AbstractLightEntity implements OrderPayoffInterface
abstract class OrderPaymentModel extends AbstractLightEntity implements OrderPayoffInterface, OrderPaymentInterface
{
use OrderPayoffTrait;


+ 53
- 1
Model/Order/OrderProductInterface.php View File

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

namespace Lc\CaracoleBundle\Model\Order;


use Lc\CaracoleBundle\Model\Config\TaxRateInterface;
use Lc\CaracoleBundle\Model\Config\UnitInterface;
use Lc\CaracoleBundle\Model\Product\ProductInterface;

interface OrderProductInterface
{
public function getOrderShop(): ?OrderShopInterface;

public function setOrderShop(?OrderShopInterface $orderShop): OrderProductInterface;

public function getProduct(): ?ProductInterface;

public function setProduct(?ProductInterface $product): OrderProductInterface;

public function getQuantityOrder(): ?int;

public function setQuantityOrder(int $quantityOrder): OrderProductInterface;

public function getQuantityProduct(): ?float;

public function setQuantityProduct(float $quantityProduct): OrderProductInterface;

public function getTitle(): ?string;

public function setTitle(string $title): OrderProductInterface;

public function getOrderProductReductionCatalog(): ?OrderProductReductionCatalogInterface;

public function setOrderProductReductionCatalog(?OrderProductReductionCatalogInterface $orderProductReductionCatalog
): OrderProductInterface;

public function getPriceInherited(): ?float;

public function getUnitInherited(): ?UnitInterface;

public function getTaxRateInherited(): ?TaxRateInterface;

public function getBuyingPriceInherited(): ?float;

public function getBuyingPrice(): ?float;

public function setBuyingPrice(?float $buyingPrice): OrderProductInterface;

public function getPrice(): ?float;

public function setPrice(?float $price): OrderProductInterface;

public function getUnit(): ?UnitInterface;

public function setUnit(?UnitInterface $unit): OrderProductInterface;

public function getTaxRate(): ?TaxRateInterface;

}
public function setTaxRate(?TaxRateInterface $taxRate): OrderProductInterface;
}

+ 1
- 1
Model/Order/OrderProductModel.php View File

@@ -11,7 +11,7 @@ use Lc\SovBundle\Doctrine\EntityInterface;
/**
* @ORM\MappedSuperclass()
*/
abstract class OrderProductModel implements PriceInterface, EntityInterface
abstract class OrderProductModel implements PriceInterface, EntityInterface, OrderProductInterface
{
use PriceTrait;


+ 17
- 1
Model/Order/OrderProductReductionCatalogInterface.php View File

@@ -1,8 +1,24 @@
<?php

namespace Lc\CaracoleBundle\Model\Order ;
namespace Lc\CaracoleBundle\Model\Order;


interface OrderProductReductionCatalogInterface
{
public function getTitle(): ?string;

public function setTitle(string $title): OrderProductReductionCatalogInterface;

public function getValue(): ?float;

public function setValue(?float $value): OrderProductReductionCatalogInterface;

public function getUnit(): ?string;

public function setUnit(?string $unit): OrderProductReductionCatalogInterface;

public function getBehaviorTaxRate(): ?string;

public function setBehaviorTaxRate(?string $behaviorTaxRate
): OrderProductReductionCatalogInterface;
}

+ 2
- 1
Model/Order/OrderProductReductionCatalogModel.php View File

@@ -4,11 +4,12 @@ namespace Lc\CaracoleBundle\Model\Order;

use Doctrine\ORM\Mapping as ORM;
use Lc\CaracoleBundle\Doctrine\Extension\ReductionTrait;
use Lc\SovBundle\Doctrine\EntityInterface;

/**
* @ORM\MappedSuperclass()
*/
abstract class OrderProductReductionCatalogModel
abstract class OrderProductReductionCatalogModel implements EntityInterface, OrderProductReductionCatalogInterface
{
use ReductionTrait;


+ 20
- 1
Model/Order/OrderProductRefundInterface.php View File

@@ -2,6 +2,25 @@

namespace Lc\CaracoleBundle\Model\Order;


interface OrderProductRefundInterface
{
}
public function getQuantityRefund(): ?int;

public function setQuantityOrder(int $quantityRefund): OrderProductRefundInterface;

public function getPrice(): ?float;

public function setPrice(?float $price): OrderProductRefundInterface;

public function getTitleInherited(): ?string;

public function getTitle(): ?string;

public function setTitle(string $title): OrderProductRefundInterface;

public function getOrderProduct(): ?OrderProductInterface;

public function setOrderProduct(OrderProductInterface $orderProduct
): OrderProductRefundInterface;
}

+ 2
- 1
Model/Order/OrderProductRefundModel.php View File

@@ -3,12 +3,13 @@
namespace Lc\CaracoleBundle\Model\Order;

use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Doctrine\EntityInterface;


/**
* @ORM\MappedSuperclass()
*/
abstract class OrderProductRefundModel
abstract class OrderProductRefundModel implements EntityInterface, OrderProductRefundInterface
{
/**
* @ORM\Column(type="integer")

+ 45
- 1
Model/Order/OrderReductionCartInterface.php View File

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

namespace Lc\CaracoleBundle\Model\Order;


use Lc\CaracoleBundle\Model\Reduction\ReductionCartInterface;

interface OrderReductionCartInterface
{
public function getTitle(): ?string;

public function setTitle(string $title): OrderReductionCartInterface;

public function getOrderShop(): ?OrderShopInterface;

public function setOrderShop(?OrderShopInterface $orderShop
): OrderReductionCartInterface;

public function getReductionCart(): ?ReductionCartInterface;

public function setReductionCart(?ReductionCartInterface $reductionCart
): OrderReductionCartInterface;

public function getCodeUsed(): ?string;

public function setCodeUsed(?string $codeUsed): OrderReductionCartInterface;

public function getFreeShipping(): ?bool;

public function setFreeShipping(?bool $freeShipping): OrderReductionCartInterface;

public function getAppliedTo(): ?string;

public function setAppliedTo(string $appliedTo): OrderReductionCartInterface;

public function getType(): ?string;

public function setType(string $type): OrderReductionCartInterface;

public function getValue(): ?float;

public function setValue(?float $value): OrderReductionCartInterface;

public function getUnit(): ?string;

public function setUnit(?string $unit): OrderReductionCartInterface;

public function getBehaviorTaxRate(): ?string;

}
public function setBehaviorTaxRate(?string $behaviorTaxRate
): OrderReductionCartInterface;
}

+ 1
- 1
Model/Order/OrderReductionCartModel.php View File

@@ -13,7 +13,7 @@ use Lc\SovBundle\Doctrine\EntityInterface;
/**
* @ORM\MappedSuperclass()
*/
abstract class OrderReductionCartModel implements EntityInterface, ReductionInterface, ReductionCartPropertyInterface
abstract class OrderReductionCartModel implements EntityInterface, ReductionInterface, ReductionCartPropertyInterface, OrderReductionCartInterface
{
use ReductionTrait;
use ReductionCartPropertyTrait;

+ 33
- 1
Model/Order/OrderReductionCreditInterface.php View File

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

namespace Lc\CaracoleBundle\Model\Order;


use Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface;

interface OrderReductionCreditInterface
{
public function getTitle(): ?string;

public function setTitle(string $title): OrderReductionCreditInterface;

public function getOrderShop(): ?OrderShopInterface;

public function setOrderShop(?OrderShopInterface $orderShop
): OrderReductionCreditInterface;

public function getReductionCredit(): ?ReductionCreditInterface;

public function setReductionCredit(?ReductionCreditInterface $reductionCredit
): OrderReductionCreditInterface;

public function getType(): ?string;

public function setType(string $type): OrderReductionCreditInterface;

public function getValue(): ?float;

public function setValue(?float $value): OrderReductionCreditInterface;

public function getUnit(): ?string;

public function setUnit(?string $unit): OrderReductionCreditInterface;

public function getBehaviorTaxRate(): ?string;

}
public function setBehaviorTaxRate(?string $behaviorTaxRate
): OrderReductionCreditInterface;
}

+ 2
- 1
Model/Order/OrderReductionCreditModel.php View File

@@ -6,11 +6,12 @@ use Doctrine\ORM\Mapping as ORM;
use Lc\CaracoleBundle\Doctrine\Extension\ReductionInterface;
use Lc\CaracoleBundle\Doctrine\Extension\ReductionTrait;
use Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface;
use Lc\SovBundle\Doctrine\EntityInterface;

/**
* @ORM\MappedSuperclass()
*/
abstract class OrderReductionCreditModel implements ReductionInterface
abstract class OrderReductionCreditModel implements ReductionInterface, EntityInterface, OrderReductionCreditInterface
{
use ReductionTrait;


+ 63
- 1
Model/Order/OrderRefundInterface.php View File

@@ -2,6 +2,68 @@

namespace Lc\CaracoleBundle\Model\Order;


use Lc\CaracoleBundle\Model\File\DocumentInterface;
use Lc\SovBundle\Model\User\UserInterface;

interface OrderRefundInterface
{
}
public function getCreatedBy(): ?UserInterface;

public function setCreatedBy(?UserInterface $createdBy);

public function getUpdatedBy(): ?UserInterface;

public function setUpdatedBy(?UserInterface $updatedBy);

public function getDevAlias(): ?string;

public function setDevAlias(?string $devAlias);

public function getOrderShop(): ?OrderShopInterface;

public function setOrderShop(?OrderShopInterface $orderShop): OrderRefundInterface;

public function setEditable(bool $editable): OrderRefundInterface;

public function getEditable(): ?bool;

public function isEditable(): ?bool;

public function getDeliveryRefundAmount(): ?float;

public function setDeliveryRefundAmount(?float $deliveryRefundAmount
): OrderRefundInterface;

public function getDocument(): ?DocumentInterface;

public function setDocument(DocumentInterface $document): OrderRefundInterface;

public function setMeanPayment(?string $meanPayment);

public function getMeanPayment(): ?string;

public function getReference(): ?string;

public function setReference(?string $reference);

public function getPaidAt(): ?\DateTimeInterface;

public function setPaidAt(?\DateTimeInterface $paidAt);

public function getAmount(): ?float;

public function setAmount(float $amount);

public function getComment(): ?string;

public function setComment(?string $comment);

public function getCreatedAt(): ?\DateTimeInterface;

public function setCreatedAt(\DateTimeInterface $createdAt);

public function getUpdatedAt(): ?\DateTimeInterface;

public function setUpdatedAt(\DateTimeInterface $updatedAt);
}

+ 1
- 1
Model/Order/OrderRefundModel.php View File

@@ -11,7 +11,7 @@ use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;
/**
* @ORM\MappedSuperclass()
*/
abstract class OrderRefundModel extends AbstractLightEntity implements OrderPayoffInterface
abstract class OrderRefundModel extends AbstractLightEntity implements OrderPayoffInterface, OrderRefundInterface
{
use OrderPayoffTrait;


+ 47
- 47
Model/Order/OrderShopInterface.php View File

@@ -18,27 +18,27 @@ interface OrderShopInterface
public function getValidationDate(): ?\DateTimeInterface;

public function setValidationDate(\DateTimeInterface $validationDate
): OrderShopModel;
): OrderShopInterface;

public function getUser(): ?UserInterface;

public function setUser(?UserInterface $user): OrderShopModel;
public function setUser(?UserInterface $user): OrderShopInterface;

public function getInvoiceAddress(): ?AddressInterface;

public function setInvoiceAddress(?AddressInterface $invoiceAddress): OrderShopModel;
public function setInvoiceAddress(?AddressInterface $invoiceAddress): OrderShopInterface;

public function getInvoiceAddressText(): ?string;

public function setInvoiceAddressText(string $invoiceAddressText): OrderShopModel;
public function setInvoiceAddressText(string $invoiceAddressText): OrderShopInterface;

public function getComment(): ?string;

public function setComment(?string $comment): OrderShopModel;
public function setComment(?string $comment): OrderShopInterface;

public function getMeanPayment(): ?string;

public function setMeanPayment(string $meanPayment): OrderShopModel;
public function setMeanPayment(string $meanPayment): OrderShopInterface;

/**
* @return Collection|OrderStatusHistoryInterface[]
@@ -46,43 +46,43 @@ interface OrderShopInterface
public function getOrderStatusHistories(): Collection;

public function addOrderStatusHistory(OrderStatusHistoryInterface $orderStatusHistory
): OrderShopModel;
): OrderShopInterface;

public function removeOrderStatusHistory(OrderStatusHistoryInterface $orderStatusHistory
): OrderShopModel;
): OrderShopInterface;

/**
* @return Collection|OrderPaymentInterface[]
*/
public function getOrderPayments($meanPayment = null): Collection;

public function addOrderPayment(OrderPaymentInterface $orderPayment): OrderShopModel;
public function addOrderPayment(OrderPaymentInterface $orderPayment): OrderShopInterface;

public function removeOrderPayment(OrderPaymentInterface $orderPayment
): OrderShopModel;
): OrderShopInterface;

/**
* @return Collection|OrderProductInterface[]
*/
public function getOrderProducts(): Collection;

public function addOrderProduct(OrderProductInterface $orderProduct): OrderShopModel;
public function addOrderProduct(OrderProductInterface $orderProduct): OrderShopInterface;

public function removeOrderProduct(OrderProductInterface $orderProduct
): OrderShopModel;
): OrderShopInterface;

public function getVisitor(): ?VisitorInterface;

public function setVisitor(?VisitorInterface $visitor): OrderShopModel;
public function setVisitor(?VisitorInterface $visitor): OrderShopInterface;

public function getDeliveryInfos(): ?string;

public function setDeliveryInfos(?string $deliveryInfos): OrderShopModel;
public function setDeliveryInfos(?string $deliveryInfos): OrderShopInterface;

public function getOrderStatus(): ?OrderStatusInterface;

public function setOrderStatusProtected(?OrderStatusInterface $orderStatus
): OrderShopModel;
): OrderShopInterface;

/**
* @return Collection|OrderReductionCartInterface[]
@@ -90,10 +90,10 @@ interface OrderShopInterface
public function getOrderReductionCarts(): Collection;

public function addOrderReductionCart(OrderReductionCartInterface $orderReductionCart
): OrderShopModel;
): OrderShopInterface;

public function removeOrderReductionCart(OrderReductionCartInterface $orderReductionCart
): OrderShopModel;
): OrderShopInterface;

/**
* @return Collection|OrderReductionCreditInterface[]
@@ -101,80 +101,80 @@ interface OrderShopInterface
public function getOrderReductionCredits(): Collection;

public function addOrderReductionCredit(OrderReductionCreditInterface $orderReductionCredit
): OrderShopModel;
): OrderShopInterface;

public function removeOrderReductionCredit(OrderReductionCreditInterface $orderReductionCredit
): OrderShopModel;
): OrderShopInterface;

/**
* @return Collection|DocumentInterface[]
*/
public function getDocuments(): Collection;

public function addDocument(DocumentInterface $document): OrderShopModel;
public function addDocument(DocumentInterface $document): OrderShopInterface;

public function removeDocument(DocumentInterface $document): OrderShopModel;
public function removeDocument(DocumentInterface $document): OrderShopInterface;

/**
* @return Collection|TicketInterface[]
*/
public function getTickets(): Collection;

public function addTicket(TicketInterface $ticket): OrderShopModel;
public function addTicket(TicketInterface $ticket): OrderShopInterface;

public function removeTicket(TicketInterface $ticket): OrderShopModel;
public function removeTicket(TicketInterface $ticket): OrderShopInterface;

public function getSection(): ?SectionInterface;

public function setSection(?SectionInterface $section): OrderShopModel;
public function setSection(?SectionInterface $section): OrderShopInterface;

public function getCycleId(): ?int;

public function setCycleId(?int $cycleId): OrderShopModel;
public function setCycleId(?int $cycleId): OrderShopInterface;

public function getOrderShopCreatedAt(): ?\DateTimeInterface;

public function setOrderShopCreatedAt(?\DateTimeInterface $orderShopCreatedAt
): OrderShopModel;
): OrderShopInterface;

public function getIdValidOrder(): ?int;

public function setIdValidOrder(?int $idValidOrder): OrderShopModel;
public function setIdValidOrder(?int $idValidOrder): OrderShopInterface;

public function getDeliveryAddress(): ?AddressInterface;

public function setDeliveryAddress(?AddressInterface $deliveryAddress
): OrderShopModel;
): OrderShopInterface;

public function getDeliveryAddressText(): ?string;

public function setDeliveryAddressText(string $deliveryAddressText): OrderShopModel;
public function setDeliveryAddressText(string $deliveryAddressText): OrderShopInterface;

public function getDeliveryPointSale(): ?PointSaleInterface;

public function setDeliveryPointSale(?PointSaleInterface $deliveryPointSale
): OrderShopModel;
): OrderShopInterface;

public function getDeliveryType(): ?string;

public function setDeliveryType(?string $deliveryType): OrderShopModel;
public function setDeliveryType(?string $deliveryType): OrderShopInterface;

public function getDeliveryPrice(): ?float;

public function setDeliveryPrice(?float $deliveryPrice): OrderShopModel;
public function setDeliveryPrice(?float $deliveryPrice): OrderShopInterface;

public function getDeliveryTaxRate(): ?TaxRateInterface;

public function setDeliveryTaxRate(?TaxRateInterface $deliveryTaxRate
): OrderShopModel;
): OrderShopInterface;

public function getReference(): ?string;

public function setReference(?string $reference): OrderShopModel;
public function setReference(?string $reference): OrderShopInterface;

public function getMainOrderShop(): ?self;

public function setMainOrderShop(?OrderShopModel $mainOrderShop): OrderShopModel;
public function setMainOrderShop(?OrderShopModel $mainOrderShop): OrderShopInterface;

/**
* @return Collection|OrderShopInterface[]
@@ -182,54 +182,54 @@ interface OrderShopInterface
public function getComplementaryOrderShops(): Collection;

public function addComplementaryOrderShop(OrderShopModel $complementaryOrderShop
): OrderShopModel;
): OrderShopInterface;

public function removeComplementaryOrderShop(OrderShopModel $complementaryOrderShop
): OrderShopModel;
): OrderShopInterface;

public function getDeclineComplementaryOrderShop(): ?bool;

public function setDeclineComplementaryOrderShop(?bool $declineComplementaryOrderShop
): OrderShopModel;
): OrderShopInterface;

public function getOrderAllowByAdmin(): ?bool;

public function setOrderAllowByAdmin(?bool $orderAllowByAdmin): OrderShopModel;
public function setOrderAllowByAdmin(?bool $orderAllowByAdmin): OrderShopInterface;

public function getHasReach(): ?int;

public function setHasReach(?int $hasReach): OrderShopModel;
public function setHasReach(?int $hasReach): OrderShopInterface;

public function getStatTotal(): ?float;

public function setStatTotal(?float $statTotal): OrderShopModel;
public function setStatTotal(?float $statTotal): OrderShopInterface;

public function getStatTotalWithTax(): ?float;

public function setStatTotalWithTax(?float $statTotalWithTax): OrderShopModel;
public function setStatTotalWithTax(?float $statTotalWithTax): OrderShopInterface;

public function getStatTotalOrderProductsWithReductions(): ?float;

public function setStatTotalOrderProductsWithReductions(?float $statTotalOrderProductsWithReductions
): OrderShopModel;
): OrderShopInterface;

public function getStatTotalOrderProductsWithTaxAndReductions(): ?float;

public function setStatTotalOrderProductsWithTaxAndReductions(?float $statTotalOrderProductsWithTaxAndReductions
): OrderShopModel;
): OrderShopInterface;

public function getStatMarginOrderProductsWithReductions(): ?float;

public function setStatMarginOrderProductsWithReductions(?float $statMarginOrderProductsWithReductions
): OrderShopModel;
): OrderShopInterface;

public function getStatDeliveryPriceWithReduction(): ?float;

public function setStatDeliveryPriceWithReduction(?float $statDeliveryPriceWithReduction
): OrderShopModel;
): OrderShopInterface;

public function getStatDeliveryPriceWithTaxAndReduction(): ?float;

public function setStatDeliveryPriceWithTaxAndReduction(?float $statDeliveryPriceWithTaxAndReduction
): OrderShopModel;
): OrderShopInterface;
}

+ 36
- 1
Model/Order/OrderStatusHistoryInterface.php View File

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

namespace Lc\CaracoleBundle\Model\Order;


use Lc\SovBundle\Model\User\UserInterface;

interface OrderStatusHistoryInterface
{
public function getCreatedBy(): ?UserInterface;

public function setCreatedBy(?UserInterface $createdBy);

public function getUpdatedBy(): ?UserInterface;

public function setUpdatedBy(?UserInterface $updatedBy);

public function getDevAlias(): ?string;

public function setDevAlias(?string $devAlias);

public function getOrderShop(): ?OrderShopInterface;

public function setOrderShop(?OrderShopInterface $orderShop
): OrderStatusHistoryInterface;

public function getOrderStatus(): ?OrderStatusInterface;

public function setOrderStatus(?OrderStatusInterface $orderStatus
): OrderStatusHistoryInterface;

public function getOrigin(): ?string;

public function setOrigin(string $origin): OrderStatusHistoryInterface;

public function getCreatedAt(): ?\DateTimeInterface;

public function setCreatedAt(\DateTimeInterface $createdAt);

public function getUpdatedAt(): ?\DateTimeInterface;

}
public function setUpdatedAt(\DateTimeInterface $updatedAt);
}

+ 1
- 3
Model/Order/OrderStatusHistoryModel.php View File

@@ -3,15 +3,13 @@
namespace Lc\CaracoleBundle\Model\Order;

use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Lc\SovBundle\Doctrine\Extension\BlameableNullableTrait;
use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;


/**
* @ORM\MappedSuperclass()
*/
abstract class OrderStatusHistoryModel extends AbstractLightEntity
abstract class OrderStatusHistoryModel extends AbstractLightEntity implements OrderStatusHistoryInterface
{



+ 24
- 1
Model/Order/OrderStatusInterface.php View File

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

namespace Lc\CaracoleBundle\Model\Order;


use Doctrine\Common\Collections\Collection;

interface OrderStatusInterface
{
public function getTitle(): ?string;

public function setTitle(string $title): OrderStatusInterface;

public function getDescription(): ?string;

public function setDescription(?string $description): OrderStatusInterface;

public function getNextStatusAllowed(): Collection;

public function addNextStatusAllowed(OrderStatusInterface $nextStatusAllowed): OrderStatusInterface;

public function removeNextStatusAllowed(OrderStatusInterface $nextStatusAllowed): OrderStatusInterface;

public function getAlias(): ?string;

public function setAlias(string $alias): OrderStatusInterface;

public function getColor(): ?string;

}
public function setColor(?string $color): OrderStatusInterface;
}

+ 3
- 3
Model/Order/OrderStatusModel.php View File

@@ -10,7 +10,7 @@ use Lc\SovBundle\Doctrine\EntityInterface;
/**
* @ORM\MappedSuperclass()
*/
abstract class OrderStatusModel implements EntityInterface
abstract class OrderStatusModel implements EntityInterface, OrderStatusInterface
{
const ALIAS_CART = 'cart';
const ALIAS_CART_CANCELED = 'cart-canceled';
@@ -116,7 +116,7 @@ abstract class OrderStatusModel implements EntityInterface
return $this->nextStatusAllowed;
}

public function addNextStatusAllowed(self $nextStatusAllowed): self
public function addNextStatusAllowed(OrderStatusInterface $nextStatusAllowed): self
{
if (!$this->nextStatusAllowed->contains($nextStatusAllowed)) {
$this->nextStatusAllowed[] = $nextStatusAllowed;
@@ -125,7 +125,7 @@ abstract class OrderStatusModel implements EntityInterface
return $this;
}

public function removeNextStatusAllowed(self $nextStatusAllowed): self
public function removeNextStatusAllowed(OrderStatusInterface $nextStatusAllowed): self
{
if ($this->nextStatusAllowed->contains($nextStatusAllowed)) {
$this->nextStatusAllowed->removeElement($nextStatusAllowed);

+ 112
- 1
Model/PointSale/PointSaleInterface.php View File

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

namespace Lc\CaracoleBundle\Model\PointSale;


use App\Entity\File\File;
use Doctrine\Common\Collections\Collection;
use Lc\CaracoleBundle\Model\Address\AddressInterface;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\User\UserPointSaleInterface;
use Lc\SovBundle\Model\User\UserInterface;

interface PointSaleInterface
{
public function getTitle(): ?string;

public function setTitle(string $title);

public function getDescription(): ?string;

public function setDescription(?string $description);

public function getCreatedBy(): ?UserInterface;

public function setCreatedBy(?UserInterface $createdBy);

public function getUpdatedBy(): ?UserInterface;

public function setUpdatedBy(?UserInterface $updatedBy);

public function getDevAlias(): ?string;

public function setDevAlias(?string $devAlias);

public function getOrderAmountMin(): ?float;

public function setOrderAmountMin(float $orderAmountMin): PointSaleInterface;

/**
* @return Collection|MerchantInterface[]
*/
public function getMerchants(): Collection;

public function addMerchant(MerchantInterface $merchant): PointSaleInterface;

public function removeMerchant(MerchantInterface $merchant): PointSaleInterface;

public function getCode(): ?string;

public function setCode(?string $code): PointSaleInterface;

public function getDeliveryPrice(): ?float;

public function setDeliveryPrice(float $deliveryPrice): PointSaleInterface;

public function getIsPublic(): ?bool;

public function setIsPublic(bool $isPublic): PointSaleInterface;

public function getAddress(): ?AddressInterface;

public function setAddress(AddressInterface $address): PointSaleInterface;

/**
* @return Collection|UserPointSaleInterface[]
*/
public function getUserPointSales(): Collection;

public function addUserPointSale(UserPointSaleInterface $userPointSale
): PointSaleInterface;

public function removeUserPointSale(UserPointSaleInterface $userPointSale
): PointSaleInterface;

public function getImage(): ?File;

public function setImage(?File $image): PointSaleInterface;

public function getMetaTitle(): ?string;

public function setMetaTitle(?string $metaTitle);

public function getMetaDescription(): ?string;

public function setMetaDescription(?string $metaDescription);

public function setOldUrls($oldUrls);

public function getOldUrls(): ?array;

public function getSlug(): ?string;

public function setSlug(?string $slug);

/**
* @return float
*/
public function getPosition(): float;

/**
* @param float $position
* @return $this
*/
public function setPosition(float $position);

public function clearPosition();

public function getStatus(): ?float;

public function setStatus(float $status);

public function getCreatedAt(): ?\DateTimeInterface;

public function setCreatedAt(\DateTimeInterface $createdAt);

public function getUpdatedAt(): ?\DateTimeInterface;

}
public function setUpdatedAt(\DateTimeInterface $updatedAt);
}

+ 1
- 1
Model/PointSale/PointSaleModel.php View File

@@ -18,7 +18,7 @@ use App\Entity\File\File;
* @ORM\MappedSuperclass()
*/
abstract class PointSaleModel extends AbstractFullEntity implements FilterMultipleMerchantsInterface,
OrderAmountMinInterface
OrderAmountMinInterface, PointSaleInterface
{

use OrderAmountMinTrait;

+ 69
- 13
Model/Product/ProductCategoryInterface.php View File

@@ -5,28 +5,46 @@ namespace Lc\CaracoleBundle\Model\Product;

use Doctrine\Common\Collections\Collection;
use Lc\CaracoleBundle\Model\Section\SectionInterface;

use Lc\SovBundle\Model\File\FileInterface;
use Lc\SovBundle\Model\User\UserInterface;

interface ProductCategoryInterface
{
public function getSection(): ?SectionInterface;
public function getTitle(): ?string;

public function setTitle(string $title);

public function getDescription(): ?string;

public function setDescription(?string $description);

public function getCreatedBy(): ?UserInterface;

public function setCreatedBy(?UserInterface $createdBy);

public function getUpdatedBy(): ?UserInterface;

public function setUpdatedBy(?UserInterface $updatedBy);

public function setSection(SectionInterface $section): ProductCategoryModel;
public function getDevAlias(): ?string;

public function getParent(): ?self;
public function setDevAlias(?string $devAlias);

public function setParent(?ProductCategoryModel $productCategory): ProductCategoryModel;
public function getSection(): SectionInterface;

public function setSection(SectionInterface $section): ProductCategoryInterface;

public function getParent(): ?ProductCategoryInterface;

public function setParent(?ProductCategoryInterface $productCategory): ProductCategoryInterface;

public function getParentCategory();

/**
* @return Collection|self[]
*/
public function getChildrens(): Collection;

public function addChildren(ProductCategoryModel $productCategory): ProductCategoryModel;
public function addChildren(ProductCategoryInterface $productCategory): ProductCategoryInterface;

public function removeChildren(ProductCategoryModel $productCategory): ProductCategoryModel;
public function removeChildren(ProductCategoryInterface $productCategory): ProductCategoryInterface;

/**
* @return Collection|ProductFamilyInterface[]
@@ -34,14 +52,52 @@ interface ProductCategoryInterface
public function getProductFamilies(): Collection;

public function addProductFamily(ProductFamilyInterface $productFamily
): ProductCategoryModel;
): ProductCategoryInterface;

public function removeProductFamily(ProductFamilyInterface $productFamily
): ProductCategoryModel;
): ProductCategoryInterface;

public function countProductFamilies($status = null);

public function getSaleStatus(): ?bool;

public function setSaleStatus(bool $saleStatus): ProductCategoryModel;
public function setSaleStatus(bool $saleStatus): ProductCategoryInterface;

public function getImage(): ?FileInterface;

public function setImage(?FileInterface $image): ProductCategoryInterface;

public function getMetaTitle(): ?string;

public function setMetaTitle(?string $metaTitle);

public function getMetaDescription(): ?string;

public function setMetaDescription(?string $metaDescription);

public function setOldUrls($oldUrls);

public function getOldUrls(): ?array;

public function getSlug(): ?string;

public function setSlug(?string $slug);

public function getPosition(): float;

public function setPosition(float $position);

public function clearPosition();

public function getStatus(): ?float;

public function setStatus(float $status);

public function getCreatedAt(): ?\DateTimeInterface;

public function setCreatedAt(\DateTimeInterface $createdAt);

public function getUpdatedAt(): ?\DateTimeInterface;

public function setUpdatedAt(\DateTimeInterface $updatedAt);
}

+ 3
- 3
Model/Product/ProductCategoryModel.php View File

@@ -81,7 +81,7 @@ abstract class ProductCategoryModel extends AbstractFullEntity implements TreeIn
return $this->parent;
}

public function setParent(?self $productCategory): self
public function setParent(?ProductCategoryInterface $productCategory): self
{
$this->parent = $productCategory;

@@ -113,7 +113,7 @@ abstract class ProductCategoryModel extends AbstractFullEntity implements TreeIn
return new ArrayCollection(iterator_to_array($iterator));
}

public function addChildren(self $productCategory): self
public function addChildren(ProductCategoryInterface $productCategory): self
{
if (!$this->childrens->contains($productCategory)) {
$this->childrens[] = $productCategory;
@@ -123,7 +123,7 @@ abstract class ProductCategoryModel extends AbstractFullEntity implements TreeIn
return $this;
}

public function removeChildren(self $productCategory): self
public function removeChildren(ProductCategoryInterface $productCategory): self
{
if ($this->childrens->contains($productCategory)) {
$this->childrens->removeElement($productCategory);

+ 307
- 0
Model/Product/ProductFamilyInterface.php View File

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

namespace Lc\CaracoleBundle\Model\Product;


use Doctrine\Common\Collections\Collection;
use Lc\CaracoleBundle\Model\Config\TaxRateInterface;
use Lc\CaracoleBundle\Model\Config\UnitInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionCatalogInterface;
use Lc\SovBundle\Model\File\FileInterface;
use Lc\SovBundle\Model\User\UserInterface;

interface ProductFamilyInterface
{
public function getTitle(): ?string;

public function setTitle(string $title);

public function getDescription(): ?string;

public function setDescription(?string $description);

public function getCreatedBy(): ?UserInterface;

public function setCreatedBy(?UserInterface $createdBy);

public function getUpdatedBy(): ?UserInterface;

public function setUpdatedBy(?UserInterface $updatedBy);

public function getDevAlias(): ?string;

public function setDevAlias(?string $devAlias);

public function getPriceInherited(): ?float;

public function getUnitInherited(): ?UnitInterface;

public function getTaxRateInherited(): ?TaxRateInterface;

public function getBuyingPriceInherited(): ?float;

public function getBuyingPrice(): ?float;

public function setBuyingPrice(?float $buyingPrice): ProductFamilyInterface;

public function getPrice(): ?float;

public function setPrice(?float $price): ProductFamilyInterface;

public function getUnit(): ?UnitInterface;

public function setUnit(?UnitInterface $unit): ProductFamilyInterface;

public function getTaxRate(): ?TaxRateInterface;

public function setTaxRate(?TaxRateInterface $taxRate): ProductFamilyInterface;

public function getActiveProducts(): ?bool;

public function setActiveProducts(bool $activeProducts): ProductFamilyInterface;

public function getProductsQuantityAsTitle(): ?bool;

public function setProductsQuantityAsTitle(bool $productsQuantityAsTitle
): ProductFamilyInterface;

public function getProductsType(): ?string;

public function setProductsType(?string $productsType): ProductFamilyInterface;

public function getQuantityLabel(): ?string;

public function setQuantityLabel(?string $quantityLabel): ProductFamilyInterface;

/**
* @return Collection|ProductInterface[]
*/
public function getProducts(): Collection;

public function addProduct(ProductInterface $product): ProductFamilyInterface;

public function removeProduct(ProductInterface $product): ProductFamilyInterface;

public function getReductionCatalog(): ?ReductionCatalogInterface;

public function setReductionCatalog(?ReductionCatalogInterface $reductionCatalog
): ProductFamilyInterface;

/**
* @return Collection|ProductCategoryInterface[]
*/
public function getProductCategories(): Collection;

public function initProductCategories();

public function addProductCategory(ProductCategoryInterface $productCategory
): ProductFamilyInterface;

public function removeProductCategory(ProductCategoryInterface $productCategory
): ProductFamilyInterface;

public function getSubtitle(): ?string;

public function setSubtitle(?string $subtitle): ProductFamilyInterface;

public function getWarningMessage(): ?string;

public function setWarningMessage(?string $warningMessage): ProductFamilyInterface;

public function getWarningMessageType(): ?string;

public function setWarningMessageType(?string $warningMessageType
): ProductFamilyInterface;

public function getNote(): ?string;

public function setNote(?string $note): ProductFamilyInterface;

public function getBehaviorOutOfStock(): ?string;

public function setBehaviorOutOfStock(?string $behaviorOutOfStock
): ProductFamilyInterface;

public function getBehaviorCountStock(): ?string;

public function setBehaviorCountStock(string $behaviorCountStock
): ProductFamilyInterface;

public function getExportTitle(): ?string;

public function setExportTitle(?string $exportTitle): ProductFamilyInterface;

public function getExportNote(): ?string;

public function setExportNote(?string $exportNote): ProductFamilyInterface;

public function getBehaviorStockCycle(): ?string;

public function setBehaviorStockCycle(string $behaviorStockCycle
): ProductFamilyInterface;

public function getBehaviorDisplaySale(): ?string;

public function setBehaviorDisplaySale(string $behaviorDisplaySale
): ProductFamilyInterface;

public function getPropertyNoveltyExpirationDate(): ?\DateTimeInterface;

public function setPropertyNoveltyExpirationDate(?\DateTimeInterface $propertyNoveltyExpirationDate
): ProductFamilyInterface;

public function getPropertyOrganicLabel(): ?string;

public function setPropertyOrganicLabel(?string $propertyOrganicLabel
): ProductFamilyInterface;

public function getPropertyAllergens(): ?string;

public function setPropertyAllergens(?string $propertyAllergens
): ProductFamilyInterface;

public function getPropertyComposition(): ?string;

public function setPropertyComposition(?string $propertyComposition
): ProductFamilyInterface;

public function getPropertyFragrances(): ?string;

public function setPropertyFragrances(?string $propertyFragrances
): ProductFamilyInterface;

public function getBehaviorExpirationDate(): ?string;

public function setBehaviorExpirationDate(?string $behaviorExpirationDate
): ProductFamilyInterface;

public function getTypeExpirationDate(): ?string;

public function setTypeExpirationDate(?string $typeExpirationDate
): ProductFamilyInterface;

public function getPropertyWeight(): ?string;

public function setPropertyWeight(?string $propertyWeight): ProductFamilyInterface;

public function getPropertyQuantity(): ?string;

public function setPropertyQuantity(?string $propertyQuantity): ProductFamilyInterface;

public function getPropertyVariety(): ?string;

public function setPropertyVariety(?string $propertyVariety): ProductFamilyInterface;

public function getPropertyFeature(): ?string;

public function setPropertyFeature(?string $propertyFeature): ProductFamilyInterface;

public function getPropertyAlcoholLevel(): ?string;

public function setPropertyAlcoholLevel(?string $propertyAlcoholLevel
): ProductFamilyInterface;

public function getPropertyPackaging(): ?string;

public function setPropertyPackaging(?string $propertyPackaging
): ProductFamilyInterface;

public function getPropertyCharacteristics(): ?string;

public function setPropertyCharacteristics(?string $propertyCharacteristics
): ProductFamilyInterface;

public function getBehaviorAddToCart(): ?string;

public function setBehaviorAddToCart(?string $behaviorAddToCart
): ProductFamilyInterface;

public function getBehaviorPrice(): ?string;

public function setBehaviorPrice(?string $behaviorPrice): ProductFamilyInterface;

public function getSaleStatus(): ?bool;

public function setSaleStatus(bool $saleStatus): ProductFamilyInterface;

public function getImage(): ?FileInterface;

public function setImage(?FileInterface $image): ProductFamilyInterface;

/**
* @return Collection|ProductFamilySectionPropertyInterface[]
*/
public function getProductFamilySectionProperties(): Collection;

public function addProductFamilySectionProperty(ProductFamilySectionPropertyInterface $productFamilySectionProperty
): ProductFamilyInterface;

public function removeProductFamilySectionProperty(
ProductFamilySectionPropertyInterface $productFamilySectionProperty
): ProductFamilyInterface;

/**
* @return Collection|QualityLabelInterface[]
*/
public function getQualityLabels(): Collection;

public function addQualityLabel(QualityLabelInterface $qualityLabel
): ProductFamilyInterface;

public function removeQualityLabel(QualityLabelInterface $qualityLabel
): ProductFamilyInterface;

public function getBuyingPriceByRefUnit(): ?float;

public function setBuyingPriceByRefUnit(?float $buyingPriceByRefUnit
): ProductFamilyInterface;

public function getPriceByRefUnit(): ?float;

public function setPriceByRefUnit(?float $priceByRefUnit): ProductFamilyInterface;

public function getQuantity(): ?float;

public function setQuantity(?float $quantity): ProductFamilyInterface;

public function getAvailableQuantity(): ?float;

public function setAvailableQuantity(?float $availableQuantity
): ProductFamilyInterface;

public function getAvailableQuantityDefault(): ?float;

public function setAvailableQuantityDefault(?float $availableQuantityDefault
): ProductFamilyInterface;

public function getPropertyExpirationDate(): ?string;

public function setPropertyExpirationDate(?string $propertyExpirationDate
): ProductFamilyInterface;

public function getMetaTitle(): ?string;

public function setMetaTitle(?string $metaTitle);

public function getMetaDescription(): ?string;

public function setMetaDescription(?string $metaDescription);

public function setOldUrls($oldUrls);

public function getOldUrls(): ?array;

public function getSlug(): ?string;

public function setSlug(?string $slug);

public function getPosition(): float;

public function setPosition(float $position);

public function clearPosition();

public function getStatus(): ?float;

public function setStatus(float $status);

public function getCreatedAt(): ?\DateTimeInterface;

public function setCreatedAt(\DateTimeInterface $createdAt);

public function getUpdatedAt(): ?\DateTimeInterface;

public function setUpdatedAt(\DateTimeInterface $updatedAt);
}

+ 15
- 1
Model/Product/ProductFamilySectionPropertyInterface.php View File

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

namespace Lc\CaracoleBundle\Model\Product;


use App\Entity\Product\ProductFamily;
use App\Entity\Section\Section;

interface ProductFamilySectionPropertyInterface
{
public function getSection(): ?Section;

public function setSection(?Section $section): ProductFamilySectionPropertyInterface;

public function getProductFamily(): ?ProductFamily;

public function setProductFamily(?ProductFamily $productFamily): ProductFamilySectionPropertyInterface;

public function getStatus(): ?float;

}
public function setStatus(float $status): ProductFamilySectionPropertyInterface;
}

+ 88
- 6
Model/Product/ProductInterface.php View File

@@ -3,29 +3,111 @@
namespace Lc\CaracoleBundle\Model\Product;


use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
use Lc\CaracoleBundle\Model\Config\TaxRateInterface;
use Lc\CaracoleBundle\Model\Config\UnitInterface;
use Lc\SovBundle\Model\User\UserInterface;

interface ProductInterface
{
public function getCreatedBy(): ?UserInterface;

public function setCreatedBy(?UserInterface $createdBy);

public function getUpdatedBy(): ?UserInterface;

public function setUpdatedBy(?UserInterface $updatedBy);

public function getDevAlias(): ?string;

public function setDevAlias(?string $devAlias);

public function getPriceInherited(): ?float;

public function getUnitInherited(): ?UnitInterface;

public function getTaxRateInherited(): ?TaxRateInterface;

public function getBuyingPriceInherited(): ?float;

public function getBuyingPrice(): ?float;

public function setBuyingPrice(?float $buyingPrice): ProductInterface;

public function getPrice(): ?float;

public function setPrice(?float $price): ProductInterface;

public function getUnit(): ?UnitInterface;

public function setUnit(?UnitInterface $unit): ProductInterface;

public function getTaxRate(): ?TaxRateInterface;

public function setTaxRate(?TaxRateInterface $taxRate): ProductInterface;

public function getProductFamily(): ?ProductFamilyInterface;

public function setProductFamily(?ProductFamilyInterface $productFamily
): \Lc\CaracoleBundle\Model\Product\ProductModel;
): ProductInterface;

public function getTitle(): ?string;

public function setTitle(?string $title): \Lc\CaracoleBundle\Model\Product\ProductModel;
public function setTitle(?string $title): ProductInterface;

public function getOriginProduct(): ?bool;

public function setOriginProduct(?bool $originProduct): \Lc\CaracoleBundle\Model\Product\ProductModel;
public function setOriginProduct(?bool $originProduct): ProductInterface;

public function getExportTitle(): ?string;

public function setExportTitle(?string $exportTitle): \Lc\CaracoleBundle\Model\Product\ProductModel;
public function setExportTitle(?string $exportTitle): ProductInterface;

public function getExportNote(): ?string;

public function setExportNote(?string $exportNote): \Lc\CaracoleBundle\Model\Product\ProductModel;
public function setExportNote(?string $exportNote): ProductInterface;

public function getBuyingPriceByRefUnit(): ?float;

public function setBuyingPriceByRefUnit(?float $buyingPriceByRefUnit
): ProductInterface;

public function getPriceByRefUnit(): ?float;

public function setPriceByRefUnit(?float $priceByRefUnit): ProductInterface;

public function getQuantity(): ?float;

public function setQuantity(?float $quantity): ProductInterface;

public function getAvailableQuantity(): ?float;

public function setAvailableQuantity(?float $availableQuantity): ProductInterface;

public function getAvailableQuantityDefault(): ?float;

public function setAvailableQuantityDefault(?float $availableQuantityDefault
): ProductInterface;

public function getPropertyExpirationDate(): ?string;

public function setPropertyExpirationDate(?string $propertyExpirationDate
): ProductInterface;

public function getPosition(): float;

public function setPosition(float $position);

public function clearPosition();

public function getStatus(): ?float;

public function setStatus(float $status);

public function getCreatedAt(): ?\DateTimeInterface;

public function setCreatedAt(\DateTimeInterface $createdAt);

public function getUpdatedAt(): ?\DateTimeInterface;

public function setUpdatedAt(\DateTimeInterface $updatedAt);
}

+ 60
- 0
Model/Product/QualityLabelInterface.php View File

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

namespace Lc\CaracoleBundle\Model\Product;


use Lc\SovBundle\Model\File\FileInterface;
use Lc\SovBundle\Model\User\UserInterface;

interface QualityLabelInterface
{
public function getTitle(): ?string;

public function setTitle(string $title);

public function getDescription(): ?string;

public function setDescription(?string $description);

public function getCreatedBy(): ?UserInterface;

public function setCreatedBy(?UserInterface $createdBy);

public function getUpdatedBy(): ?UserInterface;

public function setUpdatedBy(?UserInterface $updatedBy);

public function getDevAlias(): ?string;

public function setDevAlias(?string $devAlias);

public function getImage(): ?FileInterface;

public function setImage(?FileInterface $image): QualityLabelInterface;

public function getMetaTitle(): ?string;

public function setMetaTitle(?string $metaTitle);

public function getMetaDescription(): ?string;

public function setMetaDescription(?string $metaDescription);

public function setOldUrls($oldUrls);

public function getOldUrls(): ?array;

public function getSlug(): ?string;

public function setSlug(?string $slug);

public function getPosition(): float;

public function setPosition(float $position);

public function clearPosition();

public function getStatus(): ?float;

public function setStatus(float $status);

public function getCreatedAt(): ?\DateTimeInterface;

public function setCreatedAt(\DateTimeInterface $createdAt);

public function getUpdatedAt(): ?\DateTimeInterface;

public function setUpdatedAt(\DateTimeInterface $updatedAt);
}

+ 134
- 2
Model/Reduction/ReductionCartInterface.php View File

@@ -2,10 +2,142 @@

namespace Lc\CaracoleBundle\Model\Reduction;


use Doctrine\Common\Collections\Collection;
use Lc\CaracoleBundle\Model\PointSale;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\PointSale\PointSaleInterface;
use Lc\SovBundle\Model\User\GroupUserInterface;
use Lc\SovBundle\Model\User\UserInterface;

interface ReductionCartInterface
{
public function getCreatedBy(): ?UserInterface;

public function setCreatedBy(?UserInterface $createdBy);

public function getUpdatedBy(): ?UserInterface;

public function setUpdatedBy(?UserInterface $updatedBy);

public function getDevAlias(): ?string;

public function setDevAlias(?string $devAlias);

public function getOrderAmountMin(): ?float;

public function setOrderAmountMin(float $orderAmountMin): ReductionCartInterface;

public function getTitle(): ?string;

public function setTitle(string $title);

public function getMerchant(): MerchantInterface;

public function setMerchant(MerchantInterface $merchant): ReductionCartInterface;

public function getCodes(): ?array;

public function setCodes(?array $codes): ReductionCartInterface;

/**
* @return Collection|PointSaleInterface[]
*/
public function getPointSales(): Collection;

public function addPointSale(PointSaleInterface $pointSale): ReductionCartInterface;

public function removePointSale(PointSaleInterface $pointSale
): ReductionCartInterface;

public function getAvailableQuantity(): ?int;

public function setAvailableQuantity(int $availableQuantity): ReductionCartInterface;

public function getAvailableQuantityPerUser(): ?int;

public function setAvailableQuantityPerUser(int $availableQuantityPerUser
): ReductionCartInterface;

public function getUncombinables(): Collection;

public function addUncombinable(ReductionCartInterface $uncombinable): ReductionCartInterface;

public function removeUncombinables(ReductionCartInterface $uncombinable): ReductionCartInterface;

public function getUncombinableTypes(): ?array;

public function setUncombinableTypes(?array $uncombinableTypes
): ReductionCartInterface;

public function getAvailableQuantityPerCode(): ?int;

public function setAvailableQuantityPerCode(int $availableQuantityPerCode
): ReductionCartInterface;

public function getFreeShipping(): ?bool;

public function setFreeShipping(?bool $freeShipping): ReductionCartInterface;

public function getAppliedTo(): ?string;

public function setAppliedTo(string $appliedTo): ReductionCartInterface;

public function getType(): ?string;

public function setType(string $type): ReductionCartInterface;

/**
* @return Collection|UserInterface[]
*/
public function getUsers(): Collection;

public function addUser(UserInterface $user): ReductionCartInterface;

public function removeUser(UserInterface $user): ReductionCartInterface;

/**
* @return Collection|GroupUserInterface[]
*/
public function getGroupUsers(): Collection;

public function addGroupUser(GroupUserInterface $groupUser): ReductionCartInterface;

public function removeGroupUser(GroupUserInterface $groupUser
): ReductionCartInterface;

public function getDateStart(): ?\DateTimeInterface;

public function setDateStart(?\DateTimeInterface $dateStart): ReductionCartInterface;

public function getDateEnd(): ?\DateTimeInterface;

public function setDateEnd(?\DateTimeInterface $dateEnd): ReductionCartInterface;

public function getPermanent(): ?bool;

public function setPermanent(bool $permanent): ReductionCartInterface;

public function getValue(): ?float;

public function setValue(?float $value): ReductionCartInterface;

public function getUnit(): ?string;

public function setUnit(?string $unit): ReductionCartInterface;

public function getBehaviorTaxRate(): ?string;

public function setBehaviorTaxRate(?string $behaviorTaxRate): ReductionCartInterface;

public function getStatus(): ?float;

public function setStatus(float $status);

public function getCreatedAt(): ?\DateTimeInterface;

public function setCreatedAt(\DateTimeInterface $createdAt);

public function getUpdatedAt(): ?\DateTimeInterface;

}
public function setUpdatedAt(\DateTimeInterface $updatedAt);
}

+ 11
- 14
Model/Reduction/ReductionCartModel.php View File

@@ -6,7 +6,6 @@ use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface;
use Lc\CaracoleBundle\Doctrine\Extension\FilterSectionInterface;
use Lc\CaracoleBundle\Doctrine\Extension\OrderAmountMinInterface;
use Lc\CaracoleBundle\Doctrine\Extension\OrderAmountMinTrait;
use Lc\CaracoleBundle\Doctrine\Extension\ReductionCartPropertyInterface;
@@ -17,19 +16,18 @@ use Lc\CaracoleBundle\Doctrine\Extension\ReductionTrait;
use Lc\CaracoleBundle\Doctrine\Extension\ReductionPropertyInterface;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\PointSale\PointSaleInterface;
use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\SovBundle\Doctrine\Extension\StatusInterface;
use Lc\SovBundle\Doctrine\Extension\StatusTrait;
use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;
use Lc\SovBundle\Model\User\UserInterface;

/**
* @ORM\MappedSuperclass()
*/
abstract class ReductionCartModel extends AbstractLightEntity implements ReductionPropertyInterface, ReductionInterface,
ReductionCartPropertyInterface,
FilterSectionInterface,
OrderAmountMinInterface, StatusInterface
FilterMerchantInterface,
OrderAmountMinInterface,
StatusInterface, ReductionCartInterface
{
use StatusTrait;
use OrderAmountMinTrait;
@@ -48,10 +46,10 @@ abstract class ReductionCartModel extends AbstractLightEntity implements Reducti
protected $title;

/**
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Section\SectionInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface")
* @ORM\JoinColumn(nullable=false)
*/
protected $section;
protected $merchant;

/**
* @ORM\Column(type="array", nullable=true)
@@ -112,19 +110,18 @@ abstract class ReductionCartModel extends AbstractLightEntity implements Reducti
return $this;
}

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

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

return $this;
}


public function getCodes(): ?array
{
return $this->codes;
@@ -195,7 +192,7 @@ abstract class ReductionCartModel extends AbstractLightEntity implements Reducti
return $this->uncombinables;
}

public function addUncombinable(self $uncombinable): self
public function addUncombinable(ReductionCartInterface $uncombinable): self
{
if (!$this->uncombinables->contains($uncombinable)) {
$this->uncombinables[] = $uncombinable;
@@ -204,7 +201,7 @@ abstract class ReductionCartModel extends AbstractLightEntity implements Reducti
return $this;
}

public function removeUncombinables(self $uncombinable): self
public function removeUncombinables(ReductionCartInterface $uncombinable): self
{
if ($this->uncombinables->contains($uncombinable)) {
$this->uncombinables->removeElement($uncombinable);

+ 115
- 1
Model/Reduction/ReductionCatalogInterface.php View File

@@ -2,6 +2,120 @@

namespace Lc\CaracoleBundle\Model\Reduction;


use Doctrine\Common\Collections\Collection;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Product\ProductCategoryInterface;
use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface;
use Lc\SovBundle\Model\User\GroupUserInterface;
use Lc\SovBundle\Model\User\UserInterface;

interface ReductionCatalogInterface
{
}
public function getCreatedBy(): ?UserInterface;

public function setCreatedBy(?UserInterface $createdBy);

public function getUpdatedBy(): ?UserInterface;

public function setUpdatedBy(?UserInterface $updatedBy);

public function getDevAlias(): ?string;

public function setDevAlias(?string $devAlias);

public function getTitle(): ?string;

public function setTitle(string $title): ReductionCatalogInterface;

public function getMerchant(): MerchantInterface;

public function setMerchant(MerchantInterface $merchant): ReductionCatalogInterface;

/**
* @return Collection|ProductFamilyInterface[]
*/
public function getProductFamilies(): Collection;

public function addProductFamily(ProductFamilyInterface $productFamily
): ReductionCatalogInterface;

public function removeProductFamily(ProductFamilyInterface $productFamily
): ReductionCatalogInterface;

public function getProductFamily(): ?ProductFamilyInterface;

public function setProductFamily(?ProductFamilyInterface $productFamily
): ReductionCatalogInterface;

/**
* @return Collection|ProductCategoryInterface[]
*/
public function getProductCategories(): Collection;

public function addProductCategory(ProductCategoryInterface $productCategory
): ReductionCatalogInterface;

public function removeProductCategory(ProductCategoryInterface $productCategory
): ReductionCatalogInterface;

/**
* @return Collection|UserInterface[]
*/
public function getUsers(): Collection;

public function addUser(UserInterface $user): ReductionCatalogInterface;

public function removeUser(UserInterface $user): ReductionCatalogInterface;

/**
* @return Collection|GroupUserInterface[]
*/
public function getGroupUsers(): Collection;

public function addGroupUser(GroupUserInterface $groupUser
): ReductionCatalogInterface;

public function removeGroupUser(GroupUserInterface $groupUser
): ReductionCatalogInterface;

public function getDateStart(): ?\DateTimeInterface;

public function setDateStart(?\DateTimeInterface $dateStart
): ReductionCatalogInterface;

public function getDateEnd(): ?\DateTimeInterface;

public function setDateEnd(?\DateTimeInterface $dateEnd): ReductionCatalogInterface;

public function getPermanent(): ?bool;

public function setPermanent(bool $permanent): ReductionCatalogInterface;

public function getValue(): ?float;

public function setValue(?float $value): ReductionCatalogInterface;

public function getUnit(): ?string;

public function setUnit(?string $unit): ReductionCatalogInterface;

public function getBehaviorTaxRate(): ?string;

public function setBehaviorTaxRate(?string $behaviorTaxRate
): ReductionCatalogInterface;

public function getStatus(): ?float;

public function setStatus(float $status);

public function getCreatedAt(): ?\DateTimeInterface;

public function setCreatedAt(\DateTimeInterface $createdAt
);

public function getUpdatedAt(): ?\DateTimeInterface;

public function setUpdatedAt(\DateTimeInterface $updatedAt
);
}

+ 9
- 10
Model/Reduction/ReductionCatalogModel.php View File

@@ -5,15 +5,13 @@ namespace Lc\CaracoleBundle\Model\Reduction;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Lc\CaracoleBundle\Doctrine\Extension\FilterSectionInterface;
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface;
use Lc\CaracoleBundle\Doctrine\Extension\ReductionPropertyTrait;
use Lc\CaracoleBundle\Doctrine\Extension\ReductionTrait;
use Lc\CaracoleBundle\Doctrine\Extension\ReductionPropertyInterface;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Product\ProductCategoryInterface;
use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface;
use Lc\CaracoleBundle\Model\Product\ProductFamilyModel;
use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\SovBundle\Doctrine\Extension\StatusInterface;
use Lc\SovBundle\Doctrine\Extension\StatusTrait;
use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;
@@ -23,7 +21,8 @@ use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;
*/
abstract class ReductionCatalogModel extends AbstractLightEntity implements ReductionCatalogInterface,
ReductionPropertyInterface,
FilterSectionInterface, StatusInterface
FilterMerchantInterface,
StatusInterface
{
use StatusTrait;
use ReductionTrait;
@@ -37,10 +36,10 @@ abstract class ReductionCatalogModel extends AbstractLightEntity implements Redu
protected $title;

/**
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Section\SectionInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface")
* @ORM\JoinColumn(nullable=false)
*/
protected $section;
protected $merchant;

/**
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\Product\ProductFamilyInterface")
@@ -76,14 +75,14 @@ abstract class ReductionCatalogModel extends AbstractLightEntity implements Redu
return $this;
}

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

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

return $this;
}

+ 86
- 1
Model/Reduction/ReductionCreditInterface.php View File

@@ -2,6 +2,91 @@

namespace Lc\CaracoleBundle\Model\Reduction;


use Doctrine\Common\Collections\Collection;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\SovBundle\Model\User\UserInterface;

interface ReductionCreditInterface
{
}
public function getCreatedBy(): ?UserInterface;

public function setCreatedBy(?UserInterface $createdBy);

public function getUpdatedBy(): ?UserInterface;

public function setUpdatedBy(?UserInterface $updatedBy);

public function getDevAlias(): ?string;

public function setDevAlias(?string $devAlias);

public function getTitle(): ?string;

public function setTitle(string $title): ReductionCreditInterface;

public function getMerchant(): MerchantInterface;

public function setMerchant(MerchantInterface $merchant): ReductionCreditInterface;

public function getType(): ?string;

public function setType(string $type): ReductionCreditInterface;

/**
* @return Collection|UserInterface[]
*/
public function getUsers(): Collection;

public function addUser(UserInterface $user): ReductionCreditInterface;

public function removeUser(UserInterface $user): ReductionCreditInterface;

public function getSended(): ?bool;

public function setSended(?bool $sended): ReductionCreditInterface;

public function getOwner(): ?UserInterface;

public function setOwner(?UserInterface $owner): ReductionCreditInterface;

public function getActivationDate(): ?\DateTimeInterface;

public function setActivationDate(?\DateTimeInterface $activationDate
): ReductionCreditInterface;

public function getOwnerName(): ?string;

public function setOwnerName(?string $ownerName): ReductionCreditInterface;

public function getOwnerMessage(): ?string;

public function setOwnerMessage(?string $ownerMessage): ReductionCreditInterface;

public function getValue(): ?float;

public function setValue(?float $value): ReductionCreditInterface;

public function getUnit(): ?string;

public function setUnit(?string $unit): ReductionCreditInterface;

public function getBehaviorTaxRate(): ?string;

public function setBehaviorTaxRate(?string $behaviorTaxRate
): ReductionCreditInterface;

public function getStatus(): ?float;

public function setStatus(float $status): ReductionCreditInterface;

public function getCreatedAt(): ?\DateTimeInterface;

public function setCreatedAt(\DateTimeInterface $createdAt
);

public function getUpdatedAt(): ?\DateTimeInterface;

public function setUpdatedAt(\DateTimeInterface $updatedAt
);
}

+ 9
- 10
Model/Reduction/ReductionCreditModel.php View File

@@ -6,12 +6,10 @@ use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface;
use Lc\CaracoleBundle\Doctrine\Extension\FilterSectionInterface;
use Lc\CaracoleBundle\Doctrine\Extension\ReductionInterface;
use Lc\CaracoleBundle\Doctrine\Extension\ReductionTrait;
use Lc\CaracoleBundle\Model\Config\UnitModel;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\SovBundle\Doctrine\Extension\StatusInterface;
use Lc\SovBundle\Doctrine\Extension\StatusTrait;
use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity;
@@ -20,8 +18,9 @@ use Lc\SovBundle\Model\User\UserInterface;
/**
* @ORM\MappedSuperclass()
*/
abstract class ReductionCreditModel extends AbstractLightEntity implements ReductionInterface, FilterSectionInterface,
StatusInterface
abstract class ReductionCreditModel extends AbstractLightEntity implements ReductionInterface,
FilterMerchantInterface,
StatusInterface, ReductionCreditInterface
{
const TYPE_CREDIT = 'credit';
const TYPE_GIFT = 'gift';
@@ -40,10 +39,10 @@ abstract class ReductionCreditModel extends AbstractLightEntity implements Reduc
protected $users;

/**
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Section\SectionInterface")
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface")
* @ORM\JoinColumn(nullable=false)
*/
protected $section;
protected $merchant;

/**
* @ORM\Column(type="string", length=255)
@@ -99,14 +98,14 @@ abstract class ReductionCreditModel extends AbstractLightEntity implements Reduc
return $this;
}

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

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

return $this;
}

+ 22
- 1
Model/Section/OpeningInterface.php View File

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

namespace Lc\CaracoleBundle\Model\Section;


use Lc\SovBundle\Model\User\GroupUserInterface;

interface OpeningInterface
{
public function getDay(): ?int;

public function setDay(int $day): OpeningInterface;

public function getTimeStart(): ?\DateTimeInterface;

public function setTimeStart(?\DateTimeInterface $timeStart): OpeningInterface;

public function getTimeEnd(): ?\DateTimeInterface;

public function setTimeEnd(?\DateTimeInterface $timeEnd): OpeningInterface;

public function getSection(): ?SectionInterface;

public function setSection(?SectionInterface $section): OpeningInterface;

public function getGroupUser(): ?GroupUserInterface;

}
public function setGroupUser(?GroupUserInterface $groupUser): OpeningInterface;
}

+ 159
- 1
Model/Section/SectionInterface.php View File

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

namespace Lc\CaracoleBundle\Model\Section;


use Doctrine\Common\Collections\Collection;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
use Lc\CaracoleBundle\Model\Product\ProductCategoryInterface;
use Lc\CaracoleBundle\Model\Product\ProductFamilySectionPropertyInterface;
use Lc\CaracoleBundle\Model\Setting\SectionSettingInterface;
use Lc\SovBundle\Model\Newsletter\NewsletterInterface;
use Lc\SovBundle\Model\Site\NewsInterface;
use Lc\SovBundle\Model\Site\PageInterface;
use Lc\SovBundle\Model\User\UserInterface;

interface SectionInterface
{
public function getTitle(): ?string;

public function setTitle(string $title);

public function getDescription(): ?string;

public function setDescription(?string $description);

public function getCreatedBy(): ?UserInterface;

public function setCreatedBy(?UserInterface $createdBy);

public function getUpdatedBy(): ?UserInterface;

public function setUpdatedBy(?UserInterface $updatedBy);

public function getDevAlias(): ?string;

public function setDevAlias(?string $devAlias);

public function getMerchant(): ?MerchantInterface;

public function setMerchant(?MerchantInterface $merchant): SectionInterface;

public function getColor(): ?string;

public function setColor(string $color): SectionInterface;

public function getCycleType(): ?string;

public function setCycleType(string $cycleType): SectionInterface;

/**
* @return Collection|OrderShopInterface[]
*/
public function getOrderShops(): Collection;

public function addOrderShop(OrderShopInterface $orderShop): SectionInterface;

public function removeOrderShop(OrderShopInterface $orderShop): SectionInterface;

/**
* @return Collection|ProductCategoryInterface[]
*/
public function getProductCategories(): Collection;

public function addProductCategory(ProductCategoryInterface $productCategory
): SectionInterface;

public function removeProductCategory(ProductCategoryInterface $productCategory
): SectionInterface;

/**
* @return Collection|PageInterface[]
*/
public function getPages(): Collection;

public function addPage(PageInterface $page): SectionInterface;

public function removePage(PageInterface $page): SectionInterface;

/**
* @return Collection|NewsInterface[]
*/
public function getNews(): Collection;

public function addNews(NewsInterface $news): SectionInterface;

public function removeNews(NewsInterface $news): SectionInterface;

/**
* @return Collection|NewsletterInterface[]
*/
public function getNewsletters(): Collection;

public function addNewsletter(NewsletterInterface $newsletter): SectionInterface;

public function removeNewsletter(NewsletterInterface $newsletter): SectionInterface;

public function getIsDefault(): ?bool;

public function setIsDefault(?bool $isDefault): SectionInterface;

/**
* @return Collection|SectionSettingInterface[]
*/
public function getSettings(): Collection;

public function addSetting(SectionSettingInterface $sectionSetting): SectionInterface;

public function removeSetting(SectionSettingInterface $sectionSetting
): SectionInterface;

/**
* @return Collection|OpeningInterface[]
*/
public function getOpenings(): Collection;

public function addOpening(OpeningInterface $opening): SectionInterface;

public function removeOpening(OpeningInterface $opening): SectionInterface;

/**
* @return Collection|ProductFamilySectionPropertyInterface[]
*/
public function getProductFamilySectionProperties(): Collection;

public function addProductFamilySectionProperty(ProductFamilySectionPropertyInterface $productFamilySectionProperty
): SectionInterface;

public function removeProductFamilySectionProperty(
ProductFamilySectionPropertyInterface $productFamilySectionProperty
): SectionInterface;

public function getMetaTitle(): ?string;

public function setMetaTitle(?string $metaTitle);

public function getMetaDescription(): ?string;

public function setMetaDescription(?string $metaDescription);

public function setOldUrls($oldUrls);

public function getOldUrls(): ?array;

public function getSlug(): ?string;

public function setSlug(?string $slug);

public function getPosition(): float;

public function setPosition(float $position);

public function clearPosition();

public function getStatus(): ?float;

public function setStatus(float $status);

public function getCreatedAt(): ?\DateTimeInterface;

public function setCreatedAt(\DateTimeInterface $createdAt);

public function getUpdatedAt(): ?\DateTimeInterface;

}
public function setUpdatedAt(\DateTimeInterface $updatedAt);
}

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

@@ -20,7 +20,7 @@ use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity;
/**
* @ORM\MappedSuperclass()
*/
abstract class SectionModel extends AbstractFullEntity implements FilterMerchantInterface
abstract class SectionModel extends AbstractFullEntity implements FilterMerchantInterface, SectionInterface
{
const DEVALIAS_COMMON = 'common';


+ 22
- 0
Model/Setting/MerchantSettingInterface.php View File

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

namespace Lc\CaracoleBundle\Model\Setting;

use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\SovBundle\Model\File\FileInterface;
use Lc\SovBundle\Model\Setting\SettingModel;

interface MerchantSettingInterface
{
public function getMerchant(): MerchantInterface;

public function setMerchant(MerchantInterface $merchant): MerchantSettingInterface;

public function getName(): ?string;

public function setName(?string $name);

public function getText(): ?string;

public function setText($text);

public function getDate(): ?\DateTimeInterface;

public function setDate(?\DateTimeInterface $date);

public function getFile(): ?FileInterface;

public function setFile(?FileInterface $file);
}

+ 1
- 1
Model/Setting/MerchantSettingModel.php View File

@@ -8,7 +8,7 @@ use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Doctrine\EntityInterface;
use Lc\SovBundle\Model\Setting\SettingModel as SovSettingModel;

abstract class MerchantSettingModel extends SovSettingModel implements EntityInterface, FilterMerchantInterface
abstract class MerchantSettingModel extends SovSettingModel implements EntityInterface, FilterMerchantInterface, MerchantSettingInterface
{
/**
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface", inversedBy="settings")

+ 22
- 0
Model/Setting/SectionSettingInterface.php View File

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

namespace Lc\CaracoleBundle\Model\Setting;

use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\SovBundle\Model\File\FileInterface;
use Lc\SovBundle\Model\Setting\SettingModel;

interface SectionSettingInterface
{
public function getSection(): ?SectionInterface;

public function setSection(?SectionInterface $section): SectionSettingInterface;

public function getName(): ?string;

public function setName(?string $name);

public function getText(): ?string;

public function setText($text);

public function getDate(): ?\DateTimeInterface;

public function setDate(?\DateTimeInterface $date);

public function getFile(): ?FileInterface;

public function setFile(?FileInterface $file);
}

+ 1
- 1
Model/Setting/SectionSettingModel.php View File

@@ -7,7 +7,7 @@ use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Doctrine\EntityInterface;
use Lc\SovBundle\Model\Setting\SettingModel as SovSettingModel;

abstract class SectionSettingModel extends SovSettingModel implements EntityInterface
abstract class SectionSettingModel extends SovSettingModel implements EntityInterface, SectionSettingInterface
{
/**
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Section\SectionInterface", inversedBy="settings")

+ 1
- 1
Model/Site/PageModel.php View File

@@ -43,7 +43,7 @@ abstract class PageModel extends SovPageModel implements FilterMerchantInterface
return $this->section;
}

public function setSection(SectionInterface $section): self
public function setSection(?SectionInterface $section): self
{
$this->section = $section;


+ 49
- 1
Model/User/UserMerchantInterface.php View File

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

namespace Lc\CaracoleBundle\Model\User;


use Doctrine\Common\Collections\Collection;
use Lc\CaracoleBundle\Model\Credit\CreditHistoryInterface;
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
use Lc\CaracoleBundle\Model\Section\SectionInterface;

interface UserMerchantInterface
{
public function getUser(): ?UserModel;

public function setUser(?UserModel $user): UserMerchantInterface;

public function getMerchant(): ?MerchantInterface;

public function setMerchant(?MerchantInterface $merchant): UserMerchantInterface;

public function getCurrentAdminSection(): ?SectionInterface;

public function setCurrentAdminSection(?SectionInterface $currentAdminSection
): UserMerchantInterface;

public function getCredit(): ?float;

public function setCredit(?float $credit): UserMerchantInterface;

public function getCreditActive(): ?bool;

public function isCreditActive(): bool;

public function setCreditActive(bool $creditActive): UserMerchantInterface;

/**
* @return Collection|CreditHistoryInterface[]
*/
public function getCreditHistories(): Collection;

public function addCreditHistory(CreditHistoryInterface $creditHistory
): UserMerchantInterface;

public function removeCreditHistory(CreditHistoryInterface $creditHistory
): UserMerchantInterface;

public function getActive(): ?bool;

public function setActive(bool $active): UserMerchantInterface;

public function getRoles(): array;

public function setRoles(array $roles): UserMerchantInterface;

}
public function hasRole($role);
}

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

@@ -15,7 +15,7 @@ use Lc\SovBundle\Doctrine\EntityInterface;
* @ORM\MappedSuperclass()
*
*/
abstract class UserMerchantModel implements FilterMerchantInterface, EntityInterface
abstract class UserMerchantModel implements FilterMerchantInterface, EntityInterface, UserMerchantInterface
{
/**
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface", inversedBy="userMerchants")

+ 15
- 1
Model/User/UserPointSaleInterface.php View File

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

namespace Lc\CaracoleBundle\Model\User;


use Lc\CaracoleBundle\Model\PointSale\PointSaleInterface;
use Lc\SovBundle\Model\User\UserInterface;

interface UserPointSaleInterface
{
public function getUser(): ?UserInterface;

public function setUser(?UserInterface $user): UserPointSaleInterface;

public function getPointSale(): ?PointSaleInterface;

public function setPointSale(?PointSaleInterface $pointSale): UserPointSaleInterface;

public function getComment(): ?string;

}
public function setComment(?string $comment): UserPointSaleInterface;
}

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

@@ -9,7 +9,7 @@ use Lc\SovBundle\Model\User\UserInterface;
/**
* @ORM\MappedSuperclass
*/
abstract class UserPointSaleModel
abstract class UserPointSaleModel implements UserPointSaleInterface
{
/**
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface", inversedBy="userPointSales")

+ 30
- 1
Model/User/VisitorInterface.php View File

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

namespace Lc\CaracoleBundle\Model\User;


use Doctrine\Common\Collections\Collection;
use Lc\CaracoleBundle\Model\Order\OrderShopInterface;

interface VisitorInterface
{
public function getSummary();

public function getCookie(): ?string;

public function setCookie(?string $cookie): VisitorInterface;

public function getLastAccess(): ?\DateTimeInterface;

public function setLastAccess(\DateTimeInterface $lastAccess): VisitorInterface;

public function getIp(): ?string;

public function setIp(?string $ip): VisitorInterface;

public function getTotalVisit(): ?int;

public function setTotalVisit(int $totalVisit): VisitorInterface;

/**
* @return Collection|OrderShopInterface[]
*/
public function getOrders(): Collection;

public function addOrder(OrderShopInterface $order): VisitorInterface;

}
public function removeOrder(OrderShopInterface $order): VisitorInterface;
}

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

@@ -11,7 +11,7 @@ use Lc\SovBundle\Doctrine\EntityInterface;
/**
* @ORM\MappedSuperclass()
*/
abstract class VisitorModel implements EntityInterface
abstract class VisitorModel implements EntityInterface, VisitorInterface
{
/**
* @ORM\Column(type="string", length=255)

+ 1
- 1
Repository/Credit/CreditHistoryStore.php View File

@@ -21,7 +21,7 @@ class CreditHistoryStore extends AbstractStore

public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
{
$query->orderBy('createdAt');
//$query->orderBy('createdAt');
return $query;
}


+ 161
- 146
Repository/Order/OrderShopStore.php View File

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

use App\Builder\Distribution\DistributionBuilder;
use App\Entity\Distribution\Distribution;
use App\Entity\User\User;
use Doctrine\ORM\EntityManagerInterface;
use Lc\CaracoleBundle\Builder\File\DocumentBuilder;
use Lc\CaracoleBundle\Model\Distribution\DistributionInterface;
@@ -27,8 +28,8 @@ use Lc\CaracoleBundle\Solver\Reduction\ReductionCartSolver;
use Lc\SovBundle\Model\User\UserInterface;
use Lc\CaracoleBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;
use Lc\SovBundle\Translation\FlashBagTranslator;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;

class OrderShopStore extends AbstractStore
@@ -45,7 +46,7 @@ class OrderShopStore extends AbstractStore
protected SectionStore $sectionStore;
protected OrderProductStore $orderProductStore;
protected MerchantStore $merchantStore;
protected FlashBagInterface $flashBag;
protected FlashBagTranslator $flashBagTranslator;
protected OpeningResolver $openingResolver;
protected ParameterBagInterface $parameterBag;
protected UrlGeneratorInterface $router;
@@ -54,22 +55,23 @@ class OrderShopStore extends AbstractStore
protected DistributionBuilder $distributionBuilder;

public function __construct(
OrderShopRepositoryQuery $query,
EntityManagerInterface $entityManager,
PriceSolver $priceSolver,
DocumentBuilder $documentBuilder,
ReductionCreditStore $reductionCreditStore,
ReductionCartSolver $reductionCartSolver,
SectionStore $sectionStore,
OrderProductStore $orderProductStore,
MerchantStore $merchantStore,
FlashBagInterface $flashBag,
ParameterBagInterface $parameterBag,
UrlGeneratorInterface $router,
OrderShopSolver $orderShopSolver,
ReductionCartStore $reductionCartStore,
DistributionBuilder $distributionBuilder
) {
OrderShopRepositoryQuery $query,
EntityManagerInterface $entityManager,
PriceSolver $priceSolver,
DocumentBuilder $documentBuilder,
ReductionCreditStore $reductionCreditStore,
ReductionCartSolver $reductionCartSolver,
SectionStore $sectionStore,
OrderProductStore $orderProductStore,
MerchantStore $merchantStore,
FlashBagTranslator $flashBagTranslator,
ParameterBagInterface $parameterBag,
UrlGeneratorInterface $router,
OrderShopSolver $orderShopSolver,
ReductionCartStore $reductionCartStore,
DistributionBuilder $distributionBuilder
)
{
$this->query = $query;
$this->entityManager = $entityManager;
$this->priceSolver = $priceSolver;
@@ -79,7 +81,7 @@ class OrderShopStore extends AbstractStore
$this->sectionStore = $sectionStore;
$this->orderProductStore = $orderProductStore;
$this->merchantStore = $merchantStore;
$this->flashBag = $flashBag;
$this->flashBagTranslator = $flashBagTranslator;
$this->parameterBag = $parameterBag;
$this->router = $router;
$this->orderShopSolver = $orderShopSolver;
@@ -113,14 +115,14 @@ class OrderShopStore extends AbstractStore
public function getByCurrentDistribution($params = [], $query = null)
{
return $this->getBy(
array_merge(
[
'distribution' => $this->distributionBuilder->guessCurrentDistributionOrder($this->section),
'isValid' => true,
],
$params
),
$query
array_merge(
[
'distribution' => $this->distributionBuilder->guessCurrentDistributionOrder($this->section),
'isValid' => true,
],
$params
),
$query
);
}

@@ -129,14 +131,14 @@ class OrderShopStore extends AbstractStore
public function getByCurrentDistributionAndUser(UserInterface $user = null, array $params = [], $query = null)
{
return $this->getByCurrentDistribution(
array_merge(
[
'user' => $user,
'excludeComplementaryOrderShops' => true
],
$params
),
$query
array_merge(
[
'user' => $user,
'excludeComplementaryOrderShops' => true
],
$params
),
$query
);
}

@@ -146,14 +148,14 @@ class OrderShopStore extends AbstractStore
public function countByCurrentDistribution(array $params, $query = null)
{
return $this->countBy(
array_merge(
[
'distribution' => $this->distributionBuilder->guessCurrentDistributionOrder($this->section),
'excludeComplementaryOrderShops' => isset($params['excludeComplementaryOrderShops']) ?? true,
],
$params
),
$query
array_merge(
[
'distribution' => $this->distributionBuilder->guessCurrentDistributionOrder($this->section),
'excludeComplementaryOrderShops' => isset($params['excludeComplementaryOrderShops']) ?? true,
],
$params
),
$query
);

// @TODO : optimisation à remettre en place
@@ -196,26 +198,26 @@ class OrderShopStore extends AbstractStore
public function countValidByUserAllMerchant($user, $query = null): int
{
return $this->countBy(
[
'user' => $user,
'isValid' => true,
// @TODO : à tester
'isMerchantOnline' => true,
'excludeComplementaryOrderShops' => true
],
$query
[
'user' => $user,
'isValid' => true,
// @TODO : à tester
'isMerchantOnline' => true,
'excludeComplementaryOrderShops' => true
],
$query
);
}

public function countValidByUser(UserInterface $user = null, $query = null): int
{
return $this->countBy(
[
'user' => $user,
'isValid' => true,
'excludeComplementaryOrderShops' => true
],
$query
[
'user' => $user,
'isValid' => true,
'excludeComplementaryOrderShops' => true
],
$query
);
}

@@ -223,64 +225,68 @@ class OrderShopStore extends AbstractStore
public function countValidByCurrentDistribution($query = null): int
{
return $this->countBy(
[
'distribution' => $this->distributionBuilder->guessCurrentDistributionOrder($this->section),
'isValid' => true,
'excludeComplementaryOrderShops' => true
],
$query
[
'distribution' => $this->distributionBuilder->guessCurrentDistributionOrder($this->section),
'isValid' => true,
'excludeComplementaryOrderShops' => true
],
$query
);
}

// countValidOrderWithReductionCredit
public function countValidWithReductionCredit(
ReductionCreditInterface $reductionCredit,
UserInterface $user = null,
$query = null
): int {
ReductionCreditInterface $reductionCredit,
UserInterface $user = null,
$query = null
): int
{

//TODO vérifier que ne pas utiliser createDefaultQuery est pertinent
$query = $this->createQuery($query);

if ($user) {
$query->filterByUser($user);
}

$query
->selectCount()
->filterByReductionCredit($reductionCredit)
->filterByStatus(OrderStatusModel::$statusAliasAsValid);
->selectCount()
->filterByReductionCredit($reductionCredit)
->filterByStatus(OrderStatusModel::$statusAliasAsValid);

return $query->count();
}

// countValidOrderWithReductionCart
public function countValidWithReductionCart(
ReductionCartInterface $reductionCart,
$query = null
): int {
ReductionCartInterface $reductionCart,
$query = null
): int
{
$query = $this->createQuery($query);

$query
->selectCount()
->filterByReductionCart($reductionCart)
->filterByStatus(OrderStatusModel::$statusAliasAsValid);
->selectCount()
->filterByReductionCart($reductionCart)
->filterByStatus(OrderStatusModel::$statusAliasAsValid);

return $query->count();
}

// countValidOrderWithReductionCartPerUser
public function countValidWithReductionCartByUser(
ReductionCartInterface $reductionCart,
UserInterface $user,
$query = null
): int {
ReductionCartInterface $reductionCart,
UserInterface $user,
$query = null
): int
{
$query = $this->createDefaultQuery($query);

$query
->selectCount()
->filterByUser($user)
->filterByReductionCart($reductionCart)
->filterByStatus(OrderStatusModel::$statusAliasAsValid);
->selectCount()
->filterByUser($user)
->filterByReductionCart($reductionCart)
->filterByStatus(OrderStatusModel::$statusAliasAsValid);

return $query->count();
}
@@ -288,7 +294,7 @@ class OrderShopStore extends AbstractStore
// findCartCurrent
public function getOneCartCurrent(UserInterface $user = null, VisitorInterface $visitor = null, $query = null): ?OrderShopInterface
{
if(is_null($user) && is_null($visitor)) {
if (is_null($user) && is_null($visitor)) {
return null;
}

@@ -296,16 +302,15 @@ class OrderShopStore extends AbstractStore

if (!is_null($user)) {
$query->filterByUser($user);
}
else {
} else {
if (!is_null($visitor)) {
$query->filterByVisitor($visitor);
}
}

$query
->selectOrderReductionCarts()
->filterByStatus(OrderStatusModel::$statusAliasAsCart);
->selectOrderReductionCarts()
->filterByStatus(OrderStatusModel::$statusAliasAsCart);

return $query->findOne();
}
@@ -317,10 +322,10 @@ class OrderShopStore extends AbstractStore
$query = $this->createDefaultQuery($query);

$query
->filterByDistribution($distribution)
->filterByStatus(OrderStatusModel::$statusAliasAsValid)
->filterIsNotComplementaryOrderShop()
->orderBy('.cycleId', 'DESC');
->filterByDistribution($distribution)
->filterByStatus(OrderStatusModel::$statusAliasAsValid)
->filterIsNotComplementaryOrderShop()
->orderBy('.cycleId', 'DESC');

return $query->findOne();
}
@@ -331,9 +336,9 @@ class OrderShopStore extends AbstractStore
$query = $this->createDefaultQuery($query);

$query
->filterByStatus(OrderStatusModel::$statusAliasAsValid)
->filterIsNotComplementaryOrderShop()
->orderBy('.idValidOrder', 'DESC');
->filterByStatus(OrderStatusModel::$statusAliasAsValid)
->filterIsNotComplementaryOrderShop()
->orderBy('.idValidOrder', 'DESC');

return $query->findOne();
}
@@ -420,13 +425,13 @@ class OrderShopStore extends AbstractStore
$query->filterByAddress($params['address']);
}

if(isset($params['minimumTomorrowDelivery'])) {
if (isset($params['minimumTomorrowDelivery'])) {
$query->filterMinimumTomorrowDelivery();
}

if (isset($params['mergeComplementaryOrderShops'])) {
$query
->joinComplementaryOrderShops();
->joinComplementaryOrderShops();
}

if (isset($params['excludeComplementaryOrderShops']) || isset($params['mergeComplementaryOrderShops'])) {
@@ -461,10 +466,11 @@ class OrderShopStore extends AbstractStore
}

public function isReductionCreditUsed(
ReductionCreditInterface $reductionCredit,
UserInterface $user = null,
$query = null
) {
ReductionCreditInterface $reductionCredit,
UserInterface $user = null,
$query = null
)
{
if ($this->countValidWithReductionCredit($reductionCredit, $user, $query)) {
return true;
} else {
@@ -474,12 +480,13 @@ class OrderShopStore extends AbstractStore

public function getReductionCreditsAvailableByUser(UserInterface $user): array
{
$reductionCredits = $this->reductionCreditStore->getByTypeAndUser(ReductionCreditModel::TYPE_CREDIT, $user);
$reductionCredits = $this->reductionCreditStore
->setMerchant($this->merchant)
->getByTypeAndUser(ReductionCreditModel::TYPE_CREDIT, $user);

$reductionCreditsArray = [];
foreach ($reductionCredits as $reductionCredit) {
if (!$this->countValidWithReductionCredit($reductionCredit, $user)
&& ($reductionCredit->getSection()->getMerchant() == $this->merchant)) {
if (!$this->countValidWithReductionCredit($reductionCredit, $user)) {
$reductionCreditsArray[] = $reductionCredit;
}
}
@@ -487,13 +494,15 @@ class OrderShopStore extends AbstractStore
return $reductionCreditsArray;
}

public function getReductionGiftsAvailableByUser($user): array
public function getReductionGiftsAvailableByUser(UserInterface $user): array
{
$reductionGifts = $this->reductionCreditStore->getByTypeAndUser(ReductionCreditModel::TYPE_GIFT, $user);
$reductionGifts = $this->reductionCreditStore
->setMerchant($this->merchant)
->getByTypeAndUser(ReductionCreditModel::TYPE_GIFT, $user);

$reductionGiftsArray = [];
foreach ($reductionGifts as $reductionGift) {
if (!$this->countValidWithReductionCredit($reductionGift)) {
if (!$this->countValidWithReductionCredit($reductionGift, $user)) {
$reductionGiftsArray[] = $reductionGift;
}
}
@@ -505,15 +514,16 @@ class OrderShopStore extends AbstractStore
public function getReductionCartRemainingQuantity(ReductionCartInterface $reductionCart): float
{
return $reductionCart->getAvailableQuantity() - $this->countValidWithReductionCart(
$reductionCart
);
$reductionCart
);
}

// getReductionCartUsedQuantityPerUser
public function getReductionCartUsedQuantityByUser(
ReductionCartInterface $reductionCart,
UserInterface $user
): float {
ReductionCartInterface $reductionCart,
UserInterface $user
): float
{
return $this->countValidWithReductionCartByUser($reductionCart, $user);
}

@@ -525,14 +535,15 @@ class OrderShopStore extends AbstractStore

// getReductionCartRemainingQuantityPerUser
public function getReductionCartRemainingQuantityByUser(
ReductionCartInterface $reductionCart,
UserInterface $user
): float {
ReductionCartInterface $reductionCart,
UserInterface $user
): float
{
if ($reductionCart->getAvailableQuantityPerUser()) {
return $reductionCart->getAvailableQuantityPerUser() - $this->countValidWithReductionCartByUser(
$reductionCart,
$user
);
$reductionCart,
$user
);
}

return false;
@@ -541,17 +552,19 @@ class OrderShopStore extends AbstractStore
// findAllAvailableForUser / getReductionCartsAvailableByUser
public function getReductionCartAvailableByUser(UserInterface $user, $query = null)
{
$reductionCarts = $this->reductionCartStore->getOnline();
$reductionCarts = $this->reductionCartStore
->setMerchant($this->merchant)
->getOnline();

$reductionCartsArray = [];
foreach ($reductionCarts as $reductionCart) {
if ($this->reductionCartSolver->matchWithUser($reductionCart, $user)
&& $this->reductionCartSolver->matchWithGroupUser($reductionCart, $user)
&& $this->getReductionCartRemainingQuantityByUser($reductionCart, $user)
&& ($reductionCart->getUsers()->count() > 0 || $reductionCart->getGroupUsers()->count() > 0)
&& (!$this->merchant || $reductionCart->getSection()->getMerchant() == $this->merchant)) {
&& $this->reductionCartSolver->matchWithGroupUser($reductionCart, $user)
&& $this->getReductionCartRemainingQuantityByUser($reductionCart, $user)
&& ($reductionCart->getUsers()->count() > 0 || $reductionCart->getGroupUsers()->count() > 0)
&& (!$this->merchant || $reductionCart->getMerchant() == $this->merchant)) {

$reductionCartsArray[] = $reductionCart;
$reductionCartsArray[] = $reductionCart;
}
}

@@ -560,17 +573,18 @@ class OrderShopStore extends AbstractStore

//countValidOrderProductsOfCyclesByProducts
public function countValidOrderProductsOfDistributionsByProducts(
array $distributions,
array $products,
$query = null
): array {
array $distributions,
array $products,
$query = null
): array
{
$query = $this->createDefaultQuery($query);
$query
->filterByAlias(OrderStatusModel::$statusAliasAsValid)
->filterByDistributions($distributions)
->filterByProducts($products)
->selectSum()
->groupBy('distribution.cycleNumber, product.id');
->filterByAlias(OrderStatusModel::$statusAliasAsValid)
->filterByDistributions($distributions)
->filterByProducts($products)
->selectSum()
->groupBy('distribution.cycleNumber, product.id');


return $query->find();
@@ -583,12 +597,12 @@ class OrderShopStore extends AbstractStore
$query = $this->createQuery($query);

$query
->filterByAlias(OrderStatusModel::$statusAliasAsValid)
->filterByDistribution($distribution)
->filterByProduct($product)
->selectSumQuantityOrder()
->joinDistribution()
->groupBy('distribution.cycleNumber, product.id');
->filterByAlias(OrderStatusModel::$statusAliasAsValid)
->filterByDistribution($distribution)
->filterByProduct($product)
->selectSumQuantityOrder()
->joinDistribution()
->groupBy('distribution.cycleNumber, product.id');

$result = $query->findOne();

@@ -599,15 +613,16 @@ class OrderShopStore extends AbstractStore
}

public function isReductionCreditAllowAddToOrder(
OrderShopInterface $orderShop,
ReductionCreditInterface $reductionCredit
) {
OrderShopInterface $orderShop,
ReductionCreditInterface $reductionCredit
)
{
$user = $orderShop->getUser();

// appartient à l'utilisateur
if (!$reductionCredit->getUsers()->contains($user)) {
// @TODO : déplacer la gestion du flash message
//$this->flashBag->add('error', 'error.reductionCredit.userNotAllow');
$this->flashBagTranslator->add('error', 'userNotAllow', 'ReductionCredit');
return false;
}

@@ -615,13 +630,13 @@ class OrderShopStore extends AbstractStore
if ($reductionCredit->getType() == ReductionCreditModel::TYPE_CREDIT) {
if ($this->countValidWithReductionCredit($reductionCredit, $user) > 0) {
// @TODO : déplacer la gestion du flash message
//$this->flashBah->add('error', 'error.reductionCredit.alreadyUse');
$this->flashBagTranslator->add('error', 'alreadyUse', 'ReductionCredit');
return false;
}
} else {
if ($this->countValidWithReductionCredit($reductionCredit) > 0) {
// @TODO : déplacer la gestion du flash message
//$this->flashBah->add('error', 'error.reductionCredit.alreadyUse');
$this->flashBagTranslator->add('error', 'alreadyUse', 'ReductionCredit');
return false;
}
}

+ 1
- 0
Repository/Product/ProductFamilyStore.php View File

@@ -143,6 +143,7 @@ class ProductFamilyStore extends AbstractStore
return [];
}


// findByTerms
public function getByTerms(
$terms,

+ 13
- 0
Repository/Product/ProductRepositoryQuery.php View File

@@ -95,6 +95,19 @@ class ProductRepositoryQuery extends AbstractRepositoryQuery
}


public function filterIsOriginProduct():self
{
$this->andWhere('.originProduct = 1');
return $this;
}


public function filterByProductFamily(ProductFamilyInterface $productFamily): self
{
return $this->andWhereEqual('productFamily', $productFamily);
}


public function filterAvailableQuantityNegative() :self
{


+ 10
- 0
Repository/Product/ProductStore.php View File

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

namespace Lc\CaracoleBundle\Repository\Product;

use App\Entity\Product\ProductFamily;
use App\Solver\Product\ProductFamilySectionPropertySolver;
use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
use Lc\CaracoleBundle\Repository\SectionStoreTrait;
@@ -77,4 +78,13 @@ class ProductStore extends AbstractStore
}


public function getOriginByProductFamily(ProductFamily $productFamily, ProductRepositoryQuery $query = null): array
{
$query = $this->createQuery();
$query->filterByProductFamily($productFamily);
$query->filterIsOriginProduct();
$query->filterIsOnlineAndOffline();
return $query->find();

}
}

+ 1
- 2
Repository/Reduction/ReductionCartRepositoryQuery.php View File

@@ -4,12 +4,11 @@ namespace Lc\CaracoleBundle\Repository\Reduction;

use Knp\Component\Pager\PaginatorInterface;
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait;
use Lc\CaracoleBundle\Repository\SectionRepositoryQueryTrait;
use Lc\SovBundle\Repository\AbstractRepositoryQuery;

class ReductionCartRepositoryQuery extends AbstractRepositoryQuery
{
use SectionRepositoryQueryTrait;
use MerchantRepositoryQueryTrait;

public function __construct(ReductionCartRepository $repository, PaginatorInterface $paginator)
{

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

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

namespace Lc\CaracoleBundle\Repository\Reduction;

use Lc\CaracoleBundle\Repository\SectionStoreTrait;
use Lc\CaracoleBundle\Repository\MerchantStoreTrait;
use Lc\CaracoleBundle\Solver\Price\PriceSolver;
use Lc\CaracoleBundle\Solver\Reduction\ReductionCartSolver;
use Lc\CaracoleBundle\Repository\AbstractStore;
@@ -10,7 +10,7 @@ use Lc\SovBundle\Repository\RepositoryQueryInterface;

class ReductionCartStore extends AbstractStore
{
use SectionStoreTrait;
use MerchantStoreTrait;

protected ReductionCartRepositoryQuery $query;
protected ReductionCartSolver $reductionCartSolver;
@@ -34,10 +34,9 @@ class ReductionCartStore extends AbstractStore

public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
{
if($this->section) {
$query->filterBySection($this->section);
}
$this->addFilterByMerchantRequired($query);
$query->filterIsOnlineAndOffline();

return $query;
}


+ 1
- 2
Repository/Reduction/ReductionCatalogRepositoryQuery.php View File

@@ -5,7 +5,6 @@ namespace Lc\CaracoleBundle\Repository\Reduction;
use Knp\Component\Pager\PaginatorInterface;
use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface;
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait;
use Lc\CaracoleBundle\Repository\SectionRepositoryQueryTrait;
use Lc\SovBundle\Model\User\UserInterface;
use Lc\SovBundle\Repository\AbstractRepositoryQuery;

@@ -17,7 +16,7 @@ class ReductionCatalogRepositoryQuery extends AbstractRepositoryQuery
protected bool $isJoinUsers = false;
protected bool $isJoinGroupUsers = false;

use SectionRepositoryQueryTrait;
use MerchantRepositoryQueryTrait;

public function __construct(ReductionCatalogRepository $repository, PaginatorInterface $paginator)
{

+ 3
- 3
Repository/Reduction/ReductionCatalogStore.php View File

@@ -3,13 +3,13 @@
namespace Lc\CaracoleBundle\Repository\Reduction;

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

class ReductionCatalogStore extends AbstractStore
{
use SectionStoreTrait;
use MerchantStoreTrait;

protected ReductionCatalogRepositoryQuery $query;

@@ -26,7 +26,7 @@ class ReductionCatalogStore extends AbstractStore

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

+ 2
- 2
Repository/Reduction/ReductionCreditRepositoryQuery.php View File

@@ -5,14 +5,14 @@ namespace Lc\CaracoleBundle\Repository\Reduction;
use Knp\Component\Pager\PaginatorInterface;
use Lc\CaracoleBundle\Model\Reduction\ReductionCreditModel;
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait;
use Lc\CaracoleBundle\Repository\SectionRepositoryQueryTrait;
use Lc\SovBundle\Model\User\UserInterface;
use Lc\SovBundle\Repository\AbstractRepositoryQuery;

class ReductionCreditRepositoryQuery extends AbstractRepositoryQuery
{
use SectionRepositoryQueryTrait;
use MerchantRepositoryQueryTrait;

// @TODO : à utiliser
protected $isJoinUsers = false;

public function __construct(ReductionCreditRepository $repository, PaginatorInterface $paginator)

+ 1
- 4
Repository/Reduction/ReductionCreditStore.php View File

@@ -10,7 +10,6 @@ use Lc\SovBundle\Repository\RepositoryQueryInterface;

class ReductionCreditStore extends AbstractStore
{
use SectionStoreTrait;
use MerchantStoreTrait;

protected ReductionCreditRepositoryQuery $query;
@@ -29,9 +28,7 @@ class ReductionCreditStore extends AbstractStore

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

$this->addFilterByMerchantRequired($query);
$query->filterIsOnlineAndOffline();

return $query;

+ 1
- 1
Repository/User/UserRepositoryQuery.php View File

@@ -20,7 +20,7 @@ class UserRepositoryQuery extends SovUserRepositoryQuery
$this->isJoinUserMerchants = true;

return $this
->innerJoin('.userMerchants', 'userMerchants');
->leftJoin('.userMerchants', 'userMerchants');
}
return $this;
}

+ 2
- 1
Repository/User/UserStore.php View File

@@ -25,8 +25,9 @@ class UserStore extends SovUserStore
}

public function getJoinGroupUsers(){
$query = $this->createDefaultQuery();
$query = $this->createQuery();
$query->joinGroupUsers(true);
$query->orderBy('id');
return $query->find();

}

+ 16
- 4
Solver/Price/PriceSolverTrait.php View File

@@ -53,6 +53,17 @@ trait PriceSolverTrait
$withTax = true,
$round = true
): ?float {


if($entity instanceof ProductFamilyInterface) {
$taxRate = $this->productFamilySolver->getTaxRateInherited($entity)->getValue();
}else if ($entity instanceof ProductInterface) {
$taxRate = $this->productFamilySolver->getTaxRateInherited($entity->getProductFamily())->getValue();
}else{
$taxRate = $entity->getTaxRate()->getValue();
}


if ($reductionCatalog) {
$reductionCatalogValue = $reductionCatalog->getValue();
$reductionCatalogUnit = $reductionCatalog->getUnit();
@@ -82,20 +93,20 @@ trait PriceSolverTrait
}
}

if (isset($reductionCatalogValue) && isset($reductionCatalogUnit) && isset($reductionCatalogBehaviorTaxRate)) {
if (isset($reductionCatalogValue) && isset($reductionCatalogUnit)) {
if ($reductionCatalogUnit == 'percent') {
$priceWithTax = $this->applyReductionPercent(
$priceWithTax,
$reductionCatalogValue
);
} elseif ($reductionCatalogUnit == 'amount') {
} elseif ($reductionCatalogUnit == 'amount' && isset($reductionCatalogBehaviorTaxRate)) {
if ($reductionCatalogBehaviorTaxRate == 'tax-excluded') {
$priceWithTax = $this->applyTax(
$this->applyReductionAmount(
$price,
$reductionCatalogValue * $quantity
),
$entity->getTaxRateInherited()->getValue()
$taxRate
);
} elseif ($reductionCatalogBehaviorTaxRate == 'tax-included') {
$priceWithTax = $this->applyReductionAmount(
@@ -109,7 +120,8 @@ trait PriceSolverTrait
if ($withTax) {
$priceReturn = $priceWithTax;
} else {
$priceReturn = $this->applyPercentNegative($priceWithTax, $entity->getTaxRateInherited()->getValue());

$priceReturn = $this->applyPercentNegative($priceWithTax, $taxRate);
}
if ($round) {
return $this->round($priceReturn);

+ 15
- 1
Solver/Section/OpeningSolver.php View File

@@ -44,7 +44,21 @@ class OpeningSolver

protected function isOpeningDay(int $weekDay, array $openings): bool
{
return (bool) $this->getOpeningByWeekday($weekDay, $openings);
$opening = $this->getOpeningByWeekday($weekDay, $openings);

if($opening) {
$now = new \DateTime();
if($weekDay == $now->format('N')) {
if($now < $opening->getTimeEnd()) {
return true;
}
}
else {
return true;
}
}

return false;
}

protected function isClosingDay(int $weekDay, array $openings): bool

+ 17
- 13
Transformer/Order/OrderShopTransformer.php View File

@@ -5,6 +5,8 @@ namespace Lc\CaracoleBundle\Transformer\Order;
use App\Entity\Order\OrderShop;
use EasyCorp\Bundle\EasyAdminBundle\Router\AdminUrlGenerator;
use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
use Lc\CaracoleBundle\Repository\Order\OrderShopStore;
use Lc\CaracoleBundle\Repository\Reduction\ReductionCreditStore;
use Lc\CaracoleBundle\Resolver\OrderShopResolver;
use Lc\CaracoleBundle\Solver\Order\OrderShopSolver;
use Lc\CaracoleBundle\Solver\Price\PriceSolver;
@@ -20,9 +22,13 @@ class OrderShopTransformer
protected TranslatorAdmin $translatorAdmin;
protected UrlGeneratorInterface $urlGenerator;


public function __construct(PriceSolver $priceSolver, OrderShopSolver $orderShopSolver, OrderShopResolver $orderShopResolver, TranslatorAdmin $translatorAdmin, UrlGeneratorInterface $urlGenerator)
{
public function __construct(
PriceSolver $priceSolver,
OrderShopSolver $orderShopSolver,
OrderShopResolver $orderShopResolver,
TranslatorAdmin $translatorAdmin,
UrlGeneratorInterface $urlGenerator
) {
$this->priceSolver = $priceSolver;
$this->orderShopSolver = $orderShopSolver;
$this->orderShopResolver = $orderShopResolver;
@@ -34,15 +40,12 @@ class OrderShopTransformer
public function getDatas(OrderShopInterface $orderShop, UserInterface $user = null): array
{
$data = [];

$data['order'] = $orderShop;
$data['count'] = $this->orderShopSolver->countQuantities($orderShop);
$data['total_with_tax'] = $this->priceSolver->getTotalWithTax($orderShop);
$data['order_products_by_category'] = $this->orderShopSolver->getOrderProductsByParentCategory($orderShop);
$data['total_remaining_to_be_paid'] = $this->orderShopResolver->getTotalRemainingToBePaid($orderShop);

if ($orderShop) {
$data['count'] = $this->orderShopSolver->countQuantities($orderShop);
$data['total_with_tax'] = $this->priceSolver->getTotalWithTax($orderShop);
$data['order_products_by_category'] = $this->orderShopSolver->getOrderProductsByParentCategory($orderShop);
$data['total_remaining_to_be_paid'] = $this->orderShopResolver->getTotalRemainingToBePaid($orderShop);
}
return $data;
}

@@ -103,7 +106,6 @@ class OrderShopTransformer
{
$data = array();
foreach ($order->getOrderPayments() as $orderPayment) {

$data[$orderPayment->getId()] = array(
'id' => $orderPayment->getId(),
'reference' => $orderPayment->getReference(),
@@ -111,7 +113,9 @@ class OrderShopTransformer
'comment' => $orderPayment->getComment(),
'meanPayment' => $orderPayment->getMeanPayment(),
'meanPaymentText' => $this->translatorAdmin->transChoice(
'OrderPayment', 'meanPayment',$orderPayment->getMeanPayment()
'OrderPayment',
'meanPayment',
$orderPayment->getMeanPayment()
),
'paidAtText' => $orderPayment->getPaidAt()->format('d/m/Y'),
'paidAt' => $orderPayment->getPaidAt()->format('Y-m-d'),
@@ -186,7 +190,7 @@ class OrderShopTransformer
'type' => $orderDocument->getType(),
'isSent' => $orderDocument->getIsSent(),
'orderReference' => $order->getReference(),
'link' => $this->urlGenerator->generate('document_download', ['id'=> $orderDocument->getId()])
'link' => $this->urlGenerator->generate('document_download', ['id' => $orderDocument->getId()])
);
}
return $data;

Loading…
Cancel
Save