Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* PHP-1875: priceHistory; * PHP-1875: priceHistory; * PHP-1875: priceHistory; * PHP-1875: priceHistory; * PHP-1875: priceHistory; * PHP-1875: priceHistory; * PHP-1875: priceHistory; * PHP-1875: priceHistory;
- Loading branch information
Showing
7 changed files
with
102 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Homeapp\HomeappData\Registry\Dto\PriceHistory; | ||
|
||
use Homeapp\JsonApi\Attributes\AttributesInterface; | ||
use JMS\Serializer\Annotation as Serializer; | ||
|
||
class Attributes implements AttributesInterface | ||
{ | ||
/** | ||
* @Serializer\Type("int") | ||
* @Serializer\Groups({"API"}) | ||
*/ | ||
public ?int $oldPrice; | ||
|
||
/** | ||
* @Serializer\Type("int") | ||
* @Serializer\Groups({"API"}) | ||
*/ | ||
public ?int $newPrice; | ||
|
||
/** | ||
* @Serializer\Type("DateTimeImmutable<'Y-m-d H:i:s'>") | ||
* @Serializer\Groups({"API"}) | ||
*/ | ||
public ?\DateTimeImmutable $dateCreated; | ||
|
||
public function __construct(?int $oldPrice, ?int $newPrice, ?\DateTimeImmutable $dateCreated) | ||
{ | ||
$this->oldPrice = $oldPrice; | ||
$this->newPrice = $newPrice; | ||
$this->dateCreated = $dateCreated; | ||
} | ||
} |
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,31 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Homeapp\HomeappData\Registry\Dto\PriceHistory; | ||
|
||
use Homeapp\HomeappData\Registry\Dto\ResourceObject; | ||
use Homeapp\HomeappData\Registry\Enum\EntityNameEnum; | ||
use JMS\Serializer\Annotation as Serializer; | ||
|
||
class Data extends ResourceObject | ||
{ | ||
/** | ||
* @property-read | ||
* @Serializer\Type("Homeapp\HomeappData\Registry\Dto\PriceHistory\Attributes") | ||
* @Serializer\Groups({"API"}) | ||
*/ | ||
public ?Attributes $attributes = null; | ||
|
||
/** | ||
* @property-read | ||
* @Serializer\Type("Homeapp\HomeappData\Registry\Dto\PriceHistory\Relationships") | ||
* @Serializer\Groups({"API"}) | ||
*/ | ||
public ?Relationships $relationships = null; | ||
|
||
public function __construct(?string $id, ?Attributes $attributes, ?Relationships $relationships) | ||
{ | ||
parent::__construct($id, EntityNameEnum::REALTY); | ||
$this->attributes = $attributes; | ||
$this->relationships = $relationships; | ||
} | ||
} |
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,26 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace Homeapp\HomeappData\Registry\Dto\PriceHistory; | ||
|
||
use Homeapp\JsonApi\Relationships\RelationshipsBlockSingle; | ||
use Homeapp\JsonApi\Relationships\RelationshipsInterface; | ||
use Homeapp\JsonApi\ResourceIdentifierObject; | ||
use JMS\Serializer\Annotation as Serializer; | ||
|
||
class Relationships implements RelationshipsInterface | ||
{ | ||
/** | ||
* @var RelationshipsBlockSingle|null | ||
* @Serializer\Type("Homeapp\JsonApi\Relationships\RelationshipsBlockSingle") | ||
* @Serializer\Groups({"API"}) | ||
*/ | ||
public ?RelationshipsBlockSingle $realty = null; | ||
|
||
/** | ||
* @param ResourceIdentifierObject|null $realty | ||
*/ | ||
public function __construct(?ResourceIdentifierObject $realty = null) | ||
{ | ||
$this->realty = new RelationshipsBlockSingle($realty); | ||
} | ||
} |
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
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