This commit is contained in:
Thomas Peterson 2024-06-13 21:17:15 +00:00
parent a45e3ab0d3
commit 1eb90b5751
113 changed files with 894 additions and 342 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"9cf7f18ab0554c25acf26994eed62e83","collectionName":"README","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"cabfb9c4a99141a4896aaa069b16ec24","collectionName":"system.version","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"96c128ea94fd405fbfb2b2085798b0af","collectionName":"Account","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"f1346444a1484e549759c26138d9f87e","collectionName":"Contact","type":"collection"}
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"e65bd27d71484a4298d7d8e08af74de9","collectionName":"Contact","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"62a354bbd1464068b85e25293188a77d","collectionName":"ContactAddress","type":"collection"}
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"1a6bc71d62204993a30ea3cbc483ac49","collectionName":"ContactAddress","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"169571b84c0243a4b11e5e439aff4d15","collectionName":"Country","type":"collection"}
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"59837fffaaee40e78c4f17675a7192ff","collectionName":"Country","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"57d377abaa7044c19b65c3821392c38a","collectionName":"Gatewaysettings","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"1881a39e24f94ae387f9a9c3219cc978","collectionName":"Instance","type":"collection"}
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"9ee3da2c8ca84eb89765af8213dc3317","collectionName":"Instance","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"8e93a4d7154b4b85a836aad2577d8f27","collectionName":"Job","type":"collection"}
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"33af3d9422b545e1aafa5fe326e5115a","collectionName":"Job","type":"collection"}

View File

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"bc2166345a5744afbefea355652905bd","collectionName":"JobLog","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"199ca7f10d0f43beb73d7ead3bd481ad","collectionName":"LayouterSession","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"72bedb18918c433297916d5dc042cefa","collectionName":"LogEntry","type":"collection"}
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"f290794af1b0450491498bc5aba08407","collectionName":"LogEntry","type":"collection"}

BIN
dev_db/dump/psc/Media.bson Normal file

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"c6e5ee0333504de98bed8406b165aa3d","collectionName":"Media","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"d8dc8eb6b6dc461f8277c994224dee91","collectionName":"Media_Folder","type":"collection"}
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"49ecb6cbbbca4ec3b044f0a747de2562","collectionName":"Media_Folder","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"e300ea694a354d369dd12bd271dc08c4","collectionName":"Migration","type":"collection"}
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"e5598ab5df1a41b49b64f494c8c6518c","collectionName":"Migration","type":"collection"}

BIN
dev_db/dump/psc/Motiv.bson Normal file

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"76fd879bd0294206a54ec086f3ecdd02","collectionName":"Motiv","type":"collection"}

BIN
dev_db/dump/psc/Order.bson Normal file

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"d81d2fa19d9b4f58ac7d9aa63d083f63","collectionName":"Order","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"a3d6610a675b4e3eb2756d41921d7192","collectionName":"Paper","type":"collection"}
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"a8d94a25837b45aabd4e35332f6a5fd2","collectionName":"Paper","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"7ce30c5d2a89476095657c09e1d68600","collectionName":"Payment","type":"collection"}
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"05aed50a1d2647da9dd165c76dcdb964","collectionName":"Payment","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"c2e5bfb9ea6642e39825d89e4613151d","collectionName":"Plugin","type":"collection"}
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"bba4c875d7a14359a7d05bc1d6f26c55","collectionName":"Plugin","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"fa91ca9880b54f62849628311c4556c9","collectionName":"Position","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"74b3092017164bf4a803b8c96695410b","collectionName":"Product","type":"collection"}
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"fc9a818c396041c89e6c8b30fea0d9ce","collectionName":"Product","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"8087c9592a164c2f963c1b179696f506","collectionName":"Productgroup","type":"collection"}
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"404294a8c2844344bbe4046da91d4e3d","collectionName":"Productgroup","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"c92053c6ced24d758145a558dd2e9860","collectionName":"Queue","type":"collection"}
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"6173337471a7434e837c2976609d6ba8","collectionName":"Queue","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"734514bc3bb34e90b4361c9a4f8173e5","collectionName":"Route","type":"collection"}
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"57897370d13a4822a4c7c75bf7ec24a7","collectionName":"Route","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"630efa1cd2a641da9243f2f94dde939c","collectionName":"Shipping","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"d9d6aa3c816c4923b5becec6c7871365","collectionName":"Shop","type":"collection"}
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"1aeca7b3886f4ed8a6f7bc093d123e06","collectionName":"Shop","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"b42f3a7e24184815ae7d8c0070b904ac","collectionName":"ShopFormular","type":"collection"}
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"b30fa9be7c1146edb26d5493f48a4562","collectionName":"ShopFormular","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"f0b2232622354b6cad5fb62317e5b7ca","collectionName":"Status","type":"collection"}
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"0344b531680845bba6e65de7478af37b","collectionName":"Status","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"174a8f8aa338436bb72aed095f070b46","collectionName":"Tax","type":"collection"}
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"ee8261af745c41f3a210406ff8cbbfc1","collectionName":"Tax","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"d5e80f2e8a4b444d95250de37e582d50","collectionName":"accountObj_history","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"4d7d0b1a64e34f21ba51386575a5cf93","collectionName":"contactObj_history","type":"collection"}
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"098a461995214847bcfc7cffbff3209a","collectionName":"contactObj_history","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"4f475b12266c4f939a9949f107fa8aa3","collectionName":"payment_history","type":"collection"}
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"e421db95dc1c4ee4b442f210c645f609","collectionName":"payment_history","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"076f826f8ae040f28ddb3ee8df17acec","collectionName":"producktgroupObj_history","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"958170fc5354431f9e1ee15c598fd00b","collectionName":"productObj_history","type":"collection"}
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"54ed92e16668459a9f6ee1a781309450","collectionName":"productObj_history","type":"collection"}

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"c6a2e2cd6a9a4922a7f423ee8f581c4a","collectionName":"shipping_history","type":"collection"}
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"36872d347afd453db3cb84acd79eca04","collectionName":"shipping_history","type":"collection"}

