feat(backend): persist tasks and generated message history
- add EntityTask domain and CRUD API backed by PostgreSQL - relate generated messages directly to tasks and delete on task removal - move preview generation to backend Llama endpoint - migrate frontend task APIs from localStorage to backend endpoints - update tests and CLAUDE rules for backend-owned LLM/persistence
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
package com.condado.newsletter.repository
|
||||
|
||||
import com.condado.newsletter.model.EntityTask
|
||||
import com.condado.newsletter.model.VirtualEntity
|
||||
import org.springframework.data.jpa.repository.JpaRepository
|
||||
import java.util.UUID
|
||||
|
||||
interface EntityTaskRepository : JpaRepository<EntityTask, UUID> {
|
||||
fun findAllByActiveTrue(): List<EntityTask>
|
||||
fun findAllByVirtualEntity(virtualEntity: VirtualEntity): List<EntityTask>
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.condado.newsletter.repository
|
||||
|
||||
import com.condado.newsletter.model.GeneratedMessageHistory
|
||||
import org.springframework.data.jpa.repository.JpaRepository
|
||||
import java.util.UUID
|
||||
|
||||
interface GeneratedMessageHistoryRepository : JpaRepository<GeneratedMessageHistory, UUID> {
|
||||
fun findAllByTask_IdOrderByCreatedAtDesc(taskId: UUID): List<GeneratedMessageHistory>
|
||||
fun countByTask_Id(taskId: UUID): Long
|
||||
fun deleteByIdAndTask_Id(id: UUID, taskId: UUID): Long
|
||||
fun deleteAllByTask_Id(taskId: UUID)
|
||||
}
|
||||
Reference in New Issue
Block a user