Compare commits
84 commits
Author | SHA1 | Date | |
---|---|---|---|
7a87f2669b | |||
|
f65dcac9f5 | ||
|
9a23562cbd | ||
141c2c9bc3 | |||
46e0f84265 | |||
|
dc0ead717e | ||
2d5a8ceaed | |||
|
2b798fa877 | ||
95520bb1e7 | |||
|
bd0c267f09 | ||
|
f0ba8e65f3 | ||
fb0e9404a5 | |||
|
b1fd78d2b5 | ||
|
5da993d598 | ||
4b6e9e0dff | |||
2640e661cf | |||
|
d34270121c | ||
|
93777973b5 | ||
|
bcf3d0974b | ||
6e4dd6af44 | |||
|
370fd04824 | ||
26aa42ce67 | |||
|
290d5f87e5 | ||
|
54486d4008 | ||
1fc8ccda10 | |||
|
33e816ce97 | ||
|
4b5041b05b | ||
|
8a20b86b17 | ||
a05cf2cc09 | |||
|
be857dd1ac | ||
90b90c0f8d | |||
|
5aaed7ab7d | ||
|
6682b9b02c | ||
41cb22a720 | |||
|
8892e5fe5a | ||
|
e14afbf773 | ||
93924bf3b5 | |||
3d7a10f7c6 | |||
7dd570ffc3 | |||
|
d92b89ad37 | ||
|
8b9afc52af | ||
|
d9192f963c | ||
|
b478dd6f25 | ||
|
29d6732404 | ||
59e9c8d3be | |||
|
e1e484e046 | ||
516e7855a0 | |||
a08a03c1c8 | |||
016f152fef | |||
|
c024350882 | ||
6ec1f00df9 | |||
|
58aa909473 | ||
1650ff34aa | |||
aac414ecd5 | |||
181a9703a5 | |||
910bf5e118 | |||
7e1ed1a241 | |||
45b1012632 | |||
2c5fe64779 | |||
0631c80ebb | |||
c931b2622c | |||
7a92435f9f | |||
|
4b898fdc95 | ||
62ff2ec979 | |||
6476caf9b9 | |||
92a0eb0c0b | |||
6fbddeb2a9 | |||
|
00a8764edb | ||
c9a992bf6b | |||
|
fff4e6d3fa | ||
6f277f6ccd | |||
|
f56720289b | ||
|
04cd471765 | ||
|
cb94fd8e02 | ||
|
98563e2e60 | ||
|
c6a44ea2b3 | ||
|
bb78a4ffb3 | ||
|
84ecba8714 | ||
|
b7f214a212 | ||
|
c758c27e98 | ||
|
ed2efc4d1d | ||
|
316836aca7 | ||
|
0534f31c34 | ||
91453308fe |
110 changed files with 5628 additions and 4790 deletions
36
.github/workflows/ci.yml
vendored
Normal file
36
.github/workflows/ci.yml
vendored
Normal file
|
@ -0,0 +1,36 @@
|
|||
name: ci
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
tags-ignore:
|
||||
- '*.*'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
php-version: ['7.3', '7.4', '8.0', '8.1']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup PHP ${{ matrix.php-version }}
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php-version }}
|
||||
tools: composer:v1
|
||||
- name: Composer cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ env.HOME }}/.composer/cache
|
||||
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
|
||||
- name: Install dependencies
|
||||
run: composer install -o
|
||||
- name: Phpstan analysis
|
||||
run: make stan
|
||||
- name: Run tests
|
||||
run: make test
|
||||
- name: Coverage
|
||||
run: bash <(curl -s https://codecov.io/bash)
|
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -194,4 +194,7 @@ build/*
|
|||
|
||||
# Test report & coverage
|
||||
test-report.xml
|
||||
.phpunit.result.cache
|
||||
clover.xml
|
||||
composer.lock
|
||||
docker-compose.yml
|
||||
|
|
19
.travis.yml
19
.travis.yml
|
@ -1,19 +0,0 @@
|
|||
language: php
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.composer/cache
|
||||
|
||||
php:
|
||||
- '7.1'
|
||||
- '7.2'
|
||||
- '7.3'
|
||||
|
||||
before_script:
|
||||
- flags="-o"
|
||||
- composer install $flags
|
||||
|
||||
script: make travis
|
||||
|
||||
after_success:
|
||||
- bash <(curl -s https://codecov.io/bash)
|
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2018-2019 RetailDriver LLC
|
||||
Copyright (c) 2018-2020 RetailDriver LLC
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
16
Makefile
16
Makefile
|
@ -1,18 +1,16 @@
|
|||
ROOT_DIR=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||
SRC_DIR=$(ROOT_DIR)/src
|
||||
BIN_DIR=$(ROOT_DIR)/vendor/bin
|
||||
ifneq ("$(wildcard docker-compose.yml)","")
|
||||
PHP=docker-compose run --rm --no-deps php php
|
||||
else
|
||||
PHP=php
|
||||
endif
|
||||
|
||||
test:
|
||||
@echo "==> Running tests"
|
||||
@cd $(ROOT_DIR)
|
||||
@cp .env.dist .env
|
||||
@php -d memory_limit=-1 $(BIN_DIR)/phpunit -c phpunit.xml.dist
|
||||
@$(PHP) -d memory_limit=-1 vendor/bin/phpunit -c phpunit.xml.dist
|
||||
@echo "==> Testing complete"
|
||||
|
||||
stan:
|
||||
@echo "==> Running analysis"
|
||||
@php $(BIN_DIR)/phpstan analyse
|
||||
@$(PHP) vendor/bin/phpstan analyse
|
||||
@echo "==> Analysis complete"
|
||||
|
||||
travis: test stan
|
||||
@echo "==> Completed"
|
||||
|
|
17
README.md
17
README.md
|
@ -1,16 +1,14 @@
|
|||
[](https://travis-ci.org/retailcrm/mg-bot-api-client-php)
|
||||
[](https://codecov.io/gh/retailcrm/mg-bot-api-client-php)
|
||||
[](https://packagist.org/packages/retailcrm/mg-bot-api-client-php)
|
||||
[](https://packagist.org/packages/retailcrm/mg-bot-api-client-php)
|
||||
[](https://github.com/retailcrm/mg-bot-api-client-php/actions)
|
||||
[](https://codecov.io/gh/retailcrm/mg-bot-api-client-php)
|
||||
[](https://packagist.org/packages/retailcrm/mg-bot-api-client-php)
|
||||
[](https://packagist.org/packages/retailcrm/mg-bot-api-client-php)
|
||||
|
||||
|
||||
# Message Gateway Bot API PHP client
|
||||
|
||||
This is php library for retailCRM MG Bot API.
|
||||
|
||||
## Requirements
|
||||
|
||||
* PHP 7.1 and above
|
||||
* PHP 7.3 and above
|
||||
* PHP's cURL support
|
||||
* PHP's JSON support
|
||||
|
||||
|
@ -53,8 +51,3 @@ try {
|
|||
|
||||
echo $response->getPreviousResponsible();
|
||||
```
|
||||
|
||||
### Documentation
|
||||
|
||||
* [English](https://139810.selcdn.ru/download/doc/mg-bot-api/bot.v1.en.html)
|
||||
* [Russian](https://help.retailcrm.ru/Developers/MgBot)
|
||||
|
|
|
@ -1,43 +1,50 @@
|
|||
{
|
||||
"name": "retailcrm/mg-bot-api-client-php",
|
||||
"description": "PHP client for retailCRM MG Bot API",
|
||||
"description": "PHP client for MG Bot API",
|
||||
"type": "library",
|
||||
"keywords": ["API", "retailCRM", "REST", "bot"],
|
||||
"keywords": ["API", "RetailCRM", "REST", "bot"],
|
||||
"homepage": "http://www.retailcrm.ru/",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "retailCRM",
|
||||
"email": "support@retailcrm.ru"
|
||||
"name": "RetailCRM",
|
||||
"email": "support@retailcrm.pro"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.1",
|
||||
"php": ">=7.3",
|
||||
"ext-curl": "*",
|
||||
"ext-json": "*",
|
||||
"jms/serializer": "1.14.*",
|
||||
"symfony/validator": "4.3.*",
|
||||
"doctrine/annotations": "1.6.*",
|
||||
"doctrine/cache": "1.6.*",
|
||||
"guzzlehttp/guzzle": "6.*"
|
||||
"jms/serializer": "3.*",
|
||||
"symfony/validator": "5.4.*|^6",
|
||||
"doctrine/annotations": "^1",
|
||||
"guzzlehttp/guzzle": "7.*",
|
||||
"symfony/intl": "5.4.*|^6",
|
||||
"symfony/cache": "5.4.*|^6"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpmd/phpmd": "2.*",
|
||||
"squizlabs/php_codesniffer": "3.4.*",
|
||||
"symfony/dotenv": "4.3.*",
|
||||
"phpunit/phpunit": "7.*",
|
||||
"phpstan/phpstan": "0.11.*"
|
||||
"symfony/dotenv": "5.4.*",
|
||||
"phpunit/phpunit": "^9",
|
||||
"phpstan/phpstan": "0.12.*"
|
||||
},
|
||||
"support": {
|
||||
"email": "support@retailcrm.ru"
|
||||
"email": "support@retailcrm.pro"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"RetailCrm\\Mg\\": ["src/", "tests/"],
|
||||
"RetailCrm\\Common\\": ["src/", "tests/"]
|
||||
"RetailCrm\\Mg\\": "src/",
|
||||
"RetailCrm\\Common\\": "src/"
|
||||
},
|
||||
"files": ["extra/autoloader.php"]
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"RetailCrm\\Mg\\": "tests/",
|
||||
"RetailCrm\\Common\\": "tests/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.x-dev"
|
||||
|
|
4023
composer.lock
generated
4023
composer.lock
generated
File diff suppressed because it is too large
Load diff
1932
phpstan-baseline.neon
Normal file
1932
phpstan-baseline.neon
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,7 @@
|
|||
includes:
|
||||
- phpstan-baseline.neon
|
||||
|
||||
parameters:
|
||||
autoload_files:
|
||||
- %currentWorkingDirectory%/vendor/autoload.php
|
||||
level: 7
|
||||
paths:
|
||||
- %currentWorkingDirectory%/src
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
|
||||
backupGlobals="false"
|
||||
colors="false"
|
||||
bootstrap="tests/bootstrap.php"
|
||||
|
@ -15,22 +13,21 @@
|
|||
stopOnFailure="false"
|
||||
stopOnIncomplete="false"
|
||||
stopOnSkipped="false"
|
||||
stopOnRisky="false"
|
||||
>
|
||||
<testsuites>
|
||||
<testsuite name="Project Test Suite">
|
||||
<directory>tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory>src</directory>
|
||||
</whitelist>
|
||||
</filter>
|
||||
|
||||
<logging>
|
||||
<log type="coverage-clover" target="clover.xml"/>
|
||||
<log type="junit" target="/tmp/logfile.xml"/>
|
||||
</logging>
|
||||
stopOnRisky="false">
|
||||
<coverage>
|
||||
<include>
|
||||
<directory>src</directory>
|
||||
</include>
|
||||
<report>
|
||||
<clover outputFile="clover.xml"/>
|
||||
</report>
|
||||
</coverage>
|
||||
<testsuites>
|
||||
<testsuite name="Project Test Suite">
|
||||
<directory>tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<logging>
|
||||
<junit outputFile="/tmp/logfile.xml"/>
|
||||
</logging>
|
||||
</phpunit>
|
||||
|
|
|
@ -6,17 +6,13 @@
|
|||
* Client
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use RetailCrm\Common\Url;
|
||||
use RetailCrm\Common\Serializer;
|
||||
use RetailCrm\Mg\Bot\Model\ModelAdapter;
|
||||
use RetailCrm\Common\Url;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Bot;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Channel\Channel;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Chat\Chat;
|
||||
|
@ -25,21 +21,22 @@ use RetailCrm\Mg\Bot\Model\Entity\Command;
|
|||
use RetailCrm\Mg\Bot\Model\Entity\Customer;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Dialog;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Message\Message;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Template\Template;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\User;
|
||||
use RetailCrm\Mg\Bot\Model\ModelAdapter;
|
||||
use RetailCrm\Mg\Bot\Model\ModelInterface;
|
||||
use RetailCrm\Mg\Bot\Model\Request\UploadFileByUrlRequest;
|
||||
use RetailCrm\Mg\Bot\Model\Response\AssignResponse;
|
||||
use RetailCrm\Mg\Bot\Model\Response\ErrorOnlyResponse;
|
||||
use RetailCrm\Mg\Bot\Model\Response\FullFileResponse;
|
||||
use RetailCrm\Mg\Bot\Model\Response\MessageSendResponse;
|
||||
use RetailCrm\Mg\Bot\Model\Response\UnassignResponse;
|
||||
use RetailCrm\Mg\Bot\Model\Response\UploadFileResponse;
|
||||
|
||||
/**
|
||||
* Class Client
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class Client
|
||||
{
|
||||
|
@ -276,6 +273,27 @@ class Client
|
|||
return $adapter->getResponseModel($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unassigning a dialog from a manager or a bot
|
||||
*
|
||||
* @param string $request Request parameters
|
||||
*
|
||||
* @return \RetailCrm\Mg\Bot\Model\ModelInterface
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function dialogUnassign(string $request)
|
||||
{
|
||||
$response = $this->client->makeRequest(
|
||||
sprintf("/dialogs/%d/unassign", $request),
|
||||
HttpClient::METHOD_PATCH,
|
||||
null
|
||||
);
|
||||
|
||||
$adapter = new ModelAdapter(UnassignResponse::class);
|
||||
|
||||
return $adapter->getResponseModel($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Close exact dialog
|
||||
*
|
||||
|
@ -297,6 +315,48 @@ class Client
|
|||
return $adapter->getResponseModel($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add tag to dialog
|
||||
*
|
||||
* @param Model\Request\DialogTagRequest $request Request parameters
|
||||
*
|
||||
* @return \RetailCrm\Mg\Bot\Model\ModelInterface
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function dialogAddTag(Model\Request\DialogTagRequest $request)
|
||||
{
|
||||
$response = $this->client->makeRequest(
|
||||
sprintf("/dialogs/%d/tags/add", $request->getDialogId()),
|
||||
HttpClient::METHOD_PATCH,
|
||||
$request
|
||||
);
|
||||
|
||||
$adapter = new ModelAdapter(ErrorOnlyResponse::class);
|
||||
|
||||
return $adapter->getResponseModel($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete tag from dialog
|
||||
*
|
||||
* @param Model\Request\DialogTagRequest $request Request parameters
|
||||
*
|
||||
* @return \RetailCrm\Mg\Bot\Model\ModelInterface
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function dialogDeleteTag(Model\Request\DialogTagRequest $request)
|
||||
{
|
||||
$response = $this->client->makeRequest(
|
||||
sprintf("/dialogs/%d/tags/delete", $request->getDialogId()),
|
||||
HttpClient::METHOD_PATCH,
|
||||
$request
|
||||
);
|
||||
|
||||
$adapter = new ModelAdapter(ErrorOnlyResponse::class);
|
||||
|
||||
return $adapter->getResponseModel($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns filtered members list
|
||||
*
|
||||
|
@ -402,6 +462,47 @@ class Client
|
|||
return $adapter->getResponseModel($response);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns templates list
|
||||
*
|
||||
* @return Template[]
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function templates(): array
|
||||
{
|
||||
$response = $this->client->makeRequest(
|
||||
'/templates',
|
||||
HttpClient::METHOD_GET
|
||||
);
|
||||
|
||||
$adapter = new ModelAdapter(Template::class);
|
||||
|
||||
return $adapter->getResponseList($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a template message
|
||||
*
|
||||
* @param string $templateId
|
||||
* @param Model\Request\TemplateSendRequest $request Request parameters
|
||||
*
|
||||
* @return \RetailCrm\Mg\Bot\Model\ModelInterface
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function templateSend(string $templateId, Model\Request\TemplateSendRequest $request): ModelInterface
|
||||
{
|
||||
$response = $this->client->makeRequest(
|
||||
sprintf('/templates/%d/send', $templateId),
|
||||
HttpClient::METHOD_POST,
|
||||
$request
|
||||
);
|
||||
|
||||
$adapter = new ModelAdapter(MessageSendResponse::class);
|
||||
|
||||
return $adapter->getResponseModel($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns filtered users list
|
||||
*
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* HttpClient
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot;
|
||||
|
@ -16,7 +13,12 @@ namespace RetailCrm\Mg\Bot;
|
|||
use BadMethodCallException;
|
||||
use ErrorException;
|
||||
use Exception;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
use GuzzleHttp\Psr7\Utils;
|
||||
use InvalidArgumentException;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use RetailCrm\Common\Exception\InvalidJsonException;
|
||||
use RetailCrm\Common\Exception\LimitException;
|
||||
use RetailCrm\Common\Exception\NotFoundException;
|
||||
|
@ -25,19 +27,11 @@ use RetailCrm\Common\Serializer;
|
|||
use RetailCrm\Common\Url;
|
||||
use RuntimeException;
|
||||
use Symfony\Component\Validator\Validation;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use function GuzzleHttp\Psr7\stream_for;
|
||||
|
||||
/**
|
||||
* Class HttpClient
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class HttpClient
|
||||
{
|
||||
|
@ -143,7 +137,7 @@ class HttpClient
|
|||
[self::METHOD_POST, self::METHOD_PUT, self::METHOD_PATCH, self::METHOD_DELETE]
|
||||
) && is_string($requestBody)
|
||||
) {
|
||||
$request = $request->withBody(stream_for($requestBody));
|
||||
$request = $request->withBody(Utils::streamFor($requestBody));
|
||||
}
|
||||
|
||||
$responseObject = null;
|
||||
|
@ -222,14 +216,15 @@ class HttpClient
|
|||
/**
|
||||
* Validate given class
|
||||
*
|
||||
* @param string $class
|
||||
* @param object $class
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function validateRequest($class)
|
||||
private function validateRequest(object $class)
|
||||
{
|
||||
$validator = Validation::createValidatorBuilder()
|
||||
->enableAnnotationMapping()
|
||||
->addDefaultDoctrineAnnotationReader()
|
||||
->getValidator();
|
||||
|
||||
$errors = $validator->validate($class);
|
||||
|
@ -238,7 +233,7 @@ class HttpClient
|
|||
$message = '';
|
||||
|
||||
foreach ($errors as $error) {
|
||||
$message .= (string)$error;
|
||||
$message .= $error->getMessage();
|
||||
}
|
||||
|
||||
throw new InvalidArgumentException($message);
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* Constants
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model;
|
||||
|
@ -17,9 +14,6 @@ namespace RetailCrm\Mg\Bot\Model;
|
|||
* Constants class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class Constants
|
||||
{
|
||||
|
@ -44,6 +38,7 @@ class Constants
|
|||
|
||||
const BOT_ROLE_DISTRIBUTOR = "distributor";
|
||||
const BOT_ROLE_RESPONSIBLE = "responsible";
|
||||
const BOT_ROLE_HIDDEN = "hidden";
|
||||
|
||||
const MESSAGE_SCOPE_PUBLIC = "public";
|
||||
const MESSAGE_SCOPE_PRIVATE = "private";
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* Bot entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity;
|
||||
|
@ -22,9 +19,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* Bot class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class Bot implements ModelInterface
|
||||
{
|
||||
|
@ -39,7 +33,7 @@ class Bot implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $createdAt
|
||||
*
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z', null, ['Y-m-d\TH:i:s\.u\Z', 'Y-m-d\TH:i:s\Z']>")
|
||||
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -48,7 +42,7 @@ class Bot implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $updatedAt
|
||||
*
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z', null, ['Y-m-d\TH:i:s\.u\Z', 'Y-m-d\TH:i:s\Z']>")
|
||||
* @Accessor(getter="getUpdatedAt",setter="setUpdatedAt")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -136,7 +130,7 @@ class Bot implements ModelInterface
|
|||
private $isSystem;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getId(): ?string
|
||||
{
|
||||
|
@ -184,7 +178,7 @@ class Bot implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getName(): ?string
|
||||
{
|
||||
|
@ -200,7 +194,7 @@ class Bot implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @return array|null
|
||||
*/
|
||||
public function getEvents(): ?array
|
||||
{
|
||||
|
@ -216,7 +210,7 @@ class Bot implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getClientId(): ?string
|
||||
{
|
||||
|
@ -232,7 +226,7 @@ class Bot implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getAvatarUrl(): ?string
|
||||
{
|
||||
|
@ -248,7 +242,7 @@ class Bot implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @return array|null
|
||||
*/
|
||||
public function getRoles(): ?array
|
||||
{
|
||||
|
@ -264,7 +258,7 @@ class Bot implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getDeactivatedAt(): ?string
|
||||
{
|
||||
|
@ -280,7 +274,7 @@ class Bot implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
* @return bool|null
|
||||
*/
|
||||
public function isActive(): ?bool
|
||||
{
|
||||
|
@ -296,7 +290,7 @@ class Bot implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
* @return bool|null
|
||||
*/
|
||||
public function isSelf(): ?bool
|
||||
{
|
||||
|
@ -312,7 +306,7 @@ class Bot implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
* @return bool|null
|
||||
*/
|
||||
public function isSystem(): ?bool
|
||||
{
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* Channel entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Channel
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity\Channel;
|
||||
|
@ -22,9 +19,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* Class Channel
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Channel
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class Channel implements ModelInterface
|
||||
{
|
||||
|
@ -39,7 +33,7 @@ class Channel implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $createdAt
|
||||
*
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z', null, ['Y-m-d\TH:i:s\.u\Z', 'Y-m-d\TH:i:s\Z']>")
|
||||
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
|
||||
*/
|
||||
private $createdAt;
|
||||
|
@ -47,7 +41,7 @@ class Channel implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $updatedAt
|
||||
*
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z', null, ['Y-m-d\TH:i:s\.u\Z', 'Y-m-d\TH:i:s\Z']>")
|
||||
* @Accessor(getter="getUpdatedAt",setter="setUpdatedAt")
|
||||
*/
|
||||
private $updatedAt;
|
||||
|
@ -55,7 +49,7 @@ class Channel implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $activatedAt
|
||||
*
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z', null, ['Y-m-d\TH:i:s\.u\Z', 'Y-m-d\TH:i:s\Z']>")
|
||||
* @Accessor(getter="getActivatedAt",setter="setActivatedAt")
|
||||
*/
|
||||
private $activatedAt;
|
||||
|
@ -63,7 +57,7 @@ class Channel implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $deactivatedAt
|
||||
*
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z', null, ['Y-m-d\TH:i:s\.u\Z', 'Y-m-d\TH:i:s\Z']>")
|
||||
* @Accessor(getter="getDeactivatedAt",setter="setDeactivatedAt")
|
||||
*/
|
||||
private $deactivatedAt;
|
||||
|
@ -101,7 +95,7 @@ class Channel implements ModelInterface
|
|||
private $name;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getId(): ?string
|
||||
{
|
||||
|
@ -181,7 +175,7 @@ class Channel implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
* @return bool|null
|
||||
*/
|
||||
public function isActive(): ?bool
|
||||
{
|
||||
|
@ -197,7 +191,7 @@ class Channel implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return ChannelSettings
|
||||
* @return ChannelSettings|null
|
||||
*/
|
||||
public function getSettings(): ?ChannelSettings
|
||||
{
|
||||
|
@ -213,7 +207,7 @@ class Channel implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getType(): ?string
|
||||
{
|
||||
|
@ -229,7 +223,7 @@ class Channel implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getName(): ?string
|
||||
{
|
||||
|
@ -239,7 +233,7 @@ class Channel implements ModelInterface
|
|||
/**
|
||||
* @param string $name
|
||||
*/
|
||||
public function setName(string $name)
|
||||
public function setName($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* ChannelSettings entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Channel
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity\Channel;
|
||||
|
@ -22,9 +19,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* Class ChannelSettings
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Channel
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class ChannelSettings implements ModelInterface
|
||||
{
|
||||
|
@ -90,7 +84,16 @@ class ChannelSettings implements ModelInterface
|
|||
private $file;
|
||||
|
||||
/**
|
||||
* @return ChannelSettingsStatus
|
||||
* @var ChannelSettingsSuggestions $suggestions
|
||||
*
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\Channel\ChannelSettingsSuggestions")
|
||||
* @Accessor(getter="getSuggestions",setter="setSuggestions")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $suggestions;
|
||||
|
||||
/**
|
||||
* @return ChannelSettingsStatus|null
|
||||
*/
|
||||
public function getStatus(): ?ChannelSettingsStatus
|
||||
{
|
||||
|
@ -106,7 +109,7 @@ class ChannelSettings implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
* @return bool|null
|
||||
*/
|
||||
public function isSpamAllowed(): ?bool
|
||||
{
|
||||
|
@ -122,7 +125,7 @@ class ChannelSettings implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return ChannelSettingsItem
|
||||
* @return ChannelSettingsItem|null
|
||||
*/
|
||||
public function getText(): ?ChannelSettingsItem
|
||||
{
|
||||
|
@ -138,7 +141,7 @@ class ChannelSettings implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return ChannelSettingsItem
|
||||
* @return ChannelSettingsItem|null
|
||||
*/
|
||||
public function getProduct(): ?ChannelSettingsItem
|
||||
{
|
||||
|
@ -154,7 +157,7 @@ class ChannelSettings implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return ChannelSettingsItem
|
||||
* @return ChannelSettingsItem|null
|
||||
*/
|
||||
public function getOrder(): ?ChannelSettingsItem
|
||||
{
|
||||
|
@ -170,7 +173,7 @@ class ChannelSettings implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return ChannelSettingsItem
|
||||
* @return ChannelSettingsItem|null
|
||||
*/
|
||||
public function getImage(): ?ChannelSettingsItem
|
||||
{
|
||||
|
@ -186,7 +189,7 @@ class ChannelSettings implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return ChannelSettingsItem
|
||||
* @return ChannelSettingsItem|null
|
||||
*/
|
||||
public function getFile(): ?ChannelSettingsItem
|
||||
{
|
||||
|
@ -200,4 +203,20 @@ class ChannelSettings implements ModelInterface
|
|||
{
|
||||
$this->file = $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ChannelSettingsSuggestions|null
|
||||
*/
|
||||
public function getSuggestions(): ?ChannelSettingsSuggestions
|
||||
{
|
||||
return $this->suggestions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ChannelSettingsSuggestions $suggestions
|
||||
*/
|
||||
public function setSuggestions(ChannelSettingsSuggestions $suggestions): void
|
||||
{
|
||||
$this->suggestions = $suggestions;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* ChannelSettingsItem entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Channel
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity\Channel;
|
||||
|
@ -22,9 +19,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* ChannelSettingsItem class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Channel
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class ChannelSettingsItem implements ModelInterface
|
||||
{
|
||||
|
@ -101,7 +95,7 @@ class ChannelSettingsItem implements ModelInterface
|
|||
private $noteMaxCharsCount;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getCreating(): ?string
|
||||
{
|
||||
|
@ -117,7 +111,7 @@ class ChannelSettingsItem implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getEditing(): ?string
|
||||
{
|
||||
|
@ -133,7 +127,7 @@ class ChannelSettingsItem implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getQuoting(): ?string
|
||||
{
|
||||
|
@ -149,7 +143,7 @@ class ChannelSettingsItem implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getDeleting(): ?string
|
||||
{
|
||||
|
@ -165,7 +159,7 @@ class ChannelSettingsItem implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getDelivered(): ?string
|
||||
{
|
||||
|
@ -181,7 +175,7 @@ class ChannelSettingsItem implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @return int|null
|
||||
*/
|
||||
public function getMaxCharsCount(): ?int
|
||||
{
|
||||
|
@ -197,7 +191,7 @@ class ChannelSettingsItem implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @return int|null
|
||||
*/
|
||||
public function getMaxItemsCount(): ?int
|
||||
{
|
||||
|
@ -213,7 +207,7 @@ class ChannelSettingsItem implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @return int|null
|
||||
*/
|
||||
public function getNoteMaxCharsCount(): ?int
|
||||
{
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* ChannelSettingsStatus entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Channel
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity\Channel;
|
||||
|
@ -22,9 +19,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* ChannelSettingsStatus class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Channel
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class ChannelSettingsStatus implements ModelInterface
|
||||
{
|
||||
|
@ -47,7 +41,7 @@ class ChannelSettingsStatus implements ModelInterface
|
|||
private $read;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getDelivered(): ?string
|
||||
{
|
||||
|
@ -63,7 +57,7 @@ class ChannelSettingsStatus implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getRead(): ?string
|
||||
{
|
||||
|
|
100
src/Bot/Model/Entity/Channel/ChannelSettingsSuggestions.php
Normal file
100
src/Bot/Model/Entity/Channel/ChannelSettingsSuggestions.php
Normal file
|
@ -0,0 +1,100 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHP version 7.1
|
||||
*
|
||||
* ChannelSettingsSuggestions entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Channel
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity\Channel;
|
||||
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
use JMS\Serializer\Annotation\Type;
|
||||
use RetailCrm\Mg\Bot\Model\ModelInterface;
|
||||
|
||||
/**
|
||||
* ChannelSettingsSuggestions class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Channel
|
||||
*/
|
||||
class ChannelSettingsSuggestions implements ModelInterface
|
||||
{
|
||||
/**
|
||||
* @var string $email
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getEmail", setter="setEmail")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $email;
|
||||
|
||||
/**
|
||||
* @var string $phone
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getPhone", setter="setPhone")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $phone;
|
||||
|
||||
/**
|
||||
* @var string $text
|
||||
*
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getText", setter="setText")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $text;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getEmail(): ?string
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $email
|
||||
*/
|
||||
public function setEmail(string $email): void
|
||||
{
|
||||
$this->email = $email;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getPhone(): ?string
|
||||
{
|
||||
return $this->phone;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $phone
|
||||
*/
|
||||
public function setPhone(string $phone): void
|
||||
{
|
||||
$this->phone = $phone;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getText(): ?string
|
||||
{
|
||||
return $this->text;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $text
|
||||
*/
|
||||
public function setText(string $text): void
|
||||
{
|
||||
$this->text = $text;
|
||||
}
|
||||
}
|
|
@ -6,9 +6,6 @@
|
|||
* Chat entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Chat
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity\Chat;
|
||||
|
@ -24,9 +21,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* Chat class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Chat
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class Chat implements ModelInterface
|
||||
{
|
||||
|
@ -41,7 +35,7 @@ class Chat implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $createdAt
|
||||
*
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z', null, ['Y-m-d\TH:i:s\.u\Z', 'Y-m-d\TH:i:s\Z']>")
|
||||
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
|
||||
*/
|
||||
private $createdAt;
|
||||
|
@ -49,7 +43,7 @@ class Chat implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $updatedAt
|
||||
*
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z', null, ['Y-m-d\TH:i:s\.u\Z', 'Y-m-d\TH:i:s\Z']>")
|
||||
* @Accessor(getter="getUpdatedAt",setter="setUpdatedAt")
|
||||
*/
|
||||
private $updatedAt;
|
||||
|
@ -106,7 +100,7 @@ class Chat implements ModelInterface
|
|||
/**
|
||||
* @var ChatLastMessage $lastMessage
|
||||
*
|
||||
* @Type("ChatLastMessage")
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\Chat\ChatLastMessage")
|
||||
* @Accessor(getter="getLastMessage",setter="setLastMessage")
|
||||
*/
|
||||
private $lastMessage;
|
||||
|
@ -119,6 +113,14 @@ class Chat implements ModelInterface
|
|||
*/
|
||||
private $lastActivity;
|
||||
|
||||
/**
|
||||
* @var \DateTime $replyDeadline
|
||||
*
|
||||
* @Type("DateTime<'Y-m-d\TH:i:sP'>")
|
||||
* @Accessor(getter="getReplyDeadline",setter="setReplyDeadline")
|
||||
*/
|
||||
private $replyDeadline;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
|
@ -168,7 +170,7 @@ class Chat implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getAvatar(): ?string
|
||||
{
|
||||
|
@ -184,7 +186,7 @@ class Chat implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getName(): ?string
|
||||
{
|
||||
|
@ -200,7 +202,7 @@ class Chat implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return Channel
|
||||
* @return Channel|null
|
||||
*/
|
||||
public function getChannel(): ?Channel
|
||||
{
|
||||
|
@ -216,7 +218,7 @@ class Chat implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @return array|null
|
||||
*/
|
||||
public function getMembers(): ?array
|
||||
{
|
||||
|
@ -232,7 +234,7 @@ class Chat implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return Customer
|
||||
* @return Customer|null
|
||||
*/
|
||||
public function getCustomer(): ?Customer
|
||||
{
|
||||
|
@ -248,7 +250,7 @@ class Chat implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @return int|null
|
||||
*/
|
||||
public function getAuthorId(): ?int
|
||||
{
|
||||
|
@ -264,7 +266,7 @@ class Chat implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return ChatLastMessage
|
||||
* @return ChatLastMessage|null
|
||||
*/
|
||||
public function getLastMessage(): ?ChatLastMessage
|
||||
{
|
||||
|
@ -294,4 +296,20 @@ class Chat implements ModelInterface
|
|||
{
|
||||
$this->lastActivity = $lastActivity;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getReplyDeadline(): ?\DateTime
|
||||
{
|
||||
return $this->replyDeadline;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \DateTime $replyDeadline
|
||||
*/
|
||||
public function setReplyDeadline(\DateTime $replyDeadline): void
|
||||
{
|
||||
$this->replyDeadline = $replyDeadline;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* ChatLastMessage entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Chat
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity\Chat;
|
||||
|
@ -16,15 +13,13 @@ namespace RetailCrm\Mg\Bot\Model\Entity\Chat;
|
|||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
use JMS\Serializer\Annotation\Type;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Customer;
|
||||
use RetailCrm\Mg\Bot\Model\ModelInterface;
|
||||
|
||||
/**
|
||||
* ChatLastMessage class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Chat
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class ChatLastMessage implements ModelInterface
|
||||
{
|
||||
|
@ -40,7 +35,7 @@ class ChatLastMessage implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $time
|
||||
*
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:sP'>")
|
||||
* @Accessor(getter="getTime",setter="setTime")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -55,6 +50,77 @@ class ChatLastMessage implements ModelInterface
|
|||
*/
|
||||
private $type;
|
||||
|
||||
/**
|
||||
* @var string $scope
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getScope",setter="setScope")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $scope;
|
||||
|
||||
/**
|
||||
* @var int $chatId
|
||||
*
|
||||
* @Type("int")
|
||||
* @Accessor(getter="getChatId",setter="setChatId")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $chatId;
|
||||
|
||||
/**
|
||||
* @var bool $isRead
|
||||
*
|
||||
* @Type("bool")
|
||||
* @Accessor(getter="getIsRead",setter="setIsRead")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $isRead;
|
||||
|
||||
/**
|
||||
* @var bool $isEdit
|
||||
*
|
||||
* @Type("bool")
|
||||
* @Accessor(getter="getIsEdit",setter="setIsEdit")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $isEdit;
|
||||
|
||||
/**
|
||||
* @var string $status
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getStatus",setter="setStatus")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $status;
|
||||
|
||||
/**
|
||||
* @var Customer $from
|
||||
*
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\Customer")
|
||||
* @Accessor(getter="getFrom",setter="setFrom")
|
||||
*/
|
||||
private $from;
|
||||
|
||||
/**
|
||||
* @var string $content
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getContent",setter="setContent")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $content;
|
||||
|
||||
/**
|
||||
* @var \RetailCrm\Mg\Bot\Model\Entity\Message\MessageQuote $quote
|
||||
*
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\Message\MessageQuote")
|
||||
* @Accessor(getter="getQuote",setter="setQuote")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $quote;
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
|
@ -88,7 +154,7 @@ class ChatLastMessage implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getType(): ?string
|
||||
{
|
||||
|
@ -102,4 +168,132 @@ class ChatLastMessage implements ModelInterface
|
|||
{
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getScope()
|
||||
{
|
||||
return $this->scope;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $scope
|
||||
*/
|
||||
public function setScope($scope): void
|
||||
{
|
||||
$this->scope = $scope;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getChatId()
|
||||
{
|
||||
return $this->chatId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $chatId
|
||||
*/
|
||||
public function setChatId($chatId): void
|
||||
{
|
||||
$this->chatId = $chatId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getIsRead()
|
||||
{
|
||||
return $this->isRead;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $isRead
|
||||
*/
|
||||
public function setIsRead($isRead): void
|
||||
{
|
||||
$this->isRead = $isRead;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getIsEdit()
|
||||
{
|
||||
return $this->isEdit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $isEdit
|
||||
*/
|
||||
public function setIsEdit($isEdit): void
|
||||
{
|
||||
$this->isEdit = $isEdit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getStatus()
|
||||
{
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $status
|
||||
*/
|
||||
public function setStatus($status): void
|
||||
{
|
||||
$this->status = $status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getFrom()
|
||||
{
|
||||
return $this->from;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $from
|
||||
*/
|
||||
public function setFrom($from): void
|
||||
{
|
||||
$this->from = $from;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getContent()
|
||||
{
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $content
|
||||
*/
|
||||
public function setContent($content): void
|
||||
{
|
||||
$this->content = $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getQuote()
|
||||
{
|
||||
return $this->quote;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $quote
|
||||
*/
|
||||
public function setQuote($quote): void
|
||||
{
|
||||
$this->quote = $quote;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* ChatMember entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Chat
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity\Chat;
|
||||
|
@ -22,9 +19,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* ChatMember class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Chat
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class ChatMember implements ModelInterface
|
||||
{
|
||||
|
@ -39,7 +33,7 @@ class ChatMember implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $createdAt
|
||||
*
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z', null, ['Y-m-d\TH:i:s\.u\Z', 'Y-m-d\TH:i:s\Z']>")
|
||||
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
|
||||
*/
|
||||
private $createdAt;
|
||||
|
@ -47,7 +41,7 @@ class ChatMember implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $updatedAt
|
||||
*
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z', null, ['Y-m-d\TH:i:s\.u\Z', 'Y-m-d\TH:i:s\Z']>")
|
||||
* @Accessor(getter="getUpdatedAt",setter="setUpdatedAt")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -138,7 +132,7 @@ class ChatMember implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @return int|null
|
||||
*/
|
||||
public function getChatId(): ?int
|
||||
{
|
||||
|
@ -154,7 +148,7 @@ class ChatMember implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @return int|null
|
||||
*/
|
||||
public function getUserId(): ?int
|
||||
{
|
||||
|
@ -170,7 +164,7 @@ class ChatMember implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
* @return bool|null
|
||||
*/
|
||||
public function isAuthor(): ?bool
|
||||
{
|
||||
|
@ -186,7 +180,7 @@ class ChatMember implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getState(): ?string
|
||||
{
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* Command entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity;
|
||||
|
@ -22,9 +19,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* Command class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class Command implements ModelInterface
|
||||
{
|
||||
|
@ -39,7 +33,7 @@ class Command implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $createdAt
|
||||
*
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z', null, ['Y-m-d\TH:i:s\.u\Z', 'Y-m-d\TH:i:s\Z']>")
|
||||
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
|
||||
*/
|
||||
private $createdAt;
|
||||
|
@ -47,7 +41,7 @@ class Command implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $updatedAt
|
||||
*
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z', null, ['Y-m-d\TH:i:s\.u\Z', 'Y-m-d\TH:i:s\Z']>")
|
||||
* @Accessor(getter="getUpdatedAt",setter="setUpdatedAt")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -72,7 +66,7 @@ class Command implements ModelInterface
|
|||
private $description;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getId(): ?string
|
||||
{
|
||||
|
@ -120,7 +114,7 @@ class Command implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getName(): ?string
|
||||
{
|
||||
|
@ -136,7 +130,7 @@ class Command implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getDescription(): ?string
|
||||
{
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* Customer entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity;
|
||||
|
@ -23,9 +20,6 @@ use JMS\Serializer\Annotation\Type;
|
|||
* Customer class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class Customer implements ModelInterface
|
||||
{
|
||||
|
@ -40,7 +34,7 @@ class Customer implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $createdAt
|
||||
*
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z', null, ['Y-m-d\TH:i:s\.u\Z', 'Y-m-d\TH:i:s\Z']>")
|
||||
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
|
||||
*/
|
||||
private $createdAt;
|
||||
|
@ -48,7 +42,7 @@ class Customer implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $updatedAt
|
||||
*
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z', null, ['Y-m-d\TH:i:s\.u\Z', 'Y-m-d\TH:i:s\Z']>")
|
||||
* @Accessor(getter="getUpdatedAt",setter="setUpdatedAt")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -174,7 +168,16 @@ class Customer implements ModelInterface
|
|||
private $email;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @var Utm $utm
|
||||
*
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\Utm")
|
||||
* @Accessor(getter="getUtm",setter="setUtm")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $utm;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getId(): ?string
|
||||
{
|
||||
|
@ -222,7 +225,7 @@ class Customer implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getExternalId(): ?string
|
||||
{
|
||||
|
@ -238,7 +241,7 @@ class Customer implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @return int|null
|
||||
*/
|
||||
public function getChannelId(): ?int
|
||||
{
|
||||
|
@ -254,7 +257,7 @@ class Customer implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getUsername(): ?string
|
||||
{
|
||||
|
@ -270,7 +273,7 @@ class Customer implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getFirstName(): ?string
|
||||
{
|
||||
|
@ -286,7 +289,7 @@ class Customer implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getLastName(): ?string
|
||||
{
|
||||
|
@ -302,7 +305,7 @@ class Customer implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getAvatarUrl(): ?string
|
||||
{
|
||||
|
@ -318,7 +321,7 @@ class Customer implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getProfileUrl(): ?string
|
||||
{
|
||||
|
@ -334,7 +337,7 @@ class Customer implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getRevokedAt(): ?string
|
||||
{
|
||||
|
@ -350,7 +353,7 @@ class Customer implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getCountry(): ?string
|
||||
{
|
||||
|
@ -366,7 +369,7 @@ class Customer implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getLanguage(): ?string
|
||||
{
|
||||
|
@ -382,7 +385,7 @@ class Customer implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getPhone(): ?string
|
||||
{
|
||||
|
@ -398,7 +401,7 @@ class Customer implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getEmail(): ?string
|
||||
{
|
||||
|
@ -412,4 +415,21 @@ class Customer implements ModelInterface
|
|||
{
|
||||
$this->email = $email;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Utm|null
|
||||
*/
|
||||
public function getUtm(): ?Utm
|
||||
{
|
||||
return $this->utm;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Utm $utm
|
||||
* @return void
|
||||
*/
|
||||
public function setUtm(Utm $utm): void
|
||||
{
|
||||
$this->utm = $utm;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* Dialog entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity;
|
||||
|
@ -22,9 +19,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* Dialog class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class Dialog implements ModelInterface
|
||||
{
|
||||
|
@ -39,7 +33,7 @@ class Dialog implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $createdAt
|
||||
*
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z', null, ['Y-m-d\TH:i:s\.u\Z', 'Y-m-d\TH:i:s\Z']>")
|
||||
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
|
||||
*/
|
||||
private $createdAt;
|
||||
|
@ -47,7 +41,7 @@ class Dialog implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $updatedAt
|
||||
*
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z', null, ['Y-m-d\TH:i:s\.u\Z', 'Y-m-d\TH:i:s\Z']>")
|
||||
* @Accessor(getter="getUpdatedAt",setter="setUpdatedAt")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -92,7 +86,7 @@ class Dialog implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $closedAt
|
||||
*
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z', null, ['Y-m-d\TH:i:s\.u\Z', 'Y-m-d\TH:i:s\Z']>")
|
||||
* @Accessor(getter="getClosedAt",setter="setClosedAt")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -126,7 +120,7 @@ class Dialog implements ModelInterface
|
|||
private $isActive;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getId(): ?string
|
||||
{
|
||||
|
@ -174,7 +168,7 @@ class Dialog implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @return int|null
|
||||
*/
|
||||
public function getBotId(): ?int
|
||||
{
|
||||
|
@ -190,7 +184,7 @@ class Dialog implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @return int|null
|
||||
*/
|
||||
public function getChatId(): ?int
|
||||
{
|
||||
|
@ -206,7 +200,7 @@ class Dialog implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @return int|null
|
||||
*/
|
||||
public function getBeginMessageId(): ?int
|
||||
{
|
||||
|
@ -222,7 +216,7 @@ class Dialog implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @return int|null
|
||||
*/
|
||||
public function getEndingMessageId(): ?int
|
||||
{
|
||||
|
@ -254,7 +248,7 @@ class Dialog implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
* @return bool|null
|
||||
*/
|
||||
public function isAssigned(): ?bool
|
||||
{
|
||||
|
@ -270,7 +264,7 @@ class Dialog implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return Responsible
|
||||
* @return Responsible|null
|
||||
*/
|
||||
public function getResponsible(): ?Responsible
|
||||
{
|
||||
|
@ -286,7 +280,7 @@ class Dialog implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
* @return bool|null
|
||||
*/
|
||||
public function isActive(): ?bool
|
||||
{
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* FileMeta entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity;
|
||||
|
@ -22,9 +19,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* FileMeta class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class FileMeta implements ModelInterface
|
||||
{
|
||||
|
@ -47,7 +41,7 @@ class FileMeta implements ModelInterface
|
|||
private $width;
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @return int|null
|
||||
*/
|
||||
public function getHeight(): ?int
|
||||
{
|
||||
|
@ -63,7 +57,7 @@ class FileMeta implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @return int|null
|
||||
*/
|
||||
public function getWidth(): ?int
|
||||
{
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* Item entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Message
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity\Message;
|
||||
|
@ -22,9 +19,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* Item class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Message
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class Item implements ModelInterface
|
||||
{
|
||||
|
@ -56,7 +50,16 @@ class Item implements ModelInterface
|
|||
private $caption;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @var string $transcription
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getTranscription",setter="setTranscription")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $transcription;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getId(): ?string
|
||||
{
|
||||
|
@ -72,7 +75,7 @@ class Item implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @return int|null
|
||||
*/
|
||||
public function getSize(): ?int
|
||||
{
|
||||
|
@ -88,7 +91,7 @@ class Item implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getCaption()
|
||||
{
|
||||
|
@ -102,4 +105,20 @@ class Item implements ModelInterface
|
|||
{
|
||||
$this->caption = $caption;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getTranscription(): ?string
|
||||
{
|
||||
return $this->transcription;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $transcription
|
||||
*/
|
||||
public function setTranscription(string $transcription): void
|
||||
{
|
||||
$this->transcription = $transcription;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* Message entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Message
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity\Message;
|
||||
|
@ -24,9 +21,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* Message class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Message
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class Message implements ModelInterface
|
||||
{
|
||||
|
@ -41,7 +35,7 @@ class Message implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $createdAt
|
||||
*
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z', null, ['Y-m-d\TH:i:s\.u\Z', 'Y-m-d\TH:i:s\Z']>")
|
||||
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
|
||||
*/
|
||||
private $createdAt;
|
||||
|
@ -49,7 +43,7 @@ class Message implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $updatedAt
|
||||
*
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z', null, ['Y-m-d\TH:i:s\.u\Z', 'Y-m-d\TH:i:s\Z']>")
|
||||
* @Accessor(getter="getUpdatedAt",setter="setUpdatedAt")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -127,11 +121,28 @@ class Message implements ModelInterface
|
|||
*/
|
||||
private $content;
|
||||
|
||||
/**
|
||||
* @var string $note
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getNote",setter="setNote")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $note;
|
||||
|
||||
/**
|
||||
* @var ?Quote $quote
|
||||
*
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\Message\Quote")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $quote;
|
||||
|
||||
/**
|
||||
* @var bool $isRead
|
||||
*
|
||||
* @Type("bool")
|
||||
* @Accessor(getter="getIsRead",setter="setIsRead")
|
||||
* @Accessor(getter="isRead",setter="setIsRead")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $isRead;
|
||||
|
@ -140,7 +151,7 @@ class Message implements ModelInterface
|
|||
* @var bool $isEdit
|
||||
*
|
||||
* @Type("bool")
|
||||
* @Accessor(getter="getIsEdit",setter="setIsEdit")
|
||||
* @Accessor(getter="isEdit",setter="setIsEdit")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $isEdit;
|
||||
|
@ -184,7 +195,7 @@ class Message implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $channelSentAt
|
||||
*
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z', null, ['Y-m-d\TH:i:s\.u\Z', 'Y-m-d\TH:i:s\Z']>")
|
||||
* @Accessor(getter="getChannelSentAt",setter="setChannelSentAt")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -273,7 +284,7 @@ class Message implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @return array|null
|
||||
*/
|
||||
public function getItems(): ?array
|
||||
{
|
||||
|
@ -289,7 +300,7 @@ class Message implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return User
|
||||
* @return User|null
|
||||
*/
|
||||
public function getFrom(): ?User
|
||||
{
|
||||
|
@ -321,7 +332,7 @@ class Message implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getType(): ?string
|
||||
{
|
||||
|
@ -337,7 +348,7 @@ class Message implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getScope(): ?string
|
||||
{
|
||||
|
@ -353,7 +364,7 @@ class Message implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @return int|null
|
||||
*/
|
||||
public function getChatId(): ?int
|
||||
{
|
||||
|
@ -369,7 +380,7 @@ class Message implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getContent(): ?string
|
||||
{
|
||||
|
@ -385,7 +396,35 @@ class Message implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
* @return string|null
|
||||
*/
|
||||
public function getNote(): ?string
|
||||
{
|
||||
return $this->note;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $note
|
||||
*/
|
||||
public function setNote(string $note): void
|
||||
{
|
||||
$this->note = $note;
|
||||
}
|
||||
|
||||
public function getQuote(): ?Quote
|
||||
{
|
||||
return $this->quote ?? null;
|
||||
}
|
||||
|
||||
public function setQuote(?Quote $quote): Message
|
||||
{
|
||||
$this->quote = $quote;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool|null
|
||||
*/
|
||||
public function isRead(): ?bool
|
||||
{
|
||||
|
@ -401,7 +440,7 @@ class Message implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
* @return bool|null
|
||||
*/
|
||||
public function isEdit(): ?bool
|
||||
{
|
||||
|
@ -417,7 +456,7 @@ class Message implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getStatus(): ?string
|
||||
{
|
||||
|
@ -433,7 +472,7 @@ class Message implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getAction(): ?string
|
||||
{
|
||||
|
@ -449,7 +488,7 @@ class Message implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return Dialog
|
||||
* @return Dialog|null
|
||||
*/
|
||||
public function getDialog(): ?Dialog
|
||||
{
|
||||
|
@ -465,7 +504,7 @@ class Message implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @return int|null
|
||||
*/
|
||||
public function getChannelId(): ?int
|
||||
{
|
||||
|
@ -497,7 +536,7 @@ class Message implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return MessageOrder
|
||||
* @return MessageOrder|null
|
||||
*/
|
||||
public function getOrder(): ?MessageOrder
|
||||
{
|
||||
|
@ -513,7 +552,7 @@ class Message implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return MessageProduct
|
||||
* @return MessageProduct|null
|
||||
*/
|
||||
public function getProduct(): ?MessageProduct
|
||||
{
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* MessageCost entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Message
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity\Message;
|
||||
|
@ -23,9 +20,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* MessageCost class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Message
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class MessageCost implements ModelInterface
|
||||
{
|
||||
|
@ -49,7 +43,7 @@ class MessageCost implements ModelInterface
|
|||
private $currency;
|
||||
|
||||
/**
|
||||
* @return float
|
||||
* @return float|null
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
|
@ -65,7 +59,7 @@ class MessageCost implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getCurrency()
|
||||
{
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* MessageDelivery entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Message
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity\Message;
|
||||
|
@ -23,9 +20,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* MessageDelivery class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Message
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class MessageDelivery implements ModelInterface
|
||||
{
|
||||
|
@ -68,7 +62,7 @@ class MessageDelivery implements ModelInterface
|
|||
private $comment;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
|
@ -84,7 +78,7 @@ class MessageDelivery implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return MessageCost
|
||||
* @return MessageCost|null
|
||||
*/
|
||||
public function getPrice()
|
||||
{
|
||||
|
@ -100,7 +94,7 @@ class MessageDelivery implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getAddress()
|
||||
{
|
||||
|
@ -116,7 +110,7 @@ class MessageDelivery implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getComment()
|
||||
{
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* MessageOrder entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Message
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity\Message;
|
||||
|
@ -22,9 +19,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* MessageOrder class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Message
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class MessageOrder implements ModelInterface
|
||||
{
|
||||
|
@ -101,7 +95,7 @@ class MessageOrder implements ModelInterface
|
|||
private $payments;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getNumber()
|
||||
{
|
||||
|
@ -117,7 +111,7 @@ class MessageOrder implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getUrl()
|
||||
{
|
||||
|
@ -133,7 +127,7 @@ class MessageOrder implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getDate()
|
||||
{
|
||||
|
@ -149,7 +143,7 @@ class MessageOrder implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return MessageCost
|
||||
* @return MessageCost|null
|
||||
*/
|
||||
public function getCost()
|
||||
{
|
||||
|
@ -165,7 +159,7 @@ class MessageOrder implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return MessageStatus
|
||||
* @return MessageStatus|null
|
||||
*/
|
||||
public function getStatus()
|
||||
{
|
||||
|
@ -181,7 +175,7 @@ class MessageOrder implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return MessageDelivery
|
||||
* @return MessageDelivery|null
|
||||
*/
|
||||
public function getDelivery()
|
||||
{
|
||||
|
@ -197,7 +191,7 @@ class MessageOrder implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @return array|null
|
||||
*/
|
||||
public function getItems()
|
||||
{
|
||||
|
@ -213,7 +207,7 @@ class MessageOrder implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @return array|null
|
||||
*/
|
||||
public function getPayments()
|
||||
{
|
||||
|
|
|
@ -4,11 +4,6 @@
|
|||
* PHP version 7.1
|
||||
*
|
||||
* MessageOrderItem entity
|
||||
*
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
*
|
||||
* @see http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity\Message;
|
||||
|
@ -20,11 +15,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
|
||||
/**
|
||||
* MessageOrderItem class
|
||||
*
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
*
|
||||
* @see http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class MessageOrderItem implements ModelInterface
|
||||
{
|
||||
|
@ -74,7 +64,7 @@ class MessageOrderItem implements ModelInterface
|
|||
private $quantity;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
|
@ -90,7 +80,7 @@ class MessageOrderItem implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getUrl()
|
||||
{
|
||||
|
@ -106,7 +96,7 @@ class MessageOrderItem implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getImg()
|
||||
{
|
||||
|
@ -122,7 +112,7 @@ class MessageOrderItem implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return MessageCost
|
||||
* @return MessageCost|null
|
||||
*/
|
||||
public function getPrice()
|
||||
{
|
||||
|
@ -138,7 +128,7 @@ class MessageOrderItem implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return MessageQuantity
|
||||
* @return MessageQuantity|null
|
||||
*/
|
||||
public function getQuantity()
|
||||
{
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* MessageOrderPaymentStatus entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Message
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity\Message;
|
||||
|
@ -22,9 +19,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* MessageOrderPaymentStatus class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Message
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class MessageOrderPaymentStatus implements ModelInterface
|
||||
{
|
||||
|
@ -47,7 +41,7 @@ class MessageOrderPaymentStatus implements ModelInterface
|
|||
private $payed;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getName(): ?string
|
||||
{
|
||||
|
@ -63,7 +57,7 @@ class MessageOrderPaymentStatus implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
* @return bool|null
|
||||
*/
|
||||
public function getPayed(): ?bool
|
||||
{
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* MessagePayment entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Message
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity\Message;
|
||||
|
@ -22,9 +19,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* MessagePayment class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Message
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class MessagePayment implements ModelInterface
|
||||
{
|
||||
|
@ -56,7 +50,7 @@ class MessagePayment implements ModelInterface
|
|||
private $amount;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
|
@ -72,7 +66,7 @@ class MessagePayment implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return MessageOrderPaymentStatus
|
||||
* @return MessageOrderPaymentStatus|null
|
||||
*/
|
||||
public function getStatus()
|
||||
{
|
||||
|
@ -88,7 +82,7 @@ class MessagePayment implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return MessageCost
|
||||
* @return MessageCost|null
|
||||
*/
|
||||
public function getAmount()
|
||||
{
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* MessageProduct entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Message
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity\Message;
|
||||
|
@ -22,9 +19,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* MessageProduct class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Message
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class MessageProduct implements ModelInterface
|
||||
{
|
||||
|
@ -108,7 +102,7 @@ class MessageProduct implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getName(): ?string
|
||||
{
|
||||
|
@ -124,7 +118,7 @@ class MessageProduct implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getArticle(): ?string
|
||||
{
|
||||
|
@ -140,7 +134,7 @@ class MessageProduct implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getUrl(): ?string
|
||||
{
|
||||
|
@ -156,7 +150,7 @@ class MessageProduct implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getImg(): ?string
|
||||
{
|
||||
|
@ -172,7 +166,7 @@ class MessageProduct implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return MessageCost
|
||||
* @return MessageCost|null
|
||||
*/
|
||||
public function getCost(): ?MessageCost
|
||||
{
|
||||
|
@ -188,7 +182,7 @@ class MessageProduct implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return MessageQuantity
|
||||
* @return MessageQuantity|null
|
||||
*/
|
||||
public function getQuantity(): ?MessageQuantity
|
||||
{
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* MessageQuantity entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Message
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity\Message;
|
||||
|
@ -23,9 +20,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* MessageQuantity class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Message
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class MessageQuantity implements ModelInterface
|
||||
{
|
||||
|
@ -49,7 +43,7 @@ class MessageQuantity implements ModelInterface
|
|||
private $unit;
|
||||
|
||||
/**
|
||||
* @return float
|
||||
* @return float|null
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
|
@ -65,7 +59,7 @@ class MessageQuantity implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getUnit()
|
||||
{
|
||||
|
|
172
src/Bot/Model/Entity/Message/MessageQuote.php
Normal file
172
src/Bot/Model/Entity/Message/MessageQuote.php
Normal file
|
@ -0,0 +1,172 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHP version 7.3
|
||||
*
|
||||
* @category MessageQuote
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Message
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity\Message;
|
||||
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
use JMS\Serializer\Annotation\Type;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\User;
|
||||
|
||||
/**
|
||||
* Class MessageQuote
|
||||
*
|
||||
* @category MessageQuote
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Message
|
||||
*/
|
||||
class MessageQuote
|
||||
{
|
||||
/**
|
||||
* @var int $id
|
||||
*
|
||||
* @Type("int")
|
||||
* @Accessor(getter="getId",setter="setId")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string $type
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getType",setter="setType")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $type;
|
||||
|
||||
/**
|
||||
* @var User $from
|
||||
*
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\User")
|
||||
* @Accessor(getter="getFrom",setter="setFrom")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $from;
|
||||
|
||||
/**
|
||||
* @var \DateTime $time
|
||||
*
|
||||
* @Type("DateTime<'Y-m-d\TH:i:sP'>")
|
||||
* @Accessor(getter="getTime",setter="setTime")
|
||||
*/
|
||||
private $time;
|
||||
|
||||
/**
|
||||
* @var string $content
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getContent",setter="setContent")
|
||||
*/
|
||||
private $content;
|
||||
|
||||
/**
|
||||
* @var object[] $items
|
||||
*
|
||||
* @Type("array")
|
||||
* @Accessor(getter="getItems",setter="setItems")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $items;
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getId(): int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
*/
|
||||
public function setId(int $id): void
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getType(): ?string
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $type
|
||||
*/
|
||||
public function setType(string $type): void
|
||||
{
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return User|null
|
||||
*/
|
||||
public function getFrom(): ?User
|
||||
{
|
||||
return $this->from;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param User $from
|
||||
*/
|
||||
public function setFrom(User $from): void
|
||||
{
|
||||
$this->from = $from;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getTime(): ?\DateTime
|
||||
{
|
||||
return $this->time;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \DateTime $time
|
||||
*/
|
||||
public function setTime(\DateTime $time): void
|
||||
{
|
||||
$this->time = $time;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getContent(): string
|
||||
{
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $content
|
||||
*/
|
||||
public function setContent(string $content): void
|
||||
{
|
||||
$this->content = $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return object[]|null
|
||||
*/
|
||||
public function getItems(): ?array
|
||||
{
|
||||
return $this->items;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param object[] $items
|
||||
*/
|
||||
public function setItems(array $items): void
|
||||
{
|
||||
$this->items = $items;
|
||||
}
|
||||
}
|
|
@ -6,9 +6,6 @@
|
|||
* MessageStatus entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Message
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity\Message;
|
||||
|
@ -22,9 +19,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* MessageStatus class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Message
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class MessageStatus implements ModelInterface
|
||||
{
|
||||
|
@ -47,7 +41,7 @@ class MessageStatus implements ModelInterface
|
|||
private $name;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getCode(): ?string
|
||||
{
|
||||
|
@ -63,7 +57,7 @@ class MessageStatus implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getName(): ?string
|
||||
{
|
||||
|
|
106
src/Bot/Model/Entity/Message/Quote.php
Normal file
106
src/Bot/Model/Entity/Message/Quote.php
Normal file
|
@ -0,0 +1,106 @@
|
|||
<?php
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity\Message;
|
||||
|
||||
use DateTime;
|
||||
use JMS\Serializer\Annotation as Serializer;
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
use JMS\Serializer\Annotation\Type;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\User;
|
||||
use RetailCrm\Mg\Bot\Model\ModelInterface;
|
||||
|
||||
class Quote implements ModelInterface
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @Type("integer")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @Type("string")
|
||||
*/
|
||||
private $type;
|
||||
|
||||
/**
|
||||
* @var User
|
||||
*
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\User")
|
||||
*/
|
||||
private $from;
|
||||
|
||||
/**
|
||||
* @var DateTime $time
|
||||
*
|
||||
* @Type("DateTime<'Y-m-d\TH:i:sP'>")
|
||||
* @Accessor(getter="getTime",setter="setTime")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $time;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @Type("string")
|
||||
*/
|
||||
private $content;
|
||||
|
||||
public function getId(): int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function setId(int $id): Quote
|
||||
{
|
||||
$this->id = $id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getType(): string
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
public function setType(string $type): Quote
|
||||
{
|
||||
$this->type = $type;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFrom(): User
|
||||
{
|
||||
return $this->from;
|
||||
}
|
||||
|
||||
public function setFrom(User $from): Quote
|
||||
{
|
||||
$this->from = $from;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTime(): DateTime
|
||||
{
|
||||
return $this->time;
|
||||
}
|
||||
|
||||
public function setTime(DateTime $time): Quote
|
||||
{
|
||||
$this->time = $time;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getContent(): string
|
||||
{
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
public function setContent(string $content): Quote
|
||||
{
|
||||
$this->content = $content;
|
||||
return $this;
|
||||
}
|
||||
}
|
74
src/Bot/Model/Entity/Message/Suggestion.php
Normal file
74
src/Bot/Model/Entity/Message/Suggestion.php
Normal file
|
@ -0,0 +1,74 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHP version 7.1
|
||||
*
|
||||
* Suggestion entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Message
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity\Message;
|
||||
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
use JMS\Serializer\Annotation\Type;
|
||||
use RetailCrm\Mg\Bot\Model\ModelInterface;
|
||||
|
||||
/**
|
||||
* Suggestion class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Message
|
||||
*/
|
||||
class Suggestion implements ModelInterface
|
||||
{
|
||||
/**
|
||||
* @var string $title
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getTitle",setter="setTitle")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $title;
|
||||
|
||||
/**
|
||||
* @var string $type
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getType",setter="setType")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $type;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getTitle(): ?string
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $title
|
||||
*/
|
||||
public function setTitle(string $title)
|
||||
{
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getType(): ?string
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $type
|
||||
*/
|
||||
public function setType(string $type)
|
||||
{
|
||||
$this->type = $type;
|
||||
}
|
||||
}
|
50
src/Bot/Model/Entity/Message/TransportAttachments.php
Normal file
50
src/Bot/Model/Entity/Message/TransportAttachments.php
Normal file
|
@ -0,0 +1,50 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHP version 7.1
|
||||
*
|
||||
* TransportAttachments entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Message
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity\Message;
|
||||
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
use JMS\Serializer\Annotation\Type;
|
||||
use RetailCrm\Mg\Bot\Model\ModelInterface;
|
||||
|
||||
/**
|
||||
* TransportAttachments class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Message
|
||||
*/
|
||||
class TransportAttachments implements ModelInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* @var array $suggestions
|
||||
*
|
||||
* @Type("array")
|
||||
* @Accessor(getter="getSuggestions",setter="setSuggestions")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $suggestions;
|
||||
|
||||
/**
|
||||
* @param array $suggestions
|
||||
*/
|
||||
public function setSuggestions(array $suggestions): void
|
||||
{
|
||||
$this->suggestions = $suggestions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getSuggestions(): array
|
||||
{
|
||||
return $this->suggestions;
|
||||
}
|
||||
}
|
|
@ -6,9 +6,6 @@
|
|||
* Responsible entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity;
|
||||
|
@ -22,9 +19,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* Responsible class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class Responsible implements ModelInterface
|
||||
{
|
||||
|
@ -56,7 +50,16 @@ class Responsible implements ModelInterface
|
|||
private $type;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @var string $externalId
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getExternalId",setter="setExternalId")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $externalId;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getAssignedAt(): ?string
|
||||
{
|
||||
|
@ -72,7 +75,7 @@ class Responsible implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @return int|null
|
||||
*/
|
||||
public function getId(): ?int
|
||||
{
|
||||
|
@ -88,7 +91,7 @@ class Responsible implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getType(): ?string
|
||||
{
|
||||
|
@ -102,4 +105,20 @@ class Responsible implements ModelInterface
|
|||
{
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getExternalId(): ?string
|
||||
{
|
||||
return $this->externalId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $externalId
|
||||
*/
|
||||
public function setExternalId(string $externalId): void
|
||||
{
|
||||
$this->externalId = $externalId;
|
||||
}
|
||||
}
|
||||
|
|
78
src/Bot/Model/Entity/Tag.php
Normal file
78
src/Bot/Model/Entity/Tag.php
Normal file
|
@ -0,0 +1,78 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHP version 7.1
|
||||
*
|
||||
* Tag entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity;
|
||||
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
use JMS\Serializer\Annotation\Type;
|
||||
use RetailCrm\Mg\Bot\Model\ModelInterface;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* Tag class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity
|
||||
*/
|
||||
class Tag implements ModelInterface
|
||||
{
|
||||
/**
|
||||
* @var string $name
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getName",setter="setName")
|
||||
*
|
||||
* @Assert\NotBlank
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @var string $colorCode
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getColorCode",setter="setColorCode")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $colorCode;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @return void
|
||||
*/
|
||||
public function setName(string $name): void
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getColorCode(): ?string
|
||||
{
|
||||
return $this->colorCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $colorCode
|
||||
* @return void
|
||||
*/
|
||||
public function setColorCode(string $colorCode): void
|
||||
{
|
||||
$this->colorCode = $colorCode;
|
||||
}
|
||||
}
|
385
src/Bot/Model/Entity/Template/Template.php
Normal file
385
src/Bot/Model/Entity/Template/Template.php
Normal file
|
@ -0,0 +1,385 @@
|
|||
<?php
|
||||
|
||||
|
||||
/**
|
||||
* PHP version 7.1
|
||||
*
|
||||
* Template entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Template
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity\Template;
|
||||
|
||||
use RetailCrm\Mg\Bot\Model\ModelInterface;
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
use JMS\Serializer\Annotation\Type;
|
||||
|
||||
/**
|
||||
* Template class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Template
|
||||
*/
|
||||
class Template implements ModelInterface
|
||||
{
|
||||
/**
|
||||
* @var int $id
|
||||
*
|
||||
* @Type("int")
|
||||
* @Accessor(getter="getId",setter="setId")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string $code
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getCode",setter="setCode")
|
||||
*/
|
||||
private $code;
|
||||
|
||||
/**
|
||||
* @var int $channelId
|
||||
*
|
||||
* @Type("int")
|
||||
* @Accessor(getter="getChannelId",setter="setChannelId")
|
||||
*/
|
||||
private $channelId;
|
||||
|
||||
/**
|
||||
* @var string $name
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getName",setter="setName")
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @var bool $enabled
|
||||
*
|
||||
* @Type("bool")
|
||||
* @Accessor(getter="getEnabled",setter="setEnabled")
|
||||
*/
|
||||
private $enabled;
|
||||
|
||||
/**
|
||||
* @var string $type
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getType",setter="setType")
|
||||
*/
|
||||
private $type;
|
||||
|
||||
/**
|
||||
* @var array<string, string> $template
|
||||
*
|
||||
* @Type("array")
|
||||
* @Accessor(getter="getTemplate",setter="setTemplate")
|
||||
*/
|
||||
private $template;
|
||||
|
||||
/**
|
||||
* @var string $body
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getBody",setter="setBody")
|
||||
*/
|
||||
private $body;
|
||||
|
||||
/**
|
||||
* @var string $lang
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getLang",setter="setLang")
|
||||
*/
|
||||
private $lang;
|
||||
|
||||
/**
|
||||
* @var string $category
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getCategory",setter="setCategory")
|
||||
*/
|
||||
private $category;
|
||||
|
||||
/**
|
||||
* @var string $verificationStatus
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getVerificationStatus",setter="setVerificationStatus")
|
||||
*/
|
||||
private $verificationStatus;
|
||||
|
||||
/**
|
||||
* @var string $rejectionReason
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getRejectionReason",setter="setRejectionReason")
|
||||
*/
|
||||
private $rejectionReason;
|
||||
|
||||
/**
|
||||
* @var string $quality
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getQuality",setter="setQuality")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $quality;
|
||||
|
||||
/**
|
||||
* @var array<string, string> $header
|
||||
*
|
||||
* @Type("array")
|
||||
* @Accessor(getter="getHeader",setter="setHeader")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $header;
|
||||
|
||||
/**
|
||||
* @var array<string, array<string, string>> $buttons
|
||||
*
|
||||
* @Type("array")
|
||||
* @Accessor(getter="getButtons",setter="setButtons")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $buttons;
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
*/
|
||||
public function setId(int $id): void
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getCode(): ?string
|
||||
{
|
||||
return $this->code;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $code
|
||||
*/
|
||||
public function setCode(string $code): void
|
||||
{
|
||||
$this->code = $code;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
public function getChannelId(): ?int
|
||||
{
|
||||
return $this->channelId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $channelId
|
||||
*/
|
||||
public function setChannelId(int $channelId): void
|
||||
{
|
||||
$this->channelId = $channelId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*/
|
||||
public function setName(string $name): void
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool|null
|
||||
*/
|
||||
public function getEnabled(): ?bool
|
||||
{
|
||||
return $this->enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $enabled
|
||||
*/
|
||||
public function setEnabled(bool $enabled): void
|
||||
{
|
||||
$this->enabled = $enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getType(): ?string
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $type
|
||||
*/
|
||||
public function setType(string $type): void
|
||||
{
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>|null
|
||||
*/
|
||||
public function getTemplate(): ?array
|
||||
{
|
||||
return $this->template;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $template
|
||||
*/
|
||||
public function setTemplate(array $template): void
|
||||
{
|
||||
$this->template = $template;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getBody(): ?string
|
||||
{
|
||||
return $this->body;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $body
|
||||
*/
|
||||
public function setBody(string $body): void
|
||||
{
|
||||
$this->body = $body;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getVerificationStatus(): ?string
|
||||
{
|
||||
return $this->verificationStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $verificationStatus
|
||||
*/
|
||||
public function setVerificationStatus(string $verificationStatus): void
|
||||
{
|
||||
$this->verificationStatus = $verificationStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getLang(): ?string
|
||||
{
|
||||
return $this->lang;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $lang
|
||||
*/
|
||||
public function setLang(string $lang): void
|
||||
{
|
||||
$this->lang = $lang;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getCategory(): ?string
|
||||
{
|
||||
return $this->category;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $category
|
||||
*/
|
||||
public function setCategory(string $category): void
|
||||
{
|
||||
$this->category = $category;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getRejectionReason(): ?string
|
||||
{
|
||||
return $this->rejectionReason;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $rejectionReason
|
||||
*/
|
||||
public function setRejectionReason(string $rejectionReason): void
|
||||
{
|
||||
$this->rejectionReason = $rejectionReason;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getQuality(): ?string
|
||||
{
|
||||
return $this->quality;
|
||||
}
|
||||
|
||||
public function setQuality(string $quality): void
|
||||
{
|
||||
$this->quality = $quality;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>|null
|
||||
*/
|
||||
public function getHeader(): ?array
|
||||
{
|
||||
return $this->header;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $header
|
||||
*/
|
||||
public function setHeader(array $header): void
|
||||
{
|
||||
$this->header = $header;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<string, string>>|null
|
||||
*/
|
||||
public function getButtons(): ?array
|
||||
{
|
||||
return $this->buttons;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, array<string, string>> $buttons
|
||||
*/
|
||||
public function setButtons(array $buttons): void
|
||||
{
|
||||
$this->buttons = $buttons;
|
||||
}
|
||||
}
|
74
src/Bot/Model/Entity/Template/TemplateAttachment.php
Normal file
74
src/Bot/Model/Entity/Template/TemplateAttachment.php
Normal file
|
@ -0,0 +1,74 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHP version 7.1
|
||||
*
|
||||
* TemplateAttachment entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Template
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity\Template;
|
||||
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
use JMS\Serializer\Annotation\Type;
|
||||
use RetailCrm\Mg\Bot\Model\ModelInterface;
|
||||
|
||||
/**
|
||||
* TemplateAttachment class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Template
|
||||
*/
|
||||
class TemplateAttachment implements ModelInterface
|
||||
{
|
||||
/**
|
||||
* @var string $id
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getId",setter="setId")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string $caption
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getCaption",setter="setCaption")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $caption;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getId(): ?string
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id
|
||||
* @return void
|
||||
*/
|
||||
public function setId(string $id): void
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getCaption(): ?string
|
||||
{
|
||||
return $this->caption;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $caption
|
||||
*/
|
||||
public function setCaption(string $caption): void
|
||||
{
|
||||
$this->caption = $caption;
|
||||
}
|
||||
}
|
120
src/Bot/Model/Entity/Template/TemplateVariables.php
Normal file
120
src/Bot/Model/Entity/Template/TemplateVariables.php
Normal file
|
@ -0,0 +1,120 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHP version 7.1
|
||||
*
|
||||
* TemplateVariables entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Template
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity\Template;
|
||||
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
use JMS\Serializer\Annotation\Type;
|
||||
use RetailCrm\Mg\Bot\Model\ModelInterface;
|
||||
|
||||
/**
|
||||
* TemplateVariables class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Template
|
||||
*/
|
||||
class TemplateVariables implements ModelInterface
|
||||
{
|
||||
/**
|
||||
* @var array<string, string> $header
|
||||
*
|
||||
* @Type("array")
|
||||
* @Accessor(getter="getHeader",setter="setHeader")
|
||||
*/
|
||||
private $header;
|
||||
|
||||
|
||||
/** @var array<TemplateAttachment> $attachments
|
||||
*
|
||||
* @Type("array")
|
||||
* @Accessor(getter="getAttachments",setter="setAttachments")
|
||||
*/
|
||||
private $attachments;
|
||||
|
||||
/**
|
||||
* @var array<string, string> $body
|
||||
*
|
||||
* @Type("array")
|
||||
* @Accessor(getter="getBody",setter="setBody")
|
||||
*/
|
||||
private $body;
|
||||
|
||||
/**
|
||||
* @var array<string, array<string, string>> $buttons
|
||||
*
|
||||
* @Type("array")
|
||||
* @Accessor(getter="getButtons",setter="setButtons")
|
||||
*/
|
||||
private $buttons;
|
||||
|
||||
/**
|
||||
* @return array<string, string>|null
|
||||
*/
|
||||
public function getHeader(): ?array
|
||||
{
|
||||
return $this->header;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $header
|
||||
*/
|
||||
public function setHeader(array $header): void
|
||||
{
|
||||
$this->header = $header;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>|null
|
||||
*/
|
||||
public function getBody(): ?array
|
||||
{
|
||||
return $this->body;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $body
|
||||
*/
|
||||
public function setBody(array $body): void
|
||||
{
|
||||
$this->body = $body;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<string, string>>|null
|
||||
*/
|
||||
public function getButtons(): ?array
|
||||
{
|
||||
return $this->buttons;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, array<string, string>> $buttons
|
||||
*/
|
||||
public function setButtons(array $buttons): void
|
||||
{
|
||||
$this->buttons = $buttons;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return TemplateAttachment[]|null
|
||||
*/
|
||||
public function getAttachments(): ?array
|
||||
{
|
||||
return $this->attachments;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TemplateAttachment[] $attachments
|
||||
*/
|
||||
public function setAttachments(array $attachments): void
|
||||
{
|
||||
$this->attachments = $attachments;
|
||||
}
|
||||
}
|
|
@ -6,9 +6,6 @@
|
|||
* User entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity;
|
||||
|
@ -23,9 +20,6 @@ use JMS\Serializer\Annotation\Type;
|
|||
* User class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class User implements ModelInterface
|
||||
{
|
||||
|
@ -40,7 +34,7 @@ class User implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $createdAt
|
||||
*
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z', null, ['Y-m-d\TH:i:s\.u\Z', 'Y-m-d\TH:i:s\Z']>")
|
||||
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
|
||||
*/
|
||||
private $createdAt;
|
||||
|
@ -48,7 +42,7 @@ class User implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $updatedAt
|
||||
*
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z', null, ['Y-m-d\TH:i:s\.u\Z', 'Y-m-d\TH:i:s\Z']>")
|
||||
* @Accessor(getter="getUpdatedAt",setter="setUpdatedAt")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -142,14 +136,23 @@ class User implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $revokedAt
|
||||
*
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z', null, ['Y-m-d\TH:i:s\.u\Z', 'Y-m-d\TH:i:s\Z']>")
|
||||
* @Accessor(getter="getRevokedAt",setter="setRevokedAt")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $revokedAt;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @var bool $isSystem
|
||||
*
|
||||
* @Type("bool")
|
||||
* @Accessor(getter="isSystem",setter="setIsSystem")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $isSystem;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getId(): ?string
|
||||
{
|
||||
|
@ -197,7 +200,7 @@ class User implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getExternalId(): ?string
|
||||
{
|
||||
|
@ -213,7 +216,7 @@ class User implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getType(): ?string
|
||||
{
|
||||
|
@ -229,7 +232,7 @@ class User implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getAvatar(): ?string
|
||||
{
|
||||
|
@ -245,7 +248,7 @@ class User implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getName(): ?string
|
||||
{
|
||||
|
@ -261,7 +264,7 @@ class User implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getUsername(): ?string
|
||||
{
|
||||
|
@ -277,7 +280,7 @@ class User implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getFirstName(): ?string
|
||||
{
|
||||
|
@ -293,7 +296,7 @@ class User implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
public function getLastName(): ?string
|
||||
{
|
||||
|
@ -309,7 +312,7 @@ class User implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
* @return bool|null
|
||||
*/
|
||||
public function isActive(): ?bool
|
||||
{
|
||||
|
@ -325,7 +328,7 @@ class User implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
* @return bool|null
|
||||
*/
|
||||
public function isOnline(): ?bool
|
||||
{
|
||||
|
@ -355,4 +358,20 @@ class User implements ModelInterface
|
|||
{
|
||||
$this->revokedAt = $revokedAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool|null
|
||||
*/
|
||||
public function isSystem(): ?bool
|
||||
{
|
||||
return $this->isSystem;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $isSystem
|
||||
*/
|
||||
public function setIsSystem(bool $isSystem): void
|
||||
{
|
||||
$this->isSystem = $isSystem;
|
||||
}
|
||||
}
|
||||
|
|
154
src/Bot/Model/Entity/Utm.php
Normal file
154
src/Bot/Model/Entity/Utm.php
Normal file
|
@ -0,0 +1,154 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHP version 7.1
|
||||
*
|
||||
* Utm entity
|
||||
*
|
||||
* @package Retailcrm\Mg\Bot\Model\Entity
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity;
|
||||
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
use JMS\Serializer\Annotation\Type;
|
||||
use RetailCrm\Mg\Bot\Model\ModelInterface;
|
||||
|
||||
/**
|
||||
* Utm class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity
|
||||
*/
|
||||
class Utm implements ModelInterface
|
||||
{
|
||||
/**
|
||||
* @var string $campaign
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getCampaign",setter="setCampaign")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $campaign;
|
||||
|
||||
/**
|
||||
* @var string $content
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getContent",setter="setContent")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $content;
|
||||
|
||||
/**
|
||||
* @var string $medium
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getMedium",setter="setMedium")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $medium;
|
||||
|
||||
/**
|
||||
* @var string $source
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getSource",setter="setSource")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $source;
|
||||
|
||||
/**
|
||||
* @var string $term
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getTerm",setter="setTerm")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $term;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getCampaign(): ?string
|
||||
{
|
||||
return $this->campaign;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $campaign
|
||||
* @return void
|
||||
*/
|
||||
public function setCampaign(string $campaign): void
|
||||
{
|
||||
$this->campaign = $campaign;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getContent(): ?string
|
||||
{
|
||||
return $this->content;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $content
|
||||
* @return void
|
||||
*/
|
||||
public function setContent(string $content): void
|
||||
{
|
||||
$this->content = $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getMedium(): ?string
|
||||
{
|
||||
return $this->medium;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $medium
|
||||
* @return void
|
||||
*/
|
||||
public function setMedium(string $medium): void
|
||||
{
|
||||
$this->medium = $medium;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getSource(): ?string
|
||||
{
|
||||
return $this->source;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $source
|
||||
* @return void
|
||||
*/
|
||||
public function setSource(string $source): void
|
||||
{
|
||||
$this->source = $source;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getTerm(): ?string
|
||||
{
|
||||
return $this->term;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $term
|
||||
* @return void
|
||||
*/
|
||||
public function setTerm(string $term): void
|
||||
{
|
||||
$this->term = $term;
|
||||
}
|
||||
}
|
|
@ -6,9 +6,6 @@
|
|||
* ModelAdapter
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Adapter
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model;
|
||||
|
@ -21,9 +18,6 @@ use RetailCrm\Common\Serializer;
|
|||
* Class ModelAdapter
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Adapter
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class ModelAdapter
|
||||
{
|
||||
|
|
|
@ -5,14 +5,10 @@
|
|||
* ModelInterface
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model;
|
||||
|
||||
|
||||
interface ModelInterface
|
||||
{
|
||||
}
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* Bots Request
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Request;
|
||||
|
@ -22,13 +19,11 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* BotsRequest class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class BotsRequest implements ModelInterface
|
||||
{
|
||||
use CommonFields;
|
||||
use PageLimit;
|
||||
|
||||
/**
|
||||
* @Type("int")
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* Channels list request
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Request;
|
||||
|
@ -22,13 +19,11 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* ChannelsRequest class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class ChannelsRequest implements ModelInterface
|
||||
{
|
||||
use CommonFields;
|
||||
use PageLimit;
|
||||
|
||||
/**
|
||||
* @Type("array")
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* Chats list request
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Request;
|
||||
|
@ -22,13 +19,12 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* ChatsRequest class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class ChatsRequest implements ModelInterface
|
||||
{
|
||||
use CommonFields;
|
||||
use PageLimit;
|
||||
use IncludeMassCommunication;
|
||||
|
||||
/**
|
||||
* @Type("int")
|
||||
|
@ -44,6 +40,24 @@ class ChatsRequest implements ModelInterface
|
|||
*/
|
||||
private $channelType;
|
||||
|
||||
/**
|
||||
* @var int $customerId
|
||||
*
|
||||
* @Type("int")
|
||||
* @Accessor(getter="getCustomerId",setter="setCustomerId")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $customerId;
|
||||
|
||||
/**
|
||||
* @var int $sinceId
|
||||
*
|
||||
* @Type("int")
|
||||
* @Accessor(getter="getSinceId",setter="setSinceId")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $sinceId;
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
|
@ -75,4 +89,38 @@ class ChatsRequest implements ModelInterface
|
|||
{
|
||||
$this->channelType = $channelType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
public function getCustomerId(): ?int
|
||||
{
|
||||
return $this->customerId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $customerId
|
||||
* @return void
|
||||
*/
|
||||
public function setCustomerId($customerId)
|
||||
{
|
||||
$this->customerId = $customerId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
public function getSinceId()
|
||||
{
|
||||
return $this->sinceId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $sinceId
|
||||
* @return void
|
||||
*/
|
||||
public function setSinceId($sinceId)
|
||||
{
|
||||
$this->sinceId = $sinceId;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* Edit Command Request
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Request;
|
||||
|
@ -22,9 +19,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* CommandEditRequest class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class CommandEditRequest implements ModelInterface
|
||||
{
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* Commands list request
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Request;
|
||||
|
@ -22,9 +19,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* CommandsRequest class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class CommandsRequest implements ModelInterface
|
||||
{
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* Common fields
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Request;
|
||||
|
@ -21,9 +18,6 @@ use JMS\Serializer\Annotation\Type;
|
|||
* CommonFields trait
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
trait CommonFields
|
||||
{
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* Customers list request
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Request;
|
||||
|
@ -22,13 +19,11 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* CustomersRequest class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class CustomersRequest implements ModelInterface
|
||||
{
|
||||
use CommonFields;
|
||||
use PageLimit;
|
||||
|
||||
/**
|
||||
* @Type("string")
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* Dialog assign request
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Request;
|
||||
|
@ -23,9 +20,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* DialogAssignRequest class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class DialogAssignRequest implements ModelInterface
|
||||
{
|
||||
|
|
78
src/Bot/Model/Request/DialogTagRequest.php
Normal file
78
src/Bot/Model/Request/DialogTagRequest.php
Normal file
|
@ -0,0 +1,78 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHP version 7.1
|
||||
*
|
||||
* Dialog add or delete tag request
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Request;
|
||||
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
use JMS\Serializer\Annotation\Type;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Tag;
|
||||
use RetailCrm\Mg\Bot\Model\ModelInterface;
|
||||
|
||||
/**
|
||||
* DialogTagRequest class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
*/
|
||||
class DialogTagRequest implements ModelInterface
|
||||
{
|
||||
/**
|
||||
* @var int $dialogId
|
||||
*
|
||||
* @Type("int")
|
||||
* @Accessor(getter="getDialogId", setter="setDialogId")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $dialogId;
|
||||
|
||||
/**
|
||||
* @var Tag[] $tags
|
||||
*
|
||||
* @Type("array")
|
||||
* @Accessor(getter="getTags", setter="setTags")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $tags;
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getDialogId(): int
|
||||
{
|
||||
return $this->dialogId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $dialogId
|
||||
* @return void
|
||||
*/
|
||||
public function setDialogId(int $dialogId): void
|
||||
{
|
||||
$this->dialogId = $dialogId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Tag[]
|
||||
*/
|
||||
public function getTags(): array
|
||||
{
|
||||
return $this->tags;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Tag[] $tags
|
||||
* @return void
|
||||
*/
|
||||
public function setTags(array $tags): void
|
||||
{
|
||||
$this->tags = $tags;
|
||||
}
|
||||
|
||||
}
|
|
@ -6,9 +6,6 @@
|
|||
* Dialogs list request
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Request;
|
||||
|
@ -22,13 +19,21 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* DialogsRequest class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class DialogsRequest implements ModelInterface
|
||||
{
|
||||
use CommonFields;
|
||||
use PageLimit;
|
||||
use IncludeMassCommunication;
|
||||
|
||||
/**
|
||||
* @var int $sinceId
|
||||
*
|
||||
* @Type("int")
|
||||
* @Accessor(getter="getSinceId",setter="setSinceId")
|
||||
* @SkipWhenEmpty
|
||||
*/
|
||||
private $sinceId;
|
||||
|
||||
/**
|
||||
* @var int $chatId
|
||||
|
@ -75,6 +80,22 @@ class DialogsRequest implements ModelInterface
|
|||
*/
|
||||
private $assign;
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getSinceId()
|
||||
{
|
||||
return $this->sinceId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $sinceId
|
||||
*/
|
||||
public function setSinceId(int $sinceId)
|
||||
{
|
||||
$this->sinceId = $sinceId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
|
|
48
src/Bot/Model/Request/IncludeMassCommunication.php
Normal file
48
src/Bot/Model/Request/IncludeMassCommunication.php
Normal file
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHP version 7.1
|
||||
*
|
||||
* Common fields
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Request;
|
||||
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
use JMS\Serializer\Annotation\Type;
|
||||
|
||||
/**
|
||||
* CommonFields trait
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
*/
|
||||
trait IncludeMassCommunication
|
||||
{
|
||||
/**
|
||||
* @var int $includeMassCommunication
|
||||
*
|
||||
* @Type("int")
|
||||
* @Accessor(getter="getIncludeMassCommunication",setter="setIncludeMassCommunication")
|
||||
* @SkipWhenEmpty
|
||||
*/
|
||||
private $includeMassCommunication;
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getIncludeMassCommunication()
|
||||
{
|
||||
return $this->includeMassCommunication;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $includeMassCommunication
|
||||
*/
|
||||
public function setIncludeMassCommunication(?int $includeMassCommunication): void
|
||||
{
|
||||
$this->includeMassCommunication = $includeMassCommunication;
|
||||
}
|
||||
}
|
|
@ -6,9 +6,6 @@
|
|||
* Bot info request
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Request;
|
||||
|
@ -22,9 +19,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* InfoRequest class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class InfoRequest implements ModelInterface
|
||||
{
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* Members list request
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Request;
|
||||
|
@ -22,12 +19,12 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* MembersRequest class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class MembersRequest implements ModelInterface
|
||||
{
|
||||
use CommonFields;
|
||||
use PageLimit;
|
||||
|
||||
/**
|
||||
* @var int $chatId
|
||||
*
|
||||
|
@ -55,24 +52,6 @@ class MembersRequest implements ModelInterface
|
|||
*/
|
||||
private $state;
|
||||
|
||||
/**
|
||||
* @var string $since
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getSince",setter="setSince")
|
||||
* @SkipWhenEmpty
|
||||
*/
|
||||
private $since;
|
||||
|
||||
/**
|
||||
* @var string $until
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getUntil",setter="setUntil")
|
||||
* @SkipWhenEmpty
|
||||
*/
|
||||
private $until;
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
|
@ -120,36 +99,4 @@ class MembersRequest implements ModelInterface
|
|||
{
|
||||
$this->state = $state;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getSince()
|
||||
{
|
||||
return $this->since;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $since
|
||||
*/
|
||||
public function setSince(string $since)
|
||||
{
|
||||
$this->since = $since;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getUntil()
|
||||
{
|
||||
return $this->until;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $until
|
||||
*/
|
||||
public function setUntil(string $until)
|
||||
{
|
||||
$this->until = $until;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* Messages edit request
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Request;
|
||||
|
@ -22,9 +19,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* MessageEditRequest class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class MessageEditRequest implements ModelInterface
|
||||
{
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* Messages send request
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Request;
|
||||
|
@ -19,6 +16,7 @@ use JMS\Serializer\Annotation\SkipWhenEmpty;
|
|||
use JMS\Serializer\Annotation\Type;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Message\MessageOrder;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Message\MessageProduct;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Message\TransportAttachments;
|
||||
use RetailCrm\Mg\Bot\Model\ModelInterface;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
|
@ -26,9 +24,6 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||
* MessageSendRequest class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class MessageSendRequest implements ModelInterface
|
||||
{
|
||||
|
@ -77,6 +72,15 @@ class MessageSendRequest implements ModelInterface
|
|||
*/
|
||||
private $items;
|
||||
|
||||
/**
|
||||
* @var string $note
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getNote",setter="setNote")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $note;
|
||||
|
||||
/**
|
||||
* @var string $scope
|
||||
*
|
||||
|
@ -87,6 +91,16 @@ class MessageSendRequest implements ModelInterface
|
|||
*/
|
||||
private $scope;
|
||||
|
||||
|
||||
/**
|
||||
* @var TransportAttachments $transportAttachments
|
||||
*
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\Message\TransportAttachments")
|
||||
* @Accessor(getter="getTransportAttachments",setter="setTransportAttachments")
|
||||
* @SkipWhenEmpty
|
||||
*/
|
||||
private $transportAttachments;
|
||||
|
||||
/**
|
||||
* @var int $chatId
|
||||
*
|
||||
|
@ -140,6 +154,22 @@ class MessageSendRequest implements ModelInterface
|
|||
$this->scope = $scope;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return TransportAttachments
|
||||
*/
|
||||
public function getTransportAttachments()
|
||||
{
|
||||
return $this->transportAttachments;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TransportAttachments $transportAttachments
|
||||
*/
|
||||
public function setTransportAttachments(TransportAttachments $transportAttachments)
|
||||
{
|
||||
$this->transportAttachments = $transportAttachments;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
|
@ -220,6 +250,22 @@ class MessageSendRequest implements ModelInterface
|
|||
$this->items = $items;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null|string
|
||||
*/
|
||||
public function getNote(): ?string
|
||||
{
|
||||
return $this->note;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $note
|
||||
*/
|
||||
public function setNote(string $note): void
|
||||
{
|
||||
$this->note = $note;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* Messages list request
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Request;
|
||||
|
@ -22,13 +19,11 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* MessagesRequest class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class MessagesRequest implements ModelInterface
|
||||
{
|
||||
use CommonFields;
|
||||
use IncludeMassCommunication;
|
||||
|
||||
/**
|
||||
* @var int $chatId
|
||||
|
@ -111,6 +106,15 @@ class MessagesRequest implements ModelInterface
|
|||
*/
|
||||
private $type;
|
||||
|
||||
/**
|
||||
* @var int $limit
|
||||
*
|
||||
* @Type("int")
|
||||
* @Accessor(getter="getLimit",setter="setLimit")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $limit;
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
|
@ -254,4 +258,20 @@ class MessagesRequest implements ModelInterface
|
|||
{
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getLimit()
|
||||
{
|
||||
return $this->limit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $limit
|
||||
*/
|
||||
public function setLimit(int $limit)
|
||||
{
|
||||
$this->limit = $limit;
|
||||
}
|
||||
}
|
||||
|
|
49
src/Bot/Model/Request/PageLimit.php
Normal file
49
src/Bot/Model/Request/PageLimit.php
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHP version 7.1
|
||||
*
|
||||
* Page limit
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Request;
|
||||
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
use JMS\Serializer\Annotation\Type;
|
||||
|
||||
/**
|
||||
* PageLimit trait
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
*/
|
||||
trait PageLimit
|
||||
{
|
||||
/**
|
||||
* @var int $limit
|
||||
*
|
||||
* @Type("int")
|
||||
* @Accessor(getter="getLimit",setter="setLimit")
|
||||
* @SkipWhenEmpty
|
||||
*/
|
||||
private $limit;
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
*/
|
||||
public function getLimit(): ?int
|
||||
{
|
||||
return $this->limit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $limit
|
||||
* @return void
|
||||
*/
|
||||
public function setLimit($limit)
|
||||
{
|
||||
$this->limit = $limit;
|
||||
}
|
||||
}
|
77
src/Bot/Model/Request/TemplateSendRequest.php
Normal file
77
src/Bot/Model/Request/TemplateSendRequest.php
Normal file
|
@ -0,0 +1,77 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHP version 7.1
|
||||
*
|
||||
* Template send request
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Request;
|
||||
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
use JMS\Serializer\Annotation\Type;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Template\TemplateVariables;
|
||||
use RetailCrm\Mg\Bot\Model\ModelInterface;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
|
||||
/**
|
||||
* TemplateSendRequest class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
*/
|
||||
class TemplateSendRequest implements ModelInterface
|
||||
{
|
||||
/**
|
||||
* @var string $phone
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getPhone",setter="setPhone")
|
||||
*
|
||||
* @Assert\NotBlank
|
||||
*/
|
||||
private $phone;
|
||||
|
||||
/**
|
||||
* @var TemplateVariables $args
|
||||
*
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\Template\TemplateVariables")
|
||||
* @Accessor(getter="getArgs",setter="setArgs")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $args;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getPhone(): string
|
||||
{
|
||||
return $this->phone;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $phone
|
||||
*/
|
||||
public function setPhone(string $phone): void
|
||||
{
|
||||
$this->phone = $phone;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return TemplateVariables|null
|
||||
*/
|
||||
public function getArgs(): ?TemplateVariables
|
||||
{
|
||||
return $this->args;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param TemplateVariables $args
|
||||
*/
|
||||
public function setArgs(TemplateVariables $args): void
|
||||
{
|
||||
$this->args = $args;
|
||||
}
|
||||
}
|
|
@ -6,9 +6,6 @@
|
|||
* Upload file by url request
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Request;
|
||||
|
@ -22,9 +19,6 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||
* UploadFileByUrlRequest class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class UploadFileByUrlRequest implements ModelInterface
|
||||
{
|
||||
|
@ -33,7 +27,7 @@ class UploadFileByUrlRequest implements ModelInterface
|
|||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getUrl",setter="setUrl")
|
||||
* @Assert\NotBlank()
|
||||
* @Assert\NotBlank(allowNull=false)
|
||||
* @Assert\Url()
|
||||
*/
|
||||
private $url;
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* Users list request
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Request;
|
||||
|
@ -22,13 +19,11 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* UsersRequest class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Request
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class UsersRequest implements ModelInterface
|
||||
{
|
||||
use CommonFields;
|
||||
use PageLimit;
|
||||
|
||||
/**
|
||||
* @Type("string")
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* AssignResponse
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Response
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Response;
|
||||
|
@ -23,9 +20,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* AssignResponse class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Response
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class AssignResponse implements ModelInterface
|
||||
{
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* ErrorTrait
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Response
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Response;
|
||||
|
@ -22,9 +19,6 @@ use JMS\Serializer\Annotation\Type;
|
|||
* CommonFields trait
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Response
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
trait CommonFields
|
||||
{
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* ErrorOnlyResponse
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Response
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Response;
|
||||
|
@ -19,9 +16,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* ErrorOnlyResponse class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Response
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class ErrorOnlyResponse implements ModelInterface
|
||||
{
|
||||
|
|
|
@ -6,13 +6,11 @@
|
|||
* FullFileResponse
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Response
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Response;
|
||||
|
||||
use JMS\Serializer\Annotation\SerializedName;
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
use JMS\Serializer\Annotation\Type;
|
||||
|
@ -22,9 +20,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* FullFileResponse class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Response
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class FullFileResponse implements ModelInterface
|
||||
{
|
||||
|
@ -61,6 +56,7 @@ class FullFileResponse implements ModelInterface
|
|||
* @var string $url
|
||||
*
|
||||
* @Type("string")
|
||||
* @SerializedName("Url")
|
||||
* @Accessor(getter="getUrl",setter="setUrl")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* MessageSendResponse
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Response
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Response;
|
||||
|
@ -22,9 +19,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* MessageSendResponse class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Response
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class MessageSendResponse implements ModelInterface
|
||||
{
|
||||
|
|
52
src/Bot/Model/Response/UnassignResponse.php
Normal file
52
src/Bot/Model/Response/UnassignResponse.php
Normal file
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHP version 7.1
|
||||
*
|
||||
* UnassignResponse
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Response
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Response;
|
||||
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
use JMS\Serializer\Annotation\Type;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Responsible;
|
||||
use RetailCrm\Mg\Bot\Model\ModelInterface;
|
||||
|
||||
/**
|
||||
* UnassignResponse class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Response
|
||||
*/
|
||||
class UnassignResponse implements ModelInterface
|
||||
{
|
||||
use CommonFields;
|
||||
|
||||
/**
|
||||
* @var Responsible $previousResponsible
|
||||
*
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\Responsible")
|
||||
* @Accessor(getter="getPreviousResponsible",setter="setPreviousResponsible")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $previousResponsible;
|
||||
|
||||
/**
|
||||
* @return Responsible|null
|
||||
*/
|
||||
public function getPreviousResponsible(): ?Responsible
|
||||
{
|
||||
return $this->previousResponsible;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Responsible $previousResponsible
|
||||
*/
|
||||
public function setPreviousResponsible(Responsible $previousResponsible)
|
||||
{
|
||||
$this->previousResponsible = $previousResponsible;
|
||||
}
|
||||
}
|
|
@ -6,9 +6,6 @@
|
|||
* UploadFileResponse
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Response
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Model\Response;
|
||||
|
@ -23,9 +20,6 @@ use RetailCrm\Mg\Bot\Model\ModelInterface;
|
|||
* UploadFileResponse class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Response
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class UploadFileResponse implements ModelInterface
|
||||
{
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* InvalidJsonException
|
||||
*
|
||||
* @package RetailCrm\Common\Exception
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Common\Exception;
|
||||
|
@ -20,9 +17,6 @@ use Throwable;
|
|||
* Class InvalidJsonException
|
||||
*
|
||||
* @package RetailCrm\Common\Exception
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class InvalidJsonException extends DomainException implements Throwable
|
||||
{
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* LimitException
|
||||
*
|
||||
* @package RetailCrm\Common\Exception
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Common\Exception;
|
||||
|
@ -20,9 +17,6 @@ use Throwable;
|
|||
* Class LimitException
|
||||
*
|
||||
* @package RetailCrm\Common\Exception
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class LimitException extends DomainException implements Throwable
|
||||
{
|
||||
|
|
|
@ -5,9 +5,6 @@
|
|||
* NotFoundException
|
||||
*
|
||||
* @package RetailCrm\Common\Exception
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Common\Exception;
|
||||
|
@ -19,9 +16,6 @@ use Throwable;
|
|||
* Class NotFoundException
|
||||
*
|
||||
* @package RetailCrm\Common\Exception
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class NotFoundException extends DomainException implements Throwable
|
||||
{
|
||||
|
|
|
@ -5,9 +5,6 @@
|
|||
* UnauthorizedException
|
||||
*
|
||||
* @package RetailCrm\Common\Exception
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Common\Exception;
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* Register
|
||||
*
|
||||
* @package RetailCrm\Common
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Common;
|
||||
|
@ -23,9 +20,6 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||
* Class Register
|
||||
*
|
||||
* @package RetailCrm\Common
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class Register
|
||||
{
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* Serializer
|
||||
*
|
||||
* @package RetailCrm\Common
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Common;
|
||||
|
@ -23,9 +20,6 @@ use RetailCrm\Mg\Bot\Model\Response\ErrorOnlyResponse;
|
|||
* Class Serializer
|
||||
*
|
||||
* @package RetailCrm\Common
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class Serializer
|
||||
{
|
||||
|
@ -46,14 +40,16 @@ class Serializer
|
|||
$serializer = SerializerBuilder::create()->build();
|
||||
$context = self::getContext(false);
|
||||
|
||||
switch ($serialize) {
|
||||
case self::S_ARRAY:
|
||||
$serialized = $serializer->toArray($request, $context);
|
||||
break;
|
||||
case self::S_JSON:
|
||||
default:
|
||||
$serialized = $serializer->serialize($request, $serialize, $context);
|
||||
break;
|
||||
if ($context instanceof SerializationContext) {
|
||||
switch ($serialize) {
|
||||
case self::S_ARRAY:
|
||||
$serialized = $serializer->toArray($request, $context);
|
||||
break;
|
||||
case self::S_JSON:
|
||||
default:
|
||||
$serialized = $serializer->serialize($request, $serialize, $context);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $serialized;
|
||||
|
@ -74,15 +70,20 @@ class Serializer
|
|||
$serializer = SerializerBuilder::create()->build();
|
||||
$context = self::getContext(true);
|
||||
|
||||
switch ($from) {
|
||||
case self::S_ARRAY:
|
||||
$deserialized = $serializer
|
||||
->fromArray(array_filter($data), self::normalizeNamespace($entityType), $context);
|
||||
break;
|
||||
case self::S_JSON:
|
||||
$deserialized = $serializer
|
||||
->deserialize($data, self::normalizeNamespace($entityType), $from, $context);
|
||||
break;
|
||||
if ($context instanceof DeserializationContext) {
|
||||
switch ($from) {
|
||||
case self::S_ARRAY:
|
||||
$filtered = array_filter($data, static function ($el) {
|
||||
return $el !== null;
|
||||
});
|
||||
$deserialized = $serializer
|
||||
->fromArray($filtered, self::normalizeNamespace($entityType), $context);
|
||||
break;
|
||||
case self::S_JSON:
|
||||
$deserialized = $serializer
|
||||
->deserialize($data, self::normalizeNamespace($entityType), $from, $context);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $deserialized instanceof ModelInterface ? $deserialized : new ErrorOnlyResponse();
|
||||
|
@ -99,9 +100,9 @@ class Serializer
|
|||
$context = new DeserializationContext();
|
||||
} else {
|
||||
$context = new SerializationContext();
|
||||
}
|
||||
|
||||
$context->setSerializeNull(false);
|
||||
$context->setSerializeNull(false);
|
||||
}
|
||||
|
||||
return $context;
|
||||
}
|
||||
|
@ -109,7 +110,7 @@ class Serializer
|
|||
/**
|
||||
* @param string $namespace
|
||||
*
|
||||
* @return bool|string
|
||||
* @return string
|
||||
*/
|
||||
private static function normalizeNamespace(string $namespace)
|
||||
{
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* Url
|
||||
*
|
||||
* @package RetailCrm\Common
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Common;
|
||||
|
@ -17,9 +14,6 @@ namespace RetailCrm\Common;
|
|||
* Class Url
|
||||
*
|
||||
* @package RetailCrm\Common
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class Url
|
||||
{
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* Test case class
|
||||
*
|
||||
* @package Test
|
||||
* @author RetailCrm <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://www.retailcrm.ru/docs/Developers/ApiVersion5
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Test;
|
||||
|
@ -23,9 +20,6 @@ use RetailCrm\Mg\Bot\Client;
|
|||
* Class TestCase
|
||||
*
|
||||
* @package Test
|
||||
* @author RetailCrm <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://www.retailcrm.ru/docs/Developers/ApiVersion5
|
||||
*/
|
||||
class TestCase extends BaseCase
|
||||
{
|
||||
|
|
|
@ -6,13 +6,13 @@
|
|||
* Client Test
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Tests
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Tests;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use RetailCrm\Mg\Bot\Client;
|
||||
use RetailCrm\Mg\Bot\HttpClient;
|
||||
use RetailCrm\Mg\Bot\Model\Constants;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Channel;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Chat\Chat;
|
||||
|
@ -30,9 +30,6 @@ use RetailCrm\Mg\Bot\Test\TestCase;
|
|||
* Class ClientListTest
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Tests
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class ClientListTest extends TestCase
|
||||
{
|
||||
|
@ -55,8 +52,11 @@ class ClientListTest extends TestCase
|
|||
|
||||
$response = $client->channels($request);
|
||||
|
||||
static::assertEquals(4, count($response), "Incorrect channels count");
|
||||
static::assertTrue($response[0] instanceof Channel\Channel, "Incorrect channel instance");
|
||||
static::assertCount(5, $response, "Incorrect channels count");
|
||||
static::assertInstanceOf(Channel\Channel::class, $response[0], "Incorrect channel instance");
|
||||
|
||||
$textSuggestions = $response[0]->getSettings()->getSuggestions()->getText();
|
||||
static::assertStringContainsString("both", $textSuggestions, "Incorrect text suggestions");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -77,8 +77,29 @@ class ClientListTest extends TestCase
|
|||
|
||||
$response = $client->chats($request);
|
||||
|
||||
static::assertEquals(2, count($response), "Incorrect chats count");
|
||||
static::assertTrue($response[0] instanceof Chat, "Incorrect chat instance");
|
||||
static::assertCount(3, $response, "Incorrect chats count");
|
||||
static::assertInstanceOf(Chat::class, $response[0], "Incorrect chat instance");
|
||||
}
|
||||
|
||||
/**
|
||||
* @group("list")
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function testGetChatsByCustomerId(): void
|
||||
{
|
||||
$client = self::getApiClient(
|
||||
null,
|
||||
null,
|
||||
false,
|
||||
$this->getJsonResponse('chatsByCustomerId')
|
||||
);
|
||||
|
||||
$request = new Request\ChatsRequest();
|
||||
$request->setCustomerId(39);
|
||||
|
||||
$response = $client->chats($request);
|
||||
static::assertCount(1, $response, "Incorrect chats count");
|
||||
static::assertInstanceOf(Chat::class, $response[0], "Incorrect chat instance");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -97,8 +118,8 @@ class ClientListTest extends TestCase
|
|||
$request = new Request\MembersRequest();
|
||||
$response = $client->members($request);
|
||||
|
||||
static::assertEquals(4, count($response), "Incorrect members count");
|
||||
static::assertTrue($response[0] instanceof ChatMember, "Incorrect member instance");
|
||||
static::assertCount(5, $response, "Incorrect members count");
|
||||
static::assertInstanceOf(ChatMember::class, $response[0], "Incorrect member instance");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -117,11 +138,12 @@ class ClientListTest extends TestCase
|
|||
$request = new Request\MessagesRequest();
|
||||
$request->setChannelType(Constants::CHANNEL_TYPE_INSTAGRAM);
|
||||
$request->setType(Constants::MESSAGE_TYPE_TEXT);
|
||||
$request->setLimit(1000);
|
||||
|
||||
$response = $client->messages($request);
|
||||
|
||||
static::assertEquals(2, count($response), "Incorrect message count");
|
||||
static::assertTrue($response[0] instanceof Message, "Incorrect message instance");
|
||||
static::assertCount(3, $response, "Incorrect message count");
|
||||
static::assertInstanceOf(Message::class, $response[0], "Incorrect message instance");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -140,7 +162,7 @@ class ClientListTest extends TestCase
|
|||
$request = new Request\CommandsRequest();
|
||||
$response = $client->commands($request);
|
||||
|
||||
self::assertEquals(0, count($response), "Invalid commands count");
|
||||
self::assertCount(0, $response, "Invalid commands count");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -162,7 +184,7 @@ class ClientListTest extends TestCase
|
|||
|
||||
$data = $client->bots($request);
|
||||
|
||||
static::assertEquals(3, count($data));
|
||||
static::assertCount(4, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -184,8 +206,8 @@ class ClientListTest extends TestCase
|
|||
|
||||
$response = $client->users($request);
|
||||
|
||||
self::assertEquals(2, count($response));
|
||||
self::assertTrue($response[0] instanceof User);
|
||||
self::assertCount(3, $response);
|
||||
self::assertInstanceOf(User::class, $response[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -207,8 +229,8 @@ class ClientListTest extends TestCase
|
|||
|
||||
$response = $client->dialogs($request);
|
||||
|
||||
self::assertEquals(2, count($response));
|
||||
self::assertTrue($response[0] instanceof Dialog);
|
||||
self::assertCount(3, $response);
|
||||
self::assertInstanceOf(Dialog::class, $response[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -228,7 +250,10 @@ class ClientListTest extends TestCase
|
|||
|
||||
$response = $client->customers($request);
|
||||
|
||||
self::assertEquals(2, count($response));
|
||||
self::assertTrue($response[0] instanceof Customer);
|
||||
self::assertCount(3, $response);
|
||||
self::assertInstanceOf(Customer::class, $response[0]);
|
||||
|
||||
$utm = $response[0]->getUtm()->getCampaign();
|
||||
static::assertEquals('spring_sale', $utm, "Incorrect utm data");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* Commands Test
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Tests
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Tests;
|
||||
|
@ -24,9 +21,6 @@ use RetailCrm\Mg\Bot\Test\TestCase;
|
|||
* Class CommandsTest
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Tests
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class CommandsTest extends TestCase
|
||||
{
|
||||
|
@ -86,7 +80,7 @@ class CommandsTest extends TestCase
|
|||
|
||||
$response = $client->commandEdit($request);
|
||||
|
||||
self::assertTrue($response instanceof ErrorOnlyResponse);
|
||||
self::assertInstanceOf(ErrorOnlyResponse::class, $response);
|
||||
self::assertTrue($response->isSuccessful());
|
||||
}
|
||||
|
||||
|
@ -106,6 +100,6 @@ class CommandsTest extends TestCase
|
|||
|
||||
$response = $client->commandDelete("show_payment_types");
|
||||
|
||||
self::assertTrue($response->isSuccessful() == true);
|
||||
self::assertTrue($response->isSuccessful());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,9 +7,6 @@
|
|||
*
|
||||
* @package RetailCrm\Mg\Bot\Tests
|
||||
* @category Test
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Tests;
|
||||
|
@ -17,7 +14,9 @@ namespace RetailCrm\Mg\Bot\Tests;
|
|||
use InvalidArgumentException;
|
||||
use RetailCrm\Common\Exception\NotFoundException;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Responsible;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Tag;
|
||||
use RetailCrm\Mg\Bot\Model\Request\DialogAssignRequest;
|
||||
use RetailCrm\Mg\Bot\Model\Request\DialogTagRequest;
|
||||
use RetailCrm\Mg\Bot\Model\Response\ErrorOnlyResponse;
|
||||
use RetailCrm\Mg\Bot\Test\TestCase;
|
||||
|
||||
|
@ -27,9 +26,6 @@ use RetailCrm\Mg\Bot\Test\TestCase;
|
|||
* Class DialogsTest
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Tests
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class DialogsTest extends TestCase
|
||||
{
|
||||
|
@ -78,6 +74,42 @@ class DialogsTest extends TestCase
|
|||
self::assertTrue($response->getResponsible() instanceof Responsible);
|
||||
}
|
||||
|
||||
/**
|
||||
* @group("dialogs")
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function testDialogUnassignError()
|
||||
{
|
||||
$this->expectException(\RuntimeException::class);
|
||||
$client = self::getApiClient(
|
||||
null,
|
||||
null,
|
||||
false,
|
||||
$this->getErrorsResponse(400, "incorrect dialog_id")
|
||||
);
|
||||
|
||||
$client->dialogUnassign(-1);
|
||||
}
|
||||
|
||||
/**
|
||||
* @group("dialogs")
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function testDialogUnassign()
|
||||
{
|
||||
$client = self::getApiClient(
|
||||
null,
|
||||
null,
|
||||
false,
|
||||
$this->getJsonResponse('dialogUnassigned')
|
||||
);
|
||||
|
||||
$response = $client->dialogUnassign(60);
|
||||
|
||||
self::assertTrue($response->isSuccessful());
|
||||
self::assertTrue($response->getPreviousResponsible() instanceof Responsible);
|
||||
}
|
||||
|
||||
/**
|
||||
* @group("dialogs")
|
||||
* @throws \Exception
|
||||
|
@ -111,7 +143,183 @@ class DialogsTest extends TestCase
|
|||
|
||||
$response = $client->dialogClose('62');
|
||||
|
||||
self::assertTrue($response instanceof ErrorOnlyResponse);
|
||||
self::assertInstanceOF(ErrorOnlyResponse::class, $response);
|
||||
self::assertTrue($response->isSuccessful());
|
||||
self::assertEmpty($response->getErrors());
|
||||
}
|
||||
|
||||
/**
|
||||
* @group("dialogs")
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function testDialogAddTagColorError()
|
||||
{
|
||||
$this->expectException(NotFoundException::class);
|
||||
|
||||
$client = self::getApiClient(
|
||||
null,
|
||||
null,
|
||||
false,
|
||||
$this->getErrorsResponse(404,
|
||||
"'color_code can contain only the following values: " .
|
||||
"light-red; light-blue; light-green; light-orange; light-gray; " .
|
||||
"light-grayish-blue; red; blue; green; orange; gray; grayish-blue'"
|
||||
)
|
||||
);
|
||||
|
||||
$tags[0] = new Tag();
|
||||
$tags[0]->setName('tag1');
|
||||
$tags[0]->setColorCode('qwerty');
|
||||
|
||||
$request = new DialogTagRequest();
|
||||
$request->setDialogId(60);
|
||||
$request->setTags($tags);
|
||||
|
||||
$client->dialogAddTag($request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @group("dialogs")
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function testDialogAddTagDialogError()
|
||||
{
|
||||
$this->expectException(NotFoundException::class);
|
||||
|
||||
$client = self::getApiClient(
|
||||
null,
|
||||
null,
|
||||
false,
|
||||
$this->getErrorsResponse(404, "dialog #123456789 not found")
|
||||
);
|
||||
|
||||
$tags[0] = new Tag();
|
||||
$tags[0]->setName('tag1');
|
||||
|
||||
$request = new DialogTagRequest();
|
||||
$request->setDialogId(123456789);
|
||||
$request->setTags($tags);
|
||||
|
||||
$client->dialogAddTag($request);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @group("dialogs")
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function testDialogAddTagEmptyTagError()
|
||||
{
|
||||
$this->expectException(\TypeError::class);
|
||||
|
||||
$client = self::getApiClient();
|
||||
|
||||
$tags[0] = new Tag();
|
||||
|
||||
$request = new DialogTagRequest();
|
||||
$request->setDialogId(60);
|
||||
$request->setTags($tags);
|
||||
|
||||
$client->dialogAddTag($request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @group("dialogs")
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function testDialogAddTag()
|
||||
{
|
||||
$client = self::getApiClient(
|
||||
null,
|
||||
null,
|
||||
false,
|
||||
$this->getResponse('{}')
|
||||
);
|
||||
|
||||
$tags[0] = new Tag();
|
||||
$tags[0]->setName('tag1');
|
||||
$tags[0]->setColorCode('red');
|
||||
|
||||
$tags[1] = new Tag();
|
||||
$tags[1]->setName('tag2');
|
||||
|
||||
$request = new DialogTagRequest();
|
||||
$request->setDialogId(60);
|
||||
$request->setTags($tags);
|
||||
|
||||
$response = $client->dialogAddTag($request);
|
||||
|
||||
self::assertInstanceOF(ErrorOnlyResponse::class, $response);
|
||||
self::assertTrue($response->isSuccessful());
|
||||
self::assertEmpty($response->getErrors());
|
||||
}
|
||||
|
||||
/**
|
||||
* @group("dialogs")
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function testDialogDeleteTagDialogError()
|
||||
{
|
||||
$this->expectException(NotFoundException::class);
|
||||
|
||||
$client = self::getApiClient(
|
||||
null,
|
||||
null,
|
||||
false,
|
||||
$this->getErrorsResponse(404, "dialog #123456789 not found")
|
||||
);
|
||||
|
||||
$tags[0] = new Tag();
|
||||
$tags[0]->setName('tag1');
|
||||
|
||||
$request = new DialogTagRequest();
|
||||
$request->setDialogId(123456789);
|
||||
$request->setTags($tags);
|
||||
|
||||
$client->dialogAddTag($request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @group("dialogs")
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function testDialogDeleteTagEmptyTagError()
|
||||
{
|
||||
$this->expectException(\TypeError::class);
|
||||
|
||||
$client = self::getApiClient();
|
||||
|
||||
$tags[0] = new Tag();
|
||||
|
||||
$request = new DialogTagRequest();
|
||||
$request->setTags($tags);
|
||||
|
||||
$client->dialogDeleteTag($request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @group("dialogs")
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function testDialogDeleteTag()
|
||||
{
|
||||
$client = self::getApiClient(
|
||||
null,
|
||||
null,
|
||||
false,
|
||||
$this->getResponse('{}')
|
||||
);
|
||||
|
||||
$tags[0] = new Tag();
|
||||
$tags[0]->setName('tag1');
|
||||
|
||||
$request = new DialogTagRequest();
|
||||
$request->setDialogId(60);
|
||||
$request->setTags($tags);
|
||||
|
||||
$response = $client->dialogDeleteTag($request);
|
||||
|
||||
self::assertInstanceOF(ErrorOnlyResponse::class, $response);
|
||||
self::assertTrue($response->isSuccessful());
|
||||
self::assertEmpty($response->getErrors());
|
||||
}
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
* Upload file Test
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Tests
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Tests;
|
||||
|
@ -23,9 +20,6 @@ use RetailCrm\Mg\Bot\Test\TestCase;
|
|||
* Class UploadFileTest
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Tests
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class FileTest extends TestCase
|
||||
{
|
||||
|
@ -33,17 +27,32 @@ class FileTest extends TestCase
|
|||
* @group("upload")
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function testUploadFileByUrlException()
|
||||
public function testUploadFileByUrlEmpty()
|
||||
{
|
||||
$client = self::getApiClient(
|
||||
null,
|
||||
null,
|
||||
false,
|
||||
$this->getEmptyResponse(400)
|
||||
$this->getErrorsResponse(400, 'Something is not quite right.')
|
||||
);
|
||||
|
||||
self::expectException(\InvalidArgumentException::class);
|
||||
$client->uploadFileByUrl('');
|
||||
}
|
||||
/**
|
||||
* @group("upload")
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function testUploadFileByUrlInvalid()
|
||||
{
|
||||
$client = self::getApiClient(
|
||||
null,
|
||||
null,
|
||||
false,
|
||||
$this->getErrorsResponse(400, 'Something is not quite right.')
|
||||
);
|
||||
|
||||
self::expectException(\InvalidArgumentException::class);
|
||||
$client->uploadFileByUrl('rar');
|
||||
}
|
||||
|
||||
|
@ -83,7 +92,7 @@ class FileTest extends TestCase
|
|||
|
||||
$response = $client->uploadFile(__FILE__);
|
||||
|
||||
self::assertTrue($response instanceof UploadFileResponse);
|
||||
self::assertInstanceOf(UploadFileResponse::class, $response);
|
||||
self::assertEquals('b2bdba90-166c-4e0a-829d-69f26a09fd2a', $response->getId());
|
||||
self::assertEquals('file', $response->getType());
|
||||
self::assertEquals(214, $response->getSize());
|
||||
|
@ -105,7 +114,10 @@ class FileTest extends TestCase
|
|||
|
||||
$response = $client->getFileById($fileId);
|
||||
|
||||
self::assertTrue($response instanceof FullFileResponse);
|
||||
self::assertInstanceOf(FullFileResponse::class, $response);
|
||||
self::assertEquals($fileId, $response->getId());
|
||||
|
||||
$fileUrl = 'https://s3.eu-central-1.amazonaws.com/mg-node-files/files/21/b2bdba90-166c-4e0a-829d-69f26a09fd2a';
|
||||
self::assertEquals($fileUrl, $response->getUrl());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,14 +6,12 @@
|
|||
* Messages Test
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Tests
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Tests;
|
||||
|
||||
use RetailCrm\Mg\Bot\Model\Constants;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Message\Item;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Message\MessageCost;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Message\MessageDelivery;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Message\MessageOrder;
|
||||
|
@ -22,6 +20,8 @@ use RetailCrm\Mg\Bot\Model\Entity\Message\MessageOrderPaymentStatus;
|
|||
use RetailCrm\Mg\Bot\Model\Entity\Message\MessageProduct;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Message\MessageQuantity;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Message\MessageStatus;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Message\Suggestion;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Message\TransportAttachments;
|
||||
use RetailCrm\Mg\Bot\Model\Request\MessageEditRequest;
|
||||
use RetailCrm\Mg\Bot\Model\Request\MessageSendRequest;
|
||||
use RetailCrm\Mg\Bot\Model\Response\MessageSendResponse;
|
||||
|
@ -33,9 +33,6 @@ use RetailCrm\Mg\Bot\Test\TestCase;
|
|||
* Class MessagesTest
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Tests
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class MessagesTest extends TestCase
|
||||
{
|
||||
|
@ -91,7 +88,7 @@ class MessagesTest extends TestCase
|
|||
|
||||
if ($response instanceof MessageSendResponse) {
|
||||
self::assertTrue($response->isSuccessful());
|
||||
self::assertEquals(0, count($response->getErrors()));
|
||||
self::assertCount(0, $response->getErrors());
|
||||
self::assertEquals(3636, $response->getMessageId());
|
||||
}
|
||||
}
|
||||
|
@ -163,7 +160,7 @@ class MessagesTest extends TestCase
|
|||
|
||||
if ($response instanceof MessageSendResponse) {
|
||||
self::assertTrue($response->isSuccessful());
|
||||
self::assertEquals(0, count($response->getErrors()));
|
||||
self::assertCount(0, $response->getErrors());
|
||||
self::assertEquals(3636, $response->getMessageId());
|
||||
}
|
||||
}
|
||||
|
@ -213,7 +210,7 @@ class MessagesTest extends TestCase
|
|||
|
||||
if ($response instanceof MessageSendResponse) {
|
||||
self::assertTrue($response->isSuccessful());
|
||||
self::assertEquals(0, count($response->getErrors()));
|
||||
self::assertCount(0, $response->getErrors());
|
||||
self::assertEquals(3636, $response->getMessageId());
|
||||
}
|
||||
}
|
||||
|
@ -262,7 +259,7 @@ class MessagesTest extends TestCase
|
|||
$response = $client->messageEdit($request);
|
||||
|
||||
self::assertTrue($response->isSuccessful());
|
||||
self::assertEquals(0, count($response->getErrors()));
|
||||
self::assertCount(0, $response->getErrors());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -301,6 +298,102 @@ class MessagesTest extends TestCase
|
|||
$response = $client->messageDelete('3636');
|
||||
|
||||
self::assertTrue($response->isSuccessful());
|
||||
self::assertEquals(0, count($response->getErrors()));
|
||||
self::assertCount(0, $response->getErrors());
|
||||
}
|
||||
|
||||
/**
|
||||
* @group("messages")
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function testMessageSendSuggestions()
|
||||
{
|
||||
$client = self::getApiClient(
|
||||
null,
|
||||
null,
|
||||
false,
|
||||
$this->getResponse(
|
||||
'{"message_id":3636,"time":"2019-06-24T06:02:04.434291791Z"}',
|
||||
201
|
||||
)
|
||||
);
|
||||
|
||||
$suggestionsData = [
|
||||
[
|
||||
'title' => 'Hello',
|
||||
'type' => 'text'
|
||||
],
|
||||
[
|
||||
'type' => 'email'
|
||||
],
|
||||
[
|
||||
'type' => 'phone'
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
$suggestions = [];
|
||||
foreach ($suggestionsData as $suggestionsDatum) {
|
||||
$suggestion = new Suggestion();
|
||||
$suggestion->setType($suggestionsDatum['type']);
|
||||
|
||||
if (isset($suggestionsDatum['title'])) {
|
||||
$suggestion->setTitle($suggestionsDatum['title']);
|
||||
}
|
||||
|
||||
$suggestions[] = $suggestion;
|
||||
}
|
||||
|
||||
$transportAttachments = new TransportAttachments();
|
||||
$transportAttachments->setSuggestions($suggestions);
|
||||
|
||||
$request = new MessageSendRequest();
|
||||
$request->setChatId(28);
|
||||
$request->setScope(Constants::MESSAGE_SCOPE_PUBLIC);
|
||||
$request->setContent("Hello");
|
||||
$request->setTransportAttachments($transportAttachments);
|
||||
|
||||
$response = $client->messageSend($request);
|
||||
|
||||
self::assertInstanceOf(MessageSendResponse::class, $response);
|
||||
|
||||
if ($response instanceof MessageSendResponse) {
|
||||
self::assertTrue($response->isSuccessful());
|
||||
self::assertCount(0, $response->getErrors());
|
||||
self::assertEquals(3636, $response->getMessageId());
|
||||
}
|
||||
}
|
||||
|
||||
public function testMessageSendItems()
|
||||
{
|
||||
$client = self::getApiClient(
|
||||
null,
|
||||
null,
|
||||
false,
|
||||
$this->getResponse(
|
||||
'{"message_id":4242,"time":"2019-06-24T06:02:04.434291791Z"}',
|
||||
201
|
||||
)
|
||||
);
|
||||
|
||||
$item = new Item();
|
||||
$item->setCaption('demo caption');
|
||||
$item->setId('e33e5398-814a-47d6-902a-466ba120ce45');
|
||||
|
||||
$request = new MessageSendRequest();
|
||||
$request->setChatId(28);
|
||||
$request->setScope(Constants::MESSAGE_SCOPE_PUBLIC);
|
||||
$request->setContent("Hello");
|
||||
$request->setItems([$item]);
|
||||
$request->setNote('demo note');
|
||||
|
||||
$response = $client->messageSend($request);
|
||||
|
||||
self::assertInstanceOf(MessageSendResponse::class, $response);
|
||||
|
||||
if ($response instanceof MessageSendResponse) {
|
||||
self::assertTrue($response->isSuccessful());
|
||||
self::assertCount(0, $response->getErrors());
|
||||
self::assertEquals(4242, $response->getMessageId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
57
tests/Bot/Tests/Model/ListEntityRequestTest.php
Normal file
57
tests/Bot/Tests/Model/ListEntityRequestTest.php
Normal file
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Tests\Model;
|
||||
|
||||
use PHPStan\Testing\TestCase;
|
||||
use RetailCrm\Common\Serializer;
|
||||
use RetailCrm\Mg\Bot\Model\Request\BotsRequest;
|
||||
use RetailCrm\Mg\Bot\Model\Request\ChannelsRequest;
|
||||
use RetailCrm\Mg\Bot\Model\Request\ChatsRequest;
|
||||
use RetailCrm\Mg\Bot\Model\Request\CustomersRequest;
|
||||
use RetailCrm\Mg\Bot\Model\Request\DialogsRequest;
|
||||
use RetailCrm\Mg\Bot\Model\Request\MembersRequest;
|
||||
use RetailCrm\Mg\Bot\Model\Request\UsersRequest;
|
||||
|
||||
class ListEntityRequestTest extends TestCase
|
||||
{
|
||||
private const LIMIT = 100;
|
||||
|
||||
public function testListRequestsWithLimit(): void
|
||||
{
|
||||
$expected = json_encode(['limit' => self::LIMIT]);
|
||||
$request = new BotsRequest();
|
||||
$request->setLimit(self::LIMIT);
|
||||
|
||||
self::assertEquals($expected, Serializer::serialize($request));
|
||||
|
||||
$request = new ChannelsRequest();
|
||||
$request->setLimit(self::LIMIT);
|
||||
|
||||
self::assertEquals($expected, Serializer::serialize($request));
|
||||
|
||||
$request = new ChatsRequest();
|
||||
$request->setLimit(self::LIMIT);
|
||||
|
||||
self::assertEquals($expected, Serializer::serialize($request));
|
||||
|
||||
$request = new CustomersRequest();
|
||||
$request->setLimit(self::LIMIT);
|
||||
|
||||
self::assertEquals($expected, Serializer::serialize($request));
|
||||
|
||||
$request = new DialogsRequest();
|
||||
$request->setLimit(self::LIMIT);
|
||||
|
||||
self::assertEquals($expected, Serializer::serialize($request));
|
||||
|
||||
$request = new MembersRequest();
|
||||
$request->setLimit(self::LIMIT);
|
||||
|
||||
self::assertEquals($expected, Serializer::serialize($request));
|
||||
|
||||
$request = new UsersRequest();
|
||||
$request->setLimit(self::LIMIT);
|
||||
|
||||
self::assertEquals($expected, Serializer::serialize($request));
|
||||
}
|
||||
}
|
94
tests/Bot/Tests/Model/MessageTest.php
Normal file
94
tests/Bot/Tests/Model/MessageTest.php
Normal file
|
@ -0,0 +1,94 @@
|
|||
<?php
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Tests\Model;
|
||||
|
||||
use RetailCrm\Common\Serializer;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Message\Message;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class MessageTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @dataProvider dataProvider_noContent
|
||||
* @param $content
|
||||
*/
|
||||
public function testDeserialization_NoContent($content): void
|
||||
{
|
||||
$item = ['content' => $content];
|
||||
|
||||
/** @var Message $result */
|
||||
$result = Serializer::deserialize($item, Message::class, Serializer::S_ARRAY);
|
||||
|
||||
self::assertNull($result->getContent());
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider dataProvider_withContent
|
||||
* @param $content
|
||||
*/
|
||||
public function testDeserialization_WithContent($content): void
|
||||
{
|
||||
$item = ['content' => $content];
|
||||
|
||||
/** @var Message $result */
|
||||
$result = Serializer::deserialize($item, Message::class, Serializer::S_ARRAY);
|
||||
|
||||
self::assertNotNull($result->getContent());
|
||||
self::assertEquals($content, $result->getContent());
|
||||
}
|
||||
|
||||
public function testDeserializationWithQuoute(): void
|
||||
{
|
||||
$json = file_get_contents(__DIR__ . '/../../../Resources/messageWithQuote.json');
|
||||
/** @var Message $message */
|
||||
$message = Serializer::deserialize($json, Message::class);
|
||||
|
||||
self::assertEquals(3373, $message->getId());
|
||||
self::assertNotNull($message->getQuote());
|
||||
self::assertEquals("22144962", $message->getQuote()->getId());
|
||||
self::assertEquals("text", $message->getQuote()->getType());
|
||||
self::assertEquals("11111", $message->getQuote()->getFrom()->getId());
|
||||
self::assertEquals("Something content", $message->getQuote()->getContent());
|
||||
self::assertNotNull($message->getQuote()->getTime());
|
||||
}
|
||||
|
||||
public function testSerialization_NoContent(): void
|
||||
{
|
||||
$item = new Message();
|
||||
|
||||
$result = Serializer::serialize($item);
|
||||
|
||||
self::assertEquals('{}', $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider dataProvider_withContent
|
||||
* @param $content
|
||||
* @param $json
|
||||
*/
|
||||
public function testSerialization_WithContent($content, $json): void
|
||||
{
|
||||
$item = new Message();
|
||||
$item->setContent($content);
|
||||
|
||||
$result = Serializer::serialize($item);
|
||||
|
||||
self::assertEquals($json, $result);
|
||||
}
|
||||
|
||||
public function dataProvider_noContent(): array
|
||||
{
|
||||
return [
|
||||
[null],
|
||||
];
|
||||
}
|
||||
|
||||
public function dataProvider_withContent(): array
|
||||
{
|
||||
return [
|
||||
['', '{"content":""}'],
|
||||
['0', '{"content":"0"}'],
|
||||
['Something', '{"content":"Something"}'],
|
||||
];
|
||||
}
|
||||
}
|
|
@ -4,9 +4,6 @@
|
|||
*
|
||||
* RegisterTest.php
|
||||
*
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Tests;
|
||||
|
@ -20,9 +17,6 @@ use RetailCrm\Mg\Bot\Test\TestCase;
|
|||
* Class RegisterTest
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Tests
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class RegisterTest extends TestCase
|
||||
{
|
||||
|
|
113
tests/Bot/Tests/TemplatesTest.php
Normal file
113
tests/Bot/Tests/TemplatesTest.php
Normal file
|
@ -0,0 +1,113 @@
|
|||
<?php
|
||||
|
||||
namespace RetailCrm\Mg\Bot\Tests;
|
||||
|
||||
use RetailCrm\Common\Exception\NotFoundException;
|
||||
use RetailCrm\Mg\Bot\Model\Request\TemplateSendRequest;
|
||||
use RetailCrm\Mg\Bot\Model\Response\MessageSendResponse;
|
||||
use RetailCrm\Mg\Bot\Test\TestCase;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Template;
|
||||
|
||||
/**
|
||||
* PHP version 7.0
|
||||
*
|
||||
* Class TemplatesTest
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Tests
|
||||
*/
|
||||
class TemplatesTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @group("templates")
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function testTemplatesList()
|
||||
{
|
||||
$client = self::getApiClient(
|
||||
null,
|
||||
null,
|
||||
false,
|
||||
$this->getJsonResponse('templates')
|
||||
);
|
||||
|
||||
$response = $client->templates();
|
||||
|
||||
static::assertCount(2, $response, "Incorrect templates count");
|
||||
static::assertInstanceOf(Template\Template::class, $response[0], "Incorrect template instance");
|
||||
|
||||
$templateType = $response[0]->getHeader()['content']['type'];
|
||||
static::assertStringContainsString("video", $templateType, "Incorrect template type");
|
||||
}
|
||||
|
||||
/**
|
||||
* @group("templates")
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function testTemplateSendNotFound()
|
||||
{
|
||||
$this->expectException(NotFoundException::class);
|
||||
|
||||
$client = self::getApiClient(
|
||||
null,
|
||||
null,
|
||||
false,
|
||||
$this->getErrorsResponse(404, "template id=3 was not found")
|
||||
);
|
||||
|
||||
$request = new TemplateSendRequest();
|
||||
$request->setPhone('123');
|
||||
|
||||
$client->templateSend(3, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @group("templates")
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function testTemplateSendVariablesError()
|
||||
{
|
||||
$this->expectException(NotFoundException::class);
|
||||
|
||||
$client = self::getApiClient(
|
||||
null,
|
||||
null,
|
||||
false,
|
||||
$this->getErrorsResponse(404, "variables number doesn't match template")
|
||||
);
|
||||
|
||||
$request = new TemplateSendRequest();
|
||||
$request->setPhone('123');
|
||||
|
||||
$client->templateSend(2, $request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @group("templates")
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function testTemplateSendSuccess()
|
||||
{
|
||||
$client = self::getApiClient(
|
||||
null,
|
||||
null,
|
||||
false,
|
||||
$this->getResponse(
|
||||
'{"message_id":4242,"time":"2019-06-24T06:02:04.434291791Z"}',
|
||||
201
|
||||
)
|
||||
);
|
||||
|
||||
$request = new TemplateSendRequest();
|
||||
$request->setPhone('123');
|
||||
|
||||
$response = $client->templateSend(1, $request);
|
||||
|
||||
self::assertInstanceOf(MessageSendResponse::class, $response);
|
||||
|
||||
if ($response instanceof MessageSendResponse) {
|
||||
self::assertTrue($response->isSuccessful());
|
||||
self::assertCount(0, $response->getErrors());
|
||||
self::assertEquals(4242, $response->getMessageId());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,9 +5,6 @@
|
|||
* Class RegisterTest
|
||||
*
|
||||
* @package RetailCrm\Common\Tests
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
|
||||
namespace RetailCrm\Common\Tests;
|
||||
|
@ -19,9 +16,6 @@ use PHPUnit\Framework\TestCase;
|
|||
* Class RegisterTest
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Tests
|
||||
* @author retailCRM <integration@retailcrm.ru>
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link http://help.retailcrm.pro/docs/Developers
|
||||
*/
|
||||
class RegisterTest extends TestCase
|
||||
{
|
||||
|
|
|
@ -42,5 +42,21 @@
|
|||
"is_active": true,
|
||||
"is_self": false,
|
||||
"is_system": false
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"name": "Weird date formats bot",
|
||||
"events": null,
|
||||
"client_id": "identifier_4",
|
||||
"avatar_url": "https://s3.retailcrm.pro/eu-central-1/retailcrm-billing/images/5b97bfd983d2b-bot-logo-2.svg",
|
||||
"roles": [
|
||||
"responsible"
|
||||
],
|
||||
"created_at": "2018-09-06T13:40:02Z",
|
||||
"updated_at": "2018-09-12T06:15:32Z",
|
||||
"deactivated_at": "2019-09-12T06:15:32Z",
|
||||
"is_active": true,
|
||||
"is_self": false,
|
||||
"is_system": false
|
||||
}
|
||||
]
|
||||
]
|
||||
|
|
|
@ -35,6 +35,11 @@
|
|||
"quoting": "both",
|
||||
"deleting": "receive",
|
||||
"max_items_count": 1
|
||||
},
|
||||
"suggestions": {
|
||||
"text": "both",
|
||||
"email": "both",
|
||||
"phone": "both"
|
||||
}
|
||||
},
|
||||
"created_at": "2019-06-11T12:46:48.72241Z",
|
||||
|
@ -79,6 +84,11 @@
|
|||
"quoting": "both",
|
||||
"deleting": "receive",
|
||||
"max_items_count": 1
|
||||
},
|
||||
"suggestions": {
|
||||
"text": "both",
|
||||
"email": "both",
|
||||
"phone": "both"
|
||||
}
|
||||
},
|
||||
"created_at": "2019-06-11T12:41:44.660495Z",
|
||||
|
@ -123,6 +133,11 @@
|
|||
"quoting": "both",
|
||||
"deleting": "receive",
|
||||
"max_items_count": 1
|
||||
},
|
||||
"suggestions": {
|
||||
"text": "both",
|
||||
"email": "both",
|
||||
"phone": "both"
|
||||
}
|
||||
},
|
||||
"created_at": "2019-06-11T12:38:24.322413Z",
|
||||
|
@ -167,6 +182,11 @@
|
|||
"quoting": "both",
|
||||
"deleting": "receive",
|
||||
"max_items_count": 1
|
||||
},
|
||||
"suggestions": {
|
||||
"text": "both",
|
||||
"email": "both",
|
||||
"phone": "both"
|
||||
}
|
||||
},
|
||||
"created_at": "2019-06-11T12:33:08.676214Z",
|
||||
|
@ -174,5 +194,54 @@
|
|||
"activated_at": "2019-06-11T12:33:08.676043Z",
|
||||
"deactivated_at": "2019-06-11T12:38:19.615335Z",
|
||||
"is_active": true
|
||||
},
|
||||
{
|
||||
"id": 68,
|
||||
"type": "telegram",
|
||||
"name": "@oldtestbot",
|
||||
"settings": {
|
||||
"status": {
|
||||
"delivered": "send"
|
||||
},
|
||||
"text": {
|
||||
"creating": "both",
|
||||
"editing": "both",
|
||||
"quoting": "both",
|
||||
"deleting": "receive",
|
||||
"max_chars_count": 4096
|
||||
},
|
||||
"product": {
|
||||
"creating": "receive",
|
||||
"editing": "receive"
|
||||
},
|
||||
"order": {
|
||||
"creating": "receive",
|
||||
"editing": "receive"
|
||||
},
|
||||
"image": {
|
||||
"creating": "both",
|
||||
"editing": "both",
|
||||
"quoting": "both",
|
||||
"deleting": "receive",
|
||||
"max_items_count": 10
|
||||
},
|
||||
"file": {
|
||||
"creating": "both",
|
||||
"editing": "both",
|
||||
"quoting": "both",
|
||||
"deleting": "receive",
|
||||
"max_items_count": 1
|
||||
},
|
||||
"suggestions": {
|
||||
"text": "both",
|
||||
"email": "both",
|
||||
"phone": "both"
|
||||
}
|
||||
},
|
||||
"created_at": "2019-06-11T12:33:08Z",
|
||||
"updated_at": "2019-06-11T12:38:19Z",
|
||||
"activated_at": "2019-06-11T12:33:08Z",
|
||||
"deactivated_at": "2019-06-11T12:38:19Z",
|
||||
"is_active": false
|
||||
}
|
||||
]
|
||||
]
|
||||
|
|
|
@ -57,6 +57,7 @@
|
|||
"author_id": 0,
|
||||
"last_message": null,
|
||||
"last_activity": "2019-06-11T17:36:20+03:00",
|
||||
"reply_deadline": "2019-06-18T17:36:20Z",
|
||||
"created_at": "2019-06-11T12:49:26.938879Z",
|
||||
"updated_at": "2019-06-14T14:40:28.7111Z"
|
||||
},
|
||||
|
@ -108,9 +109,102 @@
|
|||
"last_name": "Петрович"
|
||||
},
|
||||
"author_id": 0,
|
||||
"last_message": null,
|
||||
"last_message": {
|
||||
"id": 1,
|
||||
"time": "2022-12-21T17:15:54+01:00",
|
||||
"type": "command",
|
||||
"scope": "private",
|
||||
"chat_id": 1053,
|
||||
"is_read": false,
|
||||
"is_edit": false,
|
||||
"status": "received",
|
||||
"from": {
|
||||
"id": 2,
|
||||
"external_id": "12",
|
||||
"type": "user",
|
||||
"avatar": null,
|
||||
"name": "Cuenta Soporte",
|
||||
"first_name": "Cuenta",
|
||||
"last_name": "Soporte",
|
||||
"is_technical_account": true
|
||||
}
|
||||
},
|
||||
"last_activity": "2019-06-13T11:07:14+03:00",
|
||||
"reply_deadline": "2019-06-20T11:07:14Z",
|
||||
"created_at": "2019-06-11T07:34:16.082957Z",
|
||||
"updated_at": "2019-06-16T08:10:28.657972Z"
|
||||
},
|
||||
{
|
||||
"id": 28,
|
||||
"avatar": "",
|
||||
"name": "",
|
||||
"channel": {
|
||||
"id": 61,
|
||||
"avatar": "",
|
||||
"transport_id": 1,
|
||||
"type": "fbmessenger",
|
||||
"settings": {
|
||||
"status": {
|
||||
"delivered": "send",
|
||||
"read": "send"
|
||||
},
|
||||
"text": {
|
||||
"creating": "both",
|
||||
"quoting": "receive",
|
||||
"max_chars_count": 2000
|
||||
},
|
||||
"product": {
|
||||
"creating": "receive"
|
||||
},
|
||||
"order": {
|
||||
"creating": "receive"
|
||||
},
|
||||
"image": {
|
||||
"creating": "both",
|
||||
"max_items_count": 10
|
||||
},
|
||||
"file": {
|
||||
"creating": "both",
|
||||
"max_items_count": 10
|
||||
}
|
||||
},
|
||||
"name": "testbot",
|
||||
"is_active": false
|
||||
},
|
||||
"members": null,
|
||||
"customer": {
|
||||
"id": 38,
|
||||
"type": "customer",
|
||||
"avatar": "",
|
||||
"name": "Пётр Петрович",
|
||||
"username": "Пётр",
|
||||
"first_name": "Пётр",
|
||||
"last_name": "Петрович"
|
||||
},
|
||||
"author_id": 0,
|
||||
"last_message": {
|
||||
"id": 1,
|
||||
"time": "2022-12-21T17:15:54+01:00",
|
||||
"type": "command",
|
||||
"scope": "private",
|
||||
"chat_id": 1053,
|
||||
"is_read": false,
|
||||
"is_edit": false,
|
||||
"status": "received",
|
||||
"from": {
|
||||
"id": 2,
|
||||
"external_id": "12",
|
||||
"type": "user",
|
||||
"avatar": null,
|
||||
"name": "Cuenta Soporte",
|
||||
"first_name": "Cuenta",
|
||||
"last_name": "Soporte",
|
||||
"is_technical_account": true
|
||||
}
|
||||
},
|
||||
"last_activity": "2019-06-13T11:07:14+03:00",
|
||||
"reply_deadline":"2019-06-20T11:07:14Z",
|
||||
"created_at": "2019-06-11T07:34:16Z",
|
||||
"updated_at": "2019-06-16T08:10:28Z"
|
||||
}
|
||||
]
|
||||
]
|
||||
|
|
63
tests/Resources/chatsByCustomerId.json
Normal file
63
tests/Resources/chatsByCustomerId.json
Normal file
|
@ -0,0 +1,63 @@
|
|||
[
|
||||
{
|
||||
"id": 30,
|
||||
"avatar": "",
|
||||
"name": "",
|
||||
"channel": {
|
||||
"id": 72,
|
||||
"avatar": "",
|
||||
"transport_id": 4,
|
||||
"type": "fbmessenger",
|
||||
"settings": {
|
||||
"status": {
|
||||
"delivered": "send"
|
||||
},
|
||||
"text": {
|
||||
"creating": "both",
|
||||
"editing": "both",
|
||||
"quoting": "both",
|
||||
"deleting": "receive",
|
||||
"max_chars_count": 4096
|
||||
},
|
||||
"product": {
|
||||
"creating": "receive",
|
||||
"editing": "receive"
|
||||
},
|
||||
"order": {
|
||||
"creating": "receive",
|
||||
"editing": "receive"
|
||||
},
|
||||
"image": {
|
||||
"creating": "both",
|
||||
"editing": "both",
|
||||
"quoting": "both",
|
||||
"deleting": "receive",
|
||||
"max_items_count": 10
|
||||
},
|
||||
"file": {
|
||||
"creating": "both",
|
||||
"editing": "both",
|
||||
"quoting": "both",
|
||||
"deleting": "receive",
|
||||
"max_items_count": 1
|
||||
}
|
||||
},
|
||||
"name": "testbot",
|
||||
"is_active": true
|
||||
},
|
||||
"members": null,
|
||||
"customer": {
|
||||
"id": 39,
|
||||
"type": "customer",
|
||||
"avatar": "",
|
||||
"name": "Иван",
|
||||
"username": "Иван",
|
||||
"first_name": "Иван"
|
||||
},
|
||||
"author_id": 0,
|
||||
"last_message": null,
|
||||
"last_activity": "2019-06-11T17:36:20+03:00",
|
||||
"created_at": "2019-06-11T12:49:26.938879Z",
|
||||
"updated_at": "2019-06-14T14:40:28.7111Z"
|
||||
}
|
||||
]
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue