Added non_working_days field to settings.
This commit is contained in:
parent
a42ddcc337
commit
86d280ba47
38
src/Model/Entity/Settings/NonWorkingDay.php
Normal file
38
src/Model/Entity/Settings/NonWorkingDay.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?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;
|
||||
|
||||
}
|
@ -44,10 +44,18 @@ class Settings
|
||||
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\SerializedName("work_times")
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ namespace RetailCrm\Tests\Model\Callback\Entity\Integration;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
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\Callback\Entity\Integration\Settings;
|
||||
use RetailCrm\Api\Model\Entity\Settings\Value;
|
||||
@ -44,6 +45,12 @@ class SettingsTest extends TestCase
|
||||
"lunch_end_time" => "05:00",
|
||||
],
|
||||
],
|
||||
'non_working_days' => [
|
||||
[
|
||||
'start_date' => '05.29',
|
||||
'end_date' => '06.29'
|
||||
]
|
||||
]
|
||||
],
|
||||
],
|
||||
Settings::class
|
||||
@ -53,5 +60,6 @@ class SettingsTest extends TestCase
|
||||
self::assertInstanceOf(SystemSettings::class, $settings->settings);
|
||||
self::assertInstanceOf(Value::class, $settings->settings->defaultCurrency);
|
||||
self::assertInstanceOf(WorkTime::class, $settings->settings->workTimes[0]);
|
||||
self::assertInstanceOf(NonWorkingDay::class, $settings->settings->nonWorkingDays[0]);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user