From 0228c19a778206cefcbf57581ca6513e7f0037f9 Mon Sep 17 00:00:00 2001 From: Hamza Mahjoubi Date: Thu, 27 Jun 2024 01:25:50 +0200 Subject: [PATCH] feat: dev-docs out of office replacement Signed-off-by: Hamza Mahjoubi --- .../client_apis/OCS/ocs-out-of-office-api.rst | 129 ++++++++++-------- .../digging_deeper/out_of_office.rst | 12 ++ 2 files changed, 85 insertions(+), 56 deletions(-) diff --git a/developer_manual/client_apis/OCS/ocs-out-of-office-api.rst b/developer_manual/client_apis/OCS/ocs-out-of-office-api.rst index d0e43f120..d8aa03d74 100644 --- a/developer_manual/client_apis/OCS/ocs-out-of-office-api.rst +++ b/developer_manual/client_apis/OCS/ocs-out-of-office-api.rst @@ -27,21 +27,25 @@ Fetch data of the ongoing out-of-office period of a user. + ``404 Not Found`` If the user does not have an ongoing out-of-office period - Data (is only sent if the status code is ``200 OK``): -+--------------+--------+---------------------------------------------------------------------+ -| field | type | Description | -+--------------+--------+---------------------------------------------------------------------+ -| ``id`` | int | Database ID of the absence data entity | -+--------------+--------+---------------------------------------------------------------------+ -| ``userId`` | string | ID of the user which the data belongs to | -+--------------+--------+---------------------------------------------------------------------+ -| ``firstDay`` | string | First day of the absence in format ``YYYY-MM-DD`` | -+--------------+--------+---------------------------------------------------------------------+ -| ``lastDay`` | string | Last day of the absence in format ``YYYY-MM-DD`` | -+--------------+--------+---------------------------------------------------------------------+ -| ``status`` | string | Short text that is set as user status during the absence | -+--------------+--------+---------------------------------------------------------------------+ -| ``message`` | string | Longer multiline message that is shown to others during the absence | -+--------------+--------+---------------------------------------------------------------------+ ++---------------------------------+-------------+---------------------------------------------------------------------+ +| field | type | Description | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``id`` | int | Database ID of the absence data entity | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``userId`` | string | ID of the user which the data belongs to | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``firstDay`` | string | First day of the absence in format ``YYYY-MM-DD`` | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``lastDay`` | string | Last day of the absence in format ``YYYY-MM-DD`` | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``status`` | string | Short text that is set as user status during the absence | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``message`` | string | Longer multiline message that is shown to others during the absence | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``replacementUserId`` | string/null | ID of the replacement user | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``replacementUserDisplayName`` | string/null | Displayname of the replacement user | ++---------------------------------+-------------+---------------------------------------------------------------------+ Fetch upcoming or ongoing data ------------------------------ @@ -57,21 +61,25 @@ ongoing or next upcoming out-of-office period of a user. + ``404 Not Found`` If the user did not schedule an out-of-office period - Data (is only sent if the status code is ``200 OK``): -+--------------+--------+---------------------------------------------------------------------+ -| field | type | Description | -+--------------+--------+---------------------------------------------------------------------+ -| ``id`` | int | Database ID of the absence data entity | -+--------------+--------+---------------------------------------------------------------------+ -| ``userId`` | string | ID of the user which the data belongs to | -+--------------+--------+---------------------------------------------------------------------+ -| ``firstDay`` | string | First day of the absence in format ``YYYY-MM-DD`` | -+--------------+--------+---------------------------------------------------------------------+ -| ``lastDay`` | string | Last day of the absence in format ``YYYY-MM-DD`` | -+--------------+--------+---------------------------------------------------------------------+ -| ``status`` | string | Short text that is set as user status during the absence | -+--------------+--------+---------------------------------------------------------------------+ -| ``message`` | string | Longer multiline message that is shown to others during the absence | -+--------------+--------+---------------------------------------------------------------------+ ++---------------------------------+-------------+---------------------------------------------------------------------+ +| field | type | Description | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``id`` | int | Database ID of the absence data entity | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``userId`` | string | ID of the user which the data belongs to | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``firstDay`` | string | First day of the absence in format ``YYYY-MM-DD`` | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``lastDay`` | string | Last day of the absence in format ``YYYY-MM-DD`` | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``status`` | string | Short text that is set as user status during the absence | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``message`` | string | Longer multiline message that is shown to others during the absence | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``replacementUserId`` | string/null | ID of the replacement user | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``replacementUserDisplayName`` | string/null | Displayname of the replacement user | ++---------------------------------+-------------+---------------------------------------------------------------------+ Modify out-of-office data ------------------------- @@ -82,40 +90,49 @@ It is only possible to modify out-of-office data of the currently logged in user * Endpoint: ``/`` * Data: -+--------------+--------+---------------------------------------------------------------------+ -| field | type | Description | -+--------------+--------+---------------------------------------------------------------------+ -| ``firstDay`` | string | First day of the absence in format ``YYYY-MM-DD`` | -+--------------+--------+---------------------------------------------------------------------+ -| ``lastDay`` | string | Last day of the absence in format ``YYYY-MM-DD`` | -+--------------+--------+---------------------------------------------------------------------+ -| ``status`` | string | Short text that is set as user status during the absence | -+--------------+--------+---------------------------------------------------------------------+ -| ``message`` | string | Longer multiline message that is shown to others during the absence | -+--------------+--------+---------------------------------------------------------------------+ ++---------------------------------+-------------+---------------------------------------------------------------------+ +| field | type | Description | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``firstDay`` | string | First day of the absence in format ``YYYY-MM-DD`` | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``lastDay`` | string | Last day of the absence in format ``YYYY-MM-DD`` | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``status`` | string | Short text that is set as user status during the absence | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``message`` | string | Longer multiline message that is shown to others during the absence | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``replacementUserId`` | string/null | ID of the replacement user | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``replacementUserDisplayName`` | string/null | Displayname of the replacement user | ++---------------------------------+-------------+---------------------------------------------------------------------+ * Response: - Status code: + ``200 OK`` Updated out-of-office data + ``400 Bad Request`` If the first day is not before the last day + + ``404 Not Found`` If a replacement user ID is provided but no corresponding user is found + ``401 Unauthorized`` If the user is not logged in - Data (is only sent if the status code is ``200 OK``): -+--------------+--------+---------------------------------------------------------------------+ -| field | type | Description | -+--------------+--------+---------------------------------------------------------------------+ -| ``id`` | int | Database ID of the absence data entity | -+--------------+--------+---------------------------------------------------------------------+ -| ``userId`` | string | ID of the user which the data belongs to | -+--------------+--------+---------------------------------------------------------------------+ -| ``firstDay`` | string | First day of the absence in format ``YYYY-MM-DD`` | -+--------------+--------+---------------------------------------------------------------------+ -| ``lastDay`` | string | Last day of the absence in format ``YYYY-MM-DD`` | -+--------------+--------+---------------------------------------------------------------------+ -| ``status`` | string | Short text that is set as user status during the absence | -+--------------+--------+---------------------------------------------------------------------+ -| ``message`` | string | Longer multiline message that is shown to others during the absence | -+--------------+--------+---------------------------------------------------------------------+ ++---------------------------------+-------------+---------------------------------------------------------------------+ +| field | type | Description | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``id`` | int | Database ID of the absence data entity | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``userId`` | string | ID of the user which the data belongs to | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``firstDay`` | string | First day of the absence in format ``YYYY-MM-DD`` | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``lastDay`` | string | Last day of the absence in format ``YYYY-MM-DD`` | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``status`` | string | Short text that is set as user status during the absence | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``message`` | string | Longer multiline message that is shown to others during the absence | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``replacementUserId`` | string/null | ID of the replacement user | ++---------------------------------+-------------+---------------------------------------------------------------------+ +| ``replacementUserDisplayName`` | string/null | Displayname of the replacement user | ++---------------------------------+-------------+---------------------------------------------------------------------+ Clear data and disable out-of-office ------------------------------------ diff --git a/developer_manual/digging_deeper/out_of_office.rst b/developer_manual/digging_deeper/out_of_office.rst index 7a60179f1..caf6b9b04 100644 --- a/developer_manual/digging_deeper/out_of_office.rst +++ b/developer_manual/digging_deeper/out_of_office.rst @@ -102,6 +102,16 @@ start and end dates are represented as UNIX timestamps. * Get the long out-of-office message for auto responders and similar */ public function getMessage(): string; + + /** + * Get the replacement user id for auto responders and similar + */ + public function getReplacementUserId(): ?string; + + /** + * Get the replacement user displayName for auto responders and similar + */ + public function getReplacementUserDisplayName(): ?string; } It can be serialized to a JSON object with the following structure: @@ -115,4 +125,6 @@ It can be serialized to a JSON object with the following structure: endDate: int, shortMessage: string, message: string, + replacementUserId: string|null, + replacementUserDisplayName: string|null }