Skip to content

Commit

Permalink
Merge branch 'release/3.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Naugrimm committed Jun 17, 2024
2 parents a853b06 + 8f39107 commit 84f9172
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions src/Nodes/Product/ProductComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,24 @@
namespace Naugrim\OpenTrans\Nodes\Product;

use JMS\Serializer\Annotation as Serializer;
use JMS\Serializer\Annotation\XmlElement;
use Naugrim\BMEcat\Nodes\Concerns\HasSerializableAttributes;
use Naugrim\BMEcat\Nodes\Contracts\NodeInterface;
use Naugrim\OpenTrans\Nodes\ProductId;
use Naugrim\OpenTrans\OpenTrans;

/**
* @implements NodeInterface<PriceFix>
* @method self setAmount(array|\Naugrim\OpenTrans\Nodes\ProductId $amount)
* @method \Naugrim\OpenTrans\Nodes\ProductId getAmount()
* @method self setProductId(array|\Naugrim\OpenTrans\Nodes\ProductId $productId)
* @method \Naugrim\OpenTrans\Nodes\ProductId getProductId()
* @method self setProductComponents(\Naugrim\OpenTrans\Nodes\Product\ProductComponent[]|array $productComponents)
* @method \Naugrim\OpenTrans\Nodes\Product\ProductComponent[]|array getProductComponents()
* @method self setQuantity(float $quantity)
* @method float getQuantity()
* @method self setOrderUnit(string $orderUnit)
* @method string getOrderUnit()
* @method self setPriceFix(array|\Naugrim\OpenTrans\Nodes\Product\PriceFix $priceFix)
* @method \Naugrim\OpenTrans\Nodes\Product\PriceFix getPriceFix()
*/
class ProductComponent implements NodeInterface
{
Expand All @@ -23,7 +29,16 @@ class ProductComponent implements NodeInterface
#[Serializer\Expose]
#[Serializer\Type(ProductId::class)]
#[Serializer\SerializedName('PRODUCT_ID')]
protected ProductId $amount;
protected ProductId $productId;

/**
* @var ProductComponent[]
*/
#[Serializer\Expose]
#[Serializer\Type('array<' . ProductComponent::class . '>')]
#[Serializer\SerializedName('PRODUCT_COMPONENTS')]
#[Serializer\XmlList(entry: 'PRODUCT_COMPONENT')]
protected array $productComponents = [];

#[Serializer\Expose]
#[Serializer\Type('float')]
Expand All @@ -33,6 +48,11 @@ class ProductComponent implements NodeInterface
#[Serializer\Expose]
#[Serializer\Type('string')]
#[Serializer\SerializedName('ORDER_UNIT')]
#[\JMS\Serializer\Annotation\XmlElement(namespace: \Naugrim\OpenTrans\OpenTrans::BMECAT_NAMESPACE)]
#[XmlElement(namespace: OpenTrans::BMECAT_NAMESPACE)]
protected string $orderUnit;

#[Serializer\Expose]
#[Serializer\Type(PriceFix::class)]
#[Serializer\SerializedName('PRODUCT_PRICE_FIX')]
protected PriceFix $priceFix;
}

0 comments on commit 84f9172

Please sign in to comment.