Skip to content

Conversation

@Kocannn
Copy link
Collaborator

@Kocannn Kocannn commented Jul 7, 2025

implement pagination

Kocannn added 5 commits July 7, 2025 23:49
- Implement BlogPostHandler and BlogPostUsecase for blog post CRUD.
- Add repository logic for blog_posts, authors, and blog_post_tags
tables.
- Register HTTP routes for creating, reading, updating, and deleting
blogs.
- Add migration for blog_posts, blog_post_tags, and authors tables.
- Ensure author and tags are handled in blog post creation and update.
- Support fetching blog post details with author and tags included.
Implement pagination in the GetAllBlogPosts repository method by
accepting
FilterPagination parameters, applying limit, offset, and orderBy to the
query,
and returning total count along with paginated data. Update related
interfaces
and usecase to support paginated responses. This enables efficient
retrieval
of blog posts with pagination metadata for API consumers.
Add TRUNCATE TABLE statements with RESTART IDENTITY CASCADE to all
seeder
SQL files to ensure tables are emptied and primary keys reset before
inserting seed data. This guarantees a clean database state for each
migration:fresh run. Also update registration_events seeder to include
"id" in insert columns and values for consistency.
Introduce `is_deleted` and `created_at` columns to the `blog_posts`
table
with a migration. Refactor repository and usecase logic to support soft
deletes by updating `is_deleted` instead of hard deleting records.
Update
domain model and API DTOs to use pointer types for `PublishedAt`,
`UpdatedAt`, and new `CreatedAt` fields. Adjust create and update flows
to
handle these changes and ensure soft-deleted posts are excluded from
queries.
Copy link
Contributor

@AfandyW AfandyW left a comment

Choose a reason for hiding this comment

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

g

@AfandyW AfandyW merged commit 0879dbc into development Jul 10, 2025
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.

3 participants