first commit

This commit is contained in:
2024-10-25 14:16:28 +02:00
commit 925276dbb2
33795 changed files with 4780077 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
<?php
namespace x13allegro\Api\Model\Command\PriceChange;
use JsonSerializable;
final class Modification implements JsonSerializable
{
/** @var string */
public $type;
/** @var \x13allegro\Api\Model\Price */
public $price;
/** @var \x13allegro\Api\Model\Price */
public $value;
/** @var string */
public $percentage;
/**
* @return array
*/
public function jsonSerialize()
{
$type = [
'type' => $this->type
];
switch ($this->type)
{
case ModificationType::INCREASE_PRICE:
case ModificationType::DECREASE_PRICE:
return $type + [
'value' => $this->value
];
case ModificationType::INCREASE_PERCENTAGE:
case ModificationType::DECREASE_PERCENTAGE:
return $type + [
'percentage' => (string)$this->percentage
];
default:
return $type + [
'price' => $this->price
];
}
}
}

View File

@@ -0,0 +1,12 @@
<?php
namespace x13allegro\Api\Model\Command\PriceChange;
final class ModificationType
{
const FIXED_PRICE = 'FIXED_PRICE';
const INCREASE_PRICE = 'INCREASE_PRICE';
const DECREASE_PRICE = 'DECREASE_PRICE';
const INCREASE_PERCENTAGE = 'INCREASE_PERCENTAGE';
const DECREASE_PERCENTAGE = 'DECREASE_PERCENTAGE';
}

View File

@@ -0,0 +1,22 @@
<?php
namespace x13allegro\Api\Model\Command\PriceChange;
use x13allegro\Api\Model\Command\CommandInterface;
final class PriceChangeCommand implements CommandInterface
{
/** @var Modification */
public $modification;
/** @var \x13allegro\Api\Model\Command\OfferCriteria[] */
public $offerCriteria;
/**
* @return \x13allegro\Api\Model\Command\OfferCriteria
*/
public function offerCriteria()
{
return $this->offerCriteria[0];
}
}