Skip to content

Feat/basic domain layer#63

Merged
ShavrinAleksei merged 30 commits into
developfrom
feat/basic-domain-layer
Mar 30, 2026
Merged

Feat/basic domain layer#63
ShavrinAleksei merged 30 commits into
developfrom
feat/basic-domain-layer

Conversation

@theveenrok
Copy link
Copy Markdown
Member

@theveenrok theveenrok commented Mar 29, 2026

Summary

Summary

Add base classes for DDD patterns: BaseEntity, BaseValueObject, BaseUseCase.

Changes

  • Added DomainError, InvariantViolationError and ValidationError.
  • Added abstract BaseValueObject, BaseEntity.
  • Added EntityIdUUID6ValueObject.
  • Allowed unused self in test classes.
  • Added hack for hook ty-check by specifying the python virtual environment: pre-commit hook for ty astral-sh/ty#269.
  • Added ApplicationError.
  • Added abstract BaseUseCase.

Verification

  • just check

Docs

  • Docs added/updated

Tests

  • Tests added for BaseValueObject
  • Tests added for BaseEntity
  • Tests added for EntityIdUUID6ValueObject
  • Tests added for BaseUseCase

Changelog

  • Added changelog fragment in changelog.d/

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 29, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6b53642f-b9ce-416d-8f89-0e7927a560d3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/basic-domain-layer

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@theveenrok theveenrok changed the base branch from main to develop March 29, 2026 21:40
@theveenrok theveenrok self-assigned this Mar 29, 2026
@theveenrok theveenrok added the enhancement Changes to application logic, new features, or code updates that affect system behavior. label Mar 29, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Roadmap Mar 29, 2026
@theveenrok theveenrok moved this from Todo to In progress in Roadmap Mar 29, 2026
@theveenrok theveenrok added this to the v1.0.0 milestone Mar 29, 2026
@theveenrok
Copy link
Copy Markdown
Member Author

@ShavrinAleksei, Check the tests for Entity, I have a question. Should entities be compared and hashed only by id? or all fields?

@theveenrok theveenrok marked this pull request as ready for review March 30, 2026 09:31
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 352fe89a5f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"""Base class for all value objects."""

def __init__(self, value: ValueT) -> None:
self._value = self._normalize(value)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Copy incoming value to preserve value-object immutability

The constructor stores _normalize(value) by reference, so if a mutable input is passed and normalization returns that object, later external mutations change internal state after validation. This undermines value-object immutability and can silently change equality/hash behavior over time; defensively copying at construction avoids aliasing with caller-owned data.

Useful? React with 👍 / 👎.

@LandSight LandSight deleted a comment from chatgpt-codex-connector Bot Mar 30, 2026
@LandSight LandSight deleted a comment from chatgpt-codex-connector Bot Mar 30, 2026
@ShavrinAleksei ShavrinAleksei merged commit 586ac1f into develop Mar 30, 2026
3 checks passed
@github-project-automation github-project-automation Bot moved this from In progress to Done in Roadmap Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Changes to application logic, new features, or code updates that affect system behavior.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants