From ed6f672cda849075c46cdc15863f5fc14b69dff5 Mon Sep 17 00:00:00 2001 From: Neur0toxine Date: Fri, 3 Sep 2021 12:00:01 +0300 Subject: [PATCH] closes #117 - fix for customer[birthday] date format --- src/Model/Entity/Customers/Customer.php | 2 +- tests/src/ResourceGroup/CustomersTest.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Model/Entity/Customers/Customer.php b/src/Model/Entity/Customers/Customer.php index 1694497..8d233fc 100644 --- a/src/Model/Entity/Customers/Customer.php +++ b/src/Model/Entity/Customers/Customer.php @@ -307,7 +307,7 @@ class Customer implements CustomerInterface /** * @var DateTime * - * @JMS\Type("DateTime<'Y-m-d H:i:s'>") + * @JMS\Type("DateTime<'Y-m-d'>") * @JMS\SerializedName("birthday") */ public $birthday; diff --git a/tests/src/ResourceGroup/CustomersTest.php b/tests/src/ResourceGroup/CustomersTest.php index 00ea8e4..e35686f 100644 --- a/tests/src/ResourceGroup/CustomersTest.php +++ b/tests/src/ResourceGroup/CustomersTest.php @@ -9,6 +9,7 @@ namespace RetailCrm\Tests\ResourceGroup; +use RetailCrm\Api\Component\Transformer\DateTimeTransformer; use RetailCrm\Api\Enum\ByIdentifier; use RetailCrm\Api\Enum\Customers\ContragentType; use RetailCrm\Api\Enum\Customers\CustomerType; @@ -262,6 +263,7 @@ EOF; $customer->phones = [ new CustomerPhone('(603) 292-6810') ]; + $customer->birthday = DateTimeTransformer::createDate('1980-01-01'); $request = new CustomersCreateRequest(); $request->site = 'aliexpress';