From 86d280ba47265a30531b8d7c78f0e702fa1f098f Mon Sep 17 00:00:00 2001 From: Max Baranikov Date: Fri, 23 Jun 2023 13:35:40 +0400 Subject: [PATCH 1/2] Added non_working_days field to settings. --- src/Model/Entity/Settings/NonWorkingDay.php | 38 +++++++++++++++++++ src/Model/Entity/Settings/Settings.php | 10 ++++- .../Entity/Integration/SettingsTest.php | 8 ++++ 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 src/Model/Entity/Settings/NonWorkingDay.php diff --git a/src/Model/Entity/Settings/NonWorkingDay.php b/src/Model/Entity/Settings/NonWorkingDay.php new file mode 100644 index 0000000..8235138 --- /dev/null +++ b/src/Model/Entity/Settings/NonWorkingDay.php @@ -0,0 +1,38 @@ +") * @JMS\SerializedName("work_times") */ public $workTimes; + + /** + * @var \RetailCrm\Api\Model\Entity\Settings\NonWorkingDay[] + * + * @JMS\Type("array") + * @JMS\SerializedName("non_working_days") + */ + public $nonWorkingDays; } diff --git a/tests/src/Model/Callback/Entity/Integration/SettingsTest.php b/tests/src/Model/Callback/Entity/Integration/SettingsTest.php index 18a11a3..145b96d 100644 --- a/tests/src/Model/Callback/Entity/Integration/SettingsTest.php +++ b/tests/src/Model/Callback/Entity/Integration/SettingsTest.php @@ -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]); } } From aa3c99fa6d139ddefc31b3c79fc5ea9adaf2af26 Mon Sep 17 00:00:00 2001 From: Max Baranikov Date: Fri, 23 Jun 2023 13:36:00 +0400 Subject: [PATCH 2/2] Added attachedTag field to customer --- src/Model/Entity/Customers/Customer.php | 9 +++++++++ src/Model/Entity/Settings/NonWorkingDay.php | 1 - 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Model/Entity/Customers/Customer.php b/src/Model/Entity/Customers/Customer.php index 7db3811..bad3cf3 100644 --- a/src/Model/Entity/Customers/Customer.php +++ b/src/Model/Entity/Customers/Customer.php @@ -120,6 +120,15 @@ class Customer implements CustomerInterface */ public $tags; + + /** + * @var string + * + * @JMS\Type("string") + * @JMS\SerializedName("attachedTag") + */ + public $attachedTag; + /** * @var string[] * diff --git a/src/Model/Entity/Settings/NonWorkingDay.php b/src/Model/Entity/Settings/NonWorkingDay.php index 8235138..e2e011d 100644 --- a/src/Model/Entity/Settings/NonWorkingDay.php +++ b/src/Model/Entity/Settings/NonWorkingDay.php @@ -34,5 +34,4 @@ class NonWorkingDay * @JMS\SerializedName("end_date") */ public $endDate; - }