Skip to content
This repository has been archived by the owner on May 21, 2021. It is now read-only.

Commit

Permalink
Remove extra request types
Browse files Browse the repository at this point in the history
  • Loading branch information
sanmai committed Oct 20, 2020
1 parent e4178f0 commit 8ec63de
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 104 deletions.
2 changes: 1 addition & 1 deletion src/Requests/Templates/OrderRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
use YDeliverySDK\Requests\Templates\OrderRequest\DeliveryOption;
use YDeliverySDK\Requests\Templates\OrderRequest\Place;
use YDeliverySDK\Requests\Templates\OrderRequest\Recipient;
use YDeliverySDK\Requests\Templates\OrderRequest\Shipment;
use YDeliverySDK\Requests\Types\Shipment;
use YDeliverySDK\Responses\OrderResponse;

/**
Expand Down
44 changes: 0 additions & 44 deletions src/Requests/Templates/OrderRequest/Dimensions.php

This file was deleted.

1 change: 1 addition & 0 deletions src/Requests/Templates/OrderRequest/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
use CommonSDK\Concerns\ObjectPropertyRead;
use CommonSDK\Concerns\PropertyWrite;
use YDeliverySDK\Common;
use YDeliverySDK\Requests\Types\Dimensions;

/**
* @property-write string $externalId Идентификатор заказа в системе партнера.
Expand Down
1 change: 1 addition & 0 deletions src/Requests/Templates/OrderRequest/Place.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
use CommonSDK\Concerns\PropertyWrite;
use CommonSDK\Contracts\ReadableRequestProperty;
use YDeliverySDK\Common;
use YDeliverySDK\Requests\Types\Dimensions;

/**
* @property-write string $externalId
Expand Down
58 changes: 0 additions & 58 deletions src/Requests/Templates/OrderRequest/Shipment.php

This file was deleted.

17 changes: 16 additions & 1 deletion src/Requests/Types/Shipment.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,28 @@
use YDeliverySDK\Common;

/**
* @property-write \DateTimeInterface $date Дата отгрузки в формате YYYY-MM-DD.
* @property-write string|\DateTimeInterface $date Дата отгрузки в формате YYYY-MM-DD.
* @property-write string $type Тип отгрузки: IMPORT — самостоятельно, WITHDRAW — курьером.
* @property-write int $partnerId Параметр учитывается только при запросе всех вариантов доставки (includeNonDefault = true).
* @property-write int $warehouseId Идентификатор склада.
* @property-write bool $includeNonDefault Нужно ли включить дополнительные варианты доставки в запрос, кроме тех, что заявлены в ЛК.
* @property-write int $warehouseFrom Идентификатор склада, с которого отгружаются товары.
* @property-write int $warehouseTo Идентификатор склада, на который отгружаются товары.
* @property-write int $partnerTo Идентификатор партнера, которому отгружаются товары.
*/
final class Shipment extends Common\Shipment implements ReadableRequestProperty
{
use PropertyWrite;

/**
* @param string|\DateTimeInterface $date
*/
private function setDate($date): void
{
if (!$date instanceof \DateTimeInterface) {
$date = new \DateTimeImmutable((string) $date);
}

$this->date = $date;
}
}

0 comments on commit 8ec63de

Please sign in to comment.