From 36bf34b511b88202237d8eb356ea5039ff965f49 Mon Sep 17 00:00:00 2001 From: Kirill Sukhorukov Date: Tue, 9 Jul 2024 10:59:51 +0300 Subject: [PATCH] Add support for MG settings --- src/Model/Entity/Settings/ChannelSetting.php | 45 +++++++++++++++++++ .../Settings/MgOrderCreationSettings.php | 37 +++++++++++++++ src/Model/Entity/Settings/MgSettings.php | 29 ++++++++++++ src/Model/Entity/Settings/Settings.php | 8 ++++ .../Entity/Integration/SettingsTest.php | 23 ++++++++++ tests/src/ResourceGroup/SettingsTest.php | 23 +++++++++- 6 files changed, 164 insertions(+), 1 deletion(-) create mode 100644 src/Model/Entity/Settings/ChannelSetting.php create mode 100644 src/Model/Entity/Settings/MgOrderCreationSettings.php create mode 100644 src/Model/Entity/Settings/MgSettings.php diff --git a/src/Model/Entity/Settings/ChannelSetting.php b/src/Model/Entity/Settings/ChannelSetting.php new file mode 100644 index 0000000..7c0eb38 --- /dev/null +++ b/src/Model/Entity/Settings/ChannelSetting.php @@ -0,0 +1,45 @@ + + * + * @JMS\Type("array") + * @JMS\SerializedName("channels") + */ + public $channels; +} diff --git a/src/Model/Entity/Settings/MgSettings.php b/src/Model/Entity/Settings/MgSettings.php new file mode 100644 index 0000000..c048f09 --- /dev/null +++ b/src/Model/Entity/Settings/MgSettings.php @@ -0,0 +1,29 @@ + '05.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(WorkTime::class, $settings->settings->workTimes[0]); self::assertInstanceOf(NonWorkingDay::class, $settings->settings->nonWorkingDays[0]); + self::assertInstanceOf(MgSettings::class, $settings->settings->mgSettings); } } diff --git a/tests/src/ResourceGroup/SettingsTest.php b/tests/src/ResourceGroup/SettingsTest.php index beec911..6ff8bec 100644 --- a/tests/src/ResourceGroup/SettingsTest.php +++ b/tests/src/ResourceGroup/SettingsTest.php @@ -54,7 +54,28 @@ class SettingsTest extends AbstractApiResourceGroupTestCase "lunch_start_time": "12:30", "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;