first commit
This commit is contained in:
61
bundles/KupShop/POSBundle/Event/PosOrderEvent.php
Normal file
61
bundles/KupShop/POSBundle/Event/PosOrderEvent.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace KupShop\POSBundle\Event;
|
||||
|
||||
use KupShop\OrderingBundle\Entity\Purchase\PurchaseState;
|
||||
use Symfony\Contracts\EventDispatcher\Event;
|
||||
|
||||
class PosOrderEvent extends Event
|
||||
{
|
||||
/** PurchaseState je vytvoren, jeste neni objednavka */
|
||||
public const PURCHASE_STATE_CHECK = 'kupshop.pos.purchase_state.check';
|
||||
|
||||
/** PurchaseState je vytvoren, objednavka je vytvořena */
|
||||
public const PURCHASE_STATE_ORDER_CREATED = 'kupshop.pos.purchase_state.created';
|
||||
public const ORDER_PAID_BY_POS = 'kupshop.pos.order.paid';
|
||||
|
||||
/** @var PurchaseState */
|
||||
private $purchaseState;
|
||||
|
||||
/** @var \Order */
|
||||
private $order;
|
||||
|
||||
/** @var int */
|
||||
private $idPos;
|
||||
|
||||
/** @var bool */
|
||||
private $isOrderNew;
|
||||
|
||||
public function __construct(PurchaseState $purchaseState, $idPos, ?\Order $order = null, $isOrderNew = false)
|
||||
{
|
||||
$this->purchaseState = $purchaseState;
|
||||
$this->order = $order;
|
||||
$this->idPos = $idPos;
|
||||
$this->isOrderNew = $isOrderNew;
|
||||
}
|
||||
|
||||
public function getPurchaseState(): PurchaseState
|
||||
{
|
||||
return $this->purchaseState;
|
||||
}
|
||||
|
||||
public function getOrder(): ?\Order
|
||||
{
|
||||
return $this->order;
|
||||
}
|
||||
|
||||
public function setOrder(\Order $order): void
|
||||
{
|
||||
$this->order = $order;
|
||||
}
|
||||
|
||||
public function getIdPos(): int
|
||||
{
|
||||
return $this->idPos;
|
||||
}
|
||||
|
||||
public function isOrderNew(): bool
|
||||
{
|
||||
return $this->isOrderNew;
|
||||
}
|
||||
}
|
||||
57
bundles/KupShop/POSBundle/Event/PosPaymentEvent.php
Normal file
57
bundles/KupShop/POSBundle/Event/PosPaymentEvent.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace KupShop\POSBundle\Event;
|
||||
|
||||
use KupShop\POSBundle\Util\PosEntity;
|
||||
use Symfony\Contracts\EventDispatcher\Event;
|
||||
|
||||
class PosPaymentEvent extends Event
|
||||
{
|
||||
/** Eventa volaná při výběru hotovosti z pokladny */
|
||||
public const POS_SELECT_PAYMENT = 'kupshop.pos.select.payment';
|
||||
|
||||
/** Eventa volaná při vkladu hotovosti do pokladny */
|
||||
public const POS_INSERT_PAYMENT = 'kupshop.pos.insert.payment';
|
||||
/** Eventa volaná při platby pomocí nastavovatelného tlačítka (custom payment) */
|
||||
public const POS_CUSTOM_PAYMENT = 'kupshop.pos.custom.payment';
|
||||
|
||||
private PosEntity $pos;
|
||||
private string $price;
|
||||
private int $method;
|
||||
private ?\Order $order;
|
||||
private ?string $note;
|
||||
|
||||
public function __construct(PosEntity $pos, string $price, int $method, ?\Order $order = null, ?string $note = null)
|
||||
{
|
||||
$this->pos = $pos;
|
||||
$this->price = $price;
|
||||
$this->method = $method;
|
||||
$this->order = $order;
|
||||
$this->note = $note;
|
||||
}
|
||||
|
||||
public function getPos(): PosEntity
|
||||
{
|
||||
return $this->pos;
|
||||
}
|
||||
|
||||
public function getPrice(): string
|
||||
{
|
||||
return $this->price;
|
||||
}
|
||||
|
||||
public function getMethod(): int
|
||||
{
|
||||
return $this->method;
|
||||
}
|
||||
|
||||
public function getOrder(): \Order
|
||||
{
|
||||
return $this->order;
|
||||
}
|
||||
|
||||
public function getNote(): string
|
||||
{
|
||||
return $this->note;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user