Skip to content

Conversation

@osoykan
Copy link
Collaborator

@osoykan osoykan commented Jul 7, 2025

No description provided.

@osoykan osoykan requested a review from Copilot July 7, 2025 15:26
@osoykan osoykan changed the title unify query and command handling under requestHandling DRAFT: unify query and command handling under requestHandling Jul 7, 2025

This comment was marked as outdated.

@osoykan osoykan requested a review from Copilot July 7, 2025 20:53
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 overhauls the framework to merge separate query/command types into a unified Request/RequestHandler API. It updates all test suites, dependency‐injection modules, core classes, and documentation to replace Query/Command artifacts with the new Request design.

  • Replace every *Command* and *Query* handler and type with Request equivalents in tests and starters
  • Remove old CommandHandler/QueryHandler/CommandProvider/QueryProvider in core and wire up a single RequestProvider
  • Refresh KDoc, README, and migration guide to reflect the unified request‐based model

Reviewed Changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated no comments.

Show a summary per file
File Description
projects/*/src/test/kotlin/com/trendyol/kediatr/**/MediatorTests.kt Swapped out TestCommandHandler* and TestQueryHandler for TestRequestHandler*
projects/kediatr-quarkus-starter/.../MediatorTests.kt Updated producer methods to return TestRequestHandler* instead of old handlers
projects/kediatr-koin-starter/.../MediatorTests.kt Adjusted Koin single bindings from CommandHandler/QueryHandler to RequestHandler
projects/kediatr-core/src/testFixtures/.../models.kt Renamed all test fixtures from Command/Query to Request types
projects/kediatr-core/src/testFixtures/.../MediatorUseCases.kt Updated test assertions to expect TestRequestHandler* naming
projects/kediatr-core/src/test/kotlin/com/trendyol/kediatr/MediatorTests.kt Updated core tests to use unified RequestHandler handlers
projects/kediatr-core/src/main/kotlin/com/trendyol/kediatr/*.kt (multiple files) Refactored core API: removed CommandHandler/QueryHandler and merged into RequestHandler, updated registry, providers, MediatorImpl, etc.
README.md Minor example update of PingCommand to Request.Unit
MIGRATION_GUIDE.md Expanded and reformatted migration instructions to cover new API
Comments suppressed due to low confidence (3)

README.md:19

  • The example still references the old Query interface. Update to Request<String> (or add a typealias Query<T> = Request<T> if you intend to keep backward compatibility).
class PingQuery : Query<String> // or

README.md:21

  • This example shows the old CommandHandler API. It should be updated to RequestHandler.Unit<PingCommand> to match the new unified handler interface.
class PingCommandHandler : CommandHandler.Unit<PingCommand> {

MIGRATION_GUIDE.md:18

  • [nitpick] The alias RequestHandlerDelegate wasn’t removed—its signature was tightened with a : Message constraint, but the type alias remains. Please remove or clarify this bullet.
- **Removed**: `RequestHandlerDelegate<TRequest, TResponse>` type (replaced with same name but different signature)

@osoykan osoykan force-pushed the query-command-unification branch 2 times, most recently from 277260f to 8e3b869 Compare July 7, 2025 20:55
@osoykan osoykan force-pushed the query-command-unification branch from 8e3b869 to 97746d4 Compare July 7, 2025 20:59
@osoykan osoykan changed the title DRAFT: unify query and command handling under requestHandling unify query and command handling under requestHandling Jul 7, 2025
@osoykan osoykan merged commit c25ca3d into main Jul 7, 2025
5 checks passed
@osoykan osoykan deleted the query-command-unification branch November 21, 2025 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants