Feat/dynamic rule engine mvp#12
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
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.



This pull request introduces a local, dynamic rule engine MVP to the backend. It adds a new
JsonRuleRepositoryfor loading and validating rules from a JSON file, defines a comprehensive rule domain model, and integrates rule evaluation into the service layer. The changes also include improved exception handling for rule-related errors and update the DynamoDB repository to persist calculated amounts.Rule Engine MVP Implementation:
JsonRuleRepositoryadapter that loads and validates business rules from a local JSON file at startup (backend/app/adapters/json_rule_repository.py,backend/app/adapters/__init__.py) [1] [2].backend/app/domain/rule.py, including rule structure, supported actions, and evaluation context (backend/app/domain/rule.py,backend/app/domain/__init__.py) [1] [2].RuleEngine) and repository into dependency injection and the service layer, ensuring rules are applied after state-machine validation (backend/app/dependencies.py) [1] [2] [3] [4] [5] [6].Persistence and Data Model Updates:
backend/app/adapters/dynamodb_order_repository.py) [1] [2] [3].Error Handling and API Improvements:
backend/app/domain/exceptions.py,backend/app/api/exception_handlers.py) [1] [2] [3].Documentation:
README.mdto document the rule engine MVP, its boundaries, and a pointer to detailed documentation (README.md).Ports and Interfaces:
RuleRepositoryport for use in the application (backend/app/ports/__init__.py).