Skip to content

Add EditPostDto for wrapping PostEntity with accessor methods #261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 162 commits into
base: feature/edit-post-application
Choose a base branch
from

Conversation

zigzagdev
Copy link
Owner

Description

This PR introduces EditPostDto, a Data Transfer Object that encapsulates a PostEntity and exposes value accessors and serialization via toArray().

Why

Instead of directly passing a domain entity through the Application layer, wrapping it inside a dedicated DTO allows for clearer data boundaries, transformation logic, and future-proofing (e.g., formatting, derived values, or flattening nested structures).

How

  • Added EditPostDto class:
    • Wraps PostEntity via constructor.
    • Provides read-only accessors (getId, getUserId, getContent, etc.).
    • Implements toArray() to export flattened primitive values.
  • Added static build() factory method for clarity and testability.

zigzagdev added 30 commits June 10, 2025 08:07
…-collection

Implement PostEntityCollection with array conversion and factory method
…ervice-interface

Define GetAllUserPostQueryServiceInterface for retrieving user's post collection
Implement PostEntityCollection and define GetAllUserPostQueryServiceInterface
…tion-dto

Implement Pagination DTO and factory for application-layer pagination handling
…tion-viewmodel

Implement Pagination ViewModel and factory for presentation-layer formatting
…tion

Integrate pagination infrastructure into show-post-index branch
…tructure

Implement `GetAllUserPostQueryService` and its integration test
…with-pagination

Add pagination support to GetAllUserPostQueryService and provide corresponding integration test
…ation-dto

Add DTO and DTO Collection for GetAllUserPost use case
…ation-usecase

Add use case for retrieving all user posts with pagination
…ation

Merge GetAllUserPost UseCase and DTO & DtoCollection
…tation-viewmodel

Implement GetAllUserPostViewModel and its test
…tation-controller

Implement controller method to retrieve all posts for a user with pagination
…tation

Merge ViewModel and Controller for Post Retrieval in Presentation Layer
zigzagdev added 30 commits July 5, 2025 14:54
…repository

Implement query service for retrieving user and other users' posts with pagination support
Integrate infrastructure layer for post query services
…ation-dto

Add use case for retrieving public posts from other users
…ation

Merge application layer for handling post retrieval use cases
…tation-viewmodel

Add GetPostViewModel and GetPostsViewModelCollection with unit tests
…tation-controller

Add GetOthersPostsController action and its feature test
…tation

Merge Presentation layer for GetOthersPosts flow (Controller, ViewModel, Factory)
Add feature test for retrieving public posts by other users
Merge feature test for retrieving others’ public posts into `main`
…ster

Fix incorrect endpoint in User registration feature tests
Fix incorrect endpoint in User show feature test
Fix incorrect endpoints in User registration and retrieval feature tests
Fix and refactor feature test for creating posts
Fix and refine feature test for updating a post via API
…all_user_posts

Fix and refactor feature test for retrieving all user posts via API
Fix and refactor multiple feature tests for Posts API
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: No status
Development

Successfully merging this pull request may close these issues.

1 participant