From d34270121ca12988fc6f684eed4809fd6f5a4a27 Mon Sep 17 00:00:00 2001 From: Alex Komarichev Date: Wed, 14 Aug 2024 17:02:07 +0300 Subject: [PATCH] Add responsible external_id field --- src/Bot/Model/Entity/Responsible.php | 25 +++++++++++++++++++++++++ tests/Resources/dialogReassigned.json | 2 +- tests/Resources/dialogUnassigned.json | 2 +- tests/Resources/dialogs.json | 3 +++ 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/Bot/Model/Entity/Responsible.php b/src/Bot/Model/Entity/Responsible.php index 55a5c3a..a495ce4 100644 --- a/src/Bot/Model/Entity/Responsible.php +++ b/src/Bot/Model/Entity/Responsible.php @@ -49,6 +49,15 @@ class Responsible implements ModelInterface */ private $type; + /** + * @var string $externalId + * + * @Type("string") + * @Accessor(getter="getExternalId",setter="setExternalId") + * @SkipWhenEmpty() + */ + private $externalId; + /** * @return string|null */ @@ -96,4 +105,20 @@ class Responsible implements ModelInterface { $this->type = $type; } + + /** + * @return string|null + */ + public function getExternalId(): ?string + { + return $this->externalId; + } + + /** + * @param string $externalId + */ + public function setExternalId(string $externalId): void + { + $this->externalId = $externalId; + } } diff --git a/tests/Resources/dialogReassigned.json b/tests/Resources/dialogReassigned.json index 60f9aa0..dca7a61 100644 --- a/tests/Resources/dialogReassigned.json +++ b/tests/Resources/dialogReassigned.json @@ -1 +1 @@ -{"responsible":{"type":"user","id":4,"assigned_at":"2019-06-21T08:01:09Z"},"is_reassign":true,"previous_responsible":{"type":"user","id":12,"assigned_at":"2019-06-11T12:49:34Z"},"left_user_id":12} \ No newline at end of file +{"responsible":{"type":"user","id":4,"external_id": "4","assigned_at":"2019-06-21T08:01:09Z"},"is_reassign":true,"previous_responsible":{"type":"user","id":12,"external_id": "12","assigned_at":"2019-06-11T12:49:34Z"},"left_user_id":12} \ No newline at end of file diff --git a/tests/Resources/dialogUnassigned.json b/tests/Resources/dialogUnassigned.json index 08d2c42..6c6101d 100644 --- a/tests/Resources/dialogUnassigned.json +++ b/tests/Resources/dialogUnassigned.json @@ -1 +1 @@ -{"previous_responsible":{"type":"user","id":12,"assigned_at":"2019-06-11T12:49:34Z"}} \ No newline at end of file +{"previous_responsible":{"type":"user","id":12,"external_id": "12","assigned_at":"2019-06-11T12:49:34Z"}} \ No newline at end of file diff --git a/tests/Resources/dialogs.json b/tests/Resources/dialogs.json index afe5ddd..af5abed 100644 --- a/tests/Resources/dialogs.json +++ b/tests/Resources/dialogs.json @@ -11,6 +11,7 @@ "responsible": { "type": "user", "id": 12, + "external_id": "12", "assigned_at": "2019-06-11T12:49:34.716716Z" }, "is_active": true @@ -27,6 +28,7 @@ "responsible": { "type": "user", "id": 12, + "external_id": "12", "assigned_at": "2019-06-11T08:40:14.136916Z" }, "is_active": true @@ -43,6 +45,7 @@ "responsible": { "type": "user", "id": 12, + "external_id": "12", "assigned_at": "2019-06-11T08:40:14Z" }, "is_active": true