-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dee0c93
commit 26caf57
Showing
12 changed files
with
304 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
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,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace VasilDakov\Econt\Model; | ||
|
||
use JMS\Serializer\Annotation as Serializer; | ||
|
||
final readonly class CDPayOptions | ||
{ | ||
public function __construct( | ||
#[Serializer\Type('string')] | ||
public ?string $num, | ||
|
||
#[Serializer\Type(ClientProfile::class)] | ||
public ?ClientProfile $clientProfile, | ||
|
||
#[Serializer\Type('bool')] | ||
public ?bool $moneyTransfer, | ||
|
||
#[Serializer\Type('bool')] | ||
public ?bool $express, | ||
|
||
#[Serializer\Type('string')] | ||
public ?string $method, | ||
|
||
#[Serializer\Type(Address::class)] | ||
public ?Address $address, | ||
) { | ||
|
||
} | ||
} |
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,41 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace VasilDakov\Econt\Model; | ||
|
||
use JMS\Serializer\Annotation as Serializer; | ||
use VasilDakov\Econt\Constants; | ||
|
||
final readonly class ClientProfile | ||
{ | ||
public function __construct( | ||
#[Serializer\Type('int')] | ||
public ?int $id = null, | ||
|
||
#[Serializer\Type('string')] | ||
public ?string $name = null, | ||
|
||
#[Serializer\Type('string')] | ||
public ?string $nameEn = null, | ||
|
||
#[Serializer\Type('array')] | ||
public ?array $phones = null, | ||
|
||
#[Serializer\Type('string')] | ||
public ?string $email = null, | ||
) { | ||
|
||
} | ||
|
||
public function toArray(): array | ||
{ | ||
return [ | ||
Constants::ID => $this->id, | ||
Constants::NAME => $this->name, | ||
Constants::NAME_EN => $this->nameEn, | ||
Constants::PHONES => $this->phones, | ||
Constants::EMAIL => $this->email, | ||
]; | ||
} | ||
} |
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,39 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace VasilDakov\Econt\Model; | ||
|
||
use JMS\Serializer\Annotation as Serializer; | ||
use VasilDakov\Econt\Constants; | ||
|
||
final readonly class Error | ||
{ | ||
public function __construct( | ||
#[Serializer\Type('string')] | ||
public ?string $type = null, | ||
|
||
#[Serializer\Type('string')] | ||
public ?string $message = null, | ||
|
||
#[Serializer\Type('string')] | ||
public ?string $fields = null, | ||
|
||
#[Serializer\Type('string')] | ||
public ?string $innerErrors = null, | ||
) { | ||
|
||
} | ||
|
||
public function toArray(): array | ||
{ | ||
return [ | ||
Constants::TYPE => $this->type, | ||
Constants::MESSAGE => $this->message, | ||
Constants::FIELDS => $this->fields, | ||
Constants::INNER_ERRORS => $this->innerErrors | ||
|
||
|
||
]; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace VasilDakov\Econt\Model; | ||
|
||
use JMS\Serializer\Annotation as Serializer; | ||
|
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,29 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace VasilDakov\Econt\Model; | ||
|
||
use JMS\Serializer\Annotation as Serializer; | ||
|
||
final readonly class Instruction | ||
{ | ||
public function __construct( | ||
#[Serializer\Type('int')] | ||
public ?int $id = null, | ||
|
||
#[Serializer\Type('string')] | ||
public ?string $type = null, | ||
|
||
#[Serializer\Type('string')] | ||
public ?string $title = null, | ||
|
||
#[Serializer\Type('string')] | ||
public ?string $description = null, | ||
|
||
#[Serializer\Type('array')] | ||
public ?array $attachments = [], | ||
) { | ||
|
||
} | ||
} |
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,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace VasilDakov\Econt\Model; | ||
|
||
use Doctrine\Common\Collections\ArrayCollection; | ||
use JMS\Serializer\Annotation as Serializer; | ||
|
||
|
||
final class ProfilesResponseElement | ||
{ | ||
public function __construct( | ||
#[Serializer\Type(ClientProfile::class)] | ||
public ?ClientProfile $client, | ||
|
||
#[Serializer\Type('ArrayCollection<VasilDakov\Econt\Model\Address>')] | ||
public ArrayCollection $addresses, | ||
|
||
#[Serializer\Type(CDPayOptions::class)] | ||
public ?CDPayOptions $cdPayOptions, | ||
|
||
#[Serializer\Type(Instruction::class)] | ||
public ?Instruction $instructionTemplates, | ||
) { | ||
$this->addresses = new ArrayCollection(); | ||
} | ||
} |
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,37 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace VasilDakov\Econt\Model; | ||
|
||
use JMS\Serializer\Annotation as Serializer; | ||
use VasilDakov\Econt\Constants; | ||
|
||
final readonly class Quarter | ||
{ | ||
public function __construct( | ||
#[Serializer\Type('int')] | ||
public ?int $id = null, | ||
|
||
#[Serializer\Type('int')] | ||
public ?int $cityId = null, | ||
|
||
#[Serializer\Type('string')] | ||
public ?string $name = null, | ||
|
||
#[Serializer\Type('string')] | ||
public ?string $nameEn = null, | ||
) { | ||
|
||
} | ||
|
||
public function toArray(): array | ||
{ | ||
return [ | ||
Constants::ID => $this->id, | ||
Constants::CITY_ID => $this->cityId, | ||
Constants::NAME => $this->name, | ||
Constants::NAME_EN => $this->nameEn, | ||
]; | ||
} | ||
} |
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,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace VasilDakov\Econt\Model; | ||
|
||
use JMS\Serializer\Annotation as Serializer; | ||
|
||
final readonly class ShippingLabel | ||
{ | ||
public function __construct( | ||
#[Serializer\Type('string')] | ||
public ?string $shipmentNumber = null, | ||
) { | ||
|
||
} | ||
} |
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,37 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace VasilDakov\Econt\Model; | ||
|
||
use JMS\Serializer\Annotation as Serializer; | ||
use VasilDakov\Econt\Constants; | ||
|
||
final readonly class Street | ||
{ | ||
public function __construct( | ||
#[Serializer\Type('int')] | ||
public ?int $id = null, | ||
|
||
#[Serializer\Type('int')] | ||
public ?int $cityId = null, | ||
|
||
#[Serializer\Type('string')] | ||
public ?string $name = null, | ||
|
||
#[Serializer\Type('string')] | ||
public ?string $nameEn = null, | ||
) { | ||
|
||
} | ||
|
||
public function toArray(): array | ||
{ | ||
return [ | ||
Constants::ID => $this->id, | ||
Constants::CITY_ID => $this->cityId, | ||
Constants::NAME => $this->name, | ||
Constants::NAME_EN => $this->nameEn, | ||
]; | ||
} | ||
} |
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,14 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace VasilDakov\Econt\Response; | ||
|
||
use Doctrine\Common\Collections\ArrayCollection; | ||
use JMS\Serializer\Annotation as Serializer; | ||
|
||
final readonly class GetClientProfilesResponse | ||
{ | ||
#[Serializer\Type("ArrayCollection<VasilDakov\Econt\Model\ProfilesResponseElement>")] | ||
private ArrayCollection $profiles; | ||
} |