Skip to content

mmilewczyk/insurchain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛡️ Insurance Document Lifecycle Management System

A powerful, extensible and production-ready insurance domain engine built with CQRS, Hexagonal Architecture, and Spring Boot.
Designed to support insurance product onboarding, document workflows, policy lifecycle, endorsements (amendments) and context-aware validation.

🧠 Built with enterprise-grade patterns and flexibility to adapt across multiple lines of business: health, life, animal, property, etc.


✨ Key Features

🧱 Domain-Driven Design (DDD) & Hexagonal Architecture

  • Full separation of concerns: application, persistence, domain, and infrastructure layers.
  • Core logic isolated in aggregates and use-case handlers.

🪄 Dynamic Document Processing

  • Create, validate, correct, reject, and approve documents like applications, policies, and endorsements.
  • State Machine–based processing pipeline managing each document through its lifecycle.

📄 Descriptor-Based Data Model

  • All business data is stored as DescriptorValues.
  • Fully dynamic schema definition using DocumentSchema, allowing rapid changes without altering code.

🔍 Validation Engine

  • Built-in conditional validation depending on process stage and field values.
  • Supports cross-field validation, required fields, enums, and custom conditions.

🧾 Amendment Support (Endorsements)

  • Smart merge engine to apply changes onto existing policies.
  • Audit trail and historical tracking of changes.
  • Validation of amendment compatibility (e.g. deductible change, coverage addition/removal).

💸 Custom Pricing Strategies

  • Injected strategy-based pricing engine per product line (e.g. animal insurance, travel, etc.).
  • Pricing recalculated on initial application and amendments.

✅ CQRS Infrastructure

  • Clean separation between Commands, Queries, Handlers and DTOs.
  • Easily extendable, testable and observable flow for all use cases.

🧠 Domain Concepts

  • DocumentRecord – container for documents flowing through process stages
  • Document – single versioned document (e.g., application, policy, amendment)
  • Descriptor – atomic unit of business input
  • Product – defines business logic, schema, pricing strategy, and amendment rules

🧪 Tech Stack

Layer Technology
Language Java 21
Framework Spring Boot 3
Architecture Hexagonal, CQRS, DDD
Data PostgreSQL
Tests JUnit 5, Mockito
Build Maven
Mapping MapStruct
API Docs SpringDoc OpenAPI + Swagger UI

About

🛡️ Extensible insurance document lifecycle engine (Java · Spring Boot · CQRS · DDD). Supports policy workflows, endorsements, dynamic schemas and validation engine.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages