Skip to content

code cleanup - #43

Merged
Fivell merged 1 commit into
mainfrom
chore/cleanup
Aug 6, 2026
Merged

code cleanup#43
Fivell merged 1 commit into
mainfrom
chore/cleanup

Conversation

@Fivell

@Fivell Fivell commented Aug 2, 2026

Copy link
Copy Markdown
Member

Replaced the SingletonRepository base class with a dedicated BalanceRepository, since it only had one use anywhere in the codebase. No behavior changes, all tests pass.

SingletonRepository had exactly one subclass (BalanceRepository) anywhere
in the codebase. Ported over from a shared base class that never gained a
second consumer.
@Fivell Fivell self-assigned this Aug 2, 2026
@sonarqubecloud

sonarqubecloud Bot commented Aug 2, 2026

Copy link
Copy Markdown

@Fivell Fivell changed the title chore: over-engineering cleanup (ponytail audit) chore: over-engineering cleanup Aug 2, 2026
@Fivell Fivell changed the title chore: over-engineering cleanup code cleanup Aug 3, 2026
@Fivell
Fivell requested a review from Copilot August 3, 2026 08:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the balance resource access layer by removing the generic SingletonRepository base class and replacing its only internal usage with a dedicated BalanceRepository, aiming to simplify the repository hierarchy.

Changes:

  • Removed SingletonRepository from didww.resources.base.
  • Implemented BalanceRepository directly in didww.resources.balance with an inline find() implementation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/didww/resources/base.py Removes the shared singleton repository base class.
src/didww/resources/balance.py Adds a dedicated repository implementation for the balance endpoint.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 377 to 378

class SingletonRepository:
_resource_class = None
_path = None

def __init__(self, client):
self.client = client

def find(self, params=None):
query = params.to_dict() if params else None
body = self.client.get(self._path, params=query)
response = JsonApiResponse.from_data(body)
resource = self._resource_class.from_response_content(response)
return ApiResponse(data=resource, meta=body.get("meta", {}))


class Repository(ReadOnlyRepository):
@Fivell
Fivell merged commit 71a731e into main Aug 6, 2026
14 checks passed
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.

2 participants