Skip to content

Add event block and agent management operations to LedgerClient#102

Merged
jfrench9 merged 3 commits intomainfrom
feature/event-block
Apr 25, 2026
Merged

Add event block and agent management operations to LedgerClient#102
jfrench9 merged 3 commits intomainfrom
feature/event-block

Conversation

@jfrench9
Copy link
Copy Markdown
Member

Summary

Introduces a new event-driven domain model to the RoboSystems ledger client, replacing the previous journal entry, closing entry, transaction, and schedule-based operations with a unified event block, event handler, and agent management paradigm. This is a significant API redesign that modernizes how ledger operations are structured and executed.

Key Changes

New Domain Concepts

  • Event Block: New core entity for grouping and managing ledger events, supporting creation, update, and preview operations with event categories, resource types, and metadata
  • Event Handler: Configurable handlers that respond to events based on origin and metadata matching expressions, replacing the previous journal entry creation workflow
  • Agent: New entity representing actors in the system, with full CRUD support including address and metadata management
  • Transaction Templates: New model hierarchy (TransactionTemplate, TransactionTemplateEntry, TransactionTemplateItem, TransactionTemplateLeg) providing structured templates for transaction generation

API Operations

  • Added: op_create_agent, op_update_agent
  • Added: op_create_event_block, op_update_event_block, op_preview_event_block
  • Added: op_create_event_handler, op_update_event_handler
  • Removed: op_create_transaction, op_dispose_schedule, op_create_closing_entry, op_create_manual_closing_entry, op_create_journal_entry, op_reverse_journal_entry, op_truncate_schedule

LedgerClient Updates

  • Refactored ledger_client.py extensively (~470 lines changed) to expose the new event block and agent management methods
  • Updated model exports in __init__.py to reflect the new entity landscape

Breaking Changes

⚠️ This is a breaking change. The following models and operations have been removed:

  • CreateJournalEntryRequest, CreateTransactionRequest, CreateClosingEntryOperation, CreateManualClosingEntryRequest
  • ReverseJournalEntryRequest, DisposeScheduleRequest, TruncateScheduleOperation
  • ManualLineItemRequest and associated status/type enums
  • All corresponding API operation modules

Consumers relying on journal entry creation, transaction creation, schedule disposal/truncation, or closing entry workflows must migrate to the new event block and event handler APIs.

Testing

  • Comprehensive unit tests added in test_ledger_client.py (~467 lines added) covering:
    • Event block CRUD operations (create, update, preview)
    • Agent management (create, update)
    • Event handler management (create, update)
    • Request model construction and serialization
  • Existing op_update_journal_entry tests remain intact

Infrastructure Considerations

  • No new external dependencies introduced
  • Model changes are auto-generated (likely from an OpenAPI spec update), so future regeneration should preserve these changes
  • Client method signatures have changed; any downstream services or integrations consuming the LedgerClient will need corresponding updates

🤖 Generated with Claude Code

Branch Info:

  • Source: feature/event-block
  • Target: main
  • Type: feature

Co-Authored-By: Claude noreply@anthropic.com

…ures

- Introduced `TransactionTemplateItem` and `TransactionTemplateLeg` models to represent transaction items and legs.
- Created `UpdateAgentRequest` model with comprehensive fields for agent updates, including address and metadata patching.
- Added `UpdateAgentRequestAddressType0` and `UpdateAgentRequestMetadataPatch` for structured address and metadata handling.
- Implemented `UpdateEventBlockRequest` and related models for event block updates, including transition handling and metadata patching.
- Added `UpdateEventHandlerRequest` and associated models to manage event handler updates with metadata expressions.
- Enhanced models with additional properties handling for flexibility in data representation.
@jfrench9 jfrench9 merged commit 2f76b45 into main Apr 25, 2026
1 check passed
@jfrench9 jfrench9 deleted the feature/event-block branch April 25, 2026 01:18
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