1
0
mirror of synced 2025-01-26 02:01:40 +03:00

add store and shipment date fields in RequestCalculate

This commit is contained in:
Ruslan Efanov 2022-08-01 10:32:51 +03:00
parent 1509fa99da
commit dd6a660d0c
4 changed files with 57 additions and 24 deletions

26
Model/BaseStore.php Normal file
View File

@ -0,0 +1,26 @@
<?php
namespace RetailCrm\DeliveryModuleBundle\Model;
use JMS\Serializer\Annotation as Serializer;
class BaseStore
{
/**
* @var string
*
* @Serializer\Groups({"request"})
* @Serializer\SerializedName("code")
* @Serializer\Type("string")
*/
public $code;
/**
* @var string
*
* @Serializer\Groups({"request"})
* @Serializer\SerializedName("name")
* @Serializer\Type("string")
*/
public $name;
}

View File

@ -2,8 +2,9 @@
namespace RetailCrm\DeliveryModuleBundle\Model\Request; namespace RetailCrm\DeliveryModuleBundle\Model\Request;
use RetailCrm\DeliveryModuleBundle\Model\DeliveryTime; use DateTime;
use JMS\Serializer\Annotation as Serializer; use JMS\Serializer\Annotation as Serializer;
use RetailCrm\DeliveryModuleBundle\Model\DeliveryTime;
use RetailCrm\DeliveryModuleBundle\Model\Traits\ExtraDataTrait; use RetailCrm\DeliveryModuleBundle\Model\Traits\ExtraDataTrait;
class RequestCalculate class RequestCalculate
@ -24,7 +25,7 @@ class RequestCalculate
/** /**
* Адрес доставки. * Адрес доставки.
* *
* @var string * @var RetailCrm\DeliveryModuleBundle\Model\DeliveryAddress
* *
* @Serializer\Groups({"request", "calculate"}) * @Serializer\Groups({"request", "calculate"})
* @Serializer\SerializedName("deliveryAddress") * @Serializer\SerializedName("deliveryAddress")
@ -79,7 +80,7 @@ class RequestCalculate
/** /**
* Дата доставки. * Дата доставки.
* *
* @var \DateTime * @var DateTime
* *
* @Serializer\Groups({"request", "calculate"}) * @Serializer\Groups({"request", "calculate"})
* @Serializer\SerializedName("deliveryDate") * @Serializer\SerializedName("deliveryDate")

View File

@ -2,6 +2,7 @@
namespace RetailCrm\DeliveryModuleBundle\Model; namespace RetailCrm\DeliveryModuleBundle\Model;
use DateTime;
use JMS\Serializer\Annotation as Serializer; use JMS\Serializer\Annotation as Serializer;
class RequestCalculate class RequestCalculate
@ -22,7 +23,7 @@ class RequestCalculate
/** /**
* Адрес доставки. * Адрес доставки.
* *
* @var string * @var DeliveryAddress
* *
* @Serializer\Groups({"request", "calculate"}) * @Serializer\Groups({"request", "calculate"})
* @Serializer\SerializedName("deliveryAddress") * @Serializer\SerializedName("deliveryAddress")
@ -74,10 +75,21 @@ class RequestCalculate
*/ */
public $payerType; public $payerType;
/**
* Дата отгрузки.
*
* @var DateTime
*
* @Serializer\Groups({"request", "calculate"})
* @Serializer\SerializedName("shipmentDate")
* @Serializer\Type("DateTime<'Y-m-d'>")
*/
public $shipmentDate;
/** /**
* Дата доставки. * Дата доставки.
* *
* @var \DateTime * @var DateTime
* *
* @Serializer\Groups({"request", "calculate"}) * @Serializer\Groups({"request", "calculate"})
* @Serializer\SerializedName("deliveryDate") * @Serializer\SerializedName("deliveryDate")
@ -117,4 +129,16 @@ class RequestCalculate
* @Serializer\Type("array") * @Serializer\Type("array")
*/ */
public $extraData; public $extraData;
/**
* Склад отгрузки.
*
* @var BaseStore
*
* @Serializer\Groups({"request", "calculate"})
* @Serializer\SerializedName("store")
* @Serializer\Type("RetailCrm\DeliveryModuleBundle\Model\BaseStore")
*/
public $store;
} }

View File

@ -4,26 +4,8 @@ namespace RetailCrm\DeliveryModuleBundle\Model;
use JMS\Serializer\Annotation as Serializer; use JMS\Serializer\Annotation as Serializer;
class Store class Store extends BaseStore
{ {
/**
* @var string
*
* @Serializer\Groups({"request"})
* @Serializer\SerializedName("code")
* @Serializer\Type("string")
*/
public $code;
/**
* @var string
*
* @Serializer\Groups({"request"})
* @Serializer\SerializedName("name")
* @Serializer\Type("string")
*/
public $name;
/** /**
* @var StoreWorkTime * @var StoreWorkTime
* *