Skip to content

Latest commit

 

History

History
63 lines (52 loc) · 2.75 KB

File metadata and controls

63 lines (52 loc) · 2.75 KB

Development Stack

  • Java 25
  • Gradle with Kotlin DSL
  • Spring Framework 7.0
  • Spring Boot 4+ (latest)
  • Vaadin
  • DB: DoltDB for development
  • JUnit 5

UI

  • Vaadin (Flow) via vaadin-spring-boot-starter; the com.vaadin Gradle plugin drives the frontend (npm) build. Views are server-side Java routed with @Route (see com.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-dev dependency, which is on Gradle's developmentOnly configuration and excluded from production jars.

Development details

  • Use SOLID principles
  • Vaadin tests for UI

Misc

  • 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.

Domain modules

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 / configMonies (BigDecimal, scale 2 HALF_UP), month-based ProRata, ReferenceNumbers, the Clock bean.

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.