Binary file not shown.

View File

@ -1 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"b9cb1fe5c5b842c586e150219cc1f4b4","collectionName":"shopObj_history","type":"collection"}
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"2db60c6a38004ec9945b4b51938ca2f2","collectionName":"shopObj_history","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"7a3447a96b5b4b11823bffcf2b78fc09","collectionName":"Contact","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"2591730e9c154b359d7d2d1392be1a06","collectionName":"Country","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"2b1015e06ac74b549591317437133ea0","collectionName":"Instance","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"d7eddee478d249be8f3d63751e45b002","collectionName":"Job","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"1ecbf49744844b889bcfefd7aaf6daff","collectionName":"Order","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"f7a9ced8466848be9a1a81a1571e5032","collectionName":"Plugin","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"c9bde0617e94483498787a88591890ec","collectionName":"Position","type":"collection"}

Binary file not shown.

View File

@ -0,0 +1 @@
{"indexes":[{"v":{"$numberInt":"2"},"key":{"_id":{"$numberInt":"1"}},"name":"_id_"}],"uuid":"0c9ba46db1f049b4bc389e7c9cff455a","collectionName":"Shop","type":"collection"}

View File

@ -13,7 +13,7 @@ PSC\Shop\EntityBundle\Entity\Voucher:
value: 5
shop: '@shop_1'
voucher_2:
title: 5 prozent
title: 5% prozent
enable: true
payment: true
shipping: true
@ -25,4 +25,34 @@ PSC\Shop\EntityBundle\Entity\Voucher:
toDate: <(new DateTime("2025-12-12"))>
value: 5
shop: '@shop_1'
voucher_3:
title: 50 fest
enable: true
payment: true
shipping: true
more: true
percent: false
code: 50f
zeroPayment: true
zeroShipping: true
mode: 1
fromDate: <(new DateTime("2023-12-12"))>
toDate: <(new DateTime("2025-12-12"))>
value: 5
shop: '@shop_1'
voucher_4:
title: 50%
enable: true
payment: true
shipping: true
more: true
percent: false
code: 50%
zeroPayment: true
zeroShipping: true
mode: 1
fromDate: <(new DateTime("2023-12-12"))>
toDate: <(new DateTime("2025-12-12"))>
value: 5
shop: '@shop_1'

View File

@ -2,6 +2,10 @@
namespace PSC\Component\ApiBundle\Transformer;
use PSC\Component\ApiBundle\Model\Shop as PSCShop;
use PSC\System\SettingsBundle\Service\Shop as AliasedShop;
/**
* Order
@ -10,6 +14,8 @@ namespace PSC\Component\ApiBundle\Transformer;
*/
class Shop
{
public function __construct(private readonly AliasedShop $shopService)
{}
public function fromEntity(\PSC\Component\ApiBundle\Model\Shop $shop, \PSC\Shop\EntityBundle\Entity\Shop $shopEntity): void
{
@ -23,5 +29,17 @@ class Shop
$shop->basketPosField1 = (string)$shopEntity->getBasketposfield1();
$shop->basketPosField2 = (string)$shopEntity->getBasketposfield2();
}
public function parseModel(PSCShop $shop): void
{
$shopEntity = $this->shopService->getShopByUid($shop->getUuid());
if(!$shopEntity) {
$shopEntity = $this->shopService->getShopByUid($shop->getId());
}
if($shopEntity) {
$shop->setId($shopEntity->getId());
$shop->setName($shop->getName());
}
}
}
}

View File

@ -16,7 +16,6 @@ namespace PSC\Shop\EntityBundle\Document;
use Doctrine\ODM\MongoDB\Mapping\Annotations\Field;
use Doctrine\ODM\MongoDB\Mapping\Annotations\Id;
use Doctrine\ODM\MongoDB\Mapping\Annotations\Document;
use Doctrine\ODM\MongoDB\Mapping\Annotations\EmbeddedDocument;
use Doctrine\ODM\MongoDB\Mapping\Annotations\EmbedOne;
#[Document]
@ -40,6 +39,12 @@ class Order
#[Field(type: 'bool')]
protected $draft = false;
#[Field(type: 'raw')]
protected string $vouchers = "";
#[Field(type: 'raw')]
protected string $discounts = "";
/**
* @return bool
*/
@ -55,22 +60,22 @@ class Order
{
$this->sendDataToShipping = $sendDataToShipping;
}
/**
* @var string $externalOrderNumber;
*/
/**
* @var string $externalOrderNumber;
*/
#[Field(type: 'string')]
protected $externalOrderNumber;
/**
* @var string $paymentRef;
*/
/**
* @var string $paymentRef;
*/
#[Field(type: 'string')]
protected $paymentRef;
#[Field(type: 'string')]
protected $paymentGateway;
/**
* @var string $paymentToken;
*/
/**
* @var string $paymentToken;
*/
#[Field(type: 'string')]
protected $paymentToken;
#[Field(type: 'hash')]
@ -83,12 +88,12 @@ class Order
protected $deliveryAddressSaved;
#[EmbedOne]
protected $senderAddressSaved;
/**
* @var boolean $withTax
*/
/**
* @var boolean $withTax
*/
#[Field(type: 'bool')]
protected $withTax;
/**
/**
* @return string
*/
public function getId()
@ -340,4 +345,20 @@ class Order
{
$this->paymentGateway = $paymentGateway;
}
public function setDiscounts(string $discounts): void
{
$this->discounts = $discounts;
}
public function getDiscounts(): string
{
return $this->discounts;
}
public function setVouchers(string $vouchers): void
{
$this->vouchers = $vouchers;
}
public function getVouchers(): string
{
return $this->vouchers;
}
}

View File

@ -19,7 +19,6 @@ use Ramsey\Uuid\Uuid;
/**
* Cms
*
*
* @package PSC\Shop\Entity
* @subpackage Entitys
*/
@ -34,40 +33,40 @@ class Voucher
*/
#[ORM\Column(name: 'created', type: 'datetime')]
protected $createdAt;
/**
* Updated
*
* @var Datetime
*/
/**
* Updated
*
* @var Datetime
*/
#[ORM\Column(name: 'updated', type: 'datetime')]
protected $updatedAt;
/**
* @var integer
*/
/**
* @var integer
*/
#[ORM\Column(name: 'id', type: 'integer')]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
private $uid;
/**
* Titel
*
* @var string
*/
/**
* Titel
*
* @var string
*/
#[ORM\Column(name: 'title', type: 'string', length: 255)]
protected $title;
/**
* Shop zu welcher die News gehört
*
* @var int
*/
/**
* Shop zu welcher die News gehört
*
* @var int
*/
#[ORM\ManyToOne(targetEntity: 'PSC\Shop\EntityBundle\Entity\Shop')]
#[ORM\JoinColumn(name: 'shop_id', referencedColumnName: 'id')]
protected $shop;
/**
* enable
*
* @var boolean
*/
/**
* enable
*
* @var boolean
*/
#[ORM\Column(name: 'enable', type: 'boolean')]
protected $enable;
@ -105,84 +104,84 @@ class Voucher
/**
* percent
*
* @var boolean
*/
/**
* percent
*
* @var boolean
*/
#[ORM\Column(name: 'percent', type: 'boolean')]
protected $percent;
/**
* more
*
* @var boolean
*/
/**
* more
*
* @var boolean
*/
#[ORM\Column(name: 'more', type: 'boolean')]
protected $more;
/**
* from
*
* @var date
*/
/**
* from
*
* @var date
*/
#[ORM\Column(name: 'f', type: 'date')]
protected $fromDate;
/**
* from
*
* @var date
*/
/**
* from
*
* @var date
*/
#[ORM\Column(name: 't', type: 'date')]
protected $toDate;
/**
* count
*
* @var int
*/
/**
* count
*
* @var int
*/
#[ORM\Column(name: 'count', type: 'integer')]
protected $count;
/**
* mode
*
* @var int
*/
/**
* mode
*
* @var int
*/
#[ORM\Column(name: 'mode', type: 'integer')]
protected $mode;
/**
* value
*
* @var float
*/
/**
* value
*
* @var float
*/
#[ORM\Column(name: 'wert', type: 'float')]
protected $value;
/**
* Code
*
* @var string
*/
/**
* Code
*
* @var string
*/
#[ORM\Column(name: 'pre_code', type: 'string', length: 255, nullable: true)]
protected $code;
/**
* Articlegroup
*
* @var string
*/
/**
* Articlegroup
*
* @var string
*/
#[ORM\Column(name: 'articlegroup_id', type: 'string', length: 255, nullable: true)]
protected $productGroupIds;
/**
* ProductIds
*
* @var string
*/
/**
* ProductIds
*
* @var string
*/
#[ORM\Column(name: 'product_id', type: 'string', length: 255, nullable: true)]
protected $productIds;
/**
* VoucherItems
*
* @var int
*/
/**
* VoucherItems
*
* @var int
*/
#[ORM\OneToMany(targetEntity: 'VoucherItem', mappedBy: 'voucher')]
protected $voucherItems;
/**
/**
* Voucher constructor.
*/
public function __construct()
@ -489,7 +488,7 @@ class Voucher
public function isZeroShipping(): bool
{
return $this->zeroShipping;
return (bool)$this->zeroShipping;
}
public function setZeroShipping(bool $zeroShipping): void
@ -499,7 +498,7 @@ class Voucher
public function isZeroPayment(): bool
{
return $this->zeroPayment;
return (bool)$this->zeroPayment;
}
public function setZeroPayment(bool $zeroPayment): void

View File

@ -14,7 +14,10 @@
namespace PSC\Shop\EntityBundle\Repository;
use DateTime;
use Doctrine\ORM\EntityRepository;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
use PSC\Component\ApiBundle\Model\Shop;
use PSC\Shop\EntityBundle\Entity\Voucher;
/**
* VoucherRepository
@ -23,6 +26,25 @@ use Doctrine\ORM\EntityRepository;
* @package PSC\Shop\Entity
* @subpackage Repositorys
*/
class VoucherRepository extends EntityRepository
class VoucherRepository extends ServiceEntityRepository
{
}
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Voucher::class);
}
public function findByCodeForActDate(string $code, Shop $shop)
{
$result = $this->getEntityManager()
->createQuery('
SELECT v FROM '.Voucher::class.' v
WHERE v.code = :code AND v.shop = :shop_id AND v.fromDate <= :from AND v.toDate >= :to')
->setParameter('shop_id', $shop->getId())
->setParameter('from', date('Y-m-d'))
->setParameter('to', date('Y-m-d'))
->setParameter('code', $code)
->setMaxResults(1)
->getOneOrNullResult();
return $result;
}
}

View File

@ -48,7 +48,7 @@ class Create extends AbstractController
* @Security(name="Bearer")
*/
#[Route(path: '/order/create', methods: ['POST'])]
#[ParamConverter('order', class: '\PSC\Shop\OrderBundle\Model\Order', converter: 'psc_rest.request_body')]
#[ParamConverter('order', class: ModelOrder::class, converter: 'psc_rest.request_body')]
public function create(ModelOrder $order): JsonResponse
{
$this->orderService->storeOrder($order);

View File

@ -7,92 +7,107 @@ use PSC\Component\ApiBundle\Model\Shop;
use PSC\Shop\AccountBundle\Model\Account;
use PSC\Shop\ContactBundle\Model\Address;
use PSC\Shop\ContactBundle\Model\Contact;
use PSC\Shop\OrderBundle\Model\Order\Discount;
use PSC\Shop\PaymentBundle\Model\Payment;
use PSC\Shop\OrderBundle\Model\Order\Position;
use PSC\Shop\ShippingBundle\Model\Shipping;
use PSC\Shop\OrderBundle\Model\Order\Tax;
use PSC\Shop\VoucherBundle\Model\Voucher;
use Ramsey\Uuid\Uuid;
abstract class Base
{
/** @var \Ramsey\Uuid\UuidInterface
/**
* @var \Ramsey\Uuid\UuidInterface
*/
#[\OpenApi\Attributes\Property(type: 'string')]
private string $uuid;
/** @var \DateTime
*/
/**
* @var \DateTime
*/
#[\OpenApi\Attributes\Property(type: 'string', format: 'date-time')]
private \DateTime $created;
/** @var \DateTime
*/
/**
* @var \DateTime
*/
#[\OpenApi\Attributes\Property(type: 'string', format: 'date-time')]
private \DateTime $updated;
/** @var string
*/
/**
* @var string
*/
#[\OpenApi\Attributes\Property(type: 'string')]
private $alias;
/** @var Address
*/
/**
* @var Address
*/
#[\OpenApi\Attributes\Property(ref: new Model(type: \PSC\Shop\ContactBundle\Model\Address::class))]
private $deliveryAddress;
/** @var Address
*/
/**
* @var Address
*/
#[\OpenApi\Attributes\Property(ref: new Model(type: \PSC\Shop\ContactBundle\Model\Address::class))]
private $senderAddress;
/** @var Address
*/
/**
* @var Address
*/
#[\OpenApi\Attributes\Property(ref: new Model(type: \PSC\Shop\ContactBundle\Model\Address::class))]
private $invoiceAddress;
/**
* @var Shipping
*/
/**
* @var Shipping
*/
#[\OpenApi\Attributes\Property(ref: new Model(type: \PSC\Shop\ShippingBundle\Model\Shipping::class))]
private Shipping $shipping;
/** @var Payment
*/
/**
* @var Payment
*/
#[\OpenApi\Attributes\Property(ref: new Model(type: \PSC\Shop\PaymentBundle\Model\Payment::class))]
private $payment;
/** @var double
*/
#[\OpenApi\Attributes\Property(type: 'number', format: 'double')]
private $net;
/** @var double
*/
#[\OpenApi\Attributes\Property(type: 'number', format: 'double')]
private $vat;
/** @var double
*/
#[\OpenApi\Attributes\Property(type: 'number', format: 'double')]
private $gross;
/** @var double
*/
#[\OpenApi\Attributes\Property(type: 'number', format: 'double')]
private $paymentCosts;
/** @var double
*/
#[\OpenApi\Attributes\Property(type: 'number', format: 'double')]
private $shippingCosts;
/** @var bool
*/
#[\OpenApi\Attributes\Property(type: 'number', format: 'integer')]
private int $net = 0;
#[\OpenApi\Attributes\Property(type: 'number', format: 'integer')]
private int $vat = 0;
#[\OpenApi\Attributes\Property(type: 'number', format: 'integer')]
private int $gross = 0;
#[\OpenApi\Attributes\Property(type: 'number', format: 'integer')]
private int $grossWithDiscount = 0;
#[\OpenApi\Attributes\Property(type: 'number', format: 'integer')]
private int $netWithDiscount = 0;
#[\OpenApi\Attributes\Property(type: 'number', format: 'integer')]
private int $vatWithDiscount = 0;
#[\OpenApi\Attributes\Property(type: 'number', format: 'integer')]
private int $paymentCosts = 0;
#[\OpenApi\Attributes\Property(type: 'number', format: 'integer')]
private int $shippingCosts = 0;
/**
* @var bool
*/
#[\OpenApi\Attributes\Property(type: 'boolean')]
private $enable;
/** @var bool
/**
* @var bool
*/
#[\OpenApi\Attributes\Property(type: 'boolean')]
private $draft = false;
/** @var bool
/**
* @var bool
*/
#[\OpenApi\Attributes\Property(type: 'boolean')]
private $sendDataToShipping = false;
/** @var string
*/
/**
* @var string
*/
#[\OpenApi\Attributes\Property(type: 'string')]
private $info;
/** @var string
*/
/**
* @var string
*/
#[\OpenApi\Attributes\Property(type: 'string')]
private $basketField1;
@ -102,51 +117,63 @@ abstract class Base
#[\OpenApi\Attributes\Property(type: 'string')]
private string $paymentGateway = "";
/** @var string
*/
/**
* @var string
*/
#[\OpenApi\Attributes\Property(type: 'string')]
private $basketField2;
/** @var int
*/
/**
* @var int
*/
#[\OpenApi\Attributes\Property(type: 'integer')]
private $couponType;
/** @var Tax[]
*/
/**
* @var Tax[]
*/
#[\OpenApi\Attributes\Property(type: 'array', items: new \OpenApi\Attributes\Items(ref: new Model(type: \PSC\Shop\OrderBundle\Model\Order\Tax::class)))]
private $taxes = [];
#[\OpenApi\Attributes\Property(type: 'array', items: new \OpenApi\Attributes\Items(ref: new Model(type: \PSC\Shop\VoucherBundle\Model\Voucher::class)))]
private $vouchers = [];
#[\OpenApi\Attributes\Property(type: 'array', items: new \OpenApi\Attributes\Items(ref: new Model(type: \PSC\Shop\OrderBundle\Model\Order\Tax::class)))]
private $allTaxes = [];
#[\OpenApi\Attributes\Property(type: 'array', items: new \OpenApi\Attributes\Items(ref: new Model(type: \PSC\Shop\OrderBundle\Model\Order\Discount::class)))]
private $discounts = [];
private Shop $shop;
/** @var int
*/
/**
* @var int
*/
#[\OpenApi\Attributes\Property(type: 'integer')]
private $status = 10;
/** @var Position[]
*/
/**
* @var Position[]
*/
#[\OpenApi\Attributes\Property(type: 'array', items: new \OpenApi\Attributes\Items(ref: new Model(type: \PSC\Shop\OrderBundle\Model\Order\Position::class)))]
private $positions = [];
/** @var string
*/
/**
* @var string
*/
#[\OpenApi\Attributes\Property(type: 'string')]
private $externalOrderNumber;
/**
* @var int
*/
/**
* @var int
*/
#[\OpenApi\Attributes\Property(type: 'integer')]
private $uid;
/**
* @var int
*/
/**
* @var int
*/
#[\OpenApi\Attributes\Property(type: 'integer')]
private $type = 1;
#[\OpenApi\Attributes\Schema(schema: "StringList", properties: [new \OpenApi\Attributes\Property(property: "value", type:"array", items: new \OpenApi\Attributes\Items(anyOf: [new \OpenApi\Attributes\Schema(type: 'string')]))])]
#[\OpenApi\Attributes\Schema(schema: "String", properties: [new \OpenApi\Attributes\Property(property: "value", type:"string")])]
#[\OpenApi\Attributes\Schema(schema: "Object", properties: [new \OpenApi\Attributes\Property(property: "value", type:"object")])]
#[\OpenApi\Attributes\Property(type: 'array', items: new \OpenApi\Attributes\Items(oneOf: [new \OpenApi\Attributes\Schema(ref: "#StringList"),new \OpenApi\Attributes\Schema(ref: "#String"),new \OpenApi\Attributes\Schema(ref: "#Object")]))]
#[\OpenApi\Attributes\Property(type: 'array', items: new \OpenApi\Attributes\Items(oneOf: [new \OpenApi\Attributes\Schema(ref: "#StringList"),new \OpenApi\Attributes\Schema(ref: "#String"),new \OpenApi\Attributes\Schema(ref: "#Object")]))]
private array $pluginSettings = [];
#[\OpenApi\Attributes\Property(ref: new Model(type: \PSC\Shop\ContactBundle\Model\Contact::class))]
@ -499,6 +526,15 @@ abstract class Base
return $this->taxes;
}
/**
* @return Voucher[]
*/
public function getVouchers()
{
return $this->vouchers;
}
public function getTaxesSum()
{
$sum = 0;
@ -509,6 +545,15 @@ abstract class Base
return $sum;
}
/**
* @param Voucher[] $vouchers
*/
public function setVouchers($vouchers)
{
$this->vouchers = $vouchers;
}
/**
* @param Tax[] $taxes
*/
@ -525,16 +570,18 @@ abstract class Base
$this->allTaxes[] = $tax;
$tmp = [];
$exists = false;
foreach ($this->taxes as $taxEntry) {
if ($taxEntry->getName() == $tax->getName()) {
$taxEntry->setValue($taxEntry->getValue() + $tax->getValue());
$tmp[] = $taxEntry;
}else{
$tmp[] = $taxEntry;
$exists = true;
}
}
if(!$exists) {
$tmp[] = $tax;
}
$this->taxes = $tmp;
}
@ -731,4 +778,45 @@ abstract class Base
{
$this->allTaxes = $allTaxes;
}
public function getDiscounts(): array
{
return $this->discounts;
}
public function setDiscounts(array $discounts): void
{
$this->discounts = $discounts;
}
public function addDiscount(Discount $discount): void
{
$this->discounts[] = $discount;
}
public function setGrossWithDiscount(int $value): void
{
$this->grossWithDiscount = $value;
}
public function setNetWithDiscount(int $value): void
{
$this->netWithDiscount = $value;
}
public function setVatWithDiscount(int $value): void
{
$this->vatWithDiscount = $value;
}
public function getGrossWithDiscount(): int
{
return $this->grossWithDiscount;
}
public function getNetWithDiscount(): int
{
return $this->netWithDiscount;
}
public function getVatWithDiscount(): int
{
return $this->vatWithDiscount;
}
}

View File

@ -0,0 +1,24 @@
<?php
namespace PSC\Shop\OrderBundle\Model\Order;
use PSC\Shop\OrderBundle\Model\Order\Discount\Price;
class Discount
{
private Price $price;
public function __construct()
{
$this->price = new Price();
}
public function setPrice(Price $price): void
{
$this->price = $price;
}
public function getPrice(): Price
{
return $this->price;
}
}

View File

@ -0,0 +1,63 @@
<?php
namespace PSC\Shop\OrderBundle\Model\Order\Discount;
use PSC\Shop\OrderBundle\Model\Order\Tax;
use Nelmio\ApiDocBundle\Annotation\Model;
use OpenApi\Attributes as OA;
class Price
{
#[OA\Property(type: 'integer')]
private int $net = 0;
#[OA\Property(type: 'integer')]
private int $vat = 0;
#[OA\Property(type: 'integer')]
private int $gross = 0;
#[OA\Property(ref: new Model(type: Tax::class))]
public Tax $tax;
public function getNet(): int
{
return $this->net;
}
public function setNet(int $net): void
{
$this->net = $net;
}
public function getVat(): int
{
return $this->vat;
}
public function setVat(int $vat): void
{
$this->vat = $vat;
}
public function getGross(): int
{
return $this->gross;
}
public function setGross(int $gross): void
{
$this->gross = $gross;
}
public function getTax(): Tax
{
return $this->tax;
}
public function setTax(Tax $tax): void
{
$this->tax = $tax;
}
}

