Fixes
This commit is contained in:
parent
29a88e341f
commit
418e8fcded
@ -5,5 +5,21 @@ declare(strict_types=1);
|
|||||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||||
|
|
||||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||||
$containerConfigurator->extension('monolog', ['handlers' => ['main' => ['type' => 'stream', 'path' => '%kernel.logs_dir%/%kernel.environment%.log', 'level' => 'debug', 'channels' => ['!event']]]]);
|
$containerConfigurator->extension('monolog', [
|
||||||
|
'channels' => ['ai'],
|
||||||
|
'handlers' => [
|
||||||
|
'ai' => [
|
||||||
|
'type' => 'stream',
|
||||||
|
'path' => '%kernel.logs_dir%/ai.log',
|
||||||
|
'level' => 'debug',
|
||||||
|
'channels' => ['ai'],
|
||||||
|
],
|
||||||
|
'main' => [
|
||||||
|
'type' => 'stream',
|
||||||
|
'path' => '%kernel.logs_dir%/%kernel.environment%.log',
|
||||||
|
'level' => 'debug',
|
||||||
|
'channels' => ['!event'],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
]);
|
||||||
};
|
};
|
||||||
|
|||||||
12
src/new/src/PSC/Shop/OrderBundle/Interface/IUploadMode.php
Normal file
12
src/new/src/PSC/Shop/OrderBundle/Interface/IUploadMode.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace PSC\Shop\OrderBundle\Interface;
|
||||||
|
|
||||||
|
use PSC\Shop\OrderBundle\Transformer\Order\Position\IUploadModeTransformer;
|
||||||
|
|
||||||
|
interface IUploadMode
|
||||||
|
{
|
||||||
|
public function getCode(): string;
|
||||||
|
|
||||||
|
public function getTransformer(): IUploadModeTransformer;
|
||||||
|
}
|
||||||
@ -2,9 +2,6 @@
|
|||||||
|
|
||||||
namespace PSC\Shop\OrderBundle\Model\Order\Position\Upload;
|
namespace PSC\Shop\OrderBundle\Model\Order\Position\Upload;
|
||||||
|
|
||||||
use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag;
|
|
||||||
|
|
||||||
#[AutoconfigureTag('order.position.uploadObjectType')]
|
|
||||||
class Center implements IUploadTypeObject
|
class Center implements IUploadTypeObject
|
||||||
{
|
{
|
||||||
public function getCode(): string
|
public function getCode(): string
|
||||||
|
|||||||
@ -2,9 +2,6 @@
|
|||||||
|
|
||||||
namespace PSC\Shop\OrderBundle\Model\Order\Position\Upload;
|
namespace PSC\Shop\OrderBundle\Model\Order\Position\Upload;
|
||||||
|
|
||||||
use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag;
|
|
||||||
|
|
||||||
#[AutoconfigureTag('order.position.uploadObjectType')]
|
|
||||||
class Mail implements IUploadTypeObject
|
class Mail implements IUploadTypeObject
|
||||||
{
|
{
|
||||||
public function getCode(): string
|
public function getCode(): string
|
||||||
|
|||||||
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace PSC\Shop\OrderBundle\Service\UploadMode;
|
||||||
|
|
||||||
|
use PSC\Shop\OrderBundle\Interface\IUploadMode;
|
||||||
|
use PSC\Shop\OrderBundle\Transformer\Order\Position\IUploadModeTransformer;
|
||||||
|
use PSC\Shop\OrderBundle\Transformer\Order\Position\Upload\Center as PSCCenter;
|
||||||
|
use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag;
|
||||||
|
|
||||||
|
#[AutoconfigureTag('order.position.uploadObjectType')]
|
||||||
|
class Center implements IUploadMode
|
||||||
|
{
|
||||||
|
public function getCode(): string
|
||||||
|
{
|
||||||
|
return 'center';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTransformer(): IUploadModeTransformer
|
||||||
|
{
|
||||||
|
return PSCCenter();
|
||||||
|
}
|
||||||
|
}
|
||||||
22
src/new/src/PSC/Shop/OrderBundle/Service/UploadMode/Mail.php
Normal file
22
src/new/src/PSC/Shop/OrderBundle/Service/UploadMode/Mail.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace PSC\Shop\OrderBundle\Service\UploadMode;
|
||||||
|
|
||||||
|
use PSC\Shop\OrderBundle\Interface\IUploadMode;
|
||||||
|
use PSC\Shop\OrderBundle\Transformer\Order\Position\IUploadModeTransformer;
|
||||||
|
use PSC\Shop\OrderBundle\Transformer\Order\Position\Upload\Mail as PSCMail;
|
||||||
|
use Symfony\Component\DependencyInjection\Attribute\AutoconfigureTag;
|
||||||
|
|
||||||
|
#[AutoconfigureTag('order.position.uploadObjectType')]
|
||||||
|
class Mail implements IUploadMode
|
||||||
|
{
|
||||||
|
public function getCode(): string
|
||||||
|
{
|
||||||
|
return 'mail';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTransformer(): IUploadModeTransformer
|
||||||
|
{
|
||||||
|
return new PSCMail();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -92,6 +92,7 @@ class Position extends Base
|
|||||||
$positionDoc->setAdditionalInfos($temp);
|
$positionDoc->setAdditionalInfos($temp);
|
||||||
$positionDoc->setCustomerInfo($position->getCustomerInfo());
|
$positionDoc->setCustomerInfo($position->getCustomerInfo());
|
||||||
$positionDoc->setExternalOrderNumber($position->getExternalOrderNumber());
|
$positionDoc->setExternalOrderNumber($position->getExternalOrderNumber());
|
||||||
|
$positionDoc->setUploadMode($position->getUploadMode());
|
||||||
$positionDoc->setSpecialProductTypeObject(
|
$positionDoc->setSpecialProductTypeObject(
|
||||||
$position->getProduct()->getSpecialProductTypeObject()->getPositionData(),
|
$position->getProduct()->getSpecialProductTypeObject()->getPositionData(),
|
||||||
);
|
);
|
||||||
@ -187,6 +188,11 @@ class Position extends Base
|
|||||||
$position->setCustomerInfo((string) $positionDoc->getCustomerInfo());
|
$position->setCustomerInfo((string) $positionDoc->getCustomerInfo());
|
||||||
|
|
||||||
if ($positionDoc->getUploadMode() != '') {
|
if ($positionDoc->getUploadMode() != '') {
|
||||||
|
foreach ($this->uploadObjectTypes as $object) {
|
||||||
|
if ($positionDoc->getUploadMode() == $object->getCode()) {
|
||||||
|
$object->getTransformer()->fromDb($position, $pos, $positionDoc);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($pos->getProduct()) {
|
if ($pos->getProduct()) {
|
||||||
|
|||||||
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace PSC\Shop\OrderBundle\Transformer\Order\Position;
|
||||||
|
|
||||||
|
use PSC\Shop\EntityBundle\Entity\Orderpos;
|
||||||
|
use PSC\Shop\OrderBundle\Model\Order\Position;
|
||||||
|
|
||||||
|
interface IUploadModeTransformer
|
||||||
|
{
|
||||||
|
public function fromDb(Position $position, Orderpos $posEntity, \PSC\Shop\EntityBundle\Document\Position $posDoc);
|
||||||
|
|
||||||
|
public function toDb(Position $position, Orderpos $posEntity, \PSC\Shop\EntityBundle\Document\Position $posDoc);
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace PSC\Shop\OrderBundle\Transformer\Order\Position\Upload;
|
||||||
|
|
||||||
|
use PSC\Shop\EntityBundle\Document\Position as PosDoc;
|
||||||
|
use PSC\Shop\EntityBundle\Entity\Orderpos;
|
||||||
|
use PSC\Shop\OrderBundle\Model\Order\Position;
|
||||||
|
use PSC\Shop\OrderBundle\Transformer\Order\Position\IUploadModeTransformer;
|
||||||
|
|
||||||
|
class Center implements IUploadModeTransformer
|
||||||
|
{
|
||||||
|
public function fromDb(Position $position, Orderpos $posEntity, PosDoc $posDoc): void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function toDb(Position $position, Orderpos $posEntity, PosDoc $posDoc): void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace PSC\Shop\OrderBundle\Transformer\Order\Position\Upload;
|
||||||
|
|
||||||
|
use PSC\Shop\EntityBundle\Document\Position as PosDoc;
|
||||||
|
use PSC\Shop\EntityBundle\Entity\Orderpos;
|
||||||
|
use PSC\Shop\OrderBundle\Model\Order\Position;
|
||||||
|
use PSC\Shop\OrderBundle\Model\Order\Position\Upload\Mail as PSCMail;
|
||||||
|
use PSC\Shop\OrderBundle\Transformer\Order\Position\IUploadModeTransformer;
|
||||||
|
|
||||||
|
class Mail implements IUploadModeTransformer
|
||||||
|
{
|
||||||
|
public function fromDb(Position $position, Orderpos $posEntity, PosDoc $posDoc): void
|
||||||
|
{
|
||||||
|
$position->setUploadTypeObject(new PSCMail());
|
||||||
|
}
|
||||||
|
|
||||||
|
public function toDb(Position $position, Orderpos $posEntity, PosDoc $posDoc): void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -3,6 +3,8 @@
|
|||||||
namespace Plugin\Custom\PSC\TemplateprintLayouter\Api\Basket;
|
namespace Plugin\Custom\PSC\TemplateprintLayouter\Api\Basket;
|
||||||
|
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
use Nelmio\ApiDocBundle\Attribute\Model;
|
||||||
|
use OpenApi\Attributes\JsonContent;
|
||||||
use OpenApi\Attributes\RequestBody;
|
use OpenApi\Attributes\RequestBody;
|
||||||
use OpenApi\Attributes\Response;
|
use OpenApi\Attributes\Response;
|
||||||
use OpenApi\Attributes\Tag;
|
use OpenApi\Attributes\Tag;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user