Add support for MG settings
This commit is contained in:
commit
71a3a66724
45
src/Model/Entity/Settings/ChannelSetting.php
Normal file
45
src/Model/Entity/Settings/ChannelSetting.php
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PHP version 7.3
|
||||||
|
*
|
||||||
|
* @category Feature
|
||||||
|
* @package RetailCrm\Api\Model\Entity\Settings
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace RetailCrm\Api\Model\Entity\Settings;
|
||||||
|
|
||||||
|
use RetailCrm\Api\Component\Serializer\Annotation as JMS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class ChannelSetting
|
||||||
|
*
|
||||||
|
* @category ChannelSetting
|
||||||
|
* @package RetailCrm\Api\Model\Entity\Settings
|
||||||
|
*/
|
||||||
|
class ChannelSetting
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @JMS\Type("string")
|
||||||
|
* @JMS\SerializedName("site")
|
||||||
|
*/
|
||||||
|
public $site;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @JMS\Type("string")
|
||||||
|
* @JMS\SerializedName("order_type")
|
||||||
|
*/
|
||||||
|
public $orderType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*
|
||||||
|
* @JMS\Type("string")
|
||||||
|
* @JMS\SerializedName("order_method")
|
||||||
|
*/
|
||||||
|
public $orderMethod;
|
||||||
|
}
|
37
src/Model/Entity/Settings/MgOrderCreationSettings.php
Normal file
37
src/Model/Entity/Settings/MgOrderCreationSettings.php
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PHP version 7.3
|
||||||
|
*
|
||||||
|
* @category Feature
|
||||||
|
* @package RetailCrm\Api\Model\Entity\Settings
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace RetailCrm\Api\Model\Entity\Settings;
|
||||||
|
|
||||||
|
use RetailCrm\Api\Component\Serializer\Annotation as JMS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class MgOrderCreationSettings
|
||||||
|
*
|
||||||
|
* @category MgOrderCreationSettings
|
||||||
|
* @package RetailCrm\Api\Model\Entity\Settings
|
||||||
|
*/
|
||||||
|
class MgOrderCreationSettings
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var \RetailCrm\Api\Model\Entity\Settings\ChannelSetting
|
||||||
|
*
|
||||||
|
* @JMS\Type("RetailCrm\Api\Model\Entity\Settings\ChannelSetting")
|
||||||
|
* @JMS\SerializedName("default")
|
||||||
|
*/
|
||||||
|
public $default;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array<int, \RetailCrm\Api\Model\Entity\Settings\ChannelSetting>
|
||||||
|
*
|
||||||
|
* @JMS\Type("array<int, RetailCrm\Api\Model\Entity\Settings\ChannelSetting>")
|
||||||
|
* @JMS\SerializedName("channels")
|
||||||
|
*/
|
||||||
|
public $channels;
|
||||||
|
}
|
29
src/Model/Entity/Settings/MgSettings.php
Normal file
29
src/Model/Entity/Settings/MgSettings.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PHP version 7.3
|
||||||
|
*
|
||||||
|
* @category Feature
|
||||||
|
* @package RetailCrm\Api\Model\Entity\Settings
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace RetailCrm\Api\Model\Entity\Settings;
|
||||||
|
|
||||||
|
use RetailCrm\Api\Component\Serializer\Annotation as JMS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class MgSettings
|
||||||
|
*
|
||||||
|
* @category MgSettings
|
||||||
|
* @package RetailCrm\Api\Model\Entity\Settings
|
||||||
|
*/
|
||||||
|
class MgSettings
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var \RetailCrm\Api\Model\Entity\Settings\MgOrderCreationSettings
|
||||||
|
*
|
||||||
|
* @JMS\Type("RetailCrm\Api\Model\Entity\Settings\MgOrderCreationSettings")
|
||||||
|
* @JMS\SerializedName("order_creation")
|
||||||
|
*/
|
||||||
|
public $orderCreation;
|
||||||
|
}
|
@ -58,4 +58,12 @@ class Settings
|
|||||||
* @JMS\SerializedName("non_working_days")
|
* @JMS\SerializedName("non_working_days")
|
||||||
*/
|
*/
|
||||||
public $nonWorkingDays;
|
public $nonWorkingDays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var \RetailCrm\Api\Model\Entity\Settings\MgSettings
|
||||||
|
*
|
||||||
|
* @JMS\Type("RetailCrm\Api\Model\Entity\Settings\MgSettings")
|
||||||
|
* @JMS\SerializedName("mg")
|
||||||
|
*/
|
||||||
|
public $mgSettings;
|
||||||
}
|
}
|
||||||
|
@ -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\MgSettings;
|
||||||
use RetailCrm\Api\Model\Entity\Settings\NonWorkingDay;
|
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;
|
||||||
@ -50,6 +51,27 @@ class SettingsTest extends TestCase
|
|||||||
'start_date' => '05.29',
|
'start_date' => '05.29',
|
||||||
'end_date' => '06.29'
|
'end_date' => '06.29'
|
||||||
]
|
]
|
||||||
|
],
|
||||||
|
'mg' => [
|
||||||
|
'order_creation' => [
|
||||||
|
'default' => [
|
||||||
|
'site' => 'site',
|
||||||
|
'order_type' => 'type',
|
||||||
|
'order_method' => 'method',
|
||||||
|
],
|
||||||
|
'channels' => [
|
||||||
|
1111 => [
|
||||||
|
'site' => 'site_1',
|
||||||
|
'order_type' => 'type_1',
|
||||||
|
'order_method' => 'method_1',
|
||||||
|
],
|
||||||
|
2222 => [
|
||||||
|
'site' => 'site_2',
|
||||||
|
'order_type' => 'type_2',
|
||||||
|
'order_method' => 'method_2',
|
||||||
|
],
|
||||||
|
]
|
||||||
|
]
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -61,5 +83,6 @@ class SettingsTest extends TestCase
|
|||||||
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]);
|
self::assertInstanceOf(NonWorkingDay::class, $settings->settings->nonWorkingDays[0]);
|
||||||
|
self::assertInstanceOf(MgSettings::class, $settings->settings->mgSettings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,28 @@ class SettingsTest extends AbstractApiResourceGroupTestCase
|
|||||||
"lunch_start_time": "12:30",
|
"lunch_start_time": "12:30",
|
||||||
"lunch_end_time": "13:00"
|
"lunch_end_time": "13:00"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"mg": {
|
||||||
|
"order_creation": {
|
||||||
|
"default": {
|
||||||
|
"site": "site",
|
||||||
|
"order_type": "type",
|
||||||
|
"order_method": "method"
|
||||||
|
},
|
||||||
|
"channels": {
|
||||||
|
"1111": {
|
||||||
|
"site": "site_1",
|
||||||
|
"order_type": "type_1",
|
||||||
|
"order_method": "method_1"
|
||||||
|
},
|
||||||
|
"2222": {
|
||||||
|
"site": "site_2",
|
||||||
|
"order_type": "type_2",
|
||||||
|
"order_method": "method_2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EOF;
|
EOF;
|
||||||
|
Loading…
Reference in New Issue
Block a user