Skip to content

Add note.* v3 service — Knowledge Base 2.0 (25 methods) #515

Description

@mesilov

Problem

The Bitrix24 REST API v3 note.* scope (Knowledge Base 2.0) is not yet supported by the SDK.
The portal exposes 25 note.* methods (collections, documents, document tree, full-text search,
and file attachments), none of which has a typed SDK wrapper.

Docs: https://apidocs.bitrix24.com/api-reference/rest-v3/note/index.html

Proposed solution

Add a new scope src/Services/Note/ following the architecture in docs/architecture.md:

  • NoteServiceBuilder.php registered in src/Services/ServiceBuilder.php
  • Service/Collection.phpnote.collection.*
  • Service/Document.phpnote.document.* (incl. tree.* and search.*)
  • Service/File.phpnote.file.*
  • Result/*ItemResult.php with @property-read annotations for every entity
  • Service/Batch.php where list/add methods support batch

This is a v3 scope: single-item responses use result.item, list responses use result.items.
Result-item classes must be produced with the
php bin/console b24-dev:result-item-generator <method.name> --stage=all generator.

Implementation plan

Collection — note.collection.* (8)

  • note.collection.add
  • note.collection.archive
  • note.collection.delete
  • note.collection.field.get
  • note.collection.field.list
  • note.collection.get
  • note.collection.list
  • note.collection.update

Document — note.document.* (7)

  • note.document.add
  • note.document.archive
  • note.document.delete
  • note.document.field.get
  • note.document.field.list
  • note.document.get
  • note.document.update

Document search — note.document.search.* (3)

  • note.document.search.field.get
  • note.document.search.field.list
  • note.document.search.list

Document tree — note.document.tree.* (3)

  • note.document.tree.field.get
  • note.document.tree.field.list
  • note.document.tree.list

File — note.file.* (4)

  • note.file.add
  • note.file.field.get
  • note.file.field.list
  • note.file.get

SDK deliverables

  • src/Services/Note/NoteServiceBuilder.php + registration in ServiceBuilder.php
  • Service/Collection.php, Service/Document.php, Service/File.php with #[ApiServiceMetadata] / #[ApiEndpointMetadata] (English doc links under apidocs.bitrix24.com)
  • Result item classes with full @property-read coverage (generated)
  • Unit tests under tests/Unit/Services/Note/
  • Integration tests under tests/Integration/Services/Note/
  • Mandatory *ItemResultTest annotation/type-cast tests for every result item
  • New suites in phpunit.xml.dist + make test-integration-note-* targets in Makefile
  • CHANGELOG.md entry under ## X.Y.Z Unreleased### Added with issue link

Acceptance criteria

  • All 25 note.* methods are callable through the SDK with typed results
  • make lint-all passes (cs-fixer, rector, phpstan, deptrac)
  • make test-unit passes
  • Integration + annotation tests pass against a real portal

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions