feat: implement VirtualEntity and DispatchLog models with corresponding tests and configuration

This commit is contained in:
2026-03-26 18:21:13 -03:00
parent a96f892dab
commit 054608fc62
7 changed files with 260 additions and 5 deletions

View File

@@ -45,7 +45,7 @@ employee is an AI-powered entity that:
|------|-----------------------------------------|-------------|
| 0 | Define project & write CLAUDE.md | ✅ Done |
| 1 | Scaffold monorepo structure | ✅ Done |
| 2 | Domain model (JPA entities) | ⬜ Pending |
| 2 | Domain model (JPA entities) | ✅ Done |
| 3 | Repositories | ⬜ Pending |
| 4 | Email Reader Service (IMAP) | ⬜ Pending |
| 5 | Prompt Builder Service | ⬜ Pending |
@@ -253,10 +253,16 @@ Tests to write (all should **fail** before implementation):
> `VirtualEntity`. Make the tests in `EntityMappingTest` pass."
**Done when:**
- [ ] `EntityMappingTest.kt` exists with all 5 tests.
- [ ] Both entity files exist in `src/main/kotlin/com/condado/newsletter/model/`.
- [ ] `./gradlew test` is green.
- [ ] Tables are auto-created by Hibernate on startup (`ddl-auto: create-drop` in dev).
- [x] `EntityMappingTest.kt` exists with all 5 tests.
- [x] Both entity files exist in `src/main/kotlin/com/condado/newsletter/model/`.
- [x] `./gradlew test` is green.
- [x] Tables are auto-created by Hibernate on startup (`ddl-auto: create-drop` in dev).
**Key decisions made:**
- Added `org.gradle.java.home=C:/Program Files/Java/jdk-21.0.10` to `gradle.properties` — the Kotlin DSL compiler embedded in Gradle 8.14.1 does not support JVM target 26, so the Gradle daemon must run under JDK 21.
- Created `src/test/resources/application.yml` to override datasource and JPA settings for tests (H2 in-memory, `ddl-auto: create-drop`), and provide placeholder values for required env vars so tests run without Docker/real services.
- `VirtualEntity` and `DispatchLog` use class-body `var` fields for `id` (`@GeneratedValue`) and `createdAt` (`@CreationTimestamp`) so Hibernate can set them; all other fields are constructor `val` properties.
- `DispatchStatus` enum: `PENDING`, `SENT`, `FAILED`.
---