-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
181 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
<?php | ||
|
||
namespace RetailCrm\Mg\Bot\Model\Entity\Message; | ||
|
||
use DateTime; | ||
use JMS\Serializer\Annotation as Serializer; | ||
use JMS\Serializer\Annotation\Accessor; | ||
use JMS\Serializer\Annotation\SkipWhenEmpty; | ||
use JMS\Serializer\Annotation\Type; | ||
use RetailCrm\Mg\Bot\Model\Entity\User; | ||
use RetailCrm\Mg\Bot\Model\ModelInterface; | ||
|
||
class Quote implements ModelInterface | ||
{ | ||
/** | ||
* @var int | ||
* | ||
* @Type("integer") | ||
*/ | ||
private $id; | ||
|
||
/** | ||
* @var string | ||
* | ||
* @Type("string") | ||
*/ | ||
private $type; | ||
|
||
/** | ||
* @var User | ||
* | ||
* @Type("RetailCrm\Mg\Bot\Model\Entity\User") | ||
*/ | ||
private $from; | ||
|
||
/** | ||
* @var DateTime $time | ||
* | ||
* @Type("DateTime<'Y-m-d\TH:i:sP'>") | ||
* @Accessor(getter="getTime",setter="setTime") | ||
* @SkipWhenEmpty() | ||
*/ | ||
private $time; | ||
|
||
/** | ||
* @var string | ||
* | ||
* @Type("string") | ||
*/ | ||
private $content; | ||
|
||
public function getId(): int | ||
{ | ||
return $this->id; | ||
} | ||
|
||
public function setId(int $id): Quote | ||
{ | ||
$this->id = $id; | ||
return $this; | ||
} | ||
|
||
public function getType(): string | ||
{ | ||
return $this->type; | ||
} | ||
|
||
public function setType(string $type): Quote | ||
{ | ||
$this->type = $type; | ||
return $this; | ||
} | ||
|
||
public function getFrom(): User | ||
{ | ||
return $this->from; | ||
} | ||
|
||
public function setFrom(User $from): Quote | ||
{ | ||
$this->from = $from; | ||
return $this; | ||
} | ||
|
||
public function getTime(): DateTime | ||
{ | ||
return $this->time; | ||
} | ||
|
||
public function setTime(DateTime $time): Quote | ||
{ | ||
$this->time = $time; | ||
return $this; | ||
} | ||
|
||
public function getContent(): string | ||
{ | ||
return $this->content; | ||
} | ||
|
||
public function setContent(string $content): Quote | ||
{ | ||
$this->content = $content; | ||
return $this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"id": 3373, | ||
"time": "2023-04-26T21:22:19+03:00", | ||
"type": "text", | ||
"scope": "public", | ||
"chat_id": 519717, | ||
"is_read": false, | ||
"is_edit": false, | ||
"status": "seen", | ||
"from": { | ||
"id": 519896, | ||
"external_id": "", | ||
"type": "customer", | ||
"avatar": "", | ||
"name": "Иван Иванов", | ||
"username": "Иван", | ||
"first_name": "Иван", | ||
"last_name": "Иванов" | ||
}, | ||
"content": "А можно при встрече и оплата картой.", | ||
"quote": { | ||
"id": 22144962, | ||
"type": "text", | ||
"from": { | ||
"id": 11111, | ||
"external_id": "116", | ||
"type": "user", | ||
"avatar": "", | ||
"name": "Николай Замышляев", | ||
"first_name": "Николай", | ||
"last_name": "Замышляев", | ||
"available": true | ||
}, | ||
"time": "2023-04-26T21:20:30+03:00", | ||
"content": "Something content" | ||
}, | ||
"channel_id": 61, | ||
"created_at": "2023-04-26T18:22:19.785679Z", | ||
"updated_at": "2023-04-26T18:22:20.533114Z" | ||
} |