Skip to content

Adds Decimal value objects and enforces immutability - #4

Merged
josedejesuschavez merged 14 commits into
mainfrom
0.1.7
Jan 15, 2026
Merged

Adds Decimal value objects and enforces immutability#4
josedejesuschavez merged 14 commits into
mainfrom
0.1.7

Conversation

@josedejesuschavez

Copy link
Copy Markdown
Owner

Adds DecimalValueObject and PositiveDecimalValueObject classes, and implements immutability for all value objects.

This change introduces new value object types for handling decimal values and ensures that value objects are immutable after initialization.

  • Introduces DecimalValueObject and PositiveDecimalValueObject
  • Implements immutability for ValueObject and CompositeValueObject

This change addresses the need for decimal value object types and ensures that value objects are immutable, preventing accidental modification after creation.

Updates the package version to 0.1.5.1 in pyproject.toml and uv.lock.

This increment addresses a minor release.
Ensures that value objects are immutable after initialization
by preventing attribute reassignment and deletion.
This enhances data integrity and prevents unintended modifications
to value object state.
Updates the package version to 0.1.6 in pyproject.toml and uv.lock.

This version bump reflects changes and improvements.
Ensures that value objects are immutable after initialization
by preventing attribute reassignment and deletion.
This enhances data integrity and prevents unintended modifications
to value object state.
Updates the package version to 0.1.6 in pyproject.toml and uv.lock.

This version bump reflects changes and improvements.
Simplifies value object implementations by removing unnecessary comments and focusing on core functionality.
This improves code readability and maintainability.

Specifically, removes redundant comments in `CompositeValueObject` and `CurrencyValueObject`.
Also, refines equality checks and hashing in `CompositeValueObject` and removes redundant tests.
Updates URL regex in `UrlValueObject` to fix a minor issue.
Adds tests to ensure that value objects and composite value objects are immutable after initialization.

Also adds tests to verify correct behavior when `super().__init__` is not called in derived classes.
Updates the package version to address a bug fix or minor enhancement.
Simplifies value object implementations by removing unnecessary comments and focusing on core functionality.
This improves code readability and maintainability.

Specifically, removes redundant comments in `CompositeValueObject` and `CurrencyValueObject`.
Also, refines equality checks and hashing in `CompositeValueObject` and removes redundant tests.
Updates URL regex in `UrlValueObject` to fix a minor issue.
Adds tests to ensure that value objects and composite value objects are immutable after initialization.

Also adds tests to verify correct behavior when `super().__init__` is not called in derived classes.
Updates the package version to address a bug fix or minor enhancement.
Adds DecimalValueObject and PositiveDecimalValueObject for handling decimal values.

Updates MoneyValueObject to use PositiveDecimalValueObject instead of PositiveFloatValueObject for amount.
This allows for more precise monetary calculations.
@josedejesuschavez
josedejesuschavez merged commit 6a6dcdd into main Jan 15, 2026
1 check 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.

1 participant