Skip to content

Conversation

zigzagdev
Copy link
Owner

Description

Introduced a new application-level interface GetAllUserPostQueryServiceInterface under the App\Post\Application\QueryServiceInterface namespace.

This interface defines the contract for retrieving all posts made by a specific user. It returns a PostEntityCollection, encapsulating the list of PostEntity objects associated with the user.

Copy link
Owner Author

@zigzagdev zigzagdev left a comment

Choose a reason for hiding this comment

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

✅ self review

  • Interface defines a single responsibility: retrieving all posts by user ID.
  • Method returns PostEntityCollection, preserving domain structure and type safety.
  • Pagination or presentation concerns are explicitly out of scope for this interface.
  • Namespace and naming conventions follow existing project standards.

@zigzagdev zigzagdev requested a review from Copilot June 10, 2025 09:30
@zigzagdev zigzagdev self-assigned this Jun 10, 2025
@zigzagdev zigzagdev added enhancement New feature or request backend labels Jun 10, 2025
Copy link

@Copilot 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 introduces a new application-level interface for retrieving all posts associated with a user and the corresponding domain entity collection to encapsulate the posts. It also adds a domain test to validate the behavior of the collection.

  • Introduces PostEntityCollection with helper methods to build and represent a collection of PostEntity objects.
  • Adds GetAllUserPostQueryServiceInterface to define the contract for retrieving user posts.
  • Implements unit tests for the PostEntityCollection.

Reviewed Changes

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

File Description
src/app/Post/Domain/Entity/PostEntityCollection.php Introduces a collection class with methods to build, represent as array, and add posts.
src/app/Post/Domain/DomainTest/PostEntityCollectionTest.php Provides tests ensuring the collection builds and returns posts as expected.
src/app/Post/Application/QueryServiceInterface/GetAllUserPostQueryServiceInterface.php Defines an interface for querying a user's posts.
Files not reviewed (1)
  • .idea/workspace.xml: Language not supported
Comments suppressed due to low confidence (1)

src/app/Post/Domain/Entity/PostEntityCollection.php:17

  • [nitpick] Consider specifying the expected structure of the posts array in the PHPDoc (e.g., '@param array<int, array> $posts' or a more precise type) for improved clarity.
     * @param array<> $posts

@zigzagdev zigzagdev linked an issue Jun 10, 2025 that may be closed by this pull request
@zigzagdev zigzagdev changed the base branch from main to feature/show-user-domain June 10, 2025 09:30
@zigzagdev zigzagdev changed the base branch from feature/show-user-domain to feature/show-post-index-domain June 10, 2025 09:31
@zigzagdev zigzagdev merged commit 1508df6 into feature/show-post-index-domain Jun 10, 2025
@zigzagdev zigzagdev deleted the feature/show-post-index-queryservice-interface branch June 10, 2025 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Create QueryService Interface in Application Layer

1 participant