Skip to content

Add Post Entity with Database Persistence #11

@cameronhotchkies

Description

@cameronhotchkies

Create Post domain entity, repository interface, database migration, and jOOQ implementation. Same vertical slice pattern as A1.

✅ Acceptance Criteria

  • Integration test: create post → findById returns it with matching fields
  • Integration test: update post → findById reflects changes
  • Integration test: delete post → findById returns null
  • Integration test: listRecent returns posts ordered newest-first
  • Creating post with nonexistent authorId fails (FK constraint)

Internal Coding

MP1

  • core/posts/Post.kt — entity with id, authorId, title, body, createdAt, updatedAt
  • core/posts/PostRepository.kt — interface with findById, create, update, delete, listByAuthor, listRecent
  • V002__create_posts_table.sql — migration with author FK, indexes on created_at
  • adapters/db/JooqPostRepository.kt — implements PostRepository

Metadata

Metadata

Assignees

No one assigned

    Labels

    ex machinaIssues/content generated by our robotic friends

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions