Skip to content

Introduce computed attribute modifier for derived values#38

Merged
afuno merged 4 commits intomainfrom
feature/SRV-348/computed
Dec 15, 2025
Merged

Introduce computed attribute modifier for derived values#38
afuno merged 4 commits intomainfrom
feature/SRV-348/computed

Conversation

@afuno
Copy link
Member

@afuno afuno commented Dec 1, 2025

No description provided.

afuno added 3 commits December 2, 2025 04:09
- Added `Treaty::Attribute::Option::Modifiers::ComputedModifier` to compute attribute values using raw data context.
- Enhanced documentation with detailed examples, comparison with `transform`, and advanced error handling.
- Updated specs to cover typical and edge cases for the new `computed` modifier.
- Adjusted transformation order documentation to include `computed` at the top of the modifier chain.
- Refactored existing tests and services to demonstrate usage of computed attributes.
- Renamed all `context` parameters to `root_data` across codebase for improved conceptual consistency.
- Updated method signatures in `ComputedModifier`, `OptionOrchestrator`, validation classes, and other related areas.
- Refactored computation logic in tests and examples to align with `root_data` terminology.
- Enhanced documentation, examples, and troubleshooting guides to reflect the renaming.
- Added error messages for `computed` modifier in English and German translations.
- Included a dedicated section for `computed` in the modifier error message reference.
- Expanded documentation with examples of `%{attribute}`, `%{type}`, and `%{error}` keys for `computed`.
@afuno afuno added this to the v1.0.0 milestone Dec 1, 2025
@afuno afuno self-assigned this Dec 1, 2025
@afuno afuno added the feature label Dec 1, 2025
- Introduced comprehensive test coverage for `Serialization::OrderDto` class.
- Validated presence and data types for all attributes including `id`, `customer_name`, and `items`.
- Covered nested attribute validations for `items` and its associated fields such as `product_name`, `quantity`, and `unit_price_cents`.
- Ensured correctness for computed attributes like `line_total_cents`, `subtotal_cents`, `tax_cents`, and `total_cents`.
- Included checks for formatted and cast attributes like `formatted_total` and `created_at`.
@afuno afuno marked this pull request as ready for review December 1, 2025 21:51
@afuno afuno merged commit 7edca6c into main Dec 15, 2025
23 checks passed
@afuno afuno deleted the feature/SRV-348/computed branch December 15, 2025 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant