-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from lamoda/feature/CORE-3376
Add method sell_correction for v4 and v5
- Loading branch information
Showing
22 changed files
with
1,600 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Lamoda\AtolClient\V4\DTO\Correction; | ||
|
||
use JMS\Serializer\Annotation as Serializer; | ||
use Lamoda\AtolClient\V4\DTO\Register\Company; | ||
use Lamoda\AtolClient\V4\DTO\Register\Payment; | ||
use Lamoda\AtolClient\V4\DTO\Register\Vat; | ||
|
||
final class Correction | ||
{ | ||
/** | ||
* @var Company | ||
* | ||
* @Serializer\Type("Lamoda\AtolClient\V4\DTO\Register\Company") | ||
*/ | ||
private $company; | ||
|
||
/** | ||
* @var CorrectionInfo | ||
* | ||
* @Serializer\Type("Lamoda\AtolClient\V4\DTO\Correction\CorrectionInfo") | ||
* @Serializer\SerializedName("correction_info") | ||
*/ | ||
private $correctionInfo; | ||
|
||
/** | ||
* @var Payment[] | ||
* | ||
* @Serializer\Type("array<Lamoda\AtolClient\V4\DTO\Register\Payment>") | ||
*/ | ||
private $payments; | ||
|
||
/** | ||
* @var Vat[] | ||
* | ||
* @Serializer\Type("array<Lamoda\AtolClient\V4\DTO\Register\Vat>") | ||
*/ | ||
private $vats; | ||
|
||
/** | ||
* @var string|null | ||
* | ||
* @Serializer\Type("string") | ||
*/ | ||
private $cashier; | ||
|
||
public function __construct(Company $company, CorrectionInfo $correctionInfo, array $payments, array $vats) | ||
{ | ||
$this->company = $company; | ||
$this->correctionInfo = $correctionInfo; | ||
$this->payments = $payments; | ||
$this->vats = $vats; | ||
} | ||
|
||
public function getCorrectionInfo(): CorrectionInfo | ||
{ | ||
return $this->correctionInfo; | ||
} | ||
|
||
public function setCorrectionInfo(CorrectionInfo $correctionInfo): self | ||
{ | ||
$this->correctionInfo = $correctionInfo; | ||
|
||
return $this; | ||
} | ||
|
||
public function getCompany(): Company | ||
{ | ||
return $this->company; | ||
} | ||
|
||
public function setCompany(Company $company): self | ||
{ | ||
$this->company = $company; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return Payment[] | ||
*/ | ||
public function getPayments(): array | ||
{ | ||
return $this->payments; | ||
} | ||
|
||
/** | ||
* @param Payment[] $payments | ||
* | ||
* @return Correction | ||
*/ | ||
public function setPayments(array $payments): self | ||
{ | ||
$this->payments = $payments; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return Vat[] | ||
*/ | ||
public function getVats(): array | ||
{ | ||
return $this->vats; | ||
} | ||
|
||
/** | ||
* @param Vat[] $vats | ||
* | ||
* @return Correction | ||
*/ | ||
public function setVats(array $vats): self | ||
{ | ||
$this->vats = $vats; | ||
|
||
return $this; | ||
} | ||
|
||
public function getCashier(): string | ||
{ | ||
return $this->cashier; | ||
} | ||
|
||
/** | ||
* @param string $cashier | ||
* | ||
* @return Correction | ||
*/ | ||
public function setCashier(string $cashier): self | ||
{ | ||
$this->cashier = $cashier; | ||
|
||
return $this; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Lamoda\AtolClient\V4\DTO\Correction; | ||
|
||
use JMS\Serializer\Annotation as Serializer; | ||
|
||
final class CorrectionInfo | ||
{ | ||
/** | ||
* @var CorrectionType | ||
* | ||
* @Serializer\Type("Enum<'Lamoda\AtolClient\V4\DTO\Correction\CorrectionType'>") | ||
*/ | ||
private $type; | ||
|
||
/** | ||
* @var \DateTime | ||
* | ||
* @Serializer\Type("DateTime<'d.m.Y'>") | ||
* @Serializer\SerializedName("base_date") | ||
*/ | ||
private $baseDate; | ||
|
||
/** | ||
* @var string | ||
* | ||
* @Serializer\Type("string") | ||
* @Serializer\SerializedName("base_number") | ||
*/ | ||
private $baseNumber; | ||
|
||
/** | ||
* @var string | ||
* | ||
* @Serializer\Type("string") | ||
* @Serializer\SerializedName("base_name") | ||
*/ | ||
private $baseName; | ||
|
||
public function __construct(CorrectionType $type, \DateTime $baseDate, string $baseNumber, string $baseName) | ||
{ | ||
$this->type = $type; | ||
$this->baseDate = $baseDate; | ||
$this->baseNumber = $baseNumber; | ||
$this->baseName = $baseName; | ||
} | ||
|
||
public function getType(): CorrectionType | ||
{ | ||
return $this->type; | ||
} | ||
|
||
public function setType(CorrectionType $type): self | ||
{ | ||
$this->type = $type; | ||
|
||
return $this; | ||
} | ||
|
||
public function getBaseDate(): \DateTime | ||
{ | ||
return $this->baseDate; | ||
} | ||
|
||
public function setBaseDate(\DateTime $baseDate): self | ||
{ | ||
$this->baseDate = $baseDate; | ||
|
||
return $this; | ||
} | ||
|
||
public function getBaseNumber(): string | ||
{ | ||
return $this->baseNumber; | ||
} | ||
|
||
public function setBaseNumber(string $baseNumber): self | ||
{ | ||
$this->baseNumber = $baseNumber; | ||
|
||
return $this; | ||
} | ||
|
||
public function getBaseName(): string | ||
{ | ||
return $this->baseName; | ||
} | ||
|
||
public function setBaseName(string $baseName): self | ||
{ | ||
$this->baseName = $baseName; | ||
|
||
return $this; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Lamoda\AtolClient\V4\DTO\Correction; | ||
|
||
use JMS\Serializer\Annotation as Serializer; | ||
use Lamoda\AtolClient\V4\DTO\Register\Service; | ||
use Lamoda\AtolClient\V4\DTO\Shared\TimestampTrait; | ||
|
||
final class CorrectionRequest | ||
{ | ||
use TimestampTrait; | ||
|
||
/** | ||
* @var string | ||
* | ||
* @Serializer\Type("string") | ||
* @Serializer\SerializedName("external_id") | ||
*/ | ||
private $externalId; | ||
|
||
/** | ||
* @var Service|null | ||
* | ||
* @Serializer\Type("Lamoda\AtolClient\V4\DTO\Register\Service") | ||
*/ | ||
private $service; | ||
|
||
/** | ||
* @var Correction | ||
* | ||
* @Serializer\Type("Lamoda\AtolClient\V4\DTO\Correction\Correction") | ||
*/ | ||
private $correction; | ||
|
||
public function __construct(string $externalId, Correction $correction, \DateTime $timestamp) | ||
{ | ||
$this->externalId = $externalId; | ||
$this->correction = $correction; | ||
$this->timestamp = $timestamp; | ||
} | ||
|
||
public function setTimestamp(\DateTime $timestamp): self | ||
{ | ||
$this->timestamp = $timestamp; | ||
|
||
return $this; | ||
} | ||
|
||
public function getExternalId(): string | ||
{ | ||
return $this->externalId; | ||
} | ||
|
||
public function setExternalId(string $externalId): void | ||
{ | ||
$this->externalId = $externalId; | ||
} | ||
|
||
public function getService(): ?Service | ||
{ | ||
return $this->service; | ||
} | ||
|
||
public function setService(?Service $service): void | ||
{ | ||
$this->service = $service; | ||
} | ||
|
||
public function getCorrection(): Correction | ||
{ | ||
return $this->correction; | ||
} | ||
|
||
public function setCorrection(Correction $correction): self | ||
{ | ||
$this->correction = $correction; | ||
|
||
return $this; | ||
} | ||
|
||
} |
Oops, something went wrong.