View File

@ -3,21 +3,26 @@
namespace PSC\Shop\OrderBundle\Service;
use Brick\Money\Money;
use PSC\Shop\OrderBundle\Model\Order\Tax;
use PSC\Component\ApiBundle\Transformer\Shop;
use PSC\Shop\PaymentBundle\Service\Price;
use PSC\Shop\PaymentBundle\Transformer\Payment;
use PSC\Shop\ShippingBundle\Transformer\Shipping;
use PSC\Shop\VoucherBundle\Service\Calc as CalcVoucher;
use PSC\Shop\VoucherBundle\Transformer\Voucher as PSCVoucher;
use PSC\System\PluginBundle\Service\ProductType;
class Calc
{
public function __construct(private readonly Price $pricePayment,
private readonly Shop $shopTransformer,
private readonly \PSC\Shop\ShippingBundle\Service\Price $priceShipping,
private readonly ProductType $productTypeRegistry,
private readonly Shipping $shippingTransformer,
private readonly Payment $paymentTransformer,
private readonly VatCalc $vatCalcService
private readonly VatCalc $vatCalcService,
private readonly CalcVoucher $voucherCalcService,
private readonly PSCVoucher $voucherTransformer
) {
}
@ -25,6 +30,9 @@ class Calc
public function calcOrder(\PSC\Shop\OrderBundle\Model\Base $order)
{
if($order->getShop()->getUuid() != "") {
$this->shopTransformer->parseModel($order->getShop());
}
$priceNet = Money::ofMinor(0, 'EUR');
$priceVat = Money::ofMinor(0, 'EUR');
$priceGross = Money::ofMinor(0, 'EUR');
@ -64,7 +72,8 @@ class Calc
$order->setNet($priceNet->getMinorAmount()->toInt());
$order->setVat($priceVat->getMinorAmount()->toInt());
$order->setGross($priceGross->getMinorAmount()->toInt());
$this->voucherTransformer->parseModel($order);
$this->voucherCalcService->calc($order);
$this->vatCalcService->calcVat($order);
}
}

View File

@ -5,11 +5,14 @@ namespace PSC\Shop\OrderBundle\Transformer;
use PSC\Shop\ContactBundle\Transformer\Order\Address;
use PSC\Shop\ContactBundle\Transformer\Order\Contact;
use PSC\Shop\EntityBundle\Document\Embed\ContactAddress;
use PSC\Shop\OrderBundle\Model\Order\Discount;
use PSC\Shop\OrderBundle\Model\Order\Tax;
use PSC\Shop\OrderBundle\Model\Order\TaxEnum;
use PSC\Shop\OrderBundle\Transformer\Order\Account;
use PSC\Shop\PaymentBundle\Transformer\Payment;
use PSC\Shop\ShippingBundle\Transformer\Shipping;
use PSC\Shop\VoucherBundle\Model\Voucher;
use Symfony\Component\Serializer\SerializerInterface;
/**
* Order
@ -26,11 +29,12 @@ class Order extends Base
private Payment $paymentTransformer;
private SerializerInterface $serializer;
private Shipping $shippingTransformer;
private \PSC\Component\ApiBundle\Transformer\Shop $shopTransformer;
#[\Symfony\Contracts\Service\Attribute\Required]
public function setAddressTransformer(Address $addressTransformer, Contact $contactTransformer, Account $accountTransformer, Payment $paymentTransformer, Shipping $shippingTransformer, \PSC\Component\ApiBundle\Transformer\Shop $shopTransformer)
public function setAddressTransformer(SerializerInterface $serializer, Address $addressTransformer, Contact $contactTransformer, Account $accountTransformer, Payment $paymentTransformer, Shipping $shippingTransformer, \PSC\Component\ApiBundle\Transformer\Shop $shopTransformer)
{
$this->addressTransformer = $addressTransformer;
$this->contactTransformer = $contactTransformer;
@ -38,6 +42,7 @@ class Order extends Base
$this->paymentTransformer = $paymentTransformer;
$this->shippingTransformer = $shippingTransformer;
$this->shopTransformer = $shopTransformer;
$this->serializer = $serializer;
}
public function fromDb(\PSC\Shop\OrderBundle\Model\Base $order, \PSC\Shop\EntityBundle\Entity\Order $orderEntity, \PSC\Shop\EntityBundle\Document\Order $orderDoc)
@ -53,9 +58,9 @@ class Order extends Base
$order->setStatus($orderEntity->getStatus());
$order->setBasketField1((string)$orderEntity->getBasketfield1());
$order->setBasketField2((string)$orderEntity->getBasketfield2());
$order->setNet($orderEntity->getNetto()*100);
$order->setVat($orderEntity->getSteuer()*100);
$order->setGross($orderEntity->getBrutto()*100);
$order->setNet($orderEntity->getNetto() * 100);
$order->setVat($orderEntity->getSteuer() * 100);
$order->setGross($orderEntity->getBrutto() * 100);
$order->setExternalOrderNumber((string)$orderEntity->getPackage());
$order->setPaymentRef((string)$orderDoc->getPaymentRef());
$order->setPaymentGateway((string)$orderDoc->getPaymentGateway());
@ -74,7 +79,7 @@ class Order extends Base
$this->shippingTransformer->fromDb($order->getShipping(), $orderEntity->getShippingType());
/**
* DOC
* DOC
*/
$invoice = new \PSC\Shop\ContactBundle\Model\Address();
@ -105,6 +110,24 @@ class Order extends Base
}
$order->setPluginSettings($orderDoc->getPluginSettings());
$order->setSendDataToShipping($orderDoc->isSendDataToShipping());
if($orderDoc->getVouchers() != "") {
$order->setVouchers($this->serializer->deserialize($orderDoc->getVouchers(), Voucher::class.'[]', 'json'));
}
if($orderDoc->getDiscounts() != "") {
$net = 0;
$gross = 0;
$vat = 0;
$order->setDiscounts($this->serializer->deserialize($orderDoc->getDiscounts(), Discount::class.'[]', 'json'));
foreach($order->getDiscounts() as $discounts) {
$net += $discounts->getPrice()->getNet();
$vat += $discounts->getPrice()->getVat();
$gross += $discounts->getPrice()->getGross();
}
$order->setNetWithDiscount($order->getNet() - $net);
$order->setVatWithDiscount($order->getVat() - $vat);
$order->setGrossWithDiscount($order->getGross() - $gross);
}
}
public function toDb(\PSC\Shop\OrderBundle\Model\Base $order, \PSC\Shop\EntityBundle\Entity\Order $orderEntity, \PSC\Shop\EntityBundle\Document\Order $orderDoc)
@ -113,11 +136,11 @@ class Order extends Base
$orderEntity->setCreated(new \DateTime());
$orderEntity->setUpdated(new \DateTime());
$orderEntity->setAlias((string)$order->getAlias());
$orderEntity->setNetto($order->getNet()/100);
$orderEntity->setSteuer($order->getVat()/100);
$orderEntity->setBrutto($order->getGross()/100);
$orderEntity->setVersandKosten($order->getShippingCosts()/100);
$orderEntity->setZahlKosten($order->getPaymentCosts()/100);
$orderEntity->setNetto($order->getNet() / 100);
$orderEntity->setSteuer($order->getVat() / 100);
$orderEntity->setBrutto($order->getGross() / 100);
$orderEntity->setVersandKosten($order->getShippingCosts() / 100);
$orderEntity->setZahlKosten($order->getPaymentCosts() / 100);
$orderEntity->setEnable($order->isEnable());
$orderEntity->setInfo($order->getInfo());
$orderEntity->setDeliverySame(0);
@ -145,7 +168,7 @@ class Order extends Base
$this->accountTransformer->toDb($order->getAccount(), $orderEntity);
/**
* DOC
* DOC
*/
$invoiceDoc = new ContactAddress();
@ -164,6 +187,7 @@ class Order extends Base
$orderDoc->setDraft($order->isDraft());
$orderDoc->setPluginSettings($order->getPluginSettings());
$orderDoc->setDiscounts($this->serializer->serialize($order->getDiscounts(), 'json'));
$orderDoc->setVouchers($this->serializer->serialize($order->getVouchers(), 'json'));
}
}

Some files were not shown because too many files have changed in this diff Show More