Skip to content

Remove dead delete() method from Bitrix24PartnerRepositoryInterface#472

Merged
mesilov merged 1 commit into
v3-devfrom
claude/fix-issue-471-cv3gE
May 8, 2026
Merged

Remove dead delete() method from Bitrix24PartnerRepositoryInterface#472
mesilov merged 1 commit into
v3-devfrom
claude/fix-issue-471-cv3gE

Conversation

@mesilov
Copy link
Copy Markdown
Collaborator

@mesilov mesilov commented May 8, 2026

Q A
Bug fix? no
New feature? no
Deprecations? no
Issues Fix #471
License MIT

Description

Removes the unused delete(Uuid $uuid): void method from Bitrix24PartnerRepositoryInterface and its implementations.

Context

The delete() method is never invoked by any use case. The actual deletion flow uses soft-delete semantics:

  1. $partner->markAsDeleted(?string $comment) — entity transitions to deleted status
  2. $repository->save($partner) — persists the state change
  3. $flusher->flush($partner) — flushes and dispatches domain events

The delete() method in the in-memory stub implementation only physically removes the entity after verifying it's already in deleted status, which duplicates a business invariant the entity itself enforces.

Changes

  • Removed delete(Uuid $uuid): void method declaration from Bitrix24PartnerRepositoryInterface
  • Removed delete() implementation from InMemoryBitrix24PartnerRepositoryImplementation
  • Removed testDelete() contract test method
  • Updated CHANGELOG.md

This is a pure refactoring with no behavior change to any production use case.

Test Plan

Existing unit and integration tests pass. The removed testDelete() method was the only test covering this dead code path.

https://claude.ai/code/session_01964BQ47XMfxWRzEuCSQu9S

…471)

The soft-delete flow (markAsDeleted() + save()) makes the explicit delete()
method redundant — it was never called by any use case handler and its
implementation only duplicated a business invariant already enforced by
the entity itself.

https://claude.ai/code/session_01964BQ47XMfxWRzEuCSQu9S
@mesilov mesilov merged commit 4973725 into v3-dev May 8, 2026
10 checks passed
@mesilov mesilov linked an issue May 9, 2026 that may be closed by this pull request
@mesilov mesilov deleted the claude/fix-issue-471-cv3gE branch May 9, 2026 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove delete(Uuid $uuid) method from Bitrix24PartnerRepositoryInterface

2 participants