Server Backend - Core DAOs (Session, Message, Group Basic CRUD) #52

Closed
opened 2025-06-05 23:28:10 +00:00 by rwachters · 0 comments
rwachters commented 2025-06-05 23:28:10 +00:00 (Migrated from github.com)

Description

Implement the basic Create, Read (list/by ID), Delete (for Session/Group, Message basic delete stub) operations in the Exposed DAOs for Sessions, Messages, and Groups. These implementations should use suspend functions and expect to be called within a TransactionScope. Include mappings from Exposed ResultRow to common DTOs. Implement addChildToMessage in MessageDao.

Stories Addressed

  • E2.S1 (Session insert)
  • E2.S3 (Session list)
  • E2.S4 (Session by ID, Messages by Session ID)
  • E6.S3 (Group insert)
  • E6.S4 (Group list)
  • Partial E3.S4 (Message delete placeholder)
  • Partial E1.S4 (Message insert, addChildToMessage)
  • Uses E7.S4 schema and E7.S6/TransactionScope

Key Files to Implement

  • server/src/main/kotlin/eu/torvian/chatbot/server/data/dao/SessionDao.kt (interface)
  • server/src/main/kotlin/eu/torvian/chatbot/server/data/exposed/SessionDaoExposed.kt (basic impl: getAll, getById, insert, basic update, delete - relying on CASCADE)
  • server/src/main/kotlin/eu/torvian/chatbot/server/data/dao/MessageDao.kt (interface)
  • server/src/main/kotlin/eu/torvian/chatbot/server/data/exposed/MessageDaoExposed.kt (basic impl: getBySessionId, insert, addChildToMessage, basic delete stub)
  • server/src/main/kotlin/eu.torvian/chatbot/server/data/dao/GroupDao.kt (interface)
  • server/src/main/kotlin/eu/torvian/chatbot/server/data/exposed/GroupDaoExposed.kt (basic impl: getAll, insert)

Acceptance Criteria

  1. All DAO interfaces are properly defined with suspend functions
  2. Exposed implementations correctly map between database rows and DTOs
  3. All operations correctly use the transaction scope
  4. Basic CRUD operations for Sessions are implemented
  5. Basic CRUD operations for Messages are implemented, including proper parent/child relationship management
  6. Basic CRUD operations for Groups are implemented
  7. Unit tests for all implementations

Assignee

Alex

Reviewer

Eric

## Description Implement the basic Create, Read (list/by ID), Delete (for Session/Group, Message basic delete stub) operations in the Exposed DAOs for Sessions, Messages, and Groups. These implementations should use suspend functions and expect to be called within a `TransactionScope`. Include mappings from Exposed `ResultRow` to common DTOs. Implement `addChildToMessage` in MessageDao. ## Stories Addressed - E2.S1 (Session insert) - E2.S3 (Session list) - E2.S4 (Session by ID, Messages by Session ID) - E6.S3 (Group insert) - E6.S4 (Group list) - Partial E3.S4 (Message delete placeholder) - Partial E1.S4 (Message insert, addChildToMessage) - Uses E7.S4 schema and E7.S6/TransactionScope ## Key Files to Implement - `server/src/main/kotlin/eu/torvian/chatbot/server/data/dao/SessionDao.kt` (interface) - `server/src/main/kotlin/eu/torvian/chatbot/server/data/exposed/SessionDaoExposed.kt` (basic impl: getAll, getById, insert, basic update, delete - relying on CASCADE) - `server/src/main/kotlin/eu/torvian/chatbot/server/data/dao/MessageDao.kt` (interface) - `server/src/main/kotlin/eu/torvian/chatbot/server/data/exposed/MessageDaoExposed.kt` (basic impl: getBySessionId, insert, addChildToMessage, basic delete stub) - `server/src/main/kotlin/eu.torvian/chatbot/server/data/dao/GroupDao.kt` (interface) - `server/src/main/kotlin/eu/torvian/chatbot/server/data/exposed/GroupDaoExposed.kt` (basic impl: getAll, insert) ## Acceptance Criteria 1. All DAO interfaces are properly defined with suspend functions 2. Exposed implementations correctly map between database rows and DTOs 3. All operations correctly use the transaction scope 4. Basic CRUD operations for Sessions are implemented 5. Basic CRUD operations for Messages are implemented, including proper parent/child relationship management 6. Basic CRUD operations for Groups are implemented 7. Unit tests for all implementations ## Assignee Alex ## Reviewer Eric
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Torvian.eu/chatbot#52
No description provided.