feat: implement VirtualEntity and DispatchLog models with corresponding tests and configuration
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
package com.condado.newsletter.model
|
||||
|
||||
import jakarta.persistence.Column
|
||||
import jakarta.persistence.Entity
|
||||
import jakarta.persistence.GeneratedValue
|
||||
import jakarta.persistence.GenerationType
|
||||
import jakarta.persistence.Id
|
||||
import jakarta.persistence.Table
|
||||
import org.hibernate.annotations.CreationTimestamp
|
||||
import java.time.LocalDateTime
|
||||
import java.util.UUID
|
||||
|
||||
/**
|
||||
* Represents a fictional employee of "Condado Abaixo da Média SA".
|
||||
* Each entity has a scheduled time to send AI-generated emails, a personality description,
|
||||
* and a context window for reading recent emails via IMAP.
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "virtual_entities")
|
||||
class VirtualEntity(
|
||||
@Column(nullable = false)
|
||||
val name: String,
|
||||
|
||||
@Column(unique = true, nullable = false)
|
||||
val email: String,
|
||||
|
||||
@Column(name = "job_title", nullable = false)
|
||||
val jobTitle: String,
|
||||
|
||||
@Column(columnDefinition = "TEXT")
|
||||
val personality: String? = null,
|
||||
|
||||
@Column(name = "schedule_cron")
|
||||
val scheduleCron: String? = null,
|
||||
|
||||
@Column(name = "context_window_days")
|
||||
val contextWindowDays: Int = 3,
|
||||
|
||||
@Column(nullable = false)
|
||||
val active: Boolean = true
|
||||
) {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.UUID)
|
||||
var id: UUID? = null
|
||||
|
||||
@CreationTimestamp
|
||||
@Column(name = "created_at", updatable = false)
|
||||
var createdAt: LocalDateTime? = null
|
||||
}
|
||||
Reference in New Issue
Block a user