Compare commits
No commits in common. "master" and "v1.1.2" have entirely different histories.
118 changed files with 6130 additions and 6007 deletions
36
.github/workflows/ci.yml
vendored
36
.github/workflows/ci.yml
vendored
|
@ -1,36 +0,0 @@
|
|||
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,7 +194,4 @@ build/*
|
|||
|
||||
# Test report & coverage
|
||||
test-report.xml
|
||||
.phpunit.result.cache
|
||||
clover.xml
|
||||
composer.lock
|
||||
docker-compose.yml
|
||||
|
|
19
.travis.yml
Normal file
19
.travis.yml
Normal file
|
@ -0,0 +1,19 @@
|
|||
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-2020 RetailDriver LLC
|
||||
Copyright (c) 2018-2019 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,16 +1,18 @@
|
|||
ifneq ("$(wildcard docker-compose.yml)","")
|
||||
PHP=docker-compose run --rm --no-deps php php
|
||||
else
|
||||
PHP=php
|
||||
endif
|
||||
ROOT_DIR=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||
SRC_DIR=$(ROOT_DIR)/src
|
||||
BIN_DIR=$(ROOT_DIR)/vendor/bin
|
||||
|
||||
test:
|
||||
@echo "==> Running tests"
|
||||
@cd $(ROOT_DIR)
|
||||
@cp .env.dist .env
|
||||
@$(PHP) -d memory_limit=-1 vendor/bin/phpunit -c phpunit.xml.dist
|
||||
@php -d memory_limit=-1 $(BIN_DIR)/phpunit -c phpunit.xml.dist
|
||||
@echo "==> Testing complete"
|
||||
|
||||
stan:
|
||||
@echo "==> Running analysis"
|
||||
@$(PHP) vendor/bin/phpstan analyse
|
||||
@php $(BIN_DIR)/phpstan analyse
|
||||
@echo "==> Analysis complete"
|
||||
|
||||
travis: test stan
|
||||
@echo "==> Completed"
|
||||
|
|
17
README.md
17
README.md
|
@ -1,14 +1,16 @@
|
|||
[](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)
|
||||
[](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)
|
||||
|
||||
|
||||
# Message Gateway Bot API PHP client
|
||||
|
||||
This is php library for retailCRM MG Bot API.
|
||||
|
||||
## Requirements
|
||||
|
||||
* PHP 7.3 and above
|
||||
* PHP 7.1 and above
|
||||
* PHP's cURL support
|
||||
* PHP's JSON support
|
||||
|
||||
|
@ -51,3 +53,8 @@ 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,50 +1,43 @@
|
|||
{
|
||||
"name": "retailcrm/mg-bot-api-client-php",
|
||||
"description": "PHP client for MG Bot API",
|
||||
"description": "PHP client for retailCRM 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.pro"
|
||||
"name": "retailCRM",
|
||||
"email": "support@retailcrm.ru"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.3",
|
||||
"php": ">=7.1",
|
||||
"ext-curl": "*",
|
||||
"ext-json": "*",
|
||||
"jms/serializer": "3.*",
|
||||
"symfony/validator": "5.4.*|^6",
|
||||
"doctrine/annotations": "^1",
|
||||
"guzzlehttp/guzzle": "7.*",
|
||||
"symfony/intl": "5.4.*|^6",
|
||||
"symfony/cache": "5.4.*|^6"
|
||||
"jms/serializer": "1.14.*",
|
||||
"symfony/validator": "4.3.*",
|
||||
"doctrine/annotations": "1.6.*",
|
||||
"doctrine/cache": "1.6.*",
|
||||
"guzzlehttp/guzzle": "6.*"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpmd/phpmd": "2.*",
|
||||
"squizlabs/php_codesniffer": "3.4.*",
|
||||
"symfony/dotenv": "5.4.*",
|
||||
"phpunit/phpunit": "^9",
|
||||
"phpstan/phpstan": "0.12.*"
|
||||
"symfony/dotenv": "4.3.*",
|
||||
"phpunit/phpunit": "7.*",
|
||||
"phpstan/phpstan": "0.11.*"
|
||||
},
|
||||
"support": {
|
||||
"email": "support@retailcrm.pro"
|
||||
"email": "support@retailcrm.ru"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"RetailCrm\\Mg\\": "src/",
|
||||
"RetailCrm\\Common\\": "src/"
|
||||
"RetailCrm\\Mg\\": ["src/", "tests/"],
|
||||
"RetailCrm\\Common\\": ["src/", "tests/"]
|
||||
},
|
||||
"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
Normal file
4023
composer.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,7 +1,6 @@
|
|||
includes:
|
||||
- phpstan-baseline.neon
|
||||
|
||||
parameters:
|
||||
autoload_files:
|
||||
- %currentWorkingDirectory%/vendor/autoload.php
|
||||
level: 7
|
||||
paths:
|
||||
- %currentWorkingDirectory%/src
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<?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="https://schema.phpunit.de/9.3/phpunit.xsd"
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
|
||||
backupGlobals="false"
|
||||
colors="false"
|
||||
bootstrap="tests/bootstrap.php"
|
||||
|
@ -13,21 +15,22 @@
|
|||
stopOnFailure="false"
|
||||
stopOnIncomplete="false"
|
||||
stopOnSkipped="false"
|
||||
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>
|
||||
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>
|
||||
</phpunit>
|
||||
|
|
|
@ -6,13 +6,17 @@
|
|||
* 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\Serializer;
|
||||
use RetailCrm\Common\Url;
|
||||
use RetailCrm\Common\Serializer;
|
||||
use RetailCrm\Mg\Bot\Model\ModelAdapter;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Bot;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Channel\Channel;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Chat\Chat;
|
||||
|
@ -21,22 +25,21 @@ 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
|
||||
{
|
||||
|
@ -273,27 +276,6 @@ 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
|
||||
*
|
||||
|
@ -315,48 +297,6 @@ 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
|
||||
*
|
||||
|
@ -462,47 +402,6 @@ 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,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -13,12 +16,7 @@ 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;
|
||||
|
@ -27,11 +25,19 @@ 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
|
||||
{
|
||||
|
@ -137,7 +143,7 @@ class HttpClient
|
|||
[self::METHOD_POST, self::METHOD_PUT, self::METHOD_PATCH, self::METHOD_DELETE]
|
||||
) && is_string($requestBody)
|
||||
) {
|
||||
$request = $request->withBody(Utils::streamFor($requestBody));
|
||||
$request = $request->withBody(stream_for($requestBody));
|
||||
}
|
||||
|
||||
$responseObject = null;
|
||||
|
@ -216,15 +222,14 @@ class HttpClient
|
|||
/**
|
||||
* Validate given class
|
||||
*
|
||||
* @param object $class
|
||||
* @param string $class
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function validateRequest(object $class)
|
||||
private function validateRequest($class)
|
||||
{
|
||||
$validator = Validation::createValidatorBuilder()
|
||||
->enableAnnotationMapping()
|
||||
->addDefaultDoctrineAnnotationReader()
|
||||
->getValidator();
|
||||
|
||||
$errors = $validator->validate($class);
|
||||
|
@ -233,7 +238,7 @@ class HttpClient
|
|||
$message = '';
|
||||
|
||||
foreach ($errors as $error) {
|
||||
$message .= $error->getMessage();
|
||||
$message .= (string)$error;
|
||||
}
|
||||
|
||||
throw new InvalidArgumentException($message);
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -14,6 +17,9 @@ 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
|
||||
{
|
||||
|
@ -38,7 +44,6 @@ 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,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,6 +22,9 @@ 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
|
||||
{
|
||||
|
@ -33,7 +39,7 @@ class Bot implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $createdAt
|
||||
*
|
||||
* @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']>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -42,7 +48,7 @@ class Bot implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $updatedAt
|
||||
*
|
||||
* @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']>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Accessor(getter="getUpdatedAt",setter="setUpdatedAt")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -130,9 +136,9 @@ class Bot implements ModelInterface
|
|||
private $isSystem;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getId(): ?string
|
||||
public function getId(): string
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
@ -148,7 +154,7 @@ class Bot implements ModelInterface
|
|||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getCreatedAt(): ?\DateTime
|
||||
public function getCreatedAt(): \DateTime
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
@ -164,7 +170,7 @@ class Bot implements ModelInterface
|
|||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getUpdatedAt(): ?\DateTime
|
||||
public function getUpdatedAt(): \DateTime
|
||||
{
|
||||
return $this->updatedAt;
|
||||
}
|
||||
|
@ -178,9 +184,9 @@ class Bot implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getName(): ?string
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
@ -194,9 +200,9 @@ class Bot implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return array|null
|
||||
* @return array
|
||||
*/
|
||||
public function getEvents(): ?array
|
||||
public function getEvents(): array
|
||||
{
|
||||
return $this->events;
|
||||
}
|
||||
|
@ -210,9 +216,9 @@ class Bot implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getClientId(): ?string
|
||||
public function getClientId(): string
|
||||
{
|
||||
return $this->clientId;
|
||||
}
|
||||
|
@ -226,9 +232,9 @@ class Bot implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getAvatarUrl(): ?string
|
||||
public function getAvatarUrl(): string
|
||||
{
|
||||
return $this->avatarUrl;
|
||||
}
|
||||
|
@ -242,9 +248,9 @@ class Bot implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return array|null
|
||||
* @return array
|
||||
*/
|
||||
public function getRoles(): ?array
|
||||
public function getRoles(): array
|
||||
{
|
||||
return $this->roles;
|
||||
}
|
||||
|
@ -258,9 +264,9 @@ class Bot implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getDeactivatedAt(): ?string
|
||||
public function getDeactivatedAt(): string
|
||||
{
|
||||
return $this->deactivatedAt;
|
||||
}
|
||||
|
@ -274,9 +280,9 @@ class Bot implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return bool|null
|
||||
* @return bool
|
||||
*/
|
||||
public function isActive(): ?bool
|
||||
public function isActive(): bool
|
||||
{
|
||||
return $this->isActive;
|
||||
}
|
||||
|
@ -290,9 +296,9 @@ class Bot implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return bool|null
|
||||
* @return bool
|
||||
*/
|
||||
public function isSelf(): ?bool
|
||||
public function isSelf(): bool
|
||||
{
|
||||
return $this->isSelf;
|
||||
}
|
||||
|
@ -306,9 +312,9 @@ class Bot implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return bool|null
|
||||
* @return bool
|
||||
*/
|
||||
public function isSystem(): ?bool
|
||||
public function isSystem(): bool
|
||||
{
|
||||
return $this->isSystem;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,6 +22,9 @@ 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
|
||||
{
|
||||
|
@ -33,7 +39,7 @@ class Channel implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $createdAt
|
||||
*
|
||||
* @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']>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
|
||||
*/
|
||||
private $createdAt;
|
||||
|
@ -41,7 +47,7 @@ class Channel implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $updatedAt
|
||||
*
|
||||
* @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']>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Accessor(getter="getUpdatedAt",setter="setUpdatedAt")
|
||||
*/
|
||||
private $updatedAt;
|
||||
|
@ -49,7 +55,7 @@ class Channel implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $activatedAt
|
||||
*
|
||||
* @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']>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Accessor(getter="getActivatedAt",setter="setActivatedAt")
|
||||
*/
|
||||
private $activatedAt;
|
||||
|
@ -57,7 +63,7 @@ class Channel implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $deactivatedAt
|
||||
*
|
||||
* @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']>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Accessor(getter="getDeactivatedAt",setter="setDeactivatedAt")
|
||||
*/
|
||||
private $deactivatedAt;
|
||||
|
@ -95,9 +101,9 @@ class Channel implements ModelInterface
|
|||
private $name;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getId(): ?string
|
||||
public function getId(): string
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
@ -113,7 +119,7 @@ class Channel implements ModelInterface
|
|||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getCreatedAt(): ?DateTime
|
||||
public function getCreatedAt(): DateTime
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
@ -129,7 +135,7 @@ class Channel implements ModelInterface
|
|||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getUpdatedAt(): ?DateTime
|
||||
public function getUpdatedAt(): DateTime
|
||||
{
|
||||
return $this->updatedAt;
|
||||
}
|
||||
|
@ -145,7 +151,7 @@ class Channel implements ModelInterface
|
|||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getActivatedAt(): ?DateTime
|
||||
public function getActivatedAt(): DateTime
|
||||
{
|
||||
return $this->activatedAt;
|
||||
}
|
||||
|
@ -161,7 +167,7 @@ class Channel implements ModelInterface
|
|||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getDeactivatedAt(): ?DateTime
|
||||
public function getDeactivatedAt(): DateTime
|
||||
{
|
||||
return $this->deactivatedAt;
|
||||
}
|
||||
|
@ -175,9 +181,9 @@ class Channel implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return bool|null
|
||||
* @return bool
|
||||
*/
|
||||
public function isActive(): ?bool
|
||||
public function isActive(): bool
|
||||
{
|
||||
return $this->isActive;
|
||||
}
|
||||
|
@ -191,9 +197,9 @@ class Channel implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return ChannelSettings|null
|
||||
* @return ChannelSettings
|
||||
*/
|
||||
public function getSettings(): ?ChannelSettings
|
||||
public function getSettings(): ChannelSettings
|
||||
{
|
||||
return $this->settings;
|
||||
}
|
||||
|
@ -207,9 +213,9 @@ class Channel implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getType(): ?string
|
||||
public function getType(): string
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
@ -223,9 +229,9 @@ class Channel implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getName(): ?string
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
@ -233,7 +239,7 @@ class Channel implements ModelInterface
|
|||
/**
|
||||
* @param string $name
|
||||
*/
|
||||
public function setName($name)
|
||||
public function setName(string $name)
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,6 +22,9 @@ 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
|
||||
{
|
||||
|
@ -84,18 +90,9 @@ class ChannelSettings implements ModelInterface
|
|||
private $file;
|
||||
|
||||
/**
|
||||
* @var ChannelSettingsSuggestions $suggestions
|
||||
*
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\Channel\ChannelSettingsSuggestions")
|
||||
* @Accessor(getter="getSuggestions",setter="setSuggestions")
|
||||
* @SkipWhenEmpty()
|
||||
* @return ChannelSettingsStatus
|
||||
*/
|
||||
private $suggestions;
|
||||
|
||||
/**
|
||||
* @return ChannelSettingsStatus|null
|
||||
*/
|
||||
public function getStatus(): ?ChannelSettingsStatus
|
||||
public function getStatus(): ChannelSettingsStatus
|
||||
{
|
||||
return $this->status;
|
||||
}
|
||||
|
@ -109,9 +106,9 @@ class ChannelSettings implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return bool|null
|
||||
* @return bool
|
||||
*/
|
||||
public function isSpamAllowed(): ?bool
|
||||
public function isSpamAllowed(): bool
|
||||
{
|
||||
return $this->spamAllowed;
|
||||
}
|
||||
|
@ -125,9 +122,9 @@ class ChannelSettings implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return ChannelSettingsItem|null
|
||||
* @return ChannelSettingsItem
|
||||
*/
|
||||
public function getText(): ?ChannelSettingsItem
|
||||
public function getText(): ChannelSettingsItem
|
||||
{
|
||||
return $this->text;
|
||||
}
|
||||
|
@ -141,9 +138,9 @@ class ChannelSettings implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return ChannelSettingsItem|null
|
||||
* @return ChannelSettingsItem
|
||||
*/
|
||||
public function getProduct(): ?ChannelSettingsItem
|
||||
public function getProduct(): ChannelSettingsItem
|
||||
{
|
||||
return $this->product;
|
||||
}
|
||||
|
@ -157,9 +154,9 @@ class ChannelSettings implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return ChannelSettingsItem|null
|
||||
* @return ChannelSettingsItem
|
||||
*/
|
||||
public function getOrder(): ?ChannelSettingsItem
|
||||
public function getOrder(): ChannelSettingsItem
|
||||
{
|
||||
return $this->order;
|
||||
}
|
||||
|
@ -173,9 +170,9 @@ class ChannelSettings implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return ChannelSettingsItem|null
|
||||
* @return ChannelSettingsItem
|
||||
*/
|
||||
public function getImage(): ?ChannelSettingsItem
|
||||
public function getImage(): ChannelSettingsItem
|
||||
{
|
||||
return $this->image;
|
||||
}
|
||||
|
@ -189,9 +186,9 @@ class ChannelSettings implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return ChannelSettingsItem|null
|
||||
* @return ChannelSettingsItem
|
||||
*/
|
||||
public function getFile(): ?ChannelSettingsItem
|
||||
public function getFile(): ChannelSettingsItem
|
||||
{
|
||||
return $this->file;
|
||||
}
|
||||
|
@ -203,20 +200,4 @@ 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,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,6 +22,9 @@ 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
|
||||
{
|
||||
|
@ -95,9 +101,9 @@ class ChannelSettingsItem implements ModelInterface
|
|||
private $noteMaxCharsCount;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getCreating(): ?string
|
||||
public function getCreating(): string
|
||||
{
|
||||
return $this->creating;
|
||||
}
|
||||
|
@ -111,9 +117,9 @@ class ChannelSettingsItem implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getEditing(): ?string
|
||||
public function getEditing(): string
|
||||
{
|
||||
return $this->editing;
|
||||
}
|
||||
|
@ -127,9 +133,9 @@ class ChannelSettingsItem implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getQuoting(): ?string
|
||||
public function getQuoting(): string
|
||||
{
|
||||
return $this->quoting;
|
||||
}
|
||||
|
@ -143,9 +149,9 @@ class ChannelSettingsItem implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getDeleting(): ?string
|
||||
public function getDeleting(): string
|
||||
{
|
||||
return $this->deleting;
|
||||
}
|
||||
|
@ -159,9 +165,9 @@ class ChannelSettingsItem implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getDelivered(): ?string
|
||||
public function getDelivered(): string
|
||||
{
|
||||
return $this->delivered;
|
||||
}
|
||||
|
@ -175,9 +181,9 @@ class ChannelSettingsItem implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
* @return int
|
||||
*/
|
||||
public function getMaxCharsCount(): ?int
|
||||
public function getMaxCharsCount(): int
|
||||
{
|
||||
return $this->maxCharsCount;
|
||||
}
|
||||
|
@ -191,9 +197,9 @@ class ChannelSettingsItem implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
* @return int
|
||||
*/
|
||||
public function getMaxItemsCount(): ?int
|
||||
public function getMaxItemsCount(): int
|
||||
{
|
||||
return $this->maxItemsCount;
|
||||
}
|
||||
|
@ -207,9 +213,9 @@ class ChannelSettingsItem implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
* @return int
|
||||
*/
|
||||
public function getNoteMaxCharsCount(): ?int
|
||||
public function getNoteMaxCharsCount(): int
|
||||
{
|
||||
return $this->noteMaxCharsCount;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,6 +22,9 @@ 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
|
||||
{
|
||||
|
@ -41,9 +47,9 @@ class ChannelSettingsStatus implements ModelInterface
|
|||
private $read;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getDelivered(): ?string
|
||||
public function getDelivered(): string
|
||||
{
|
||||
return $this->delivered;
|
||||
}
|
||||
|
@ -57,9 +63,9 @@ class ChannelSettingsStatus implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getRead(): ?string
|
||||
public function getRead(): string
|
||||
{
|
||||
return $this->read;
|
||||
}
|
||||
|
|
|
@ -1,100 +0,0 @@
|
|||
<?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,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -21,6 +24,9 @@ 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
|
||||
{
|
||||
|
@ -35,7 +41,7 @@ class Chat implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $createdAt
|
||||
*
|
||||
* @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']>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
|
||||
*/
|
||||
private $createdAt;
|
||||
|
@ -43,7 +49,7 @@ class Chat implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $updatedAt
|
||||
*
|
||||
* @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']>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Accessor(getter="getUpdatedAt",setter="setUpdatedAt")
|
||||
*/
|
||||
private $updatedAt;
|
||||
|
@ -100,7 +106,7 @@ class Chat implements ModelInterface
|
|||
/**
|
||||
* @var ChatLastMessage $lastMessage
|
||||
*
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\Chat\ChatLastMessage")
|
||||
* @Type("ChatLastMessage")
|
||||
* @Accessor(getter="getLastMessage",setter="setLastMessage")
|
||||
*/
|
||||
private $lastMessage;
|
||||
|
@ -114,17 +120,9 @@ class Chat implements ModelInterface
|
|||
private $lastActivity;
|
||||
|
||||
/**
|
||||
* @var \DateTime $replyDeadline
|
||||
*
|
||||
* @Type("DateTime<'Y-m-d\TH:i:sP'>")
|
||||
* @Accessor(getter="getReplyDeadline",setter="setReplyDeadline")
|
||||
* @return string
|
||||
*/
|
||||
private $replyDeadline;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getId(): ?string
|
||||
public function getId(): string
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
@ -140,7 +138,7 @@ class Chat implements ModelInterface
|
|||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getCreatedAt(): ?\DateTime
|
||||
public function getCreatedAt(): \DateTime
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
@ -156,7 +154,7 @@ class Chat implements ModelInterface
|
|||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getUpdatedAt(): ?\DateTime
|
||||
public function getUpdatedAt(): \DateTime
|
||||
{
|
||||
return $this->updatedAt;
|
||||
}
|
||||
|
@ -170,9 +168,9 @@ class Chat implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getAvatar(): ?string
|
||||
public function getAvatar(): string
|
||||
{
|
||||
return $this->avatar;
|
||||
}
|
||||
|
@ -186,9 +184,9 @@ class Chat implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getName(): ?string
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
@ -202,9 +200,9 @@ class Chat implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return Channel|null
|
||||
* @return Channel
|
||||
*/
|
||||
public function getChannel(): ?Channel
|
||||
public function getChannel(): Channel
|
||||
{
|
||||
return $this->channel;
|
||||
}
|
||||
|
@ -218,9 +216,9 @@ class Chat implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return array|null
|
||||
* @return array
|
||||
*/
|
||||
public function getMembers(): ?array
|
||||
public function getMembers(): array
|
||||
{
|
||||
return $this->members;
|
||||
}
|
||||
|
@ -234,9 +232,9 @@ class Chat implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return Customer|null
|
||||
* @return Customer
|
||||
*/
|
||||
public function getCustomer(): ?Customer
|
||||
public function getCustomer(): Customer
|
||||
{
|
||||
return $this->customer;
|
||||
}
|
||||
|
@ -250,9 +248,9 @@ class Chat implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
* @return int
|
||||
*/
|
||||
public function getAuthorId(): ?int
|
||||
public function getAuthorId(): int
|
||||
{
|
||||
return $this->authorId;
|
||||
}
|
||||
|
@ -266,9 +264,9 @@ class Chat implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return ChatLastMessage|null
|
||||
* @return ChatLastMessage
|
||||
*/
|
||||
public function getLastMessage(): ?ChatLastMessage
|
||||
public function getLastMessage(): ChatLastMessage
|
||||
{
|
||||
return $this->lastMessage;
|
||||
}
|
||||
|
@ -284,7 +282,7 @@ class Chat implements ModelInterface
|
|||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getLastActivity(): ?\DateTime
|
||||
public function getLastActivity(): \DateTime
|
||||
{
|
||||
return $this->lastActivity;
|
||||
}
|
||||
|
@ -296,20 +294,4 @@ 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,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -13,13 +16,15 @@ 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
|
||||
{
|
||||
|
@ -35,7 +40,7 @@ class ChatLastMessage implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $time
|
||||
*
|
||||
* @Type("DateTime<'Y-m-d\TH:i:sP'>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Accessor(getter="getTime",setter="setTime")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -51,80 +56,9 @@ class ChatLastMessage implements ModelInterface
|
|||
private $type;
|
||||
|
||||
/**
|
||||
* @var string $scope
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getScope",setter="setScope")
|
||||
* @SkipWhenEmpty()
|
||||
* @return int
|
||||
*/
|
||||
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
|
||||
*/
|
||||
public function getId(): ?int
|
||||
public function getId(): int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
@ -140,7 +74,7 @@ class ChatLastMessage implements ModelInterface
|
|||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getTime(): ?\DateTime
|
||||
public function getTime(): \DateTime
|
||||
{
|
||||
return $this->time;
|
||||
}
|
||||
|
@ -154,9 +88,9 @@ class ChatLastMessage implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getType(): ?string
|
||||
public function getType(): string
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
@ -168,132 +102,4 @@ 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,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,6 +22,9 @@ 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
|
||||
{
|
||||
|
@ -33,7 +39,7 @@ class ChatMember implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $createdAt
|
||||
*
|
||||
* @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']>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
|
||||
*/
|
||||
private $createdAt;
|
||||
|
@ -41,7 +47,7 @@ class ChatMember implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $updatedAt
|
||||
*
|
||||
* @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']>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Accessor(getter="getUpdatedAt",setter="setUpdatedAt")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -84,9 +90,9 @@ class ChatMember implements ModelInterface
|
|||
private $state;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getId(): ?string
|
||||
public function getId(): string
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
@ -102,7 +108,7 @@ class ChatMember implements ModelInterface
|
|||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getCreatedAt(): ?\DateTime
|
||||
public function getCreatedAt(): \DateTime
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
@ -118,7 +124,7 @@ class ChatMember implements ModelInterface
|
|||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getUpdatedAt(): ?\DateTime
|
||||
public function getUpdatedAt(): \DateTime
|
||||
{
|
||||
return $this->updatedAt;
|
||||
}
|
||||
|
@ -132,9 +138,9 @@ class ChatMember implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
* @return int
|
||||
*/
|
||||
public function getChatId(): ?int
|
||||
public function getChatId(): int
|
||||
{
|
||||
return $this->chatId;
|
||||
}
|
||||
|
@ -148,9 +154,9 @@ class ChatMember implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
* @return int
|
||||
*/
|
||||
public function getUserId(): ?int
|
||||
public function getUserId(): int
|
||||
{
|
||||
return $this->userId;
|
||||
}
|
||||
|
@ -164,9 +170,9 @@ class ChatMember implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return bool|null
|
||||
* @return bool
|
||||
*/
|
||||
public function isAuthor(): ?bool
|
||||
public function isAuthor(): bool
|
||||
{
|
||||
return $this->isAuthor;
|
||||
}
|
||||
|
@ -180,9 +186,9 @@ class ChatMember implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getState(): ?string
|
||||
public function getState(): string
|
||||
{
|
||||
return $this->state;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,6 +22,9 @@ 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
|
||||
{
|
||||
|
@ -33,7 +39,7 @@ class Command implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $createdAt
|
||||
*
|
||||
* @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']>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
|
||||
*/
|
||||
private $createdAt;
|
||||
|
@ -41,7 +47,7 @@ class Command implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $updatedAt
|
||||
*
|
||||
* @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']>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Accessor(getter="getUpdatedAt",setter="setUpdatedAt")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -66,9 +72,9 @@ class Command implements ModelInterface
|
|||
private $description;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getId(): ?string
|
||||
public function getId(): string
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
@ -84,7 +90,7 @@ class Command implements ModelInterface
|
|||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getCreatedAt(): ?\DateTime
|
||||
public function getCreatedAt(): \DateTime
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
@ -100,7 +106,7 @@ class Command implements ModelInterface
|
|||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getUpdatedAt(): ?\DateTime
|
||||
public function getUpdatedAt(): \DateTime
|
||||
{
|
||||
return $this->updatedAt;
|
||||
}
|
||||
|
@ -114,9 +120,9 @@ class Command implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getName(): ?string
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
@ -130,9 +136,9 @@ class Command implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getDescription(): ?string
|
||||
public function getDescription(): string
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
|
81
src/Bot/Model/Entity/Cost.php
Normal file
81
src/Bot/Model/Entity/Cost.php
Normal file
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHP version 7.1
|
||||
*
|
||||
* Cost 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;
|
||||
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
use JMS\Serializer\Annotation\Type;
|
||||
use RetailCrm\Mg\Bot\Model\ModelInterface;
|
||||
|
||||
/**
|
||||
* Cost 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 Cost implements ModelInterface
|
||||
{
|
||||
/**
|
||||
* @var float $value
|
||||
*
|
||||
* @Type("float")
|
||||
* @Accessor(getter="getValue",setter="setValue")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $value;
|
||||
|
||||
/**
|
||||
* @var string $currency
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getCurrency",setter="setCurrency")
|
||||
*
|
||||
* @Assert\Currency
|
||||
*/
|
||||
private $currency;
|
||||
|
||||
/**
|
||||
* @return float
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param float $value
|
||||
*/
|
||||
public function setValue(float $value)
|
||||
{
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getCurrency()
|
||||
{
|
||||
return $this->currency;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $currency
|
||||
*/
|
||||
public function setCurrency(string $currency)
|
||||
{
|
||||
$this->currency = $currency;
|
||||
}
|
||||
}
|
|
@ -6,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -20,6 +23,9 @@ 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
|
||||
{
|
||||
|
@ -34,7 +40,7 @@ class Customer implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $createdAt
|
||||
*
|
||||
* @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']>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
|
||||
*/
|
||||
private $createdAt;
|
||||
|
@ -42,7 +48,7 @@ class Customer implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $updatedAt
|
||||
*
|
||||
* @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']>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Accessor(getter="getUpdatedAt",setter="setUpdatedAt")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -168,18 +174,9 @@ class Customer implements ModelInterface
|
|||
private $email;
|
||||
|
||||
/**
|
||||
* @var Utm $utm
|
||||
*
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\Utm")
|
||||
* @Accessor(getter="getUtm",setter="setUtm")
|
||||
* @SkipWhenEmpty()
|
||||
* @return string
|
||||
*/
|
||||
private $utm;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getId(): ?string
|
||||
public function getId(): string
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
@ -195,7 +192,7 @@ class Customer implements ModelInterface
|
|||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getCreatedAt(): ?\DateTime
|
||||
public function getCreatedAt(): \DateTime
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
@ -211,7 +208,7 @@ class Customer implements ModelInterface
|
|||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getUpdatedAt(): ?\DateTime
|
||||
public function getUpdatedAt(): \DateTime
|
||||
{
|
||||
return $this->updatedAt;
|
||||
}
|
||||
|
@ -225,9 +222,9 @@ class Customer implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getExternalId(): ?string
|
||||
public function getExternalId(): string
|
||||
{
|
||||
return $this->externalId;
|
||||
}
|
||||
|
@ -241,9 +238,9 @@ class Customer implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
* @return int
|
||||
*/
|
||||
public function getChannelId(): ?int
|
||||
public function getChannelId(): int
|
||||
{
|
||||
return $this->channelId;
|
||||
}
|
||||
|
@ -257,9 +254,9 @@ class Customer implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getUsername(): ?string
|
||||
public function getUsername(): string
|
||||
{
|
||||
return $this->username;
|
||||
}
|
||||
|
@ -273,9 +270,9 @@ class Customer implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getFirstName(): ?string
|
||||
public function getFirstName(): string
|
||||
{
|
||||
return $this->firstName;
|
||||
}
|
||||
|
@ -289,9 +286,9 @@ class Customer implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getLastName(): ?string
|
||||
public function getLastName(): string
|
||||
{
|
||||
return $this->lastName;
|
||||
}
|
||||
|
@ -305,9 +302,9 @@ class Customer implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getAvatarUrl(): ?string
|
||||
public function getAvatarUrl(): string
|
||||
{
|
||||
return $this->avatarUrl;
|
||||
}
|
||||
|
@ -321,9 +318,9 @@ class Customer implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getProfileUrl(): ?string
|
||||
public function getProfileUrl(): string
|
||||
{
|
||||
return $this->profileUrl;
|
||||
}
|
||||
|
@ -337,9 +334,9 @@ class Customer implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getRevokedAt(): ?string
|
||||
public function getRevokedAt(): string
|
||||
{
|
||||
return $this->revokedAt;
|
||||
}
|
||||
|
@ -353,9 +350,9 @@ class Customer implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getCountry(): ?string
|
||||
public function getCountry(): string
|
||||
{
|
||||
return $this->country;
|
||||
}
|
||||
|
@ -369,9 +366,9 @@ class Customer implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getLanguage(): ?string
|
||||
public function getLanguage(): string
|
||||
{
|
||||
return $this->language;
|
||||
}
|
||||
|
@ -385,9 +382,9 @@ class Customer implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getPhone(): ?string
|
||||
public function getPhone(): string
|
||||
{
|
||||
return $this->phone;
|
||||
}
|
||||
|
@ -401,9 +398,9 @@ class Customer implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getEmail(): ?string
|
||||
public function getEmail(): string
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
@ -415,21 +412,4 @@ 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;
|
||||
}
|
||||
}
|
||||
|
|
132
src/Bot/Model/Entity/Delivery.php
Normal file
132
src/Bot/Model/Entity/Delivery.php
Normal file
|
@ -0,0 +1,132 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHP version 7.1
|
||||
*
|
||||
* Delivery 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;
|
||||
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
use JMS\Serializer\Annotation\Type;
|
||||
use RetailCrm\Mg\Bot\Model\ModelInterface;
|
||||
|
||||
/**
|
||||
* Delivery 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 Delivery implements ModelInterface
|
||||
{
|
||||
/**
|
||||
* @var string $name
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getName",setter="setName")
|
||||
*
|
||||
* @Assert\NotBlank
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @var Cost $price
|
||||
*
|
||||
* @Type("Cost")
|
||||
* @Accessor(getter="getPrice",setter="setPrice")
|
||||
*
|
||||
* @Assert\Currency
|
||||
*/
|
||||
private $price;
|
||||
|
||||
/**
|
||||
* @var string $address
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getAddress",setter="setAddress")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $address;
|
||||
|
||||
/**
|
||||
* @var string $comment
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getComment",setter="setComment")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $comment;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*/
|
||||
public function setName(string $name)
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Cost
|
||||
*/
|
||||
public function getPrice()
|
||||
{
|
||||
return $this->price;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Cost $price
|
||||
*/
|
||||
public function setPrice(Cost $price)
|
||||
{
|
||||
$this->price = $price;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getAddress()
|
||||
{
|
||||
return $this->address;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $address
|
||||
*/
|
||||
public function setAddress(string $address)
|
||||
{
|
||||
$this->address = $address;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getComment()
|
||||
{
|
||||
return $this->comment;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $comment
|
||||
*/
|
||||
public function setComment(string $comment)
|
||||
{
|
||||
$this->comment = $comment;
|
||||
}
|
||||
}
|
|
@ -6,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,6 +22,9 @@ 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
|
||||
{
|
||||
|
@ -33,7 +39,7 @@ class Dialog implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $createdAt
|
||||
*
|
||||
* @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']>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
|
||||
*/
|
||||
private $createdAt;
|
||||
|
@ -41,7 +47,7 @@ class Dialog implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $updatedAt
|
||||
*
|
||||
* @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']>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Accessor(getter="getUpdatedAt",setter="setUpdatedAt")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -86,7 +92,7 @@ class Dialog implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $closedAt
|
||||
*
|
||||
* @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']>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Accessor(getter="getClosedAt",setter="setClosedAt")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -120,18 +126,9 @@ class Dialog implements ModelInterface
|
|||
private $isActive;
|
||||
|
||||
/**
|
||||
* @var Utm $utm
|
||||
*
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\Utm")
|
||||
* @Accessor(getter="getUtm",setter="setUtm")
|
||||
* @SkipWhenEmpty()
|
||||
* @return string
|
||||
*/
|
||||
private $utm;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getId(): ?string
|
||||
public function getId(): string
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
@ -147,7 +144,7 @@ class Dialog implements ModelInterface
|
|||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getCreatedAt(): ?\DateTime
|
||||
public function getCreatedAt(): \DateTime
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
@ -163,7 +160,7 @@ class Dialog implements ModelInterface
|
|||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getUpdatedAt(): ?\DateTime
|
||||
public function getUpdatedAt(): \DateTime
|
||||
{
|
||||
return $this->updatedAt;
|
||||
}
|
||||
|
@ -177,9 +174,9 @@ class Dialog implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
* @return int
|
||||
*/
|
||||
public function getBotId(): ?int
|
||||
public function getBotId(): int
|
||||
{
|
||||
return $this->botId;
|
||||
}
|
||||
|
@ -193,9 +190,9 @@ class Dialog implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
* @return int
|
||||
*/
|
||||
public function getChatId(): ?int
|
||||
public function getChatId(): int
|
||||
{
|
||||
return $this->chatId;
|
||||
}
|
||||
|
@ -209,9 +206,9 @@ class Dialog implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
* @return int
|
||||
*/
|
||||
public function getBeginMessageId(): ?int
|
||||
public function getBeginMessageId(): int
|
||||
{
|
||||
return $this->beginMessageId;
|
||||
}
|
||||
|
@ -225,9 +222,9 @@ class Dialog implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
* @return int
|
||||
*/
|
||||
public function getEndingMessageId(): ?int
|
||||
public function getEndingMessageId(): int
|
||||
{
|
||||
return $this->endingMessageId;
|
||||
}
|
||||
|
@ -243,7 +240,7 @@ class Dialog implements ModelInterface
|
|||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getClosedAt(): ?\DateTime
|
||||
public function getClosedAt(): \DateTime
|
||||
{
|
||||
return $this->closedAt;
|
||||
}
|
||||
|
@ -257,9 +254,9 @@ class Dialog implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return bool|null
|
||||
* @return bool
|
||||
*/
|
||||
public function isAssigned(): ?bool
|
||||
public function isAssigned(): bool
|
||||
{
|
||||
return $this->isAssigned;
|
||||
}
|
||||
|
@ -273,9 +270,9 @@ class Dialog implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return Responsible|null
|
||||
* @return Responsible
|
||||
*/
|
||||
public function getResponsible(): ?Responsible
|
||||
public function getResponsible(): Responsible
|
||||
{
|
||||
return $this->responsible;
|
||||
}
|
||||
|
@ -289,9 +286,9 @@ class Dialog implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return bool|null
|
||||
* @return bool
|
||||
*/
|
||||
public function isActive(): ?bool
|
||||
public function isActive(): bool
|
||||
{
|
||||
return $this->isActive;
|
||||
}
|
||||
|
@ -303,21 +300,4 @@ class Dialog implements ModelInterface
|
|||
{
|
||||
$this->isActive = $isActive;
|
||||
}
|
||||
|
||||
/**
|
||||
* @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,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,6 +22,9 @@ 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
|
||||
{
|
||||
|
@ -41,9 +47,9 @@ class FileMeta implements ModelInterface
|
|||
private $width;
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
* @return int
|
||||
*/
|
||||
public function getHeight(): ?int
|
||||
public function getHeight(): int
|
||||
{
|
||||
return $this->height;
|
||||
}
|
||||
|
@ -57,9 +63,9 @@ class FileMeta implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
* @return int
|
||||
*/
|
||||
public function getWidth(): ?int
|
||||
public function getWidth(): int
|
||||
{
|
||||
return $this->width;
|
||||
}
|
||||
|
|
|
@ -3,12 +3,15 @@
|
|||
/**
|
||||
* PHP version 7.1
|
||||
*
|
||||
* TemplateAttachment entity
|
||||
* Item entity
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Template
|
||||
* @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\Template;
|
||||
namespace RetailCrm\Mg\Bot\Model\Entity;
|
||||
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
|
@ -16,17 +19,21 @@ use JMS\Serializer\Annotation\Type;
|
|||
use RetailCrm\Mg\Bot\Model\ModelInterface;
|
||||
|
||||
/**
|
||||
* TemplateAttachment class
|
||||
* Item class
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Model\Entity\Template
|
||||
* @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 TemplateAttachment implements ModelInterface
|
||||
class Item implements ModelInterface
|
||||
{
|
||||
/**
|
||||
* @var string $id
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getId",setter="setId")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $id;
|
||||
|
||||
|
@ -40,26 +47,25 @@ class TemplateAttachment implements ModelInterface
|
|||
private $caption;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getId(): ?string
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $id
|
||||
* @return void
|
||||
*/
|
||||
public function setId(string $id): void
|
||||
public function setId(string $id)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getCaption(): ?string
|
||||
public function getCaption()
|
||||
{
|
||||
return $this->caption;
|
||||
}
|
||||
|
@ -67,7 +73,7 @@ class TemplateAttachment implements ModelInterface
|
|||
/**
|
||||
* @param string $caption
|
||||
*/
|
||||
public function setCaption(string $caption): void
|
||||
public function setCaption(string $caption)
|
||||
{
|
||||
$this->caption = $caption;
|
||||
}
|
|
@ -6,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,6 +22,9 @@ 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
|
||||
{
|
||||
|
@ -50,18 +56,9 @@ class Item implements ModelInterface
|
|||
private $caption;
|
||||
|
||||
/**
|
||||
* @var string $transcription
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getTranscription",setter="setTranscription")
|
||||
* @SkipWhenEmpty()
|
||||
* @return string
|
||||
*/
|
||||
private $transcription;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getId(): ?string
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
@ -75,9 +72,9 @@ class Item implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
* @return int
|
||||
*/
|
||||
public function getSize(): ?int
|
||||
public function getSize(): int
|
||||
{
|
||||
return $this->size;
|
||||
}
|
||||
|
@ -91,7 +88,7 @@ class Item implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getCaption()
|
||||
{
|
||||
|
@ -105,20 +102,4 @@ 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,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -21,6 +24,9 @@ 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
|
||||
{
|
||||
|
@ -35,7 +41,7 @@ class Message implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $createdAt
|
||||
*
|
||||
* @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']>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
|
||||
*/
|
||||
private $createdAt;
|
||||
|
@ -43,7 +49,7 @@ class Message implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $updatedAt
|
||||
*
|
||||
* @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']>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Accessor(getter="getUpdatedAt",setter="setUpdatedAt")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -121,28 +127,11 @@ 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="isRead",setter="setIsRead")
|
||||
* @Accessor(getter="getIsRead",setter="setIsRead")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $isRead;
|
||||
|
@ -151,7 +140,7 @@ class Message implements ModelInterface
|
|||
* @var bool $isEdit
|
||||
*
|
||||
* @Type("bool")
|
||||
* @Accessor(getter="isEdit",setter="setIsEdit")
|
||||
* @Accessor(getter="getIsEdit",setter="setIsEdit")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $isEdit;
|
||||
|
@ -177,7 +166,7 @@ class Message implements ModelInterface
|
|||
/**
|
||||
* @var Dialog $dialog
|
||||
*
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\Dialog")
|
||||
* @Type("Dialog")
|
||||
* @Accessor(getter="getDialog",setter="setDialog")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -195,7 +184,7 @@ class Message implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $channelSentAt
|
||||
*
|
||||
* @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']>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Accessor(getter="getChannelSentAt",setter="setChannelSentAt")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -204,7 +193,7 @@ class Message implements ModelInterface
|
|||
/**
|
||||
* @var MessageOrder $order
|
||||
*
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\Message\MessageOrder")
|
||||
* @Type("MessageOrder")
|
||||
* @Accessor(getter="getOrder",setter="setOrder")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -213,16 +202,16 @@ class Message implements ModelInterface
|
|||
/**
|
||||
* @var MessageProduct $product
|
||||
*
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\Message\MessageProduct")
|
||||
* @Type("MessageProduct")
|
||||
* @Accessor(getter="getProduct",setter="setProduct")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $product;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getId(): ?string
|
||||
public function getId(): string
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
@ -238,7 +227,7 @@ class Message implements ModelInterface
|
|||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getCreatedAt(): ?\DateTime
|
||||
public function getCreatedAt(): \DateTime
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
@ -254,7 +243,7 @@ class Message implements ModelInterface
|
|||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getUpdatedAt(): ?\DateTime
|
||||
public function getUpdatedAt(): \DateTime
|
||||
{
|
||||
return $this->updatedAt;
|
||||
}
|
||||
|
@ -268,9 +257,9 @@ class Message implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getActions(): ?string
|
||||
public function getActions(): string
|
||||
{
|
||||
return $this->actions;
|
||||
}
|
||||
|
@ -284,9 +273,9 @@ class Message implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return array|null
|
||||
* @return array
|
||||
*/
|
||||
public function getItems(): ?array
|
||||
public function getItems(): array
|
||||
{
|
||||
return $this->items;
|
||||
}
|
||||
|
@ -300,9 +289,9 @@ class Message implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return User|null
|
||||
* @return User
|
||||
*/
|
||||
public function getFrom(): ?User
|
||||
public function getFrom(): User
|
||||
{
|
||||
return $this->from;
|
||||
}
|
||||
|
@ -318,7 +307,7 @@ class Message implements ModelInterface
|
|||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getTime(): ?\DateTime
|
||||
public function getTime(): \DateTime
|
||||
{
|
||||
return $this->time;
|
||||
}
|
||||
|
@ -332,9 +321,9 @@ class Message implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getType(): ?string
|
||||
public function getType(): string
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
@ -348,9 +337,9 @@ class Message implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getScope(): ?string
|
||||
public function getScope(): string
|
||||
{
|
||||
return $this->scope;
|
||||
}
|
||||
|
@ -364,9 +353,9 @@ class Message implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
* @return int
|
||||
*/
|
||||
public function getChatId(): ?int
|
||||
public function getChatId(): int
|
||||
{
|
||||
return $this->chatId;
|
||||
}
|
||||
|
@ -380,9 +369,9 @@ class Message implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getContent(): ?string
|
||||
public function getContent(): string
|
||||
{
|
||||
return $this->content;
|
||||
}
|
||||
|
@ -396,37 +385,9 @@ class Message implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return bool
|
||||
*/
|
||||
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
|
||||
public function isRead(): bool
|
||||
{
|
||||
return $this->isRead;
|
||||
}
|
||||
|
@ -440,9 +401,9 @@ class Message implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return bool|null
|
||||
* @return bool
|
||||
*/
|
||||
public function isEdit(): ?bool
|
||||
public function isEdit(): bool
|
||||
{
|
||||
return $this->isEdit;
|
||||
}
|
||||
|
@ -456,9 +417,9 @@ class Message implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getStatus(): ?string
|
||||
public function getStatus(): string
|
||||
{
|
||||
return $this->status;
|
||||
}
|
||||
|
@ -472,9 +433,9 @@ class Message implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getAction(): ?string
|
||||
public function getAction(): string
|
||||
{
|
||||
return $this->action;
|
||||
}
|
||||
|
@ -488,9 +449,9 @@ class Message implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return Dialog|null
|
||||
* @return Dialog
|
||||
*/
|
||||
public function getDialog(): ?Dialog
|
||||
public function getDialog(): Dialog
|
||||
{
|
||||
return $this->dialog;
|
||||
}
|
||||
|
@ -504,9 +465,9 @@ class Message implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
* @return int
|
||||
*/
|
||||
public function getChannelId(): ?int
|
||||
public function getChannelId(): int
|
||||
{
|
||||
return $this->channelId;
|
||||
}
|
||||
|
@ -522,7 +483,7 @@ class Message implements ModelInterface
|
|||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getChannelSentAt(): ?\DateTime
|
||||
public function getChannelSentAt(): \DateTime
|
||||
{
|
||||
return $this->channelSentAt;
|
||||
}
|
||||
|
@ -536,9 +497,9 @@ class Message implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return MessageOrder|null
|
||||
* @return MessageOrder
|
||||
*/
|
||||
public function getOrder(): ?MessageOrder
|
||||
public function getOrder(): MessageOrder
|
||||
{
|
||||
return $this->order;
|
||||
}
|
||||
|
@ -552,9 +513,9 @@ class Message implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return MessageProduct|null
|
||||
* @return MessageProduct
|
||||
*/
|
||||
public function getProduct(): ?MessageProduct
|
||||
public function getProduct(): MessageProduct
|
||||
{
|
||||
return $this->product;
|
||||
}
|
||||
|
|
|
@ -6,11 +6,13 @@
|
|||
* 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;
|
||||
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
use JMS\Serializer\Annotation\Type;
|
||||
|
@ -20,6 +22,9 @@ 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
|
||||
{
|
||||
|
@ -43,7 +48,7 @@ class MessageCost implements ModelInterface
|
|||
private $currency;
|
||||
|
||||
/**
|
||||
* @return float|null
|
||||
* @return float
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
|
@ -59,7 +64,7 @@ class MessageCost implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getCurrency()
|
||||
{
|
||||
|
|
|
@ -6,11 +6,13 @@
|
|||
* 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;
|
||||
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
use JMS\Serializer\Annotation\Type;
|
||||
|
@ -20,6 +22,9 @@ 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
|
||||
{
|
||||
|
@ -36,7 +41,7 @@ class MessageDelivery implements ModelInterface
|
|||
/**
|
||||
* @var MessageCost $price
|
||||
*
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\Message\MessageCost")
|
||||
* @Type("Cost")
|
||||
* @Accessor(getter="getPrice",setter="setPrice")
|
||||
*
|
||||
* @Assert\Currency
|
||||
|
@ -62,7 +67,7 @@ class MessageDelivery implements ModelInterface
|
|||
private $comment;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
|
@ -78,7 +83,7 @@ class MessageDelivery implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return MessageCost|null
|
||||
* @return MessageCost
|
||||
*/
|
||||
public function getPrice()
|
||||
{
|
||||
|
@ -94,7 +99,7 @@ class MessageDelivery implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getAddress()
|
||||
{
|
||||
|
@ -110,7 +115,7 @@ class MessageDelivery implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getComment()
|
||||
{
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,6 +22,9 @@ 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
|
||||
{
|
||||
|
@ -52,7 +58,7 @@ class MessageOrder implements ModelInterface
|
|||
/**
|
||||
* @var MessageCost $cost
|
||||
*
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\Message\MessageCost")
|
||||
* @Type("MessageCost")
|
||||
* @Accessor(getter="getCost",setter="setCost")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -61,7 +67,7 @@ class MessageOrder implements ModelInterface
|
|||
/**
|
||||
* @var MessageStatus $status
|
||||
*
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\Message\MessageStatus")
|
||||
* @Type("MessageStatus")
|
||||
* @Accessor(getter="getStatus",setter="setStatus")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -70,7 +76,7 @@ class MessageOrder implements ModelInterface
|
|||
/**
|
||||
* @var MessageDelivery $delivery
|
||||
*
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\Message\MessageDelivery")
|
||||
* @Type("MessageDelivery")
|
||||
* @Accessor(getter="getDelivery",setter="setDelivery")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -95,7 +101,7 @@ class MessageOrder implements ModelInterface
|
|||
private $payments;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getNumber()
|
||||
{
|
||||
|
@ -111,7 +117,7 @@ class MessageOrder implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getUrl()
|
||||
{
|
||||
|
@ -127,7 +133,7 @@ class MessageOrder implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getDate()
|
||||
{
|
||||
|
@ -143,7 +149,7 @@ class MessageOrder implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return MessageCost|null
|
||||
* @return MessageCost
|
||||
*/
|
||||
public function getCost()
|
||||
{
|
||||
|
@ -159,7 +165,7 @@ class MessageOrder implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return MessageStatus|null
|
||||
* @return MessageStatus
|
||||
*/
|
||||
public function getStatus()
|
||||
{
|
||||
|
@ -175,7 +181,7 @@ class MessageOrder implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return MessageDelivery|null
|
||||
* @return MessageDelivery
|
||||
*/
|
||||
public function getDelivery()
|
||||
{
|
||||
|
@ -191,7 +197,7 @@ class MessageOrder implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return array|null
|
||||
* @return array
|
||||
*/
|
||||
public function getItems()
|
||||
{
|
||||
|
@ -207,7 +213,7 @@ class MessageOrder implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return array|null
|
||||
* @return array
|
||||
*/
|
||||
public function getPayments()
|
||||
{
|
||||
|
|
|
@ -4,6 +4,11 @@
|
|||
* 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;
|
||||
|
@ -15,6 +20,11 @@ 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
|
||||
{
|
||||
|
@ -48,7 +58,7 @@ class MessageOrderItem implements ModelInterface
|
|||
/**
|
||||
* @var MessageCost
|
||||
*
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\Message\MessageCost")
|
||||
* @Type("MessageCost")
|
||||
* @Accessor(getter="getPrice",setter="setPrice")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -57,14 +67,14 @@ class MessageOrderItem implements ModelInterface
|
|||
/**
|
||||
* @var MessageQuantity
|
||||
*
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\Message\MessageQuantity")
|
||||
* @Accessor(getter="getQuantity",setter="setQuantity")
|
||||
* @Type("MessageQuantity")
|
||||
* @Accessor(getter="getQuantity",setter="setQuantity)
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $quantity;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
|
@ -80,7 +90,7 @@ class MessageOrderItem implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getUrl()
|
||||
{
|
||||
|
@ -96,7 +106,7 @@ class MessageOrderItem implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getImg()
|
||||
{
|
||||
|
@ -112,7 +122,7 @@ class MessageOrderItem implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return MessageCost|null
|
||||
* @return MessageCost
|
||||
*/
|
||||
public function getPrice()
|
||||
{
|
||||
|
@ -128,7 +138,7 @@ class MessageOrderItem implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return MessageQuantity|null
|
||||
* @return MessageQuantity
|
||||
*/
|
||||
public function getQuantity()
|
||||
{
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,6 +22,9 @@ 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
|
||||
{
|
||||
|
@ -41,9 +47,9 @@ class MessageOrderPaymentStatus implements ModelInterface
|
|||
private $payed;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getName(): ?string
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
@ -57,9 +63,9 @@ class MessageOrderPaymentStatus implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return bool|null
|
||||
* @return bool
|
||||
*/
|
||||
public function getPayed(): ?bool
|
||||
public function getPayed(): bool
|
||||
{
|
||||
return $this->payed;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,6 +22,9 @@ 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
|
||||
{
|
||||
|
@ -34,7 +40,7 @@ class MessagePayment implements ModelInterface
|
|||
/**
|
||||
* @var MessageOrderPaymentStatus $status
|
||||
*
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\Message\MessageOrderPaymentStatus")
|
||||
* @Type("MessageOrderPaymentStatus")
|
||||
* @Accessor(getter="getStatus",setter="setStatus")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -43,14 +49,14 @@ class MessagePayment implements ModelInterface
|
|||
/**
|
||||
* @var MessageCost $amount
|
||||
*
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\Message\MessageCost")
|
||||
* @Type("MessageCost")
|
||||
* @Accessor(getter="getAmount",setter="setAmount")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $amount;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
|
@ -66,7 +72,7 @@ class MessagePayment implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return MessageOrderPaymentStatus|null
|
||||
* @return MessageOrderPaymentStatus
|
||||
*/
|
||||
public function getStatus()
|
||||
{
|
||||
|
@ -82,7 +88,7 @@ class MessagePayment implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return MessageCost|null
|
||||
* @return MessageCost
|
||||
*/
|
||||
public function getAmount()
|
||||
{
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,6 +22,9 @@ 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
|
||||
{
|
||||
|
@ -70,7 +76,7 @@ class MessageProduct implements ModelInterface
|
|||
/**
|
||||
* @var MessageCost $cost
|
||||
*
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\Message\MessageCost")
|
||||
* @Type("Cost")
|
||||
* @Accessor(getter="getCost",setter="setCost")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -79,16 +85,16 @@ class MessageProduct implements ModelInterface
|
|||
/**
|
||||
* @var MessageQuantity $quantity
|
||||
*
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\Message\MessageQuantity")
|
||||
* @Accessor(getter="getQuantity",setter="setQuantity")
|
||||
* @Type("MessageQuantity")
|
||||
* @Accessor(getter="getQuantity",setter="setQuantity)
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $quantity;
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
* @return int
|
||||
*/
|
||||
public function getId(): ?int
|
||||
public function getId(): int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
@ -102,9 +108,9 @@ class MessageProduct implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getName(): ?string
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
@ -118,9 +124,9 @@ class MessageProduct implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getArticle(): ?string
|
||||
public function getArticle(): string
|
||||
{
|
||||
return $this->article;
|
||||
}
|
||||
|
@ -134,9 +140,9 @@ class MessageProduct implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getUrl(): ?string
|
||||
public function getUrl(): string
|
||||
{
|
||||
return $this->url;
|
||||
}
|
||||
|
@ -150,9 +156,9 @@ class MessageProduct implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getImg(): ?string
|
||||
public function getImg(): string
|
||||
{
|
||||
return $this->img;
|
||||
}
|
||||
|
@ -166,9 +172,9 @@ class MessageProduct implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return MessageCost|null
|
||||
* @return MessageCost
|
||||
*/
|
||||
public function getCost(): ?MessageCost
|
||||
public function getCost(): MessageCost
|
||||
{
|
||||
return $this->cost;
|
||||
}
|
||||
|
@ -182,9 +188,9 @@ class MessageProduct implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return MessageQuantity|null
|
||||
* @return MessageQuantity
|
||||
*/
|
||||
public function getQuantity(): ?MessageQuantity
|
||||
public function getQuantity(): MessageQuantity
|
||||
{
|
||||
return $this->quantity;
|
||||
}
|
||||
|
|
|
@ -6,11 +6,13 @@
|
|||
* 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;
|
||||
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
use JMS\Serializer\Annotation\Type;
|
||||
|
@ -20,6 +22,9 @@ 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
|
||||
{
|
||||
|
@ -43,7 +48,7 @@ class MessageQuantity implements ModelInterface
|
|||
private $unit;
|
||||
|
||||
/**
|
||||
* @return float|null
|
||||
* @return float
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
|
@ -59,7 +64,7 @@ class MessageQuantity implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getUnit()
|
||||
{
|
||||
|
|
|
@ -1,172 +0,0 @@
|
|||
<?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,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,6 +22,9 @@ 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
|
||||
{
|
||||
|
@ -41,9 +47,9 @@ class MessageStatus implements ModelInterface
|
|||
private $name;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getCode(): ?string
|
||||
public function getCode(): string
|
||||
{
|
||||
return $this->code;
|
||||
}
|
||||
|
@ -57,9 +63,9 @@ class MessageStatus implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getName(): ?string
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
|
|
@ -1,106 +0,0 @@
|
|||
<?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;
|
||||
}
|
||||
}
|
|
@ -1,74 +0,0 @@
|
|||
<?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;
|
||||
}
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
<?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;
|
||||
}
|
||||
}
|
230
src/Bot/Model/Entity/Order.php
Normal file
230
src/Bot/Model/Entity/Order.php
Normal file
|
@ -0,0 +1,230 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHP version 7.1
|
||||
*
|
||||
* Order 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;
|
||||
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
use JMS\Serializer\Annotation\Type;
|
||||
use RetailCrm\Mg\Bot\Model\ModelInterface;
|
||||
|
||||
/**
|
||||
* Order 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 Order implements ModelInterface
|
||||
{
|
||||
/**
|
||||
* @var string $number
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getNumber",setter="setNumber")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $number;
|
||||
|
||||
/**
|
||||
* @var string $url
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getUrl",setter="setUrl")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $url;
|
||||
|
||||
/**
|
||||
* @var string $date
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getDate",setter="setDate")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $date;
|
||||
|
||||
/**
|
||||
* @var Cost $cost
|
||||
*
|
||||
* @Type("Cost")
|
||||
* @Accessor(getter="getCost",setter="setCost")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $cost;
|
||||
|
||||
/**
|
||||
* @var Status $status
|
||||
*
|
||||
* @Type("Status")
|
||||
* @Accessor(getter="getStatus",setter="setStatus")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $status;
|
||||
|
||||
/**
|
||||
* @var Delivery $delivery
|
||||
*
|
||||
* @Type("Delivery")
|
||||
* @Accessor(getter="getDelivery",setter="setDelivery")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $delivery;
|
||||
|
||||
/**
|
||||
* @var array $items
|
||||
*
|
||||
* @Type("array")
|
||||
* @Accessor(getter="getItems",setter="setItems")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $items;
|
||||
|
||||
/**
|
||||
* @var array $payments
|
||||
*
|
||||
* @Type("array")
|
||||
* @Accessor(getter="getPayments",setter="setPayments")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $payments;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getNumber()
|
||||
{
|
||||
return $this->number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $number
|
||||
*/
|
||||
public function setNumber(string $number)
|
||||
{
|
||||
$this->number = $number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getUrl()
|
||||
{
|
||||
return $this->url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
*/
|
||||
public function setUrl(string $url)
|
||||
{
|
||||
$this->url = $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getDate()
|
||||
{
|
||||
return $this->date;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $date
|
||||
*/
|
||||
public function setDate(string $date)
|
||||
{
|
||||
$this->date = $date;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Cost
|
||||
*/
|
||||
public function getCost()
|
||||
{
|
||||
return $this->cost;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Cost $cost
|
||||
*/
|
||||
public function setCost(Cost $cost)
|
||||
{
|
||||
$this->cost = $cost;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Status
|
||||
*/
|
||||
public function getStatus()
|
||||
{
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Status $status
|
||||
*/
|
||||
public function setStatus(Status $status)
|
||||
{
|
||||
$this->status = $status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Delivery
|
||||
*/
|
||||
public function getDelivery()
|
||||
{
|
||||
return $this->delivery;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Delivery $delivery
|
||||
*/
|
||||
public function setDelivery(Delivery $delivery)
|
||||
{
|
||||
$this->delivery = $delivery;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getItems()
|
||||
{
|
||||
return $this->items;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $items
|
||||
*/
|
||||
public function setItems(array $items)
|
||||
{
|
||||
$this->items = $items;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getPayments()
|
||||
{
|
||||
return $this->payments;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $payments
|
||||
*/
|
||||
public function setPayments(array $payments)
|
||||
{
|
||||
$this->payments = $payments;
|
||||
}
|
||||
}
|
155
src/Bot/Model/Entity/OrderItem.php
Normal file
155
src/Bot/Model/Entity/OrderItem.php
Normal file
|
@ -0,0 +1,155 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHP version 7.1
|
||||
*
|
||||
* Order item 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;
|
||||
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
use JMS\Serializer\Annotation\Type;
|
||||
use RetailCrm\Mg\Bot\Model\ModelInterface;
|
||||
|
||||
/**
|
||||
* OrderItem 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 OrderItem implements ModelInterface
|
||||
{
|
||||
/**
|
||||
* @var string $name
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getName",setter="setName")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @var string $url
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getUrl",setter="setUrl")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $url;
|
||||
|
||||
/**
|
||||
* @var string $img
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getImg",setter="setImg")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $img;
|
||||
|
||||
/**
|
||||
* @var Cost $price
|
||||
*
|
||||
* @Type("Cost")
|
||||
* @Accessor(getter="getPrice",setter="setPrice")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $price;
|
||||
|
||||
/**
|
||||
* @var Quantity $quantity
|
||||
*
|
||||
* @Type("Quantity")
|
||||
* @Accessor(getter="getQuantity",setter="setQuantity)
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $quantity;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*/
|
||||
public function setName(string $name)
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getUrl()
|
||||
{
|
||||
return $this->url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
*/
|
||||
public function setUrl(string $url)
|
||||
{
|
||||
$this->url = $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getImg()
|
||||
{
|
||||
return $this->img;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $img
|
||||
*/
|
||||
public function setImg(string $img)
|
||||
{
|
||||
$this->img = $img;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Cost
|
||||
*/
|
||||
public function getPrice()
|
||||
{
|
||||
return $this->price;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Cost $price
|
||||
*/
|
||||
public function setPrice(Cost $price)
|
||||
{
|
||||
$this->price = $price;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Quantity
|
||||
*/
|
||||
public function getQuantity()
|
||||
{
|
||||
return $this->quantity;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Quantity $quantity
|
||||
*/
|
||||
public function setQuantity(Quantity $quantity)
|
||||
{
|
||||
$this->quantity = $quantity;
|
||||
}
|
||||
}
|
105
src/Bot/Model/Entity/Payment.php
Normal file
105
src/Bot/Model/Entity/Payment.php
Normal file
|
@ -0,0 +1,105 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHP version 7.1
|
||||
*
|
||||
* Payment 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;
|
||||
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
use JMS\Serializer\Annotation\Type;
|
||||
use RetailCrm\Mg\Bot\Model\ModelInterface;
|
||||
|
||||
/**
|
||||
* Payment 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 Payment implements ModelInterface
|
||||
{
|
||||
/**
|
||||
* @var string $name
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getName",setter="setName")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @var PaymentStatus $status
|
||||
*
|
||||
* @Type("PaymentStatus")
|
||||
* @Accessor(getter="getStatus",setter="setStatus")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $status;
|
||||
|
||||
/**
|
||||
* @var Cost $amount
|
||||
*
|
||||
* @Type("Cost")
|
||||
* @Accessor(getter="getAmount",setter="setAmount")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $amount;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*/
|
||||
public function setName(string $name)
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return PaymentStatus
|
||||
*/
|
||||
public function getStatus()
|
||||
{
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param PaymentStatus $status
|
||||
*/
|
||||
public function setStatus(PaymentStatus $status)
|
||||
{
|
||||
$this->status = $status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Cost
|
||||
*/
|
||||
public function getAmount()
|
||||
{
|
||||
return $this->amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Cost $amount
|
||||
*/
|
||||
public function setAmount(Cost $amount)
|
||||
{
|
||||
$this->amount = $amount;
|
||||
}
|
||||
}
|
80
src/Bot/Model/Entity/PaymentStatus.php
Normal file
80
src/Bot/Model/Entity/PaymentStatus.php
Normal file
|
@ -0,0 +1,80 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHP version 7.1
|
||||
*
|
||||
* Payment status 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;
|
||||
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
use JMS\Serializer\Annotation\Type;
|
||||
use RetailCrm\Mg\Bot\Model\ModelInterface;
|
||||
|
||||
/**
|
||||
* PaymentStatus 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 PaymentStatus implements ModelInterface
|
||||
{
|
||||
/**
|
||||
* @var string $name
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getName",setter="setName")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @var bool $payed
|
||||
*
|
||||
* @Type("bool")
|
||||
* @Accessor(getter="getPayed",setter="setPayed")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $payed;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*/
|
||||
public function setName(string $name)
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isPayed()
|
||||
{
|
||||
return $this->payed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $payed
|
||||
*/
|
||||
public function setPayed(bool $payed)
|
||||
{
|
||||
$this->payed = $payed;
|
||||
}
|
||||
}
|
205
src/Bot/Model/Entity/Product.php
Normal file
205
src/Bot/Model/Entity/Product.php
Normal file
|
@ -0,0 +1,205 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHP version 7.1
|
||||
*
|
||||
* Product 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;
|
||||
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
use JMS\Serializer\Annotation\Type;
|
||||
use RetailCrm\Mg\Bot\Model\ModelInterface;
|
||||
|
||||
/**
|
||||
* Product 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 Product implements ModelInterface
|
||||
{
|
||||
/**
|
||||
* @var int $id
|
||||
*
|
||||
* @Type("int")
|
||||
* @Accessor(getter="getId",setter="setId")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string $name
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getName",setter="setName")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @var string $article
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getArticle",setter="setArticle")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $article;
|
||||
|
||||
/**
|
||||
* @var string $url
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getUrl",setter="setUrl")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $url;
|
||||
|
||||
/**
|
||||
* @var string $img
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getImg",setter="setImg")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $img;
|
||||
|
||||
/**
|
||||
* @var Cost $cost
|
||||
*
|
||||
* @Type("Cost")
|
||||
* @Accessor(getter="getCost",setter="setCost")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $cost;
|
||||
|
||||
/**
|
||||
* @var Quantity $quantity
|
||||
*
|
||||
* @Type("Quantity")
|
||||
* @Accessor(getter="getQuantity",setter="setQuantity)
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $quantity;
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getId(): int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $id
|
||||
*/
|
||||
public function setId(int $id)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*/
|
||||
public function setName(string $name)
|
||||
{
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getArticle()
|
||||
{
|
||||
return $this->article;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $article
|
||||
*/
|
||||
public function setArticle(string $article)
|
||||
{
|
||||
$this->article = $article;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getUrl()
|
||||
{
|
||||
return $this->url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
*/
|
||||
public function setUrl(string $url)
|
||||
{
|
||||
$this->url = $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getImg()
|
||||
{
|
||||
return $this->img;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $img
|
||||
*/
|
||||
public function setImg(string $img)
|
||||
{
|
||||
$this->img = $img;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Cost
|
||||
*/
|
||||
public function getCost()
|
||||
{
|
||||
return $this->cost;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Cost $cost
|
||||
*/
|
||||
public function setCost(Cost $cost)
|
||||
{
|
||||
$this->cost = $cost;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Quantity
|
||||
*/
|
||||
public function getQuantity()
|
||||
{
|
||||
return $this->quantity;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Quantity $quantity
|
||||
*/
|
||||
public function setQuantity(Quantity $quantity)
|
||||
{
|
||||
$this->quantity = $quantity;
|
||||
}
|
||||
}
|
81
src/Bot/Model/Entity/Quantity.php
Normal file
81
src/Bot/Model/Entity/Quantity.php
Normal file
|
@ -0,0 +1,81 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* PHP version 7.1
|
||||
*
|
||||
* Quantity 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;
|
||||
|
||||
use JMS\Serializer\Annotation\Accessor;
|
||||
use JMS\Serializer\Annotation\SkipWhenEmpty;
|
||||
use JMS\Serializer\Annotation\Type;
|
||||
use RetailCrm\Mg\Bot\Model\ModelInterface;
|
||||
|
||||
/**
|
||||
* Quantity 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 Quantity implements ModelInterface
|
||||
{
|
||||
/**
|
||||
* @var float $value
|
||||
*
|
||||
* @Type("float")
|
||||
* @Accessor(getter="getValue",setter="setValue")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $value;
|
||||
|
||||
/**
|
||||
* @var string $unit
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getUnit",setter="setUnit")
|
||||
*
|
||||
* @Assert\Currency
|
||||
*/
|
||||
private $unit;
|
||||
|
||||
/**
|
||||
* @return float
|
||||
*/
|
||||
public function getValue()
|
||||
{
|
||||
return $this->value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param float $value
|
||||
*/
|
||||
public function setValue(float $value)
|
||||
{
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getUnit()
|
||||
{
|
||||
return $this->unit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $unit
|
||||
*/
|
||||
public function setUnit(string $unit)
|
||||
{
|
||||
$this->unit = $unit;
|
||||
}
|
||||
}
|
|
@ -6,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,6 +22,9 @@ 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
|
||||
{
|
||||
|
@ -50,18 +56,9 @@ class Responsible implements ModelInterface
|
|||
private $type;
|
||||
|
||||
/**
|
||||
* @var string $externalId
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getExternalId",setter="setExternalId")
|
||||
* @SkipWhenEmpty()
|
||||
* @return string
|
||||
*/
|
||||
private $externalId;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getAssignedAt(): ?string
|
||||
public function getAssignedAt(): string
|
||||
{
|
||||
return $this->assignedAt;
|
||||
}
|
||||
|
@ -75,9 +72,9 @@ class Responsible implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
* @return int
|
||||
*/
|
||||
public function getId(): ?int
|
||||
public function getId(): int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
@ -91,9 +88,9 @@ class Responsible implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getType(): ?string
|
||||
public function getType(): string
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
@ -105,20 +102,4 @@ 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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,9 +3,12 @@
|
|||
/**
|
||||
* PHP version 7.1
|
||||
*
|
||||
* Tag entity
|
||||
* Status 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;
|
||||
|
@ -14,65 +17,64 @@ 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
|
||||
* Status 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 Tag implements ModelInterface
|
||||
class Status implements ModelInterface
|
||||
{
|
||||
/**
|
||||
* @var string $code
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getCode",setter="setCode")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $code;
|
||||
|
||||
/**
|
||||
* @var string $name
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getName",setter="setName")
|
||||
*
|
||||
* @Assert\NotBlank
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $name;
|
||||
|
||||
/**
|
||||
* @var string $colorCode
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getColorCode",setter="setColorCode")
|
||||
* @SkipWhenEmpty()
|
||||
* @return string
|
||||
*/
|
||||
private $colorCode;
|
||||
public function getCode()
|
||||
{
|
||||
return $this->code;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $code
|
||||
*/
|
||||
public function setCode(string $code)
|
||||
{
|
||||
$this->code = $code;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getName(): string
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @return void
|
||||
*/
|
||||
public function setName(string $name): void
|
||||
public function setName(string $name)
|
||||
{
|
||||
$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;
|
||||
}
|
||||
}
|
|
@ -1,385 +0,0 @@
|
|||
<?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;
|
||||
}
|
||||
}
|
|
@ -1,120 +0,0 @@
|
|||
<?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,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -20,6 +23,9 @@ 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
|
||||
{
|
||||
|
@ -34,7 +40,7 @@ class User implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $createdAt
|
||||
*
|
||||
* @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']>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Accessor(getter="getCreatedAt",setter="setCreatedAt")
|
||||
*/
|
||||
private $createdAt;
|
||||
|
@ -42,7 +48,7 @@ class User implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $updatedAt
|
||||
*
|
||||
* @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']>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Accessor(getter="getUpdatedAt",setter="setUpdatedAt")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -136,25 +142,16 @@ class User implements ModelInterface
|
|||
/**
|
||||
* @var \DateTime $revokedAt
|
||||
*
|
||||
* @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']>")
|
||||
* @Type("DateTime<'Y-m-d\TH:i:s\.u\Z'>")
|
||||
* @Accessor(getter="getRevokedAt",setter="setRevokedAt")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $revokedAt;
|
||||
|
||||
/**
|
||||
* @var bool $isSystem
|
||||
*
|
||||
* @Type("bool")
|
||||
* @Accessor(getter="isSystem",setter="setIsSystem")
|
||||
* @SkipWhenEmpty()
|
||||
* @return string
|
||||
*/
|
||||
private $isSystem;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function getId(): ?string
|
||||
public function getId(): string
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
@ -170,7 +167,7 @@ class User implements ModelInterface
|
|||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getCreatedAt(): ?\DateTime
|
||||
public function getCreatedAt(): \DateTime
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
@ -186,7 +183,7 @@ class User implements ModelInterface
|
|||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getUpdatedAt(): ?\DateTime
|
||||
public function getUpdatedAt(): \DateTime
|
||||
{
|
||||
return $this->updatedAt;
|
||||
}
|
||||
|
@ -200,9 +197,9 @@ class User implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getExternalId(): ?string
|
||||
public function getExternalId(): string
|
||||
{
|
||||
return $this->externalId;
|
||||
}
|
||||
|
@ -216,9 +213,9 @@ class User implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getType(): ?string
|
||||
public function getType(): string
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
@ -232,9 +229,9 @@ class User implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getAvatar(): ?string
|
||||
public function getAvatar(): string
|
||||
{
|
||||
return $this->avatar;
|
||||
}
|
||||
|
@ -248,9 +245,9 @@ class User implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getName(): ?string
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
@ -264,9 +261,9 @@ class User implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getUsername(): ?string
|
||||
public function getUsername(): string
|
||||
{
|
||||
return $this->username;
|
||||
}
|
||||
|
@ -280,9 +277,9 @@ class User implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getFirstName(): ?string
|
||||
public function getFirstName(): string
|
||||
{
|
||||
return $this->firstName;
|
||||
}
|
||||
|
@ -296,9 +293,9 @@ class User implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getLastName(): ?string
|
||||
public function getLastName(): string
|
||||
{
|
||||
return $this->lastName;
|
||||
}
|
||||
|
@ -312,9 +309,9 @@ class User implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return bool|null
|
||||
* @return bool
|
||||
*/
|
||||
public function isActive(): ?bool
|
||||
public function isActive(): bool
|
||||
{
|
||||
return $this->isActive;
|
||||
}
|
||||
|
@ -328,9 +325,9 @@ class User implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return bool|null
|
||||
* @return bool
|
||||
*/
|
||||
public function isOnline(): ?bool
|
||||
public function isOnline(): bool
|
||||
{
|
||||
return $this->isOnline;
|
||||
}
|
||||
|
@ -346,7 +343,7 @@ class User implements ModelInterface
|
|||
/**
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getRevokedAt(): ?\DateTime
|
||||
public function getRevokedAt(): \DateTime
|
||||
{
|
||||
return $this->revokedAt;
|
||||
}
|
||||
|
@ -358,20 +355,4 @@ 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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,154 +0,0 @@
|
|||
<?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,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -18,6 +21,9 @@ 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,10 +5,14 @@
|
|||
* 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,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,11 +22,13 @@ 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,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,11 +22,13 @@ 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,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,12 +22,13 @@ 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")
|
||||
|
@ -40,24 +44,6 @@ 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
|
||||
*/
|
||||
|
@ -89,38 +75,4 @@ 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,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,6 +22,9 @@ 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,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,6 +22,9 @@ 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,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -18,6 +21,9 @@ 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
|
||||
{
|
||||
|
@ -49,9 +55,9 @@ trait CommonFields
|
|||
private $until;
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
* @return int
|
||||
*/
|
||||
public function getId(): ?int
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,11 +22,13 @@ 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,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -20,6 +23,9 @@ 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
|
||||
{
|
||||
|
|
|
@ -1,78 +0,0 @@
|
|||
<?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,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,21 +22,13 @@ 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
|
||||
|
@ -80,22 +75,6 @@ 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
|
||||
*/
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
<?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,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,6 +22,9 @@ 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,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,12 +22,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
|
||||
*
|
||||
|
@ -52,6 +55,24 @@ 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
|
||||
*/
|
||||
|
@ -99,4 +120,36 @@ 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,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,6 +22,9 @@ 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
|
||||
{
|
||||
|
@ -41,9 +47,9 @@ class MessageEditRequest implements ModelInterface
|
|||
private $content;
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
* @return int
|
||||
*/
|
||||
public function getId(): ?int
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
|
|
@ -6,17 +6,18 @@
|
|||
* 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;
|
||||
|
||||
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\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;
|
||||
|
||||
|
@ -24,6 +25,9 @@ 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
|
||||
{
|
||||
|
@ -41,14 +45,15 @@ class MessageSendRequest implements ModelInterface
|
|||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getContent",setter="setContent")
|
||||
* @SkipWhenEmpty()
|
||||
*
|
||||
* @Assert\NotBlank
|
||||
*/
|
||||
private $content;
|
||||
|
||||
/**
|
||||
* @var MessageProduct $product
|
||||
*
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\Message\MessageProduct")
|
||||
* @Type("Product")
|
||||
* @Accessor(getter="getProduct",setter="setProduct")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -57,7 +62,7 @@ class MessageSendRequest implements ModelInterface
|
|||
/**
|
||||
* @var MessageOrder $order
|
||||
*
|
||||
* @Type("RetailCrm\Mg\Bot\Model\Entity\Message\MessageOrder")
|
||||
* @Type("Order")
|
||||
* @Accessor(getter="getOrder",setter="setOrder")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
|
@ -72,15 +77,6 @@ class MessageSendRequest implements ModelInterface
|
|||
*/
|
||||
private $items;
|
||||
|
||||
/**
|
||||
* @var string $note
|
||||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getNote",setter="setNote")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $note;
|
||||
|
||||
/**
|
||||
* @var string $scope
|
||||
*
|
||||
|
@ -91,16 +87,6 @@ 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
|
||||
*
|
||||
|
@ -154,22 +140,6 @@ 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
|
||||
*/
|
||||
|
@ -250,22 +220,6 @@ 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,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,11 +22,13 @@ 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
|
||||
|
@ -106,15 +111,6 @@ class MessagesRequest implements ModelInterface
|
|||
*/
|
||||
private $type;
|
||||
|
||||
/**
|
||||
* @var int $limit
|
||||
*
|
||||
* @Type("int")
|
||||
* @Accessor(getter="getLimit",setter="setLimit")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $limit;
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
|
@ -258,20 +254,4 @@ 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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,49 +0,0 @@
|
|||
<?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;
|
||||
}
|
||||
}
|
|
@ -1,77 +0,0 @@
|
|||
<?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,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,6 +22,9 @@ 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
|
||||
{
|
||||
|
@ -27,7 +33,7 @@ class UploadFileByUrlRequest implements ModelInterface
|
|||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getUrl",setter="setUrl")
|
||||
* @Assert\NotBlank(allowNull=false)
|
||||
* @Assert\NotBlank()
|
||||
* @Assert\Url()
|
||||
*/
|
||||
private $url;
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,11 +22,13 @@ 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,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -20,6 +23,9 @@ 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
|
||||
{
|
||||
|
@ -62,9 +68,9 @@ class AssignResponse implements ModelInterface
|
|||
private $responsible;
|
||||
|
||||
/**
|
||||
* @return bool|null
|
||||
* @return bool
|
||||
*/
|
||||
public function getIsReassign(): ?bool
|
||||
public function getIsReassign(): bool
|
||||
{
|
||||
return $this->isReassign;
|
||||
}
|
||||
|
@ -78,9 +84,9 @@ class AssignResponse implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
* @return int
|
||||
*/
|
||||
public function getLeftManagerId(): ?int
|
||||
public function getLeftManagerId(): int
|
||||
{
|
||||
return $this->leftManagerId;
|
||||
}
|
||||
|
@ -94,9 +100,9 @@ class AssignResponse implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return Responsible|null
|
||||
* @return Responsible
|
||||
*/
|
||||
public function getPreviousResponsible(): ?Responsible
|
||||
public function getPreviousResponsible(): Responsible
|
||||
{
|
||||
return $this->previousResponsible;
|
||||
}
|
||||
|
@ -110,9 +116,9 @@ class AssignResponse implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return Responsible|null
|
||||
* @return Responsible
|
||||
*/
|
||||
public function getResponsible(): ?Responsible
|
||||
public function getResponsible(): Responsible
|
||||
{
|
||||
return $this->responsible;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,6 +22,9 @@ 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
|
||||
{
|
||||
|
@ -38,9 +44,9 @@ trait CommonFields
|
|||
private $statusCode;
|
||||
|
||||
/**
|
||||
* @return array|null
|
||||
* @return array
|
||||
*/
|
||||
public function getErrors(): ?array
|
||||
public function getErrors(): array
|
||||
{
|
||||
return empty($this->errors) ? [] : $this->errors;
|
||||
}
|
||||
|
@ -54,9 +60,9 @@ trait CommonFields
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
* @return int
|
||||
*/
|
||||
public function getStatusCode(): ?int
|
||||
public function getStatusCode(): int
|
||||
{
|
||||
return $this->statusCode;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -16,6 +19,9 @@ 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,11 +6,13 @@
|
|||
* 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;
|
||||
|
@ -20,6 +22,9 @@ 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
|
||||
{
|
||||
|
@ -56,16 +61,15 @@ class FullFileResponse implements ModelInterface
|
|||
* @var string $url
|
||||
*
|
||||
* @Type("string")
|
||||
* @SerializedName("Url")
|
||||
* @Accessor(getter="getUrl",setter="setUrl")
|
||||
* @SkipWhenEmpty()
|
||||
*/
|
||||
private $url;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getId(): ?string
|
||||
public function getId(): string
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
@ -79,9 +83,9 @@ class FullFileResponse implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
* @return int
|
||||
*/
|
||||
public function getSize(): ?int
|
||||
public function getSize(): int
|
||||
{
|
||||
return $this->size;
|
||||
}
|
||||
|
@ -95,9 +99,9 @@ class FullFileResponse implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getType(): ?string
|
||||
public function getType(): string
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
@ -111,9 +115,9 @@ class FullFileResponse implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getUrl(): ?string
|
||||
public function getUrl(): string
|
||||
{
|
||||
return $this->url;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,6 +22,9 @@ 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
|
||||
{
|
||||
|
@ -43,9 +49,9 @@ class MessageSendResponse implements ModelInterface
|
|||
private $time;
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
* @return int
|
||||
*/
|
||||
public function getMessageId(): ?int
|
||||
public function getMessageId(): int
|
||||
{
|
||||
return $this->messageId;
|
||||
}
|
||||
|
@ -59,9 +65,9 @@ class MessageSendResponse implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getTime(): ?string
|
||||
public function getTime(): string
|
||||
{
|
||||
return $this->time;
|
||||
}
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
<?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,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -20,6 +23,9 @@ 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
|
||||
{
|
||||
|
@ -98,9 +104,9 @@ class UploadFileResponse implements ModelInterface
|
|||
private $type;
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getCreatedAt(): ?string
|
||||
public function getCreatedAt(): string
|
||||
{
|
||||
return $this->createdAt;
|
||||
}
|
||||
|
@ -114,9 +120,9 @@ class UploadFileResponse implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getHash(): ?string
|
||||
public function getHash(): string
|
||||
{
|
||||
return $this->hash;
|
||||
}
|
||||
|
@ -130,9 +136,9 @@ class UploadFileResponse implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getId(): ?string
|
||||
public function getId(): string
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
@ -146,9 +152,9 @@ class UploadFileResponse implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return FileMeta|null
|
||||
* @return FileMeta
|
||||
*/
|
||||
public function getMeta(): ?FileMeta
|
||||
public function getMeta(): FileMeta
|
||||
{
|
||||
return $this->meta;
|
||||
}
|
||||
|
@ -162,9 +168,9 @@ class UploadFileResponse implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getMimeType(): ?string
|
||||
public function getMimeType(): string
|
||||
{
|
||||
return $this->mimeType;
|
||||
}
|
||||
|
@ -178,9 +184,9 @@ class UploadFileResponse implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return int|null
|
||||
* @return int
|
||||
*/
|
||||
public function getSize(): ?int
|
||||
public function getSize(): int
|
||||
{
|
||||
return $this->size;
|
||||
}
|
||||
|
@ -194,9 +200,9 @@ class UploadFileResponse implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getSourceUrl(): ?string
|
||||
public function getSourceUrl(): string
|
||||
{
|
||||
return $this->sourceUrl;
|
||||
}
|
||||
|
@ -210,9 +216,9 @@ class UploadFileResponse implements ModelInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string|null
|
||||
* @return string
|
||||
*/
|
||||
public function getType(): ?string
|
||||
public function getType(): string
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -17,6 +20,9 @@ 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,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -17,6 +20,9 @@ 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,6 +5,9 @@
|
|||
* 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;
|
||||
|
@ -16,6 +19,9 @@ 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,6 +5,9 @@
|
|||
* 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,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -20,6 +23,9 @@ 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
|
||||
{
|
||||
|
@ -45,8 +51,8 @@ class Register
|
|||
private $integrationCode;
|
||||
|
||||
/**
|
||||
* @var bool $active
|
||||
* @Type("bool")
|
||||
* @var string $active
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getActive",setter="setActive")
|
||||
* @SkipWhenEmpty
|
||||
*/
|
||||
|
@ -57,7 +63,7 @@ class Register
|
|||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getName",setter="setName")
|
||||
* @Assert\NotBlank()
|
||||
* @SkipWhenEmpty
|
||||
*/
|
||||
private $name;
|
||||
|
||||
|
@ -106,7 +112,6 @@ class Register
|
|||
*
|
||||
* @Type("string")
|
||||
* @Accessor(getter="getAccountUrl",setter="setAccountUrl")
|
||||
* @SerializedName("accountUrl")
|
||||
*
|
||||
* @Assert\NotBlank
|
||||
* @Assert\Url(
|
||||
|
@ -179,7 +184,7 @@ class Register
|
|||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
* @return string
|
||||
*/
|
||||
public function getActive()
|
||||
{
|
||||
|
@ -187,9 +192,9 @@ class Register
|
|||
}
|
||||
|
||||
/**
|
||||
* @param bool $active
|
||||
* @param string $active
|
||||
*/
|
||||
public function setActive(bool $active)
|
||||
public function setActive(string $active)
|
||||
{
|
||||
$this->active = $active;
|
||||
}
|
||||
|
@ -325,32 +330,22 @@ class Register
|
|||
/**
|
||||
* Get configuration as JSON
|
||||
*
|
||||
* @return string
|
||||
* @return array|string
|
||||
* @todo make exact type
|
||||
*/
|
||||
public function getJsonConfiguration()
|
||||
{
|
||||
$serialized = Serializer::serialize($this);
|
||||
|
||||
if (is_string($serialized)) {
|
||||
return $serialized;
|
||||
}
|
||||
|
||||
return '';
|
||||
return Serializer::serialize($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get configuration as array
|
||||
*
|
||||
* @return array
|
||||
* @return array|string
|
||||
* @todo make exact type
|
||||
*/
|
||||
public function getArrayConfiguration()
|
||||
{
|
||||
$serialized = Serializer::serialize($this, Serializer::S_ARRAY);
|
||||
|
||||
if (is_array($serialized)) {
|
||||
return $serialized;
|
||||
}
|
||||
|
||||
return [];
|
||||
return Serializer::serialize($this, Serializer::S_ARRAY);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -20,6 +23,9 @@ 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
|
||||
{
|
||||
|
@ -40,16 +46,14 @@ class Serializer
|
|||
$serializer = SerializerBuilder::create()->build();
|
||||
$context = self::getContext(false);
|
||||
|
||||
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;
|
||||
}
|
||||
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;
|
||||
|
@ -70,20 +74,15 @@ class Serializer
|
|||
$serializer = SerializerBuilder::create()->build();
|
||||
$context = self::getContext(true);
|
||||
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
return $deserialized instanceof ModelInterface ? $deserialized : new ErrorOnlyResponse();
|
||||
|
@ -100,17 +99,17 @@ class Serializer
|
|||
$context = new DeserializationContext();
|
||||
} else {
|
||||
$context = new SerializationContext();
|
||||
|
||||
$context->setSerializeNull(false);
|
||||
}
|
||||
|
||||
$context->setSerializeNull(false);
|
||||
|
||||
return $context;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $namespace
|
||||
*
|
||||
* @return string
|
||||
* @return bool|string
|
||||
*/
|
||||
private static function normalizeNamespace(string $namespace)
|
||||
{
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -14,6 +17,9 @@ 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,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -20,6 +23,9 @@ 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,6 +30,9 @@ 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
|
||||
{
|
||||
|
@ -52,11 +55,8 @@ class ClientListTest extends TestCase
|
|||
|
||||
$response = $client->channels($request);
|
||||
|
||||
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");
|
||||
static::assertEquals(4, count($response), "Incorrect channels count");
|
||||
static::assertTrue($response[0] instanceof Channel\Channel, "Incorrect channel instance");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -77,29 +77,8 @@ class ClientListTest extends TestCase
|
|||
|
||||
$response = $client->chats($request);
|
||||
|
||||
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");
|
||||
static::assertEquals(2, count($response), "Incorrect chats count");
|
||||
static::assertTrue($response[0] instanceof Chat, "Incorrect chat instance");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -118,8 +97,8 @@ class ClientListTest extends TestCase
|
|||
$request = new Request\MembersRequest();
|
||||
$response = $client->members($request);
|
||||
|
||||
static::assertCount(5, $response, "Incorrect members count");
|
||||
static::assertInstanceOf(ChatMember::class, $response[0], "Incorrect member instance");
|
||||
static::assertEquals(4, count($response), "Incorrect members count");
|
||||
static::assertTrue($response[0] instanceof ChatMember, "Incorrect member instance");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -138,12 +117,11 @@ 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::assertCount(3, $response, "Incorrect message count");
|
||||
static::assertInstanceOf(Message::class, $response[0], "Incorrect message instance");
|
||||
static::assertEquals(2, count($response), "Incorrect message count");
|
||||
static::assertTrue($response[0] instanceof Message, "Incorrect message instance");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -162,7 +140,7 @@ class ClientListTest extends TestCase
|
|||
$request = new Request\CommandsRequest();
|
||||
$response = $client->commands($request);
|
||||
|
||||
self::assertCount(0, $response, "Invalid commands count");
|
||||
self::assertEquals(0, count($response), "Invalid commands count");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -184,7 +162,7 @@ class ClientListTest extends TestCase
|
|||
|
||||
$data = $client->bots($request);
|
||||
|
||||
static::assertCount(4, $data);
|
||||
static::assertEquals(3, count($data));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -206,8 +184,8 @@ class ClientListTest extends TestCase
|
|||
|
||||
$response = $client->users($request);
|
||||
|
||||
self::assertCount(3, $response);
|
||||
self::assertInstanceOf(User::class, $response[0]);
|
||||
self::assertEquals(2, count($response));
|
||||
self::assertTrue($response[0] instanceof User);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -229,8 +207,8 @@ class ClientListTest extends TestCase
|
|||
|
||||
$response = $client->dialogs($request);
|
||||
|
||||
self::assertCount(3, $response);
|
||||
self::assertInstanceOf(Dialog::class, $response[0]);
|
||||
self::assertEquals(2, count($response));
|
||||
self::assertTrue($response[0] instanceof Dialog);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -250,10 +228,7 @@ class ClientListTest extends TestCase
|
|||
|
||||
$response = $client->customers($request);
|
||||
|
||||
self::assertCount(3, $response);
|
||||
self::assertInstanceOf(Customer::class, $response[0]);
|
||||
|
||||
$utm = $response[0]->getUtm()->getCampaign();
|
||||
static::assertEquals('spring_sale', $utm, "Incorrect utm data");
|
||||
self::assertEquals(2, count($response));
|
||||
self::assertTrue($response[0] instanceof Customer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -21,6 +24,9 @@ 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
|
||||
{
|
||||
|
@ -80,7 +86,7 @@ class CommandsTest extends TestCase
|
|||
|
||||
$response = $client->commandEdit($request);
|
||||
|
||||
self::assertInstanceOf(ErrorOnlyResponse::class, $response);
|
||||
self::assertTrue($response instanceof ErrorOnlyResponse);
|
||||
self::assertTrue($response->isSuccessful());
|
||||
}
|
||||
|
||||
|
@ -100,6 +106,6 @@ class CommandsTest extends TestCase
|
|||
|
||||
$response = $client->commandDelete("show_payment_types");
|
||||
|
||||
self::assertTrue($response->isSuccessful());
|
||||
self::assertTrue($response->isSuccessful() == true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
*
|
||||
* @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;
|
||||
|
@ -14,9 +17,7 @@ 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;
|
||||
|
||||
|
@ -26,6 +27,9 @@ 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
|
||||
{
|
||||
|
@ -74,42 +78,6 @@ 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
|
||||
|
@ -143,183 +111,7 @@ class DialogsTest extends TestCase
|
|||
|
||||
$response = $client->dialogClose('62');
|
||||
|
||||
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 instanceof ErrorOnlyResponse);
|
||||
self::assertTrue($response->isSuccessful());
|
||||
self::assertEmpty($response->getErrors());
|
||||
}
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
* 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;
|
||||
|
@ -19,7 +22,10 @@ use RetailCrm\Mg\Bot\Test\TestCase;
|
|||
*
|
||||
* Class UploadFileTest
|
||||
*
|
||||
* @package RetailCrm\Mg\Bot\Tests
|
||||
* @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
|
||||
{
|
||||
|
@ -27,32 +33,17 @@ class FileTest extends TestCase
|
|||
* @group("upload")
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function testUploadFileByUrlEmpty()
|
||||
public function testUploadFileByUrlException()
|
||||
{
|
||||
$client = self::getApiClient(
|
||||
null,
|
||||
null,
|
||||
false,
|
||||
$this->getErrorsResponse(400, 'Something is not quite right.')
|
||||
$this->getEmptyResponse(400)
|
||||
);
|
||||
|
||||
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');
|
||||
}
|
||||
|
||||
|
@ -92,7 +83,7 @@ class FileTest extends TestCase
|
|||
|
||||
$response = $client->uploadFile(__FILE__);
|
||||
|
||||
self::assertInstanceOf(UploadFileResponse::class, $response);
|
||||
self::assertTrue($response instanceof UploadFileResponse);
|
||||
self::assertEquals('b2bdba90-166c-4e0a-829d-69f26a09fd2a', $response->getId());
|
||||
self::assertEquals('file', $response->getType());
|
||||
self::assertEquals(214, $response->getSize());
|
||||
|
@ -114,10 +105,7 @@ class FileTest extends TestCase
|
|||
|
||||
$response = $client->getFileById($fileId);
|
||||
|
||||
self::assertInstanceOf(FullFileResponse::class, $response);
|
||||
self::assertTrue($response instanceof FullFileResponse);
|
||||
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,25 +6,16 @@
|
|||
* 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;
|
||||
use RetailCrm\Mg\Bot\Model\Entity\Message\MessageOrderItem;
|
||||
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;
|
||||
use RetailCrm\Mg\Bot\Test\TestCase;
|
||||
|
||||
/**
|
||||
|
@ -33,6 +24,9 @@ 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
|
||||
{
|
||||
|
@ -65,7 +59,7 @@ class MessagesTest extends TestCase
|
|||
* @group("messages")
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function testMessageSendText()
|
||||
public function testMessageSend()
|
||||
{
|
||||
$client = self::getApiClient(
|
||||
null,
|
||||
|
@ -84,135 +78,9 @@ class MessagesTest extends TestCase
|
|||
|
||||
$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());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @group("messages")
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function testMessageSendOrder()
|
||||
{
|
||||
$client = self::getApiClient(
|
||||
null,
|
||||
null,
|
||||
false,
|
||||
$this->getResponse(
|
||||
'{"message_id":3636,"time":"2019-06-24T06:02:04.434291791Z"}',
|
||||
201
|
||||
)
|
||||
);
|
||||
|
||||
$cost = new MessageCost();
|
||||
$cost->setCurrency("₽");
|
||||
$cost->setValue(500);
|
||||
|
||||
$delivery = new MessageDelivery();
|
||||
$delivery->setAddress('address');
|
||||
$delivery->setComment('comment');
|
||||
$delivery->setName('test delivery');
|
||||
$delivery->setPrice($cost);
|
||||
|
||||
$quantity = new MessageQuantity();
|
||||
$quantity->setUnit('pcs');
|
||||
$quantity->setValue(1);
|
||||
|
||||
$item = new MessageOrderItem();
|
||||
$item->setName('product');
|
||||
$item->setPrice($cost);
|
||||
$item->setImg('https://example.com/image.jpeg');
|
||||
$item->setQuantity($quantity);
|
||||
$item->setUrl('https://example.com');
|
||||
|
||||
$orderStatus = new MessageStatus();
|
||||
$orderStatus->setName('name');
|
||||
$orderStatus->setCode('code');
|
||||
|
||||
$payment = new MessageOrderPaymentStatus();
|
||||
$payment->setName('card');
|
||||
$payment->setPayed(true);
|
||||
|
||||
$order = new MessageOrder();
|
||||
$order->setCost($cost);
|
||||
$order->setDelivery($delivery);
|
||||
$order->setDate(date('Y-m-d\TH:i:s\.u\Z'));
|
||||
$order->setItems([$item]);
|
||||
$order->setUrl('https://example.com');
|
||||
$order->setNumber('2038C');
|
||||
$order->setPayments([$payment]);
|
||||
$order->setStatus($orderStatus);
|
||||
|
||||
$request = new MessageSendRequest();
|
||||
$request->setChatId(28);
|
||||
$request->setType(Constants::MESSAGE_TYPE_ORDER);
|
||||
$request->setScope(Constants::MESSAGE_SCOPE_PUBLIC);
|
||||
$request->setOrder($order);
|
||||
|
||||
$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());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @group("messages")
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function testMessageSendProduct()
|
||||
{
|
||||
$client = self::getApiClient(
|
||||
null,
|
||||
null,
|
||||
false,
|
||||
$this->getResponse(
|
||||
'{"message_id":3636,"time":"2019-06-24T06:02:04.434291791Z"}',
|
||||
201
|
||||
)
|
||||
);
|
||||
|
||||
$cost = new MessageCost();
|
||||
$cost->setCurrency("₽");
|
||||
$cost->setValue(500);
|
||||
|
||||
$quantity = new MessageQuantity();
|
||||
$quantity->setUnit('pcs');
|
||||
$quantity->setValue(1);
|
||||
|
||||
$product = new MessageProduct();
|
||||
$product->setId(1);
|
||||
$product->setName('product');
|
||||
$product->setUrl('https://example.com');
|
||||
$product->setImg('https://example.com/image.jpg');
|
||||
$product->setQuantity($quantity);
|
||||
$product->setCost($cost);
|
||||
$product->setArticle('article');
|
||||
|
||||
$request = new MessageSendRequest();
|
||||
$request->setChatId(28);
|
||||
$request->setType(Constants::MESSAGE_TYPE_PRODUCT);
|
||||
$request->setScope(Constants::MESSAGE_SCOPE_PUBLIC);
|
||||
$request->setProduct($product);
|
||||
|
||||
$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());
|
||||
}
|
||||
self::assertTrue($response->isSuccessful());
|
||||
self::assertEquals(0, count($response->getErrors()));
|
||||
self::assertEquals(3636, $response->getMessageId());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -259,7 +127,7 @@ class MessagesTest extends TestCase
|
|||
$response = $client->messageEdit($request);
|
||||
|
||||
self::assertTrue($response->isSuccessful());
|
||||
self::assertCount(0, $response->getErrors());
|
||||
self::assertEquals(0, count($response->getErrors()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -298,102 +166,6 @@ class MessagesTest extends TestCase
|
|||
$response = $client->messageDelete('3636');
|
||||
|
||||
self::assertTrue($response->isSuccessful());
|
||||
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());
|
||||
}
|
||||
self::assertEquals(0, count($response->getErrors()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,57 +0,0 @@
|
|||
<?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));
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue