if ($orderProductAdd->getQuantityOrder() > 0) { | if ($orderProductAdd->getQuantityOrder() > 0) { | ||||
$updated = false; | $updated = false; | ||||
$this->orderProductBuilder->init($orderProductAdd); | $this->orderProductBuilder->init($orderProductAdd); | ||||
$productFamily = $this->productFamilyStore->getOneBySlug( | |||||
$productFamily = $this->productFamilyStore->setSection($orderShop->getSection())->getOneBySlug( | |||||
$orderProductAdd->getProduct()->getProductFamily()->getSlug() | $orderProductAdd->getProduct()->getProductFamily()->getSlug() | ||||
); | ); | ||||
$orderShop->addOrderReductionCredit($orderReductionCredit); | $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->create($orderReductionCredit); | ||||
$this->entityManager->flush(); | $this->entityManager->flush(); | ||||
$user = $orderShop->getUser(); | $user = $orderShop->getUser(); | ||||
$orderProductsGiftVouchers = $this->orderProductStore->getGiftVouchersByOrder($orderShop); | $orderProductsGiftVouchers = $this->orderProductStore->getGiftVouchersByOrder($orderShop); | ||||
$sectionMarket = $this->sectionStore | |||||
->setMerchant($orderShop->getSection()->getMerchant()) | |||||
->getOneMarket(); | |||||
foreach ($orderProductsGiftVouchers as $orderProductsGiftVoucher) { | foreach ($orderProductsGiftVouchers as $orderProductsGiftVoucher) { | ||||
$i = 1; | $i = 1; | ||||
// création de la reductionCredit | // création de la reductionCredit | ||||
while ($i <= $orderProductsGiftVoucher->getQuantityOrder()) { | 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->setTitle($orderProductsGiftVoucher->getTitle()); | ||||
$reductionGift->setOwner($user); | $reductionGift->setOwner($user); | ||||
$reductionGift->setCreatedBy($user); | $reductionGift->setCreatedBy($user); | ||||
$reductionGift->setUpdatedBy($user); | $reductionGift->setUpdatedBy($user); | ||||
$reductionGift->setValue($this->priceSolver->getPriceWithTax($orderProductsGiftVoucher->getProduct())); | $reductionGift->setValue($this->priceSolver->getPriceWithTax($orderProductsGiftVoucher->getProduct())); | ||||
$reductionGift->setBehaviorTaxRate(TaxRateModel::BEHAVIOR_TAX_RATE_INCLUDED); | $reductionGift->setBehaviorTaxRate(TaxRateModel::BEHAVIOR_TAX_RATE_INCLUDED); | ||||
$this->entityManager->persist($reductionGift); | |||||
$this->entityManager->create($reductionGift); | |||||
$i++; | $i++; | ||||
} | } |
return $this->store; | return $this->store; | ||||
} | } | ||||
} | } |
use Symfony\Component\HttpFoundation\Request; | use Symfony\Component\HttpFoundation\Request; | ||||
use Symfony\Component\Routing\Annotation\Route; | use Symfony\Component\Routing\Annotation\Route; | ||||
/** | |||||
* @Route("/{section}/panier", name="frontend_cart_") | |||||
*/ | |||||
class CartController extends AbstractController | class CartController extends AbstractController | ||||
{ | { | ||||
protected ProductFamilyInterface $productFamily; | protected ProductFamilyInterface $productFamily; | ||||
} | } | ||||
/** | /** | ||||
* @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 | public function deleteReductionCart(Request $request): RedirectResponse | ||||
{ | { | ||||
} | } | ||||
/** | /** | ||||
* @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 | public function addReductionCredit(Request $request): RedirectResponse | ||||
{ | { | ||||
} | } | ||||
/** | /** | ||||
* @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 | public function deleteReductionCredit(Request $request): RedirectResponse | ||||
{ | { |
public function createEntity(string $entityFqcn) | public function createEntity(string $entityFqcn) | ||||
{ | { | ||||
return $this->getReductionCartContainer()->getFactory()->create($this->getSectionCurrent()); | |||||
return $this->getReductionCartContainer()->getFactory()->create($this->getMerchantCurrent()); | |||||
} | } | ||||
} | } |
public function createEntity(string $entityFqcn) | public function createEntity(string $entityFqcn) | ||||
{ | { | ||||
return $this->getReductionCatalogContainer()->getFactory()->create($this->getSectionCurrent()); | |||||
return $this->getReductionCatalogContainer()->getFactory()->create($this->getMerchantCurrent()); | |||||
} | } | ||||
} | } |
public function createEntity(string $entityFqcn) | public function createEntity(string $entityFqcn) | ||||
{ | { | ||||
return $this->getReductionCreditContainer()->getFactory()->create($this->getSectionCurrent()); | |||||
return $this->getReductionCreditContainer()->getFactory()->create($this->getMerchantCurrent()); | |||||
} | } | ||||
} | } |
<?php | <?php | ||||
namespace Lc\CaracoleBundle\Definition; | namespace Lc\CaracoleBundle\Definition; | ||||
use Lc\SovBundle\Definition\AbstractSettingDefinition; | |||||
interface MerchantSettingDefinitionInterface | 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(); | |||||
} | } |
interface OrderAmountMinInterface | interface OrderAmountMinInterface | ||||
{ | { | ||||
public function getOrderAmountMin(): ?float; | |||||
public function setOrderAmountMin(float $orderAmountMin); | |||||
} | } |
namespace Lc\CaracoleBundle\Doctrine\Extension; | namespace Lc\CaracoleBundle\Doctrine\Extension; | ||||
use Lc\CaracoleBundle\Model\Order\OrderShopInterface; | |||||
interface OrderPayoffInterface | interface OrderPayoffInterface | ||||
{ | { | ||||
public function getOrderShop(): ?OrderShopInterface; | |||||
public function setOrderShop(?OrderShopInterface $orderShop); | |||||
public function setEditable(bool $editable); | |||||
public function getEditable(): ?bool; | |||||
public function isEditable(): ?bool; | |||||
} | } |
interface PayoffInterface | 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); | |||||
} | } |
<?php | <?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 | 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); | |||||
} | } |
interface ProductPropertyInterface | 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); | |||||
} | } |
interface ReductionCartPropertyInterface | 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); | |||||
} | } |
interface ReductionInterface | 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); | |||||
} | } |
namespace Lc\CaracoleBundle\Doctrine\Extension; | namespace Lc\CaracoleBundle\Doctrine\Extension; | ||||
use Doctrine\Common\Collections\Collection; | |||||
use Lc\SovBundle\Model\User\GroupUserInterface; | |||||
use Lc\SovBundle\Model\User\UserInterface; | |||||
interface ReductionPropertyInterface | 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); | |||||
} | } |
protected function processProducts($entity) | 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 { | } 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); | |||||
} | |||||
} | } | ||||
} | } | ||||
namespace Lc\CaracoleBundle\Factory\Reduction; | namespace Lc\CaracoleBundle\Factory\Reduction; | ||||
use App\Entity\Reduction\ReductionCart; | use App\Entity\Reduction\ReductionCart; | ||||
use Lc\CaracoleBundle\Context\MerchantContextTrait; | |||||
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | ||||
use Lc\CaracoleBundle\Model\Reduction\ReductionCartInterface; | use Lc\CaracoleBundle\Model\Reduction\ReductionCartInterface; | ||||
use Lc\CaracoleBundle\Model\Section\SectionInterface; | |||||
use Lc\SovBundle\Factory\AbstractFactory; | use Lc\SovBundle\Factory\AbstractFactory; | ||||
class ReductionCartFactory extends AbstractFactory | class ReductionCartFactory extends AbstractFactory | ||||
{ | { | ||||
public function create(SectionInterface $section): ReductionCartInterface | |||||
public function create(MerchantInterface $merchant): ReductionCartInterface | |||||
{ | { | ||||
$reductionCart = new ReductionCart(); | $reductionCart = new ReductionCart(); | ||||
$reductionCart->setSection($section); | |||||
$reductionCart->setMerchant($merchant); | |||||
$reductionCart->setStatus(1); | $reductionCart->setStatus(1); | ||||
return $reductionCart; | return $reductionCart; |
namespace Lc\CaracoleBundle\Factory\Reduction; | namespace Lc\CaracoleBundle\Factory\Reduction; | ||||
use App\Entity\Reduction\ReductionCatalog; | use App\Entity\Reduction\ReductionCatalog; | ||||
use Lc\CaracoleBundle\Context\MerchantContextTrait; | |||||
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | ||||
use Lc\CaracoleBundle\Model\Reduction\ReductionCatalogInterface; | use Lc\CaracoleBundle\Model\Reduction\ReductionCatalogInterface; | ||||
use Lc\CaracoleBundle\Model\Section\SectionInterface; | |||||
use Lc\SovBundle\Factory\AbstractFactory; | use Lc\SovBundle\Factory\AbstractFactory; | ||||
class ReductionCatalogFactory extends AbstractFactory | class ReductionCatalogFactory extends AbstractFactory | ||||
{ | { | ||||
public function create(SectionInterface $section): ReductionCatalogInterface | |||||
public function create(MerchantInterface $merchant): ReductionCatalogInterface | |||||
{ | { | ||||
$reductionCatalog = new ReductionCatalog(); | $reductionCatalog = new ReductionCatalog(); | ||||
$reductionCatalog->setSection($section); | |||||
$reductionCatalog->setMerchant($merchant); | |||||
$reductionCatalog->setStatus(1); | $reductionCatalog->setStatus(1); | ||||
return $reductionCatalog; | return $reductionCatalog; |
namespace Lc\CaracoleBundle\Factory\Reduction; | namespace Lc\CaracoleBundle\Factory\Reduction; | ||||
use App\Entity\Reduction\ReductionCredit; | use App\Entity\Reduction\ReductionCredit; | ||||
use Lc\CaracoleBundle\Context\MerchantContextTrait; | |||||
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | ||||
use Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface; | use Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface; | ||||
use Lc\CaracoleBundle\Model\Reduction\ReductionCreditModel; | use Lc\CaracoleBundle\Model\Reduction\ReductionCreditModel; | ||||
use Lc\CaracoleBundle\Model\Section\SectionInterface; | |||||
use Lc\SovBundle\Factory\AbstractFactory; | use Lc\SovBundle\Factory\AbstractFactory; | ||||
class ReductionCreditFactory extends 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 = new ReductionCredit(); | ||||
$reductionCredit->setSection($section); | |||||
$reductionCredit->setMerchant($merchant); | |||||
$reductionCredit->setType($type); | $reductionCredit->setType($type); | ||||
$reductionCredit->setStatus(1); | $reductionCredit->setStatus(1); | ||||
} | } | ||||
$section = ' ['.$category->getSection()->getTitle().']' ;; | $section = ' ['.$category->getSection()->getTitle().']' ;; | ||||
return $category . $section. $isOffline; | return $category . $section. $isOffline; | ||||
} | } | ||||
) | ) | ||||
); | ); |
namespace Lc\CaracoleBundle\Model\Address; | namespace Lc\CaracoleBundle\Model\Address; | ||||
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | ||||
use Lc\CaracoleBundle\Model\PointSale\PointSaleInterface; | use Lc\CaracoleBundle\Model\PointSale\PointSaleInterface; | ||||
use Lc\SovBundle\Model\User\UserInterface; | use Lc\SovBundle\Model\User\UserInterface; | ||||
{ | { | ||||
public function getUser(): ?UserInterface; | public function getUser(): ?UserInterface; | ||||
public function setUser(?UserInterface $user): AddressModel; | |||||
public function setUser(?UserInterface $user): AddressInterface; | |||||
public function getTitle(): ?string; | public function getTitle(): ?string; | ||||
public function setTitle(string $title): AddressModel; | |||||
public function setTitle(string $title): AddressInterface; | |||||
public function getType(): ?string; | public function getType(): ?string; | ||||
public function setType(string $type): AddressModel; | |||||
public function setType(string $type): AddressInterface; | |||||
public function getCivility(): ?bool; | public function getCivility(): ?bool; | ||||
public function setCivility(?bool $civility): AddressModel; | |||||
public function setCivility(?bool $civility): AddressInterface; | |||||
public function getLastname(): ?string; | public function getLastname(): ?string; | ||||
public function setLastname(?string $lastname): AddressModel; | |||||
public function setLastname(?string $lastname): AddressInterface; | |||||
public function getFirstname(): ?string; | public function getFirstname(): ?string; | ||||
public function setFirstname(?string $firstname): AddressModel; | |||||
public function setFirstname(?string $firstname): AddressInterface; | |||||
public function getAddress(): ?string; | public function getAddress(): ?string; | ||||
public function setAddress(string $address): AddressModel; | |||||
public function setAddress(string $address): AddressInterface; | |||||
public function getZip(): ?string; | public function getZip(): ?string; | ||||
public function setZip(string $zip): AddressModel; | |||||
public function setZip(string $zip): AddressInterface; | |||||
public function getCity(): ?string; | public function getCity(): ?string; | ||||
public function setCity(string $city): AddressModel; | |||||
public function setCity(string $city): AddressInterface; | |||||
public function getCountry(): ?string; | public function getCountry(): ?string; | ||||
public function setCountry(string $country): AddressModel; | |||||
public function setCountry(string $country): AddressInterface; | |||||
public function getLatitude(): ?string; | public function getLatitude(): ?string; | ||||
public function setLatitude(?string $latitude): AddressModel; | |||||
public function setLatitude(?string $latitude): AddressInterface; | |||||
public function getLongitude(): ?string; | public function getLongitude(): ?string; | ||||
public function setLongitude(?string $longitude): AddressModel; | |||||
public function setLongitude(?string $longitude): AddressInterface; | |||||
public function getLatitudeOverride(): ?string; | public function getLatitudeOverride(): ?string; | ||||
public function setLatitudeOverride(?string $latitudeOverride): AddressModel; | |||||
public function setLatitudeOverride(?string $latitudeOverride): AddressInterface; | |||||
public function getLongitudeOverride(): ?string; | public function getLongitudeOverride(): ?string; | ||||
public function setLongitudeOverride(?string $longitudeOverride): AddressModel; | |||||
public function setLongitudeOverride(?string $longitudeOverride): AddressInterface; | |||||
public function getCompany(): ?string; | public function getCompany(): ?string; | ||||
public function setCompany(?string $company): AddressModel; | |||||
public function setCompany(?string $company): AddressInterface; | |||||
public function getSiret(): ?string; | public function getSiret(): ?string; | ||||
public function setSiret(?string $siret): AddressModel; | |||||
public function setSiret(?string $siret): AddressInterface; | |||||
public function getTva(): ?string; | public function getTva(): ?string; | ||||
public function setTva(?string $tva): AddressModel; | |||||
public function setTva(?string $tva): AddressInterface; | |||||
public function getPhone(): ?array; | public function getPhone(): ?array; | ||||
public function setPhone(?array $phone): AddressModel; | |||||
public function setPhone(?array $phone): AddressInterface; | |||||
public function getComment(): ?string; | public function getComment(): ?string; | ||||
public function setComment(?string $comment): AddressModel; | |||||
public function setComment(?string $comment): AddressInterface; | |||||
public function getPointSale(): ?PointSaleInterface; | public function getPointSale(): ?PointSaleInterface; | ||||
public function setPointSale(PointSaleInterface $pointSale): AddressModel; | |||||
public function setPointSale(PointSaleInterface $pointSale): AddressInterface; | |||||
public function getMerchant(): ?MerchantInterface; | public function getMerchant(): ?MerchantInterface; | ||||
public function setMerchant(MerchantInterface $merchant): AddressModel; | |||||
public function setMerchant(MerchantInterface $merchant): AddressInterface; | |||||
public function getDeliveryInfos(): ?string; | 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); | |||||
} | } |
<?php | <?php | ||||
/** | |||||
* @author La clic ! <contact@laclic.fr> | |||||
*/ | |||||
namespace Lc\CaracoleBundle\Model\Config; | 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; | use Lc\SovBundle\Model\User\UserInterface; | ||||
/** | |||||
* @ORM\MappedSuperclass() | |||||
*/ | |||||
interface TaxRateInterface | interface TaxRateInterface | ||||
{ | { | ||||
public function getCreatedBy(): ?UserInterface; | public function getCreatedBy(): ?UserInterface; | ||||
public function getBehaviorTaxRateChoices(): array; | public function getBehaviorTaxRateChoices(): array; | ||||
public function __toString(); | |||||
public function getTitle(): ?string; | public function getTitle(): ?string; | ||||
public function setTitle(string $title); | |||||
public function setTitle(string $title): TaxRateInterface; | |||||
public function getValue(): ?float; | public function getValue(): ?float; | ||||
public function setValue(float $value): TaxRateModel; | |||||
public function setValue(float $value): TaxRateInterface; | |||||
public function getCreatedAt(): ?\DateTimeInterface; | public function getCreatedAt(): ?\DateTimeInterface; | ||||
<?php | <?php | ||||
/** | |||||
* @author La clic ! <contact@laclic.fr> | |||||
*/ | |||||
namespace Lc\CaracoleBundle\Model\Config; | 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; | use Lc\SovBundle\Model\User\UserInterface; | ||||
interface UnitInterface | interface UnitInterface | ||||
{ | { | ||||
public function getCreatedBy(): ?UserInterface; | public function getCreatedBy(): ?UserInterface; | ||||
public function getUnitAmountChoices(): array; | public function getUnitAmountChoices(): array; | ||||
public function __toString(); | |||||
public function getUnit(): ?string; | public function getUnit(): ?string; | ||||
public function setUnit(string $unit): UnitModel; | |||||
public function setUnit(string $unit): UnitInterface; | |||||
public function getWording(): ?string; | public function getWording(): ?string; | ||||
public function setWording(string $wording): UnitModel; | |||||
public function setWording(string $wording): UnitInterface; | |||||
public function getWordingUnit(): ?string; | public function getWordingUnit(): ?string; | ||||
public function setWordingUnit(string $wordingUnit): UnitModel; | |||||
public function setWordingUnit(string $wordingUnit): UnitInterface; | |||||
public function getWordingShort(): ?string; | public function getWordingShort(): ?string; | ||||
public function setWordingShort(string $wordingShort): UnitModel; | |||||
public function setWordingShort(string $wordingShort): UnitInterface; | |||||
public function getCoefficient(): ?int; | 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); | |||||
} | } |
return $this->unitReference; | return $this->unitReference; | ||||
} | } | ||||
public function setUnitReference(?self $unitReference): self | |||||
public function setUnitReference(?UnitInterface $unitReference): self | |||||
{ | { | ||||
$this->unitReference = $unitReference; | $this->unitReference = $unitReference; | ||||
<?php | <?php | ||||
/** | |||||
* @author La clic ! <contact@laclic.fr> | |||||
*/ | |||||
namespace Lc\CaracoleBundle\Model\Credit; | namespace Lc\CaracoleBundle\Model\Credit; | ||||
use Lc\CaracoleBundle\Doctrine\Extension\PayoffTrait; | |||||
use Lc\CaracoleBundle\Model\Order\OrderPaymentInterface; | use Lc\CaracoleBundle\Model\Order\OrderPaymentInterface; | ||||
use Lc\CaracoleBundle\Model\Order\OrderRefundInterface; | use Lc\CaracoleBundle\Model\Order\OrderRefundInterface; | ||||
use Lc\CaracoleBundle\Model\User\UserMerchantInterface; | 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; | use Lc\SovBundle\Model\User\UserInterface; | ||||
interface CreditHistoryInterface | 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); | |||||
} |
namespace Lc\CaracoleBundle\Model\Distribution; | namespace Lc\CaracoleBundle\Model\Distribution; | ||||
interface DistributionInterface | 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; | |||||
} |
namespace Lc\CaracoleBundle\Model\Distribution; | namespace Lc\CaracoleBundle\Model\Distribution; | ||||
use Doctrine\ORM\Mapping as ORM; | 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\EntityInterface; | ||||
use Lc\SovBundle\Doctrine\Extension\BlameableNullableTrait; | |||||
use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity; | |||||
/** | /** | ||||
* @ORM\MappedSuperclass() | * @ORM\MappedSuperclass() | ||||
public function __toString() | public function __toString() | ||||
{ | { | ||||
return $this->getCycleNumber().'/'.$this->getYear(); | |||||
return $this->getCycleNumber() . '/' . $this->getYear(); | |||||
} | } | ||||
public function getCycleNumber(): ?int | public function getCycleNumber(): ?int | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getCycleType(): ?string | public function getCycleType(): ?string | ||||
{ | { | ||||
return $this->cycleType; | return $this->cycleType; |
namespace Lc\CaracoleBundle\Model\File; | 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 | 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); | |||||
} |
use Doctrine\Common\Collections\Collection; | use Doctrine\Common\Collections\Collection; | ||||
use Doctrine\ORM\Mapping as ORM; | use Doctrine\ORM\Mapping as ORM; | ||||
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface; | 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\Address\AddressInterface; | ||||
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | ||||
use Lc\CaracoleBundle\Model\Order\OrderRefundInterface; | use Lc\CaracoleBundle\Model\Order\OrderRefundInterface; | ||||
use Lc\CaracoleBundle\Model\Order\OrderShopInterface; | use Lc\CaracoleBundle\Model\Order\OrderShopInterface; | ||||
use Lc\CaracoleBundle\Model\Section\SectionInterface; | |||||
use Lc\SovBundle\Doctrine\Extension\BlameableNullableTrait; | |||||
use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity; | use Lc\SovBundle\Doctrine\Pattern\AbstractFullEntity; | ||||
/** | /** | ||||
* @ORM\MappedSuperclass() | * @ORM\MappedSuperclass() | ||||
*/ | */ | ||||
abstract class DocumentModel extends AbstractFullEntity implements FilterMerchantInterface | |||||
abstract class DocumentModel extends AbstractFullEntity implements FilterMerchantInterface, DocumentInterface | |||||
{ | { | ||||
const TYPE_INVOICE = 'invoice'; | const TYPE_INVOICE = 'invoice'; | ||||
const TYPE_QUOTATION = 'quotation'; | const TYPE_QUOTATION = 'quotation'; |
namespace Lc\CaracoleBundle\Model\Merchant; | 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 | 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); | |||||
} |
/** | /** | ||||
* @ORM\MappedSuperclass() | * @ORM\MappedSuperclass() | ||||
*/ | */ | ||||
abstract class MerchantModel extends AbstractFullEntity | |||||
abstract class MerchantModel extends AbstractFullEntity implements MerchantInterface | |||||
{ | { | ||||
/** | /** |
<?php | <?php | ||||
namespace Lc\CaracoleBundle\Model\Order ; | |||||
namespace Lc\CaracoleBundle\Model\Order; | |||||
use Lc\SovBundle\Model\User\UserInterface; | |||||
interface OrderPaymentInterface | 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); | |||||
} |
/** | /** | ||||
* @ORM\MappedSuperclass() | * @ORM\MappedSuperclass() | ||||
*/ | */ | ||||
abstract class OrderPaymentModel extends AbstractLightEntity implements OrderPayoffInterface | |||||
abstract class OrderPaymentModel extends AbstractLightEntity implements OrderPayoffInterface, OrderPaymentInterface | |||||
{ | { | ||||
use OrderPayoffTrait; | use OrderPayoffTrait; | ||||
namespace Lc\CaracoleBundle\Model\Order; | 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 | 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; | |||||
} |
/** | /** | ||||
* @ORM\MappedSuperclass() | * @ORM\MappedSuperclass() | ||||
*/ | */ | ||||
abstract class OrderProductModel implements PriceInterface, EntityInterface | |||||
abstract class OrderProductModel implements PriceInterface, EntityInterface, OrderProductInterface | |||||
{ | { | ||||
use PriceTrait; | use PriceTrait; | ||||
<?php | <?php | ||||
namespace Lc\CaracoleBundle\Model\Order ; | |||||
namespace Lc\CaracoleBundle\Model\Order; | |||||
interface OrderProductReductionCatalogInterface | 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; | |||||
} | } |
use Doctrine\ORM\Mapping as ORM; | use Doctrine\ORM\Mapping as ORM; | ||||
use Lc\CaracoleBundle\Doctrine\Extension\ReductionTrait; | use Lc\CaracoleBundle\Doctrine\Extension\ReductionTrait; | ||||
use Lc\SovBundle\Doctrine\EntityInterface; | |||||
/** | /** | ||||
* @ORM\MappedSuperclass() | * @ORM\MappedSuperclass() | ||||
*/ | */ | ||||
abstract class OrderProductReductionCatalogModel | |||||
abstract class OrderProductReductionCatalogModel implements EntityInterface, OrderProductReductionCatalogInterface | |||||
{ | { | ||||
use ReductionTrait; | use ReductionTrait; | ||||
namespace Lc\CaracoleBundle\Model\Order; | namespace Lc\CaracoleBundle\Model\Order; | ||||
interface OrderProductRefundInterface | 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; | |||||
} |
namespace Lc\CaracoleBundle\Model\Order; | namespace Lc\CaracoleBundle\Model\Order; | ||||
use Doctrine\ORM\Mapping as ORM; | use Doctrine\ORM\Mapping as ORM; | ||||
use Lc\SovBundle\Doctrine\EntityInterface; | |||||
/** | /** | ||||
* @ORM\MappedSuperclass() | * @ORM\MappedSuperclass() | ||||
*/ | */ | ||||
abstract class OrderProductRefundModel | |||||
abstract class OrderProductRefundModel implements EntityInterface, OrderProductRefundInterface | |||||
{ | { | ||||
/** | /** | ||||
* @ORM\Column(type="integer") | * @ORM\Column(type="integer") |
namespace Lc\CaracoleBundle\Model\Order; | namespace Lc\CaracoleBundle\Model\Order; | ||||
use Lc\CaracoleBundle\Model\Reduction\ReductionCartInterface; | |||||
interface OrderReductionCartInterface | 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; | |||||
} |
/** | /** | ||||
* @ORM\MappedSuperclass() | * @ORM\MappedSuperclass() | ||||
*/ | */ | ||||
abstract class OrderReductionCartModel implements EntityInterface, ReductionInterface, ReductionCartPropertyInterface | |||||
abstract class OrderReductionCartModel implements EntityInterface, ReductionInterface, ReductionCartPropertyInterface, OrderReductionCartInterface | |||||
{ | { | ||||
use ReductionTrait; | use ReductionTrait; | ||||
use ReductionCartPropertyTrait; | use ReductionCartPropertyTrait; |
namespace Lc\CaracoleBundle\Model\Order; | namespace Lc\CaracoleBundle\Model\Order; | ||||
use Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface; | |||||
interface OrderReductionCreditInterface | 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; | |||||
} |
use Lc\CaracoleBundle\Doctrine\Extension\ReductionInterface; | use Lc\CaracoleBundle\Doctrine\Extension\ReductionInterface; | ||||
use Lc\CaracoleBundle\Doctrine\Extension\ReductionTrait; | use Lc\CaracoleBundle\Doctrine\Extension\ReductionTrait; | ||||
use Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface; | use Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface; | ||||
use Lc\SovBundle\Doctrine\EntityInterface; | |||||
/** | /** | ||||
* @ORM\MappedSuperclass() | * @ORM\MappedSuperclass() | ||||
*/ | */ | ||||
abstract class OrderReductionCreditModel implements ReductionInterface | |||||
abstract class OrderReductionCreditModel implements ReductionInterface, EntityInterface, OrderReductionCreditInterface | |||||
{ | { | ||||
use ReductionTrait; | use ReductionTrait; | ||||
namespace Lc\CaracoleBundle\Model\Order; | namespace Lc\CaracoleBundle\Model\Order; | ||||
use Lc\CaracoleBundle\Model\File\DocumentInterface; | |||||
use Lc\SovBundle\Model\User\UserInterface; | |||||
interface OrderRefundInterface | 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); | |||||
} |
/** | /** | ||||
* @ORM\MappedSuperclass() | * @ORM\MappedSuperclass() | ||||
*/ | */ | ||||
abstract class OrderRefundModel extends AbstractLightEntity implements OrderPayoffInterface | |||||
abstract class OrderRefundModel extends AbstractLightEntity implements OrderPayoffInterface, OrderRefundInterface | |||||
{ | { | ||||
use OrderPayoffTrait; | use OrderPayoffTrait; | ||||
public function getValidationDate(): ?\DateTimeInterface; | public function getValidationDate(): ?\DateTimeInterface; | ||||
public function setValidationDate(\DateTimeInterface $validationDate | public function setValidationDate(\DateTimeInterface $validationDate | ||||
): OrderShopModel; | |||||
): OrderShopInterface; | |||||
public function getUser(): ?UserInterface; | public function getUser(): ?UserInterface; | ||||
public function setUser(?UserInterface $user): OrderShopModel; | |||||
public function setUser(?UserInterface $user): OrderShopInterface; | |||||
public function getInvoiceAddress(): ?AddressInterface; | public function getInvoiceAddress(): ?AddressInterface; | ||||
public function setInvoiceAddress(?AddressInterface $invoiceAddress): OrderShopModel; | |||||
public function setInvoiceAddress(?AddressInterface $invoiceAddress): OrderShopInterface; | |||||
public function getInvoiceAddressText(): ?string; | public function getInvoiceAddressText(): ?string; | ||||
public function setInvoiceAddressText(string $invoiceAddressText): OrderShopModel; | |||||
public function setInvoiceAddressText(string $invoiceAddressText): OrderShopInterface; | |||||
public function getComment(): ?string; | public function getComment(): ?string; | ||||
public function setComment(?string $comment): OrderShopModel; | |||||
public function setComment(?string $comment): OrderShopInterface; | |||||
public function getMeanPayment(): ?string; | public function getMeanPayment(): ?string; | ||||
public function setMeanPayment(string $meanPayment): OrderShopModel; | |||||
public function setMeanPayment(string $meanPayment): OrderShopInterface; | |||||
/** | /** | ||||
* @return Collection|OrderStatusHistoryInterface[] | * @return Collection|OrderStatusHistoryInterface[] | ||||
public function getOrderStatusHistories(): Collection; | public function getOrderStatusHistories(): Collection; | ||||
public function addOrderStatusHistory(OrderStatusHistoryInterface $orderStatusHistory | public function addOrderStatusHistory(OrderStatusHistoryInterface $orderStatusHistory | ||||
): OrderShopModel; | |||||
): OrderShopInterface; | |||||
public function removeOrderStatusHistory(OrderStatusHistoryInterface $orderStatusHistory | public function removeOrderStatusHistory(OrderStatusHistoryInterface $orderStatusHistory | ||||
): OrderShopModel; | |||||
): OrderShopInterface; | |||||
/** | /** | ||||
* @return Collection|OrderPaymentInterface[] | * @return Collection|OrderPaymentInterface[] | ||||
*/ | */ | ||||
public function getOrderPayments($meanPayment = null): Collection; | public function getOrderPayments($meanPayment = null): Collection; | ||||
public function addOrderPayment(OrderPaymentInterface $orderPayment): OrderShopModel; | |||||
public function addOrderPayment(OrderPaymentInterface $orderPayment): OrderShopInterface; | |||||
public function removeOrderPayment(OrderPaymentInterface $orderPayment | public function removeOrderPayment(OrderPaymentInterface $orderPayment | ||||
): OrderShopModel; | |||||
): OrderShopInterface; | |||||
/** | /** | ||||
* @return Collection|OrderProductInterface[] | * @return Collection|OrderProductInterface[] | ||||
*/ | */ | ||||
public function getOrderProducts(): Collection; | public function getOrderProducts(): Collection; | ||||
public function addOrderProduct(OrderProductInterface $orderProduct): OrderShopModel; | |||||
public function addOrderProduct(OrderProductInterface $orderProduct): OrderShopInterface; | |||||
public function removeOrderProduct(OrderProductInterface $orderProduct | public function removeOrderProduct(OrderProductInterface $orderProduct | ||||
): OrderShopModel; | |||||
): OrderShopInterface; | |||||
public function getVisitor(): ?VisitorInterface; | public function getVisitor(): ?VisitorInterface; | ||||
public function setVisitor(?VisitorInterface $visitor): OrderShopModel; | |||||
public function setVisitor(?VisitorInterface $visitor): OrderShopInterface; | |||||
public function getDeliveryInfos(): ?string; | public function getDeliveryInfos(): ?string; | ||||
public function setDeliveryInfos(?string $deliveryInfos): OrderShopModel; | |||||
public function setDeliveryInfos(?string $deliveryInfos): OrderShopInterface; | |||||
public function getOrderStatus(): ?OrderStatusInterface; | public function getOrderStatus(): ?OrderStatusInterface; | ||||
public function setOrderStatusProtected(?OrderStatusInterface $orderStatus | public function setOrderStatusProtected(?OrderStatusInterface $orderStatus | ||||
): OrderShopModel; | |||||
): OrderShopInterface; | |||||
/** | /** | ||||
* @return Collection|OrderReductionCartInterface[] | * @return Collection|OrderReductionCartInterface[] | ||||
public function getOrderReductionCarts(): Collection; | public function getOrderReductionCarts(): Collection; | ||||
public function addOrderReductionCart(OrderReductionCartInterface $orderReductionCart | public function addOrderReductionCart(OrderReductionCartInterface $orderReductionCart | ||||
): OrderShopModel; | |||||
): OrderShopInterface; | |||||
public function removeOrderReductionCart(OrderReductionCartInterface $orderReductionCart | public function removeOrderReductionCart(OrderReductionCartInterface $orderReductionCart | ||||
): OrderShopModel; | |||||
): OrderShopInterface; | |||||
/** | /** | ||||
* @return Collection|OrderReductionCreditInterface[] | * @return Collection|OrderReductionCreditInterface[] | ||||
public function getOrderReductionCredits(): Collection; | public function getOrderReductionCredits(): Collection; | ||||
public function addOrderReductionCredit(OrderReductionCreditInterface $orderReductionCredit | public function addOrderReductionCredit(OrderReductionCreditInterface $orderReductionCredit | ||||
): OrderShopModel; | |||||
): OrderShopInterface; | |||||
public function removeOrderReductionCredit(OrderReductionCreditInterface $orderReductionCredit | public function removeOrderReductionCredit(OrderReductionCreditInterface $orderReductionCredit | ||||
): OrderShopModel; | |||||
): OrderShopInterface; | |||||
/** | /** | ||||
* @return Collection|DocumentInterface[] | * @return Collection|DocumentInterface[] | ||||
*/ | */ | ||||
public function getDocuments(): Collection; | 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[] | * @return Collection|TicketInterface[] | ||||
*/ | */ | ||||
public function getTickets(): Collection; | 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 getSection(): ?SectionInterface; | ||||
public function setSection(?SectionInterface $section): OrderShopModel; | |||||
public function setSection(?SectionInterface $section): OrderShopInterface; | |||||
public function getCycleId(): ?int; | public function getCycleId(): ?int; | ||||
public function setCycleId(?int $cycleId): OrderShopModel; | |||||
public function setCycleId(?int $cycleId): OrderShopInterface; | |||||
public function getOrderShopCreatedAt(): ?\DateTimeInterface; | public function getOrderShopCreatedAt(): ?\DateTimeInterface; | ||||
public function setOrderShopCreatedAt(?\DateTimeInterface $orderShopCreatedAt | public function setOrderShopCreatedAt(?\DateTimeInterface $orderShopCreatedAt | ||||
): OrderShopModel; | |||||
): OrderShopInterface; | |||||
public function getIdValidOrder(): ?int; | public function getIdValidOrder(): ?int; | ||||
public function setIdValidOrder(?int $idValidOrder): OrderShopModel; | |||||
public function setIdValidOrder(?int $idValidOrder): OrderShopInterface; | |||||
public function getDeliveryAddress(): ?AddressInterface; | public function getDeliveryAddress(): ?AddressInterface; | ||||
public function setDeliveryAddress(?AddressInterface $deliveryAddress | public function setDeliveryAddress(?AddressInterface $deliveryAddress | ||||
): OrderShopModel; | |||||
): OrderShopInterface; | |||||
public function getDeliveryAddressText(): ?string; | public function getDeliveryAddressText(): ?string; | ||||
public function setDeliveryAddressText(string $deliveryAddressText): OrderShopModel; | |||||
public function setDeliveryAddressText(string $deliveryAddressText): OrderShopInterface; | |||||
public function getDeliveryPointSale(): ?PointSaleInterface; | public function getDeliveryPointSale(): ?PointSaleInterface; | ||||
public function setDeliveryPointSale(?PointSaleInterface $deliveryPointSale | public function setDeliveryPointSale(?PointSaleInterface $deliveryPointSale | ||||
): OrderShopModel; | |||||
): OrderShopInterface; | |||||
public function getDeliveryType(): ?string; | public function getDeliveryType(): ?string; | ||||
public function setDeliveryType(?string $deliveryType): OrderShopModel; | |||||
public function setDeliveryType(?string $deliveryType): OrderShopInterface; | |||||
public function getDeliveryPrice(): ?float; | public function getDeliveryPrice(): ?float; | ||||
public function setDeliveryPrice(?float $deliveryPrice): OrderShopModel; | |||||
public function setDeliveryPrice(?float $deliveryPrice): OrderShopInterface; | |||||
public function getDeliveryTaxRate(): ?TaxRateInterface; | public function getDeliveryTaxRate(): ?TaxRateInterface; | ||||
public function setDeliveryTaxRate(?TaxRateInterface $deliveryTaxRate | public function setDeliveryTaxRate(?TaxRateInterface $deliveryTaxRate | ||||
): OrderShopModel; | |||||
): OrderShopInterface; | |||||
public function getReference(): ?string; | public function getReference(): ?string; | ||||
public function setReference(?string $reference): OrderShopModel; | |||||
public function setReference(?string $reference): OrderShopInterface; | |||||
public function getMainOrderShop(): ?self; | public function getMainOrderShop(): ?self; | ||||
public function setMainOrderShop(?OrderShopModel $mainOrderShop): OrderShopModel; | |||||
public function setMainOrderShop(?OrderShopModel $mainOrderShop): OrderShopInterface; | |||||
/** | /** | ||||
* @return Collection|OrderShopInterface[] | * @return Collection|OrderShopInterface[] | ||||
public function getComplementaryOrderShops(): Collection; | public function getComplementaryOrderShops(): Collection; | ||||
public function addComplementaryOrderShop(OrderShopModel $complementaryOrderShop | public function addComplementaryOrderShop(OrderShopModel $complementaryOrderShop | ||||
): OrderShopModel; | |||||
): OrderShopInterface; | |||||
public function removeComplementaryOrderShop(OrderShopModel $complementaryOrderShop | public function removeComplementaryOrderShop(OrderShopModel $complementaryOrderShop | ||||
): OrderShopModel; | |||||
): OrderShopInterface; | |||||
public function getDeclineComplementaryOrderShop(): ?bool; | public function getDeclineComplementaryOrderShop(): ?bool; | ||||
public function setDeclineComplementaryOrderShop(?bool $declineComplementaryOrderShop | public function setDeclineComplementaryOrderShop(?bool $declineComplementaryOrderShop | ||||
): OrderShopModel; | |||||
): OrderShopInterface; | |||||
public function getOrderAllowByAdmin(): ?bool; | public function getOrderAllowByAdmin(): ?bool; | ||||
public function setOrderAllowByAdmin(?bool $orderAllowByAdmin): OrderShopModel; | |||||
public function setOrderAllowByAdmin(?bool $orderAllowByAdmin): OrderShopInterface; | |||||
public function getHasReach(): ?int; | public function getHasReach(): ?int; | ||||
public function setHasReach(?int $hasReach): OrderShopModel; | |||||
public function setHasReach(?int $hasReach): OrderShopInterface; | |||||
public function getStatTotal(): ?float; | public function getStatTotal(): ?float; | ||||
public function setStatTotal(?float $statTotal): OrderShopModel; | |||||
public function setStatTotal(?float $statTotal): OrderShopInterface; | |||||
public function getStatTotalWithTax(): ?float; | public function getStatTotalWithTax(): ?float; | ||||
public function setStatTotalWithTax(?float $statTotalWithTax): OrderShopModel; | |||||
public function setStatTotalWithTax(?float $statTotalWithTax): OrderShopInterface; | |||||
public function getStatTotalOrderProductsWithReductions(): ?float; | public function getStatTotalOrderProductsWithReductions(): ?float; | ||||
public function setStatTotalOrderProductsWithReductions(?float $statTotalOrderProductsWithReductions | public function setStatTotalOrderProductsWithReductions(?float $statTotalOrderProductsWithReductions | ||||
): OrderShopModel; | |||||
): OrderShopInterface; | |||||
public function getStatTotalOrderProductsWithTaxAndReductions(): ?float; | public function getStatTotalOrderProductsWithTaxAndReductions(): ?float; | ||||
public function setStatTotalOrderProductsWithTaxAndReductions(?float $statTotalOrderProductsWithTaxAndReductions | public function setStatTotalOrderProductsWithTaxAndReductions(?float $statTotalOrderProductsWithTaxAndReductions | ||||
): OrderShopModel; | |||||
): OrderShopInterface; | |||||
public function getStatMarginOrderProductsWithReductions(): ?float; | public function getStatMarginOrderProductsWithReductions(): ?float; | ||||
public function setStatMarginOrderProductsWithReductions(?float $statMarginOrderProductsWithReductions | public function setStatMarginOrderProductsWithReductions(?float $statMarginOrderProductsWithReductions | ||||
): OrderShopModel; | |||||
): OrderShopInterface; | |||||
public function getStatDeliveryPriceWithReduction(): ?float; | public function getStatDeliveryPriceWithReduction(): ?float; | ||||
public function setStatDeliveryPriceWithReduction(?float $statDeliveryPriceWithReduction | public function setStatDeliveryPriceWithReduction(?float $statDeliveryPriceWithReduction | ||||
): OrderShopModel; | |||||
): OrderShopInterface; | |||||
public function getStatDeliveryPriceWithTaxAndReduction(): ?float; | public function getStatDeliveryPriceWithTaxAndReduction(): ?float; | ||||
public function setStatDeliveryPriceWithTaxAndReduction(?float $statDeliveryPriceWithTaxAndReduction | public function setStatDeliveryPriceWithTaxAndReduction(?float $statDeliveryPriceWithTaxAndReduction | ||||
): OrderShopModel; | |||||
): OrderShopInterface; | |||||
} | } |
namespace Lc\CaracoleBundle\Model\Order; | namespace Lc\CaracoleBundle\Model\Order; | ||||
use Lc\SovBundle\Model\User\UserInterface; | |||||
interface OrderStatusHistoryInterface | 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); | |||||
} |
namespace Lc\CaracoleBundle\Model\Order; | namespace Lc\CaracoleBundle\Model\Order; | ||||
use Doctrine\ORM\Mapping as ORM; | use Doctrine\ORM\Mapping as ORM; | ||||
use Gedmo\Mapping\Annotation as Gedmo; | |||||
use Lc\SovBundle\Doctrine\Extension\BlameableNullableTrait; | |||||
use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity; | use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity; | ||||
/** | /** | ||||
* @ORM\MappedSuperclass() | * @ORM\MappedSuperclass() | ||||
*/ | */ | ||||
abstract class OrderStatusHistoryModel extends AbstractLightEntity | |||||
abstract class OrderStatusHistoryModel extends AbstractLightEntity implements OrderStatusHistoryInterface | |||||
{ | { | ||||
namespace Lc\CaracoleBundle\Model\Order; | namespace Lc\CaracoleBundle\Model\Order; | ||||
use Doctrine\Common\Collections\Collection; | |||||
interface OrderStatusInterface | 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; | |||||
} |
/** | /** | ||||
* @ORM\MappedSuperclass() | * @ORM\MappedSuperclass() | ||||
*/ | */ | ||||
abstract class OrderStatusModel implements EntityInterface | |||||
abstract class OrderStatusModel implements EntityInterface, OrderStatusInterface | |||||
{ | { | ||||
const ALIAS_CART = 'cart'; | const ALIAS_CART = 'cart'; | ||||
const ALIAS_CART_CANCELED = 'cart-canceled'; | const ALIAS_CART_CANCELED = 'cart-canceled'; | ||||
return $this->nextStatusAllowed; | return $this->nextStatusAllowed; | ||||
} | } | ||||
public function addNextStatusAllowed(self $nextStatusAllowed): self | |||||
public function addNextStatusAllowed(OrderStatusInterface $nextStatusAllowed): self | |||||
{ | { | ||||
if (!$this->nextStatusAllowed->contains($nextStatusAllowed)) { | if (!$this->nextStatusAllowed->contains($nextStatusAllowed)) { | ||||
$this->nextStatusAllowed[] = $nextStatusAllowed; | $this->nextStatusAllowed[] = $nextStatusAllowed; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function removeNextStatusAllowed(self $nextStatusAllowed): self | |||||
public function removeNextStatusAllowed(OrderStatusInterface $nextStatusAllowed): self | |||||
{ | { | ||||
if ($this->nextStatusAllowed->contains($nextStatusAllowed)) { | if ($this->nextStatusAllowed->contains($nextStatusAllowed)) { | ||||
$this->nextStatusAllowed->removeElement($nextStatusAllowed); | $this->nextStatusAllowed->removeElement($nextStatusAllowed); |
namespace Lc\CaracoleBundle\Model\PointSale; | 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 | 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); | |||||
} |
* @ORM\MappedSuperclass() | * @ORM\MappedSuperclass() | ||||
*/ | */ | ||||
abstract class PointSaleModel extends AbstractFullEntity implements FilterMultipleMerchantsInterface, | abstract class PointSaleModel extends AbstractFullEntity implements FilterMultipleMerchantsInterface, | ||||
OrderAmountMinInterface | |||||
OrderAmountMinInterface, PointSaleInterface | |||||
{ | { | ||||
use OrderAmountMinTrait; | use OrderAmountMinTrait; |
use Doctrine\Common\Collections\Collection; | use Doctrine\Common\Collections\Collection; | ||||
use Lc\CaracoleBundle\Model\Section\SectionInterface; | use Lc\CaracoleBundle\Model\Section\SectionInterface; | ||||
use Lc\SovBundle\Model\File\FileInterface; | |||||
use Lc\SovBundle\Model\User\UserInterface; | |||||
interface ProductCategoryInterface | 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(); | public function getParentCategory(); | ||||
/** | |||||
* @return Collection|self[] | |||||
*/ | |||||
public function getChildrens(): Collection; | 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[] | * @return Collection|ProductFamilyInterface[] | ||||
public function getProductFamilies(): Collection; | public function getProductFamilies(): Collection; | ||||
public function addProductFamily(ProductFamilyInterface $productFamily | public function addProductFamily(ProductFamilyInterface $productFamily | ||||
): ProductCategoryModel; | |||||
): ProductCategoryInterface; | |||||
public function removeProductFamily(ProductFamilyInterface $productFamily | public function removeProductFamily(ProductFamilyInterface $productFamily | ||||
): ProductCategoryModel; | |||||
): ProductCategoryInterface; | |||||
public function countProductFamilies($status = null); | public function countProductFamilies($status = null); | ||||
public function getSaleStatus(): ?bool; | 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); | |||||
} | } |
return $this->parent; | return $this->parent; | ||||
} | } | ||||
public function setParent(?self $productCategory): self | |||||
public function setParent(?ProductCategoryInterface $productCategory): self | |||||
{ | { | ||||
$this->parent = $productCategory; | $this->parent = $productCategory; | ||||
return new ArrayCollection(iterator_to_array($iterator)); | return new ArrayCollection(iterator_to_array($iterator)); | ||||
} | } | ||||
public function addChildren(self $productCategory): self | |||||
public function addChildren(ProductCategoryInterface $productCategory): self | |||||
{ | { | ||||
if (!$this->childrens->contains($productCategory)) { | if (!$this->childrens->contains($productCategory)) { | ||||
$this->childrens[] = $productCategory; | $this->childrens[] = $productCategory; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function removeChildren(self $productCategory): self | |||||
public function removeChildren(ProductCategoryInterface $productCategory): self | |||||
{ | { | ||||
if ($this->childrens->contains($productCategory)) { | if ($this->childrens->contains($productCategory)) { | ||||
$this->childrens->removeElement($productCategory); | $this->childrens->removeElement($productCategory); |
namespace Lc\CaracoleBundle\Model\Product; | 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 | 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); | |||||
} | } |
namespace Lc\CaracoleBundle\Model\Product; | namespace Lc\CaracoleBundle\Model\Product; | ||||
use App\Entity\Product\ProductFamily; | |||||
use App\Entity\Section\Section; | |||||
interface ProductFamilySectionPropertyInterface | 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; | |||||
} |
namespace Lc\CaracoleBundle\Model\Product; | 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 | 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 getProductFamily(): ?ProductFamilyInterface; | ||||
public function setProductFamily(?ProductFamilyInterface $productFamily | public function setProductFamily(?ProductFamilyInterface $productFamily | ||||
): \Lc\CaracoleBundle\Model\Product\ProductModel; | |||||
): ProductInterface; | |||||
public function getTitle(): ?string; | 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 getOriginProduct(): ?bool; | ||||
public function setOriginProduct(?bool $originProduct): \Lc\CaracoleBundle\Model\Product\ProductModel; | |||||
public function setOriginProduct(?bool $originProduct): ProductInterface; | |||||
public function getExportTitle(): ?string; | 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 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); | |||||
} | } |
namespace Lc\CaracoleBundle\Model\Product; | namespace Lc\CaracoleBundle\Model\Product; | ||||
use Lc\SovBundle\Model\File\FileInterface; | |||||
use Lc\SovBundle\Model\User\UserInterface; | |||||
interface QualityLabelInterface | 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); | |||||
} | } |
namespace Lc\CaracoleBundle\Model\Reduction; | namespace Lc\CaracoleBundle\Model\Reduction; | ||||
use Doctrine\Common\Collections\Collection; | 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 | 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); | |||||
} |
use Doctrine\Common\Collections\Collection; | use Doctrine\Common\Collections\Collection; | ||||
use Doctrine\ORM\Mapping as ORM; | use Doctrine\ORM\Mapping as ORM; | ||||
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface; | use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface; | ||||
use Lc\CaracoleBundle\Doctrine\Extension\FilterSectionInterface; | |||||
use Lc\CaracoleBundle\Doctrine\Extension\OrderAmountMinInterface; | use Lc\CaracoleBundle\Doctrine\Extension\OrderAmountMinInterface; | ||||
use Lc\CaracoleBundle\Doctrine\Extension\OrderAmountMinTrait; | use Lc\CaracoleBundle\Doctrine\Extension\OrderAmountMinTrait; | ||||
use Lc\CaracoleBundle\Doctrine\Extension\ReductionCartPropertyInterface; | use Lc\CaracoleBundle\Doctrine\Extension\ReductionCartPropertyInterface; | ||||
use Lc\CaracoleBundle\Doctrine\Extension\ReductionPropertyInterface; | use Lc\CaracoleBundle\Doctrine\Extension\ReductionPropertyInterface; | ||||
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | ||||
use Lc\CaracoleBundle\Model\PointSale\PointSaleInterface; | use Lc\CaracoleBundle\Model\PointSale\PointSaleInterface; | ||||
use Lc\CaracoleBundle\Model\Section\SectionInterface; | |||||
use Lc\SovBundle\Doctrine\Extension\StatusInterface; | use Lc\SovBundle\Doctrine\Extension\StatusInterface; | ||||
use Lc\SovBundle\Doctrine\Extension\StatusTrait; | use Lc\SovBundle\Doctrine\Extension\StatusTrait; | ||||
use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity; | use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity; | ||||
use Lc\SovBundle\Model\User\UserInterface; | |||||
/** | /** | ||||
* @ORM\MappedSuperclass() | * @ORM\MappedSuperclass() | ||||
*/ | */ | ||||
abstract class ReductionCartModel extends AbstractLightEntity implements ReductionPropertyInterface, ReductionInterface, | abstract class ReductionCartModel extends AbstractLightEntity implements ReductionPropertyInterface, ReductionInterface, | ||||
ReductionCartPropertyInterface, | ReductionCartPropertyInterface, | ||||
FilterSectionInterface, | |||||
OrderAmountMinInterface, StatusInterface | |||||
FilterMerchantInterface, | |||||
OrderAmountMinInterface, | |||||
StatusInterface, ReductionCartInterface | |||||
{ | { | ||||
use StatusTrait; | use StatusTrait; | ||||
use OrderAmountMinTrait; | use OrderAmountMinTrait; | ||||
protected $title; | protected $title; | ||||
/** | /** | ||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Section\SectionInterface") | |||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface") | |||||
* @ORM\JoinColumn(nullable=false) | * @ORM\JoinColumn(nullable=false) | ||||
*/ | */ | ||||
protected $section; | |||||
protected $merchant; | |||||
/** | /** | ||||
* @ORM\Column(type="array", nullable=true) | * @ORM\Column(type="array", nullable=true) | ||||
return $this; | 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; | return $this; | ||||
} | } | ||||
public function getCodes(): ?array | public function getCodes(): ?array | ||||
{ | { | ||||
return $this->codes; | return $this->codes; | ||||
return $this->uncombinables; | return $this->uncombinables; | ||||
} | } | ||||
public function addUncombinable(self $uncombinable): self | |||||
public function addUncombinable(ReductionCartInterface $uncombinable): self | |||||
{ | { | ||||
if (!$this->uncombinables->contains($uncombinable)) { | if (!$this->uncombinables->contains($uncombinable)) { | ||||
$this->uncombinables[] = $uncombinable; | $this->uncombinables[] = $uncombinable; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function removeUncombinables(self $uncombinable): self | |||||
public function removeUncombinables(ReductionCartInterface $uncombinable): self | |||||
{ | { | ||||
if ($this->uncombinables->contains($uncombinable)) { | if ($this->uncombinables->contains($uncombinable)) { | ||||
$this->uncombinables->removeElement($uncombinable); | $this->uncombinables->removeElement($uncombinable); |
namespace Lc\CaracoleBundle\Model\Reduction; | 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 | 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 | |||||
); | |||||
} |
use Doctrine\Common\Collections\ArrayCollection; | use Doctrine\Common\Collections\ArrayCollection; | ||||
use Doctrine\Common\Collections\Collection; | use Doctrine\Common\Collections\Collection; | ||||
use Doctrine\ORM\Mapping as ORM; | 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\ReductionPropertyTrait; | ||||
use Lc\CaracoleBundle\Doctrine\Extension\ReductionTrait; | use Lc\CaracoleBundle\Doctrine\Extension\ReductionTrait; | ||||
use Lc\CaracoleBundle\Doctrine\Extension\ReductionPropertyInterface; | use Lc\CaracoleBundle\Doctrine\Extension\ReductionPropertyInterface; | ||||
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | ||||
use Lc\CaracoleBundle\Model\Product\ProductCategoryInterface; | use Lc\CaracoleBundle\Model\Product\ProductCategoryInterface; | ||||
use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface; | 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\StatusInterface; | ||||
use Lc\SovBundle\Doctrine\Extension\StatusTrait; | use Lc\SovBundle\Doctrine\Extension\StatusTrait; | ||||
use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity; | use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity; | ||||
*/ | */ | ||||
abstract class ReductionCatalogModel extends AbstractLightEntity implements ReductionCatalogInterface, | abstract class ReductionCatalogModel extends AbstractLightEntity implements ReductionCatalogInterface, | ||||
ReductionPropertyInterface, | ReductionPropertyInterface, | ||||
FilterSectionInterface, StatusInterface | |||||
FilterMerchantInterface, | |||||
StatusInterface | |||||
{ | { | ||||
use StatusTrait; | use StatusTrait; | ||||
use ReductionTrait; | use ReductionTrait; | ||||
protected $title; | protected $title; | ||||
/** | /** | ||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Section\SectionInterface") | |||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface") | |||||
* @ORM\JoinColumn(nullable=false) | * @ORM\JoinColumn(nullable=false) | ||||
*/ | */ | ||||
protected $section; | |||||
protected $merchant; | |||||
/** | /** | ||||
* @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\Product\ProductFamilyInterface") | * @ORM\ManyToMany(targetEntity="Lc\CaracoleBundle\Model\Product\ProductFamilyInterface") | ||||
return $this; | 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; | return $this; | ||||
} | } |
namespace Lc\CaracoleBundle\Model\Reduction; | namespace Lc\CaracoleBundle\Model\Reduction; | ||||
use Doctrine\Common\Collections\Collection; | |||||
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | |||||
use Lc\SovBundle\Model\User\UserInterface; | |||||
interface ReductionCreditInterface | 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 | |||||
); | |||||
} |
use Doctrine\Common\Collections\Collection; | use Doctrine\Common\Collections\Collection; | ||||
use Doctrine\ORM\Mapping as ORM; | use Doctrine\ORM\Mapping as ORM; | ||||
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface; | use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface; | ||||
use Lc\CaracoleBundle\Doctrine\Extension\FilterSectionInterface; | |||||
use Lc\CaracoleBundle\Doctrine\Extension\ReductionInterface; | use Lc\CaracoleBundle\Doctrine\Extension\ReductionInterface; | ||||
use Lc\CaracoleBundle\Doctrine\Extension\ReductionTrait; | use Lc\CaracoleBundle\Doctrine\Extension\ReductionTrait; | ||||
use Lc\CaracoleBundle\Model\Config\UnitModel; | use Lc\CaracoleBundle\Model\Config\UnitModel; | ||||
use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | use Lc\CaracoleBundle\Model\Merchant\MerchantInterface; | ||||
use Lc\CaracoleBundle\Model\Section\SectionInterface; | |||||
use Lc\SovBundle\Doctrine\Extension\StatusInterface; | use Lc\SovBundle\Doctrine\Extension\StatusInterface; | ||||
use Lc\SovBundle\Doctrine\Extension\StatusTrait; | use Lc\SovBundle\Doctrine\Extension\StatusTrait; | ||||
use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity; | use Lc\SovBundle\Doctrine\Pattern\AbstractLightEntity; | ||||
/** | /** | ||||
* @ORM\MappedSuperclass() | * @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_CREDIT = 'credit'; | ||||
const TYPE_GIFT = 'gift'; | const TYPE_GIFT = 'gift'; | ||||
protected $users; | protected $users; | ||||
/** | /** | ||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Section\SectionInterface") | |||||
* @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface") | |||||
* @ORM\JoinColumn(nullable=false) | * @ORM\JoinColumn(nullable=false) | ||||
*/ | */ | ||||
protected $section; | |||||
protected $merchant; | |||||
/** | /** | ||||
* @ORM\Column(type="string", length=255) | * @ORM\Column(type="string", length=255) | ||||
return $this; | 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; | return $this; | ||||
} | } |
namespace Lc\CaracoleBundle\Model\Section; | namespace Lc\CaracoleBundle\Model\Section; | ||||
use Lc\SovBundle\Model\User\GroupUserInterface; | |||||
interface OpeningInterface | 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; | |||||
} |
namespace Lc\CaracoleBundle\Model\Section; | 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 | 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); | |||||
} |
/** | /** | ||||
* @ORM\MappedSuperclass() | * @ORM\MappedSuperclass() | ||||
*/ | */ | ||||
abstract class SectionModel extends AbstractFullEntity implements FilterMerchantInterface | |||||
abstract class SectionModel extends AbstractFullEntity implements FilterMerchantInterface, SectionInterface | |||||
{ | { | ||||
const DEVALIAS_COMMON = 'common'; | const DEVALIAS_COMMON = 'common'; | ||||
namespace Lc\CaracoleBundle\Model\Setting; | 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 | 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); | |||||
} | } |
use Lc\SovBundle\Doctrine\EntityInterface; | use Lc\SovBundle\Doctrine\EntityInterface; | ||||
use Lc\SovBundle\Model\Setting\SettingModel as SovSettingModel; | 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") | * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Merchant\MerchantInterface", inversedBy="settings") |
namespace Lc\CaracoleBundle\Model\Setting; | 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 | 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); | |||||
} | } |
use Lc\SovBundle\Doctrine\EntityInterface; | use Lc\SovBundle\Doctrine\EntityInterface; | ||||
use Lc\SovBundle\Model\Setting\SettingModel as SovSettingModel; | 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") | * @ORM\ManyToOne(targetEntity="Lc\CaracoleBundle\Model\Section\SectionInterface", inversedBy="settings") |
return $this->section; | return $this->section; | ||||
} | } | ||||
public function setSection(SectionInterface $section): self | |||||
public function setSection(?SectionInterface $section): self | |||||
{ | { | ||||
$this->section = $section; | $this->section = $section; | ||||
namespace Lc\CaracoleBundle\Model\User; | 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 | 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); | |||||
} |
* @ORM\MappedSuperclass() | * @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") | * @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface", inversedBy="userMerchants") |
namespace Lc\CaracoleBundle\Model\User; | namespace Lc\CaracoleBundle\Model\User; | ||||
use Lc\CaracoleBundle\Model\PointSale\PointSaleInterface; | |||||
use Lc\SovBundle\Model\User\UserInterface; | |||||
interface UserPointSaleInterface | 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; | |||||
} |
/** | /** | ||||
* @ORM\MappedSuperclass | * @ORM\MappedSuperclass | ||||
*/ | */ | ||||
abstract class UserPointSaleModel | |||||
abstract class UserPointSaleModel implements UserPointSaleInterface | |||||
{ | { | ||||
/** | /** | ||||
* @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface", inversedBy="userPointSales") | * @ORM\ManyToOne(targetEntity="Lc\SovBundle\Model\User\UserInterface", inversedBy="userPointSales") |
namespace Lc\CaracoleBundle\Model\User; | namespace Lc\CaracoleBundle\Model\User; | ||||
use Doctrine\Common\Collections\Collection; | |||||
use Lc\CaracoleBundle\Model\Order\OrderShopInterface; | |||||
interface VisitorInterface | 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; | |||||
} |
/** | /** | ||||
* @ORM\MappedSuperclass() | * @ORM\MappedSuperclass() | ||||
*/ | */ | ||||
abstract class VisitorModel implements EntityInterface | |||||
abstract class VisitorModel implements EntityInterface, VisitorInterface | |||||
{ | { | ||||
/** | /** | ||||
* @ORM\Column(type="string", length=255) | * @ORM\Column(type="string", length=255) |
public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | ||||
{ | { | ||||
$query->orderBy('createdAt'); | |||||
//$query->orderBy('createdAt'); | |||||
return $query; | return $query; | ||||
} | } | ||||
use App\Builder\Distribution\DistributionBuilder; | use App\Builder\Distribution\DistributionBuilder; | ||||
use App\Entity\Distribution\Distribution; | use App\Entity\Distribution\Distribution; | ||||
use App\Entity\User\User; | |||||
use Doctrine\ORM\EntityManagerInterface; | use Doctrine\ORM\EntityManagerInterface; | ||||
use Lc\CaracoleBundle\Builder\File\DocumentBuilder; | use Lc\CaracoleBundle\Builder\File\DocumentBuilder; | ||||
use Lc\CaracoleBundle\Model\Distribution\DistributionInterface; | use Lc\CaracoleBundle\Model\Distribution\DistributionInterface; | ||||
use Lc\SovBundle\Model\User\UserInterface; | use Lc\SovBundle\Model\User\UserInterface; | ||||
use Lc\CaracoleBundle\Repository\AbstractStore; | use Lc\CaracoleBundle\Repository\AbstractStore; | ||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
use Lc\SovBundle\Translation\FlashBagTranslator; | |||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; | use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; | ||||
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface; | |||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface; | use Symfony\Component\Routing\Generator\UrlGeneratorInterface; | ||||
class OrderShopStore extends AbstractStore | class OrderShopStore extends AbstractStore | ||||
protected SectionStore $sectionStore; | protected SectionStore $sectionStore; | ||||
protected OrderProductStore $orderProductStore; | protected OrderProductStore $orderProductStore; | ||||
protected MerchantStore $merchantStore; | protected MerchantStore $merchantStore; | ||||
protected FlashBagInterface $flashBag; | |||||
protected FlashBagTranslator $flashBagTranslator; | |||||
protected OpeningResolver $openingResolver; | protected OpeningResolver $openingResolver; | ||||
protected ParameterBagInterface $parameterBag; | protected ParameterBagInterface $parameterBag; | ||||
protected UrlGeneratorInterface $router; | protected UrlGeneratorInterface $router; | ||||
protected DistributionBuilder $distributionBuilder; | protected DistributionBuilder $distributionBuilder; | ||||
public function __construct( | 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->query = $query; | ||||
$this->entityManager = $entityManager; | $this->entityManager = $entityManager; | ||||
$this->priceSolver = $priceSolver; | $this->priceSolver = $priceSolver; | ||||
$this->sectionStore = $sectionStore; | $this->sectionStore = $sectionStore; | ||||
$this->orderProductStore = $orderProductStore; | $this->orderProductStore = $orderProductStore; | ||||
$this->merchantStore = $merchantStore; | $this->merchantStore = $merchantStore; | ||||
$this->flashBag = $flashBag; | |||||
$this->flashBagTranslator = $flashBagTranslator; | |||||
$this->parameterBag = $parameterBag; | $this->parameterBag = $parameterBag; | ||||
$this->router = $router; | $this->router = $router; | ||||
$this->orderShopSolver = $orderShopSolver; | $this->orderShopSolver = $orderShopSolver; | ||||
public function getByCurrentDistribution($params = [], $query = null) | public function getByCurrentDistribution($params = [], $query = null) | ||||
{ | { | ||||
return $this->getBy( | 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 | |||||
); | ); | ||||
} | } | ||||
public function getByCurrentDistributionAndUser(UserInterface $user = null, array $params = [], $query = null) | public function getByCurrentDistributionAndUser(UserInterface $user = null, array $params = [], $query = null) | ||||
{ | { | ||||
return $this->getByCurrentDistribution( | return $this->getByCurrentDistribution( | ||||
array_merge( | |||||
[ | |||||
'user' => $user, | |||||
'excludeComplementaryOrderShops' => true | |||||
], | |||||
$params | |||||
), | |||||
$query | |||||
array_merge( | |||||
[ | |||||
'user' => $user, | |||||
'excludeComplementaryOrderShops' => true | |||||
], | |||||
$params | |||||
), | |||||
$query | |||||
); | ); | ||||
} | } | ||||
public function countByCurrentDistribution(array $params, $query = null) | public function countByCurrentDistribution(array $params, $query = null) | ||||
{ | { | ||||
return $this->countBy( | 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 | // @TODO : optimisation à remettre en place | ||||
public function countValidByUserAllMerchant($user, $query = null): int | public function countValidByUserAllMerchant($user, $query = null): int | ||||
{ | { | ||||
return $this->countBy( | 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 | public function countValidByUser(UserInterface $user = null, $query = null): int | ||||
{ | { | ||||
return $this->countBy( | return $this->countBy( | ||||
[ | |||||
'user' => $user, | |||||
'isValid' => true, | |||||
'excludeComplementaryOrderShops' => true | |||||
], | |||||
$query | |||||
[ | |||||
'user' => $user, | |||||
'isValid' => true, | |||||
'excludeComplementaryOrderShops' => true | |||||
], | |||||
$query | |||||
); | ); | ||||
} | } | ||||
public function countValidByCurrentDistribution($query = null): int | public function countValidByCurrentDistribution($query = null): int | ||||
{ | { | ||||
return $this->countBy( | 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 | // countValidOrderWithReductionCredit | ||||
public function countValidWithReductionCredit( | 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 | //TODO vérifier que ne pas utiliser createDefaultQuery est pertinent | ||||
$query = $this->createQuery($query); | $query = $this->createQuery($query); | ||||
if ($user) { | if ($user) { | ||||
$query->filterByUser($user); | $query->filterByUser($user); | ||||
} | } | ||||
$query | $query | ||||
->selectCount() | |||||
->filterByReductionCredit($reductionCredit) | |||||
->filterByStatus(OrderStatusModel::$statusAliasAsValid); | |||||
->selectCount() | |||||
->filterByReductionCredit($reductionCredit) | |||||
->filterByStatus(OrderStatusModel::$statusAliasAsValid); | |||||
return $query->count(); | return $query->count(); | ||||
} | } | ||||
// countValidOrderWithReductionCart | // countValidOrderWithReductionCart | ||||
public function countValidWithReductionCart( | public function countValidWithReductionCart( | ||||
ReductionCartInterface $reductionCart, | |||||
$query = null | |||||
): int { | |||||
ReductionCartInterface $reductionCart, | |||||
$query = null | |||||
): int | |||||
{ | |||||
$query = $this->createQuery($query); | $query = $this->createQuery($query); | ||||
$query | $query | ||||
->selectCount() | |||||
->filterByReductionCart($reductionCart) | |||||
->filterByStatus(OrderStatusModel::$statusAliasAsValid); | |||||
->selectCount() | |||||
->filterByReductionCart($reductionCart) | |||||
->filterByStatus(OrderStatusModel::$statusAliasAsValid); | |||||
return $query->count(); | return $query->count(); | ||||
} | } | ||||
// countValidOrderWithReductionCartPerUser | // countValidOrderWithReductionCartPerUser | ||||
public function countValidWithReductionCartByUser( | public function countValidWithReductionCartByUser( | ||||
ReductionCartInterface $reductionCart, | |||||
UserInterface $user, | |||||
$query = null | |||||
): int { | |||||
ReductionCartInterface $reductionCart, | |||||
UserInterface $user, | |||||
$query = null | |||||
): int | |||||
{ | |||||
$query = $this->createDefaultQuery($query); | $query = $this->createDefaultQuery($query); | ||||
$query | $query | ||||
->selectCount() | |||||
->filterByUser($user) | |||||
->filterByReductionCart($reductionCart) | |||||
->filterByStatus(OrderStatusModel::$statusAliasAsValid); | |||||
->selectCount() | |||||
->filterByUser($user) | |||||
->filterByReductionCart($reductionCart) | |||||
->filterByStatus(OrderStatusModel::$statusAliasAsValid); | |||||
return $query->count(); | return $query->count(); | ||||
} | } | ||||
// findCartCurrent | // findCartCurrent | ||||
public function getOneCartCurrent(UserInterface $user = null, VisitorInterface $visitor = null, $query = null): ?OrderShopInterface | 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; | return null; | ||||
} | } | ||||
if (!is_null($user)) { | if (!is_null($user)) { | ||||
$query->filterByUser($user); | $query->filterByUser($user); | ||||
} | |||||
else { | |||||
} else { | |||||
if (!is_null($visitor)) { | if (!is_null($visitor)) { | ||||
$query->filterByVisitor($visitor); | $query->filterByVisitor($visitor); | ||||
} | } | ||||
} | } | ||||
$query | $query | ||||
->selectOrderReductionCarts() | |||||
->filterByStatus(OrderStatusModel::$statusAliasAsCart); | |||||
->selectOrderReductionCarts() | |||||
->filterByStatus(OrderStatusModel::$statusAliasAsCart); | |||||
return $query->findOne(); | return $query->findOne(); | ||||
} | } | ||||
$query = $this->createDefaultQuery($query); | $query = $this->createDefaultQuery($query); | ||||
$query | $query | ||||
->filterByDistribution($distribution) | |||||
->filterByStatus(OrderStatusModel::$statusAliasAsValid) | |||||
->filterIsNotComplementaryOrderShop() | |||||
->orderBy('.cycleId', 'DESC'); | |||||
->filterByDistribution($distribution) | |||||
->filterByStatus(OrderStatusModel::$statusAliasAsValid) | |||||
->filterIsNotComplementaryOrderShop() | |||||
->orderBy('.cycleId', 'DESC'); | |||||
return $query->findOne(); | return $query->findOne(); | ||||
} | } | ||||
$query = $this->createDefaultQuery($query); | $query = $this->createDefaultQuery($query); | ||||
$query | $query | ||||
->filterByStatus(OrderStatusModel::$statusAliasAsValid) | |||||
->filterIsNotComplementaryOrderShop() | |||||
->orderBy('.idValidOrder', 'DESC'); | |||||
->filterByStatus(OrderStatusModel::$statusAliasAsValid) | |||||
->filterIsNotComplementaryOrderShop() | |||||
->orderBy('.idValidOrder', 'DESC'); | |||||
return $query->findOne(); | return $query->findOne(); | ||||
} | } | ||||
$query->filterByAddress($params['address']); | $query->filterByAddress($params['address']); | ||||
} | } | ||||
if(isset($params['minimumTomorrowDelivery'])) { | |||||
if (isset($params['minimumTomorrowDelivery'])) { | |||||
$query->filterMinimumTomorrowDelivery(); | $query->filterMinimumTomorrowDelivery(); | ||||
} | } | ||||
if (isset($params['mergeComplementaryOrderShops'])) { | if (isset($params['mergeComplementaryOrderShops'])) { | ||||
$query | $query | ||||
->joinComplementaryOrderShops(); | |||||
->joinComplementaryOrderShops(); | |||||
} | } | ||||
if (isset($params['excludeComplementaryOrderShops']) || isset($params['mergeComplementaryOrderShops'])) { | if (isset($params['excludeComplementaryOrderShops']) || isset($params['mergeComplementaryOrderShops'])) { | ||||
} | } | ||||
public function isReductionCreditUsed( | public function isReductionCreditUsed( | ||||
ReductionCreditInterface $reductionCredit, | |||||
UserInterface $user = null, | |||||
$query = null | |||||
) { | |||||
ReductionCreditInterface $reductionCredit, | |||||
UserInterface $user = null, | |||||
$query = null | |||||
) | |||||
{ | |||||
if ($this->countValidWithReductionCredit($reductionCredit, $user, $query)) { | if ($this->countValidWithReductionCredit($reductionCredit, $user, $query)) { | ||||
return true; | return true; | ||||
} else { | } else { | ||||
public function getReductionCreditsAvailableByUser(UserInterface $user): array | 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 = []; | $reductionCreditsArray = []; | ||||
foreach ($reductionCredits as $reductionCredit) { | foreach ($reductionCredits as $reductionCredit) { | ||||
if (!$this->countValidWithReductionCredit($reductionCredit, $user) | |||||
&& ($reductionCredit->getSection()->getMerchant() == $this->merchant)) { | |||||
if (!$this->countValidWithReductionCredit($reductionCredit, $user)) { | |||||
$reductionCreditsArray[] = $reductionCredit; | $reductionCreditsArray[] = $reductionCredit; | ||||
} | } | ||||
} | } | ||||
return $reductionCreditsArray; | 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 = []; | $reductionGiftsArray = []; | ||||
foreach ($reductionGifts as $reductionGift) { | foreach ($reductionGifts as $reductionGift) { | ||||
if (!$this->countValidWithReductionCredit($reductionGift)) { | |||||
if (!$this->countValidWithReductionCredit($reductionGift, $user)) { | |||||
$reductionGiftsArray[] = $reductionGift; | $reductionGiftsArray[] = $reductionGift; | ||||
} | } | ||||
} | } | ||||
public function getReductionCartRemainingQuantity(ReductionCartInterface $reductionCart): float | public function getReductionCartRemainingQuantity(ReductionCartInterface $reductionCart): float | ||||
{ | { | ||||
return $reductionCart->getAvailableQuantity() - $this->countValidWithReductionCart( | return $reductionCart->getAvailableQuantity() - $this->countValidWithReductionCart( | ||||
$reductionCart | |||||
); | |||||
$reductionCart | |||||
); | |||||
} | } | ||||
// getReductionCartUsedQuantityPerUser | // getReductionCartUsedQuantityPerUser | ||||
public function getReductionCartUsedQuantityByUser( | public function getReductionCartUsedQuantityByUser( | ||||
ReductionCartInterface $reductionCart, | |||||
UserInterface $user | |||||
): float { | |||||
ReductionCartInterface $reductionCart, | |||||
UserInterface $user | |||||
): float | |||||
{ | |||||
return $this->countValidWithReductionCartByUser($reductionCart, $user); | return $this->countValidWithReductionCartByUser($reductionCart, $user); | ||||
} | } | ||||
// getReductionCartRemainingQuantityPerUser | // getReductionCartRemainingQuantityPerUser | ||||
public function getReductionCartRemainingQuantityByUser( | public function getReductionCartRemainingQuantityByUser( | ||||
ReductionCartInterface $reductionCart, | |||||
UserInterface $user | |||||
): float { | |||||
ReductionCartInterface $reductionCart, | |||||
UserInterface $user | |||||
): float | |||||
{ | |||||
if ($reductionCart->getAvailableQuantityPerUser()) { | if ($reductionCart->getAvailableQuantityPerUser()) { | ||||
return $reductionCart->getAvailableQuantityPerUser() - $this->countValidWithReductionCartByUser( | return $reductionCart->getAvailableQuantityPerUser() - $this->countValidWithReductionCartByUser( | ||||
$reductionCart, | |||||
$user | |||||
); | |||||
$reductionCart, | |||||
$user | |||||
); | |||||
} | } | ||||
return false; | return false; | ||||
// findAllAvailableForUser / getReductionCartsAvailableByUser | // findAllAvailableForUser / getReductionCartsAvailableByUser | ||||
public function getReductionCartAvailableByUser(UserInterface $user, $query = null) | public function getReductionCartAvailableByUser(UserInterface $user, $query = null) | ||||
{ | { | ||||
$reductionCarts = $this->reductionCartStore->getOnline(); | |||||
$reductionCarts = $this->reductionCartStore | |||||
->setMerchant($this->merchant) | |||||
->getOnline(); | |||||
$reductionCartsArray = []; | $reductionCartsArray = []; | ||||
foreach ($reductionCarts as $reductionCart) { | foreach ($reductionCarts as $reductionCart) { | ||||
if ($this->reductionCartSolver->matchWithUser($reductionCart, $user) | 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; | |||||
} | } | ||||
} | } | ||||
//countValidOrderProductsOfCyclesByProducts | //countValidOrderProductsOfCyclesByProducts | ||||
public function countValidOrderProductsOfDistributionsByProducts( | public function countValidOrderProductsOfDistributionsByProducts( | ||||
array $distributions, | |||||
array $products, | |||||
$query = null | |||||
): array { | |||||
array $distributions, | |||||
array $products, | |||||
$query = null | |||||
): array | |||||
{ | |||||
$query = $this->createDefaultQuery($query); | $query = $this->createDefaultQuery($query); | ||||
$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(); | return $query->find(); | ||||
$query = $this->createQuery($query); | $query = $this->createQuery($query); | ||||
$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(); | $result = $query->findOne(); | ||||
} | } | ||||
public function isReductionCreditAllowAddToOrder( | public function isReductionCreditAllowAddToOrder( | ||||
OrderShopInterface $orderShop, | |||||
ReductionCreditInterface $reductionCredit | |||||
) { | |||||
OrderShopInterface $orderShop, | |||||
ReductionCreditInterface $reductionCredit | |||||
) | |||||
{ | |||||
$user = $orderShop->getUser(); | $user = $orderShop->getUser(); | ||||
// appartient à l'utilisateur | // appartient à l'utilisateur | ||||
if (!$reductionCredit->getUsers()->contains($user)) { | if (!$reductionCredit->getUsers()->contains($user)) { | ||||
// @TODO : déplacer la gestion du flash message | // @TODO : déplacer la gestion du flash message | ||||
//$this->flashBag->add('error', 'error.reductionCredit.userNotAllow'); | |||||
$this->flashBagTranslator->add('error', 'userNotAllow', 'ReductionCredit'); | |||||
return false; | return false; | ||||
} | } | ||||
if ($reductionCredit->getType() == ReductionCreditModel::TYPE_CREDIT) { | if ($reductionCredit->getType() == ReductionCreditModel::TYPE_CREDIT) { | ||||
if ($this->countValidWithReductionCredit($reductionCredit, $user) > 0) { | if ($this->countValidWithReductionCredit($reductionCredit, $user) > 0) { | ||||
// @TODO : déplacer la gestion du flash message | // @TODO : déplacer la gestion du flash message | ||||
//$this->flashBah->add('error', 'error.reductionCredit.alreadyUse'); | |||||
$this->flashBagTranslator->add('error', 'alreadyUse', 'ReductionCredit'); | |||||
return false; | return false; | ||||
} | } | ||||
} else { | } else { | ||||
if ($this->countValidWithReductionCredit($reductionCredit) > 0) { | if ($this->countValidWithReductionCredit($reductionCredit) > 0) { | ||||
// @TODO : déplacer la gestion du flash message | // @TODO : déplacer la gestion du flash message | ||||
//$this->flashBah->add('error', 'error.reductionCredit.alreadyUse'); | |||||
$this->flashBagTranslator->add('error', 'alreadyUse', 'ReductionCredit'); | |||||
return false; | return false; | ||||
} | } | ||||
} | } |
return []; | return []; | ||||
} | } | ||||
// findByTerms | // findByTerms | ||||
public function getByTerms( | public function getByTerms( | ||||
$terms, | $terms, |
} | } | ||||
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 | public function filterAvailableQuantityNegative() :self | ||||
{ | { | ||||
namespace Lc\CaracoleBundle\Repository\Product; | namespace Lc\CaracoleBundle\Repository\Product; | ||||
use App\Entity\Product\ProductFamily; | |||||
use App\Solver\Product\ProductFamilySectionPropertySolver; | use App\Solver\Product\ProductFamilySectionPropertySolver; | ||||
use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | ||||
use Lc\CaracoleBundle\Repository\SectionStoreTrait; | use Lc\CaracoleBundle\Repository\SectionStoreTrait; | ||||
} | } | ||||
public function getOriginByProductFamily(ProductFamily $productFamily, ProductRepositoryQuery $query = null): array | |||||
{ | |||||
$query = $this->createQuery(); | |||||
$query->filterByProductFamily($productFamily); | |||||
$query->filterIsOriginProduct(); | |||||
$query->filterIsOnlineAndOffline(); | |||||
return $query->find(); | |||||
} | |||||
} | } |
use Knp\Component\Pager\PaginatorInterface; | use Knp\Component\Pager\PaginatorInterface; | ||||
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | ||||
use Lc\CaracoleBundle\Repository\SectionRepositoryQueryTrait; | |||||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | use Lc\SovBundle\Repository\AbstractRepositoryQuery; | ||||
class ReductionCartRepositoryQuery extends AbstractRepositoryQuery | class ReductionCartRepositoryQuery extends AbstractRepositoryQuery | ||||
{ | { | ||||
use SectionRepositoryQueryTrait; | |||||
use MerchantRepositoryQueryTrait; | |||||
public function __construct(ReductionCartRepository $repository, PaginatorInterface $paginator) | public function __construct(ReductionCartRepository $repository, PaginatorInterface $paginator) | ||||
{ | { |
namespace Lc\CaracoleBundle\Repository\Reduction; | 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\Price\PriceSolver; | ||||
use Lc\CaracoleBundle\Solver\Reduction\ReductionCartSolver; | use Lc\CaracoleBundle\Solver\Reduction\ReductionCartSolver; | ||||
use Lc\CaracoleBundle\Repository\AbstractStore; | use Lc\CaracoleBundle\Repository\AbstractStore; | ||||
class ReductionCartStore extends AbstractStore | class ReductionCartStore extends AbstractStore | ||||
{ | { | ||||
use SectionStoreTrait; | |||||
use MerchantStoreTrait; | |||||
protected ReductionCartRepositoryQuery $query; | protected ReductionCartRepositoryQuery $query; | ||||
protected ReductionCartSolver $reductionCartSolver; | protected ReductionCartSolver $reductionCartSolver; | ||||
public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | ||||
{ | { | ||||
if($this->section) { | |||||
$query->filterBySection($this->section); | |||||
} | |||||
$this->addFilterByMerchantRequired($query); | |||||
$query->filterIsOnlineAndOffline(); | $query->filterIsOnlineAndOffline(); | ||||
return $query; | return $query; | ||||
} | } | ||||
use Knp\Component\Pager\PaginatorInterface; | use Knp\Component\Pager\PaginatorInterface; | ||||
use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface; | use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface; | ||||
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | ||||
use Lc\CaracoleBundle\Repository\SectionRepositoryQueryTrait; | |||||
use Lc\SovBundle\Model\User\UserInterface; | use Lc\SovBundle\Model\User\UserInterface; | ||||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | use Lc\SovBundle\Repository\AbstractRepositoryQuery; | ||||
protected bool $isJoinUsers = false; | protected bool $isJoinUsers = false; | ||||
protected bool $isJoinGroupUsers = false; | protected bool $isJoinGroupUsers = false; | ||||
use SectionRepositoryQueryTrait; | |||||
use MerchantRepositoryQueryTrait; | |||||
public function __construct(ReductionCatalogRepository $repository, PaginatorInterface $paginator) | public function __construct(ReductionCatalogRepository $repository, PaginatorInterface $paginator) | ||||
{ | { |
namespace Lc\CaracoleBundle\Repository\Reduction; | namespace Lc\CaracoleBundle\Repository\Reduction; | ||||
use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface; | use Lc\CaracoleBundle\Model\Product\ProductFamilyInterface; | ||||
use Lc\CaracoleBundle\Repository\SectionStoreTrait; | |||||
use Lc\CaracoleBundle\Repository\MerchantStoreTrait; | |||||
use Lc\CaracoleBundle\Repository\AbstractStore; | use Lc\CaracoleBundle\Repository\AbstractStore; | ||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | use Lc\SovBundle\Repository\RepositoryQueryInterface; | ||||
class ReductionCatalogStore extends AbstractStore | class ReductionCatalogStore extends AbstractStore | ||||
{ | { | ||||
use SectionStoreTrait; | |||||
use MerchantStoreTrait; | |||||
protected ReductionCatalogRepositoryQuery $query; | protected ReductionCatalogRepositoryQuery $query; | ||||
public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | ||||
{ | { | ||||
$this->addFilterBySectionOptionnal($query); | |||||
$this->addFilterByMerchantRequired($query); | |||||
$query->filterIsOnlineAndOffline(); | $query->filterIsOnlineAndOffline(); | ||||
return $query; | return $query; | ||||
} | } |
use Knp\Component\Pager\PaginatorInterface; | use Knp\Component\Pager\PaginatorInterface; | ||||
use Lc\CaracoleBundle\Model\Reduction\ReductionCreditModel; | use Lc\CaracoleBundle\Model\Reduction\ReductionCreditModel; | ||||
use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | use Lc\CaracoleBundle\Repository\MerchantRepositoryQueryTrait; | ||||
use Lc\CaracoleBundle\Repository\SectionRepositoryQueryTrait; | |||||
use Lc\SovBundle\Model\User\UserInterface; | use Lc\SovBundle\Model\User\UserInterface; | ||||
use Lc\SovBundle\Repository\AbstractRepositoryQuery; | use Lc\SovBundle\Repository\AbstractRepositoryQuery; | ||||
class ReductionCreditRepositoryQuery extends AbstractRepositoryQuery | class ReductionCreditRepositoryQuery extends AbstractRepositoryQuery | ||||
{ | { | ||||
use SectionRepositoryQueryTrait; | |||||
use MerchantRepositoryQueryTrait; | |||||
// @TODO : à utiliser | |||||
protected $isJoinUsers = false; | protected $isJoinUsers = false; | ||||
public function __construct(ReductionCreditRepository $repository, PaginatorInterface $paginator) | public function __construct(ReductionCreditRepository $repository, PaginatorInterface $paginator) |
class ReductionCreditStore extends AbstractStore | class ReductionCreditStore extends AbstractStore | ||||
{ | { | ||||
use SectionStoreTrait; | |||||
use MerchantStoreTrait; | use MerchantStoreTrait; | ||||
protected ReductionCreditRepositoryQuery $query; | protected ReductionCreditRepositoryQuery $query; | ||||
public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface | ||||
{ | { | ||||
$this->addFilterBySectionOptionnal($query); | |||||
$this->addFilterByMerchantViaSectionOptionnal($query); | |||||
$this->addFilterByMerchantRequired($query); | |||||
$query->filterIsOnlineAndOffline(); | $query->filterIsOnlineAndOffline(); | ||||
return $query; | return $query; |
$this->isJoinUserMerchants = true; | $this->isJoinUserMerchants = true; | ||||
return $this | return $this | ||||
->innerJoin('.userMerchants', 'userMerchants'); | |||||
->leftJoin('.userMerchants', 'userMerchants'); | |||||
} | } | ||||
return $this; | return $this; | ||||
} | } |
} | } | ||||
public function getJoinGroupUsers(){ | public function getJoinGroupUsers(){ | ||||
$query = $this->createDefaultQuery(); | |||||
$query = $this->createQuery(); | |||||
$query->joinGroupUsers(true); | $query->joinGroupUsers(true); | ||||
$query->orderBy('id'); | |||||
return $query->find(); | return $query->find(); | ||||
} | } |
$withTax = true, | $withTax = true, | ||||
$round = true | $round = true | ||||
): ?float { | ): ?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) { | if ($reductionCatalog) { | ||||
$reductionCatalogValue = $reductionCatalog->getValue(); | $reductionCatalogValue = $reductionCatalog->getValue(); | ||||
$reductionCatalogUnit = $reductionCatalog->getUnit(); | $reductionCatalogUnit = $reductionCatalog->getUnit(); | ||||
} | } | ||||
} | } | ||||
if (isset($reductionCatalogValue) && isset($reductionCatalogUnit) && isset($reductionCatalogBehaviorTaxRate)) { | |||||
if (isset($reductionCatalogValue) && isset($reductionCatalogUnit)) { | |||||
if ($reductionCatalogUnit == 'percent') { | if ($reductionCatalogUnit == 'percent') { | ||||
$priceWithTax = $this->applyReductionPercent( | $priceWithTax = $this->applyReductionPercent( | ||||
$priceWithTax, | $priceWithTax, | ||||
$reductionCatalogValue | $reductionCatalogValue | ||||
); | ); | ||||
} elseif ($reductionCatalogUnit == 'amount') { | |||||
} elseif ($reductionCatalogUnit == 'amount' && isset($reductionCatalogBehaviorTaxRate)) { | |||||
if ($reductionCatalogBehaviorTaxRate == 'tax-excluded') { | if ($reductionCatalogBehaviorTaxRate == 'tax-excluded') { | ||||
$priceWithTax = $this->applyTax( | $priceWithTax = $this->applyTax( | ||||
$this->applyReductionAmount( | $this->applyReductionAmount( | ||||
$price, | $price, | ||||
$reductionCatalogValue * $quantity | $reductionCatalogValue * $quantity | ||||
), | ), | ||||
$entity->getTaxRateInherited()->getValue() | |||||
$taxRate | |||||
); | ); | ||||
} elseif ($reductionCatalogBehaviorTaxRate == 'tax-included') { | } elseif ($reductionCatalogBehaviorTaxRate == 'tax-included') { | ||||
$priceWithTax = $this->applyReductionAmount( | $priceWithTax = $this->applyReductionAmount( | ||||
if ($withTax) { | if ($withTax) { | ||||
$priceReturn = $priceWithTax; | $priceReturn = $priceWithTax; | ||||
} else { | } else { | ||||
$priceReturn = $this->applyPercentNegative($priceWithTax, $entity->getTaxRateInherited()->getValue()); | |||||
$priceReturn = $this->applyPercentNegative($priceWithTax, $taxRate); | |||||
} | } | ||||
if ($round) { | if ($round) { | ||||
return $this->round($priceReturn); | return $this->round($priceReturn); |
protected function isOpeningDay(int $weekDay, array $openings): bool | 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 | protected function isClosingDay(int $weekDay, array $openings): bool |
use App\Entity\Order\OrderShop; | use App\Entity\Order\OrderShop; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Router\AdminUrlGenerator; | use EasyCorp\Bundle\EasyAdminBundle\Router\AdminUrlGenerator; | ||||
use Lc\CaracoleBundle\Model\Order\OrderShopInterface; | 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\Resolver\OrderShopResolver; | ||||
use Lc\CaracoleBundle\Solver\Order\OrderShopSolver; | use Lc\CaracoleBundle\Solver\Order\OrderShopSolver; | ||||
use Lc\CaracoleBundle\Solver\Price\PriceSolver; | use Lc\CaracoleBundle\Solver\Price\PriceSolver; | ||||
protected TranslatorAdmin $translatorAdmin; | protected TranslatorAdmin $translatorAdmin; | ||||
protected UrlGeneratorInterface $urlGenerator; | 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->priceSolver = $priceSolver; | ||||
$this->orderShopSolver = $orderShopSolver; | $this->orderShopSolver = $orderShopSolver; | ||||
$this->orderShopResolver = $orderShopResolver; | $this->orderShopResolver = $orderShopResolver; | ||||
public function getDatas(OrderShopInterface $orderShop, UserInterface $user = null): array | public function getDatas(OrderShopInterface $orderShop, UserInterface $user = null): array | ||||
{ | { | ||||
$data = []; | $data = []; | ||||
$data['order'] = $orderShop; | $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; | return $data; | ||||
} | } | ||||
{ | { | ||||
$data = array(); | $data = array(); | ||||
foreach ($order->getOrderPayments() as $orderPayment) { | foreach ($order->getOrderPayments() as $orderPayment) { | ||||
$data[$orderPayment->getId()] = array( | $data[$orderPayment->getId()] = array( | ||||
'id' => $orderPayment->getId(), | 'id' => $orderPayment->getId(), | ||||
'reference' => $orderPayment->getReference(), | 'reference' => $orderPayment->getReference(), | ||||
'comment' => $orderPayment->getComment(), | 'comment' => $orderPayment->getComment(), | ||||
'meanPayment' => $orderPayment->getMeanPayment(), | 'meanPayment' => $orderPayment->getMeanPayment(), | ||||
'meanPaymentText' => $this->translatorAdmin->transChoice( | 'meanPaymentText' => $this->translatorAdmin->transChoice( | ||||
'OrderPayment', 'meanPayment',$orderPayment->getMeanPayment() | |||||
'OrderPayment', | |||||
'meanPayment', | |||||
$orderPayment->getMeanPayment() | |||||
), | ), | ||||
'paidAtText' => $orderPayment->getPaidAt()->format('d/m/Y'), | 'paidAtText' => $orderPayment->getPaidAt()->format('d/m/Y'), | ||||
'paidAt' => $orderPayment->getPaidAt()->format('Y-m-d'), | 'paidAt' => $orderPayment->getPaidAt()->format('Y-m-d'), | ||||
'type' => $orderDocument->getType(), | 'type' => $orderDocument->getType(), | ||||
'isSent' => $orderDocument->getIsSent(), | 'isSent' => $orderDocument->getIsSent(), | ||||
'orderReference' => $order->getReference(), | 'orderReference' => $order->getReference(), | ||||
'link' => $this->urlGenerator->generate('document_download', ['id'=> $orderDocument->getId()]) | |||||
'link' => $this->urlGenerator->generate('document_download', ['id' => $orderDocument->getId()]) | |||||
); | ); | ||||
} | } | ||||
return $data; | return $data; |