|
| 1 | +# Implementation Plan: Rule Management |
| 2 | + |
| 3 | +This plan outlines the implementation of Rule management (create, list, get, update, enable/disable, delete) in the Enapter HTTP API Rule Engine client. |
| 4 | + |
| 5 | +## Phase 1: Models and Foundation [checkpoint: c888a5d] |
| 6 | + |
| 7 | +- [x] Task: Define `Rule`, `RuleScript`, and `RuntimeVersion`, and `RuleState` data models |
| 8 | + - [x] Create `src/enapter/http/api/rule_engine/rule.py`, `src/enapter/http/api/rule_engine/rule_script.py`, `src/enapter/http/api/rule_engine/runtime_version.py`, and `src/enapter/http/api/rule_engine/rule_state.py` |
| 9 | + - [x] Implement `Rule` and `RuleScript` dataclasses and `RuntimeVersion` and `RuleState` enums |
| 10 | + - [x] Implement `from_dto` and `to_dto` methods for all models |
| 11 | + - [x] Add unit tests for models in `tests/unit/test_http/test_api/test_rule_engine/test_rule.py` |
| 12 | +- [x] Task: Export models in `src/enapter/http/api/rule_engine/__init__.py` |
| 13 | +- [x] Task: Conductor - User Manual Verification 'Phase 1: Models and Foundation' (Protocol in workflow.md) |
| 14 | + |
| 15 | +## Phase 2: Rule Management Implementation (Read Operations) [checkpoint: 6745120] |
| 16 | + |
| 17 | +- [x] Task: Implement `List Rules` method |
| 18 | + - [x] Add `list_rules` method to `src/enapter/http/api/rule_engine/client.py` |
| 19 | + - [x] Write failing tests in `tests/unit/test_http/test_api/test_rule_engine/test_client.py` |
| 20 | + - [x] Implement method to pass tests |
| 21 | +- [x] Task: Implement `Get Rule` method |
| 22 | + - [x] Add `get_rule` method to `src/enapter/http/api/rule_engine/client.py` |
| 23 | + - [x] Write failing tests |
| 24 | + - [x] Implement method to pass tests |
| 25 | +- [x] Task: Conductor - User Manual Verification 'Phase 2: Rule Management Implementation (Read Operations)' (Protocol in workflow.md) |
| 26 | + |
| 27 | +## Phase 3: Rule Management Implementation (Write Operations) [checkpoint: 15e657c] |
| 28 | + |
| 29 | +- [x] Task: Implement `Create Rule` method |
| 30 | + - [x] Add `create_rule` method to `src/enapter/http/api/rule_engine/client.py` |
| 31 | + - [x] Write failing tests (including base64 encoding check) |
| 32 | + - [x] Implement method to pass tests |
| 33 | +- [x] Task: Implement `Update Rule` (slug) method |
| 34 | + - [x] Add `update_rule` method to `src/enapter/http/api/rule_engine/client.py` |
| 35 | + - [x] Write failing tests |
| 36 | + - [x] Implement method to pass tests |
| 37 | +- [x] Task: Implement `Update Rule Script` method |
| 38 | + - [x] Add `update_rule_script` method to `src/enapter/http/api/rule_engine/client.py` |
| 39 | + - [x] Write failing tests |
| 40 | + - [x] Implement method to pass tests |
| 41 | +- [x] Task: Implement `Delete Rule` method |
| 42 | + - [x] Add `delete_rule` method to `src/enapter/http/api/rule_engine/client.py` |
| 43 | + - [x] Write failing tests |
| 44 | + - [x] Implement method to pass tests |
| 45 | +- [x] Task: Conductor - User Manual Verification 'Phase 3: Rule Management Implementation (Write Operations)' (Protocol in workflow.md) |
| 46 | + |
| 47 | +## Phase 4: Rule State Management [checkpoint: 43df5d0] |
| 48 | + |
| 49 | +- [x] Task: Implement `Enable Rule` and `Disable Rule` methods |
| 50 | + - [x] Add `enable_rule` and `disable_rule` methods to `src/enapter/http/api/rule_engine/client.py` |
| 51 | + - [x] Write failing tests |
| 52 | + - [x] Implement methods to pass tests |
| 53 | +- [x] Task: Conductor - User Manual Verification 'Phase 4: Rule State Management' (Protocol in workflow.md) |
| 54 | + |
| 55 | +## Phase 5: Integration and Finalization [checkpoint: 90987b4] |
| 56 | + |
| 57 | +- [x] Task: Add integration tests for all new Rule management methods |
| 58 | + - [x] Create `tests/integration/test_rule_engine_management.py` (or similar) |
| 59 | + - [x] Verify full flows against a mock or real environment if possible |
| 60 | +- [x] Task: Final code quality check (linting, coverage) |
| 61 | +- [x] Task: Conductor - User Manual Verification 'Phase 5: Integration and Finalization' (Protocol in workflow.md) |
0 commit comments