1
0
mirror of synced 2024-11-25 06:46:07 +03:00

Added non_working_days field to settings. Added attachedTag field to customer

This commit is contained in:
Pavel 2023-06-27 11:33:07 +03:00 committed by GitHub
commit fa0e8a7075
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 63 additions and 1 deletions

View File

@ -120,6 +120,15 @@ class Customer implements CustomerInterface
*/ */
public $tags; public $tags;
/**
* @var string
*
* @JMS\Type("string")
* @JMS\SerializedName("attachedTag")
*/
public $attachedTag;
/** /**
* @var string[] * @var string[]
* *

View File

@ -0,0 +1,37 @@
<?php
/**
* PHP version 7.3
*
* @category Value
* @package RetailCrm\Api\Model\Entity\Settings
*/
namespace RetailCrm\Api\Model\Entity\Settings;
use RetailCrm\Api\Component\Serializer\Annotation as JMS;
/**
* Class NonWorkingDay
*
* @category NonWorkingDay
* @package RetailCrm\Api\Model\Entity\Settings
*/
class NonWorkingDay
{
/**
* @var string
*
* @JMS\Type("string")
* @JMS\SerializedName("start_date")
*/
public $startDate;
/**
* @var string
*
* @JMS\Type("string")
* @JMS\SerializedName("end_date")
*/
public $endDate;
}

View File

@ -44,10 +44,18 @@ class Settings
public $timezone; public $timezone;
/** /**
* @var \RetailCrm\Api\Model\Entity\Settings\WorkTime * @var \RetailCrm\Api\Model\Entity\Settings\WorkTime[]
* *
* @JMS\Type("array<RetailCrm\Api\Model\Entity\Settings\WorkTime>") * @JMS\Type("array<RetailCrm\Api\Model\Entity\Settings\WorkTime>")
* @JMS\SerializedName("work_times") * @JMS\SerializedName("work_times")
*/ */
public $workTimes; public $workTimes;
/**
* @var \RetailCrm\Api\Model\Entity\Settings\NonWorkingDay[]
*
* @JMS\Type("array<RetailCrm\Api\Model\Entity\Settings\NonWorkingDay>")
* @JMS\SerializedName("non_working_days")
*/
public $nonWorkingDays;
} }

View File

@ -11,6 +11,7 @@ namespace RetailCrm\Tests\Model\Callback\Entity\Integration;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use RetailCrm\Api\Factory\SerializerFactory; use RetailCrm\Api\Factory\SerializerFactory;
use RetailCrm\Api\Model\Entity\Settings\NonWorkingDay;
use RetailCrm\Api\Model\Entity\Settings\Settings as SystemSettings; use RetailCrm\Api\Model\Entity\Settings\Settings as SystemSettings;
use RetailCrm\Api\Model\Callback\Entity\Integration\Settings; use RetailCrm\Api\Model\Callback\Entity\Integration\Settings;
use RetailCrm\Api\Model\Entity\Settings\Value; use RetailCrm\Api\Model\Entity\Settings\Value;
@ -44,6 +45,12 @@ class SettingsTest extends TestCase
"lunch_end_time" => "05:00", "lunch_end_time" => "05:00",
], ],
], ],
'non_working_days' => [
[
'start_date' => '05.29',
'end_date' => '06.29'
]
]
], ],
], ],
Settings::class Settings::class
@ -53,5 +60,6 @@ class SettingsTest extends TestCase
self::assertInstanceOf(SystemSettings::class, $settings->settings); self::assertInstanceOf(SystemSettings::class, $settings->settings);
self::assertInstanceOf(Value::class, $settings->settings->defaultCurrency); self::assertInstanceOf(Value::class, $settings->settings->defaultCurrency);
self::assertInstanceOf(WorkTime::class, $settings->settings->workTimes[0]); self::assertInstanceOf(WorkTime::class, $settings->settings->workTimes[0]);
self::assertInstanceOf(NonWorkingDay::class, $settings->settings->nonWorkingDays[0]);
} }
} }