1
0
mirror of synced 2024-11-22 05:16:09 +03:00

ref #91532 Исправление передачи даты регистрации клиента (#309)

This commit is contained in:
Kocmonavtik 2023-08-25 11:27:22 +03:00 committed by GitHub
parent 25b4a17e40
commit e003b63f2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 51 additions and 7 deletions

View File

@ -1,3 +1,6 @@
## 2023-08-22 v.6.4.1
- Исправлена передача даты регистрации клиента
## 2023-08-22 v.6.4.0
- Добавлена функция подписки на рекламно-информационные рассылки

View File

@ -1 +1 @@
- Добавлена функция подписки на рекламно-информационные рассылки
- Исправлена передача даты регистрации клиента

View File

@ -1,6 +1,6 @@
<?php
$arModuleVersion = [
'VERSION' => '6.4.0',
'VERSION_DATE' => '2023-08-22 13:00:00'
'VERSION' => '6.4.1',
'VERSION_DATE' => '2023-08-22 9:30:00'
];

View File

@ -68,7 +68,7 @@ class User extends AbstractSerializableModel
/**
* @var \DateTime|null
*
* @Mapping\Type("DateTime<'m.d.Y H:i:s'>")
* @Mapping\Type("DateTime<'d.m.Y H:i:s'>")
* @Mapping\SerializedName("DATE_REGISTER")
*/
private $dateRegister;
@ -85,7 +85,7 @@ class User extends AbstractSerializableModel
/**
* @var \DateTime
*
* @Mapping\Type("DateTime<'m.d.Y H:i:s'>")
* @Mapping\Type("DateTime<'d.m.Y H:i:s'>")
* @Mapping\SerializedName("LAST_LOGIN")
*/
private $lastLogin;
@ -102,7 +102,7 @@ class User extends AbstractSerializableModel
/**
* @var \DateTime
*
* @Mapping\Type("DateTime<'m.d.Y H:i:s'>")
* @Mapping\Type("DateTime<'d.m.Y H:i:s'>")
* @Mapping\SerializedName("LAST_ACTIVITY_DATE")
*/
private $lastActivityDate;
@ -110,7 +110,7 @@ class User extends AbstractSerializableModel
/**
* @var \DateTime
*
* @Mapping\Type("DateTime<'m.d.Y H:i:s'>")
* @Mapping\Type("DateTime<'d.m.Y H:i:s'>")
* @Mapping\SerializedName("TIMESTAMP_X")
*/
private $timestampX;

View File

@ -0,0 +1,41 @@
<?php
use Intaro\RetailCrm\Service\CustomerService;
/**
* Class CustomerService
*/
class CustomerServiceTest extends BitrixTestCase
{
private $customerService;
public function setUp(): void
{
parent::setUp();
COption::SetOptionString('intaro.retailcrm', 'api_version', 'v5');
CModule::IncludeModule('intaro.retailcrm');
$this->customerService = new CustomerService();
}
public function testCreateModel()
{
$user = new CUser;
$arUser = $user->Register(
'TestLogin',
'TestName',
'TestLastName',
'TestPassword',
'TestPassword',
'testemail@gmail.com'
);
$customer = $this->customerService->createModel($arUser['ID']);
$fields = CUser::GetByID($arUser['ID'])->Fetch();
$dateRegister = new DateTimeImmutable($fields['DATE_REGISTER']);
self::assertEquals($dateRegister->getTimestamp(), $customer->createdAt->getTimestamp());
CUser::Delete($arUser['ID']);
}
}