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.
- Full separation of concerns: application, persistence, domain, and infrastructure layers.
- Core logic isolated in aggregates and use-case handlers.
- Create, validate, correct, reject, and approve documents like applications, policies, and endorsements.
- State Machine–based processing pipeline managing each document through its lifecycle.
- All business data is stored as DescriptorValues.
- Fully dynamic schema definition using
DocumentSchema, allowing rapid changes without altering code.
- Built-in conditional validation depending on process stage and field values.
- Supports cross-field validation, required fields, enums, and custom conditions.
- 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).
- Injected strategy-based pricing engine per product line (e.g. animal insurance, travel, etc.).
- Pricing recalculated on initial application and amendments.
- Clean separation between Commands, Queries, Handlers and DTOs.
- Easily extendable, testable and observable flow for all use cases.
DocumentRecord– container for documents flowing through process stagesDocument– single versioned document (e.g., application, policy, amendment)Descriptor– atomic unit of business inputProduct– defines business logic, schema, pricing strategy, and amendment rules
| 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 |