From f0ba8e65f3be489bfa9119c08d212fe5062c8321 Mon Sep 17 00:00:00 2001 From: Opheugene Date: Mon, 16 Sep 2024 13:44:41 +0200 Subject: [PATCH 1/2] Added include_mass_communication param for requests --- src/Bot/Model/Request/ChatsRequest.php | 1 + src/Bot/Model/Request/DialogsRequest.php | 1 + .../Request/IncludeMassCommunication.php | 48 +++++++++++++++++++ src/Bot/Model/Request/MessagesRequest.php | 1 + 4 files changed, 51 insertions(+) create mode 100644 src/Bot/Model/Request/IncludeMassCommunication.php diff --git a/src/Bot/Model/Request/ChatsRequest.php b/src/Bot/Model/Request/ChatsRequest.php index 61c5f65..a6a5f1b 100644 --- a/src/Bot/Model/Request/ChatsRequest.php +++ b/src/Bot/Model/Request/ChatsRequest.php @@ -24,6 +24,7 @@ class ChatsRequest implements ModelInterface { use CommonFields; use PageLimit; + use IncludeMassCommunication; /** * @Type("int") diff --git a/src/Bot/Model/Request/DialogsRequest.php b/src/Bot/Model/Request/DialogsRequest.php index dce064b..771f809 100644 --- a/src/Bot/Model/Request/DialogsRequest.php +++ b/src/Bot/Model/Request/DialogsRequest.php @@ -24,6 +24,7 @@ class DialogsRequest implements ModelInterface { use CommonFields; use PageLimit; + use IncludeMassCommunication; /** * @var int $sinceId diff --git a/src/Bot/Model/Request/IncludeMassCommunication.php b/src/Bot/Model/Request/IncludeMassCommunication.php new file mode 100644 index 0000000..a8ddefc --- /dev/null +++ b/src/Bot/Model/Request/IncludeMassCommunication.php @@ -0,0 +1,48 @@ +includeMassCommunication; + } + + /** + * @param int $includeMassCommunication + */ + public function setIncludeMassCommunication(int $includeMassCommunication): void + { + $this->includeMassCommunication = $includeMassCommunication; + } +} diff --git a/src/Bot/Model/Request/MessagesRequest.php b/src/Bot/Model/Request/MessagesRequest.php index e691b8d..5679104 100644 --- a/src/Bot/Model/Request/MessagesRequest.php +++ b/src/Bot/Model/Request/MessagesRequest.php @@ -23,6 +23,7 @@ use RetailCrm\Mg\Bot\Model\ModelInterface; class MessagesRequest implements ModelInterface { use CommonFields; + use IncludeMassCommunication; /** * @var int $chatId From bd0c267f094eb32428960746e2c6e1eb510efe8e Mon Sep 17 00:00:00 2001 From: Opheugene Date: Mon, 16 Sep 2024 13:53:48 +0200 Subject: [PATCH 2/2] fix tests --- src/Bot/Model/Request/IncludeMassCommunication.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bot/Model/Request/IncludeMassCommunication.php b/src/Bot/Model/Request/IncludeMassCommunication.php index a8ddefc..ec4e7fd 100644 --- a/src/Bot/Model/Request/IncludeMassCommunication.php +++ b/src/Bot/Model/Request/IncludeMassCommunication.php @@ -33,7 +33,7 @@ trait IncludeMassCommunication /** * @return int */ - public function getIncludeMassCommunication(): int + public function getIncludeMassCommunication() { return $this->includeMassCommunication; } @@ -41,7 +41,7 @@ trait IncludeMassCommunication /** * @param int $includeMassCommunication */ - public function setIncludeMassCommunication(int $includeMassCommunication): void + public function setIncludeMassCommunication(?int $includeMassCommunication): void { $this->includeMassCommunication = $includeMassCommunication; }