- Java 25
- Gradle with Kotlin DSL
- Spring Framework 7.0
- Spring Boot 4+ (latest)
- Vaadin
- DB: DoltDB for development
- JUnit 5
- Vaadin (Flow) via
vaadin-spring-boot-starter; thecom.vaadinGradle plugin drives the frontend (npm) build. Views are server-side Java routed with@Route(seecom.example.insurance.ui). - Vaadin's first frontend build downloads an npm toolchain and is slow; later
builds are cached. Dev mode requires the
com.vaadin:vaadin-devdependency, which is on Gradle'sdevelopmentOnlyconfiguration and excluded from production jars.
- Use SOLID principles
- Vaadin tests for UI
- Money: BigDecimal (or a Money type) with explicit scale/rounding — never double.
- Time: java.time, inject Clock so "installment due today" and "nightly billing job" scenarios are testable; state the timezone policy.
com.example.insurance is organized by insurance domain, mirroring specs/:
policy.quote— rating and quoting: the filed auto plan table, the HO-3 rate table, underwriting declines (recorded on the quote).policy.bind— quote acceptance: cleared-down-payment check, no backdating, policy issuance, ID cards + declarations page, billing account.policy.cancel/policy.renew/policy.endorse— lifecycle: 14-day non-payment notices + nightly cancellation job, the 45-day renewal-offer job, mid-term endorsements with prorated premium.billing— installment plans and schedules, autopay declines (3-day retry, 10-day grace), pro-rata refunds to the original payment method.claims— FNOL (auto accidents online/hotline, home water losses), adjuster routing by damage estimate, collision settlements paid to the shop.notification— outbound email/SMS port; every send is persisted (sent_notification) as the audit trail.common/config—Monies(BigDecimal, scale 2 HALF_UP), month-basedProRata,ReferenceNumbers, theClockbean.
Timezone policy: every business date (due dates, grace periods,
effective/cancellation dates, "expiring in 45 days") is computed in the
company's operating timezone, configured by insurance.time-zone
(default America/New_York) and injected as java.time.Clock. Services never
call now() without the Clock.
Pro-rata convention: terms are equal monthly units (month-based, days within a partial month), so a $600 six-month policy cancelled exactly 2 months in refunds exactly $400 — matching the published billing spec.
Spec traceability: only [published] scenarios are implemented; scenarios
marked [proposed] are intentionally absent. Each service/test carries a
comment naming its spec file, and tests' @DisplayNames quote the scenario
titles.