Skip to content

Add IM\Recent service for im.recent.* support #427

@mesilov

Description

@mesilov

Problem

The Bitrix24 REST API methods im.recent.* (recent chats list, pinning, read/unread) are not yet supported by the SDK. See https://apidocs.bitrix24.com/api-reference/chats/index.html.

Proposed solution

Add a new service src/Services/IM/Recent/Service/Recent.php that wraps the following REST methods, following patterns in other src/Services/<Scope>/ folders. Scope: im.

Methods to implement

  • im.recent.get — list the user's recent chats
  • im.recent.hide — hide a dialog from the list
  • im.recent.list — list recent dialogs with pagination
  • im.recent.pin — pin/unpin a dialog
  • im.recent.unread — toggle the "read" mark on a chat

Acceptance criteria

  • Bitrix24\SDK\Services\IM\Recent\Service\Recent implements each method with correct parameter mapping and #[ApiEndpointMetadata] / #[ApiServiceMetadata(new Scope(['im']))] attributes
  • IMServiceBuilder::recent() exposes the new service
  • RecentItemResult with @property-read annotations covers all fields returned by im.recent.list / im.recent.get
  • Unit tests in tests/Unit/Services/IM/Recent/Service/RecentTest.php pass (make test-unit)
  • Integration tests in tests/Integration/Services/IM/Recent/Service/RecentTest.php pass
  • tests/Integration/Services/IM/Recent/Result/RecentItemResultTest.php passes (annotation completeness + type-cast checks)
  • make test-integration-im-recent target added to Makefile and a suite added to phpunit.xml.dist
  • CHANGELOG.md entry under ## 3.2.0 – UNRELEASED### Added with link to this issue

Part of #422.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions