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

Added non_working_days field to settings.

This commit is contained in:
Max Baranikov 2023-06-23 13:35:40 +04:00
parent a42ddcc337
commit 86d280ba47
3 changed files with 55 additions and 1 deletions

View 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;
}

View File

@ -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;
}

View File

@ -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]);
}
}