Remove dead delete() method from Bitrix24PartnerRepositoryInterface#472
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Removes the unused
delete(Uuid $uuid): voidmethod fromBitrix24PartnerRepositoryInterfaceand its implementations.Context
The
delete()method is never invoked by any use case. The actual deletion flow uses soft-delete semantics:$partner->markAsDeleted(?string $comment)— entity transitions todeletedstatus$repository->save($partner)— persists the state change$flusher->flush($partner)— flushes and dispatches domain eventsThe
delete()method in the in-memory stub implementation only physically removes the entity after verifying it's already indeletedstatus, which duplicates a business invariant the entity itself enforces.Changes
delete(Uuid $uuid): voidmethod declaration fromBitrix24PartnerRepositoryInterfacedelete()implementation fromInMemoryBitrix24PartnerRepositoryImplementationtestDelete()contract test methodCHANGELOG.mdThis 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