Skip to content

Conversation

@remimd
Copy link
Member

@remimd remimd commented Sep 7, 2025

No description provided.

@remimd remimd requested a review from Copilot September 7, 2025 15:18
@remimd remimd self-assigned this Sep 7, 2025

This comment was marked as outdated.

@remimd remimd requested a review from Copilot September 9, 2025 10:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR makes the input type parameter optional for HandlerDecorator, allowing handlers to be registered without explicitly specifying the input type. The decorator now automatically infers the input type from the handler's handle method signature.

  • Input type parameter is now optional for all handler decorators (@command_handler, @event_handler, @query_handler)
  • Automatic type inference from handler method signatures when input type is not provided
  • Updated documentation and examples to demonstrate the new simplified syntax

Reviewed Changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test_command_bus.py Updated test to use new decorator syntax without explicit type parameters
tests/core/test_handler.py Added comprehensive test coverage for HandlerDecorator functionality
documentation/writing-application-layer.md Updated examples to show new simplified decorator syntax
documentation/fastapi-example.md Updated FastAPI integration example with new decorator syntax
cq/middlewares/scope.py Refactored to use dataclass and added exist_ok parameter for scope handling
cq/middlewares/retry.py Changed parameter type from Iterable to Sequence for better type safety
cq/_core/scope.py Renamed scope from ON_COMMAND to TRANSACTION
cq/_core/related_events.py Added bool method and updated scope reference
cq/_core/message.py Updated to use new TRANSACTION scope with exist_ok parameter
cq/_core/handler.py Implemented new HandlerDecorator logic with automatic type inference

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@remimd remimd merged commit c2bba37 into dev Sep 9, 2025
5 checks passed
@remimd remimd deleted the decorator_update branch September 9, 2025 10:43
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.

2 participants