Reorganize attribute handling under entity namespace#45
Merged
Conversation
Move all attribute-related code from lib/treaty/attribute to lib/treaty/entity/attribute to better reflect the domain model where attributes belong to entities, not as a separate top-level concern. Changes: - Move attribute builder, options, validators, and validation orchestration classes - Move attribute base class, DSL, collection, and helper utilities - Move conditional logic (if/unless) for attribute options - Move all attribute option modifiers (as, cast, computed, default, transform) - Move attribute validators (format, inclusion, required, type) - Add new entity builder to coordinate attribute initialization - Update request and response attribute classes to reference new location - Update request and response validators, factories, and entities - Update core engine and entity module to use reorganized structure - Move corresponding test suite from spec/treaty/attribute to spec/treaty/entity/attribute - Update documentation for core concepts and entities This reorganization improves code cohesion by grouping attribute logic with its containing entity, making the architectural intent clearer.
- Moved `Info::Entity` modules (Builder, DSL, Result) under `Entity::Info`. - Introduced a dedicated `Entity::Base` class to standardize reusable entities. - Updated all references in code and documentation to use `Entity::Base` as the primary entity class. - Reorganized `Entity` attributes and utilities into a nested module for clarity. - Updated tests and specs to reflect the new namespace structure. - Adjusted i18n translations to align with the new class names and an improved validation messaging system. - Updated entity-related documentation for better examples and clearer explanations. This refactoring improves domain alignment, readability, and future flexibility.
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.
No description provided.