mamonet GitHub avatar

spring-tax-calc-service

mamonet

一个基于Java 17和Spring Boot的参考实现,用于金融计算和监管报告,具有版本化配置驱动的规则、完整审计追踪以及XML合规文件生成(含XSD验证)。

Stars

5

7 天增长

暂无数据

Fork 数

1

开放 Issue

0

开源协议

暂无数据

最近更新

2026-07-29

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它直接解决了金融平台常见的三个问题(硬编码规则、不可解释的数值、模式耦合报告),采用清晰的六边形架构和领域纯净性。

适合谁使用

  • 构建企业金融平台的开发者
  • 设计可配置计算引擎的架构师
  • 需要可审计结果的合规工程师
  • 评估Spring Boot模式的技术负责人

典型使用场景

  • 实现无需代码发布即可动态调整的税率或费用计算
  • 生成每个数值都有推导过程的可审计合规报表
  • 产生经过XSD验证的XML监管报告
  • 创建可通过配置适应新辖区的模块化金融服务

项目优势

  • 六边形架构,领域核心无框架依赖
  • 按生效日期选择的版本化规则集,支持历史可重现
  • 每个计算数值都包含规则版本、输入和中间值的完整审计追踪
  • XML合规输出在返回前经XSD验证,防止静默模式违规

使用前须知

  • 属于中立辖区的参考实现,未针对任何具体国家的监管申报
  • 尚未提供针对设计目标的基准测试结果
  • 状态清单显示部分功能(如基准测试、Docker CI流水线)可能仍在进行中

README 快速开始

spring-tax-calc-service

A Java 17 and Spring Boot service for financial calculation and regulatory reporting, built the way an enterprise platform has to be built: rules that change without code changes, results that are auditable, and an architecture that survives a decade of amendments.

Financial and tax-compliance platforms fail in a predictable way. Calculation rules are hard-coded, so every rate change or new jurisdiction means a release. Results can't be explained after the fact, so nobody can answer why a figure came out the way it did. Report formats are welded to the domain model, so a new schema version rewrites half the system.

spring-tax-calc-service is a reference implementation that avoids all three. It takes financial transactions, applies a versioned, configuration-driven rule set to compute liabilities, keeps a full audit trail of how every figure was derived, and emits both a financial report and a structured XML compliance file validated against its schema.

Scope note: a generic, jurisdiction-neutral reference implementation for calculation and regulatory reporting. It demonstrates the architecture and the engineering practice, not any one country's filing product.


Architecture

Hexagonal (ports and adapters), so the domain has no idea what a database or an XML schema is.

flowchart LR
    API[REST API\nSpring Web] --> APP[Application services]
    APP --> DOM[Domain core\ncalculation engine]
    DOM --> RULES[(Versioned rule sets\nconfiguration)]
    APP --> REPO[(PostgreSQL\nJPA adapter)]
    APP --> RPT[Report adapter\nfinancial summary]
    APP --> XML[Compliance adapter\nXML + XSD validation]
    DOM --> AUDIT[Audit trail\nper-figure derivation]
  • Domain core. Pure Java 17, no framework annotations: money as BigDecimal with explicit rounding, immutable value objects, records and sealed types for the transaction model.
  • Calculation engine. Rules are data, not code. A rule set is versioned and selected by effective date, so a rate change is configuration and historical periods stay reproducible. Strategy and chain-of-responsibility keep each rule small and independently testable.
  • Audit trail. Every computed figure records the rules applied, the inputs, and the intermediate values, so any number can be explained line by line.
  • Reporting adapters. One produce

项目描述

Hexagonal Spring Boot tax calculation service where rules are configuration, every figure carries its derivation, and the compliance XML is validated before it leaves the process.

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

deerwork-ai
精选
deerwork-ai GitHub avatar

deer-workflow

An open-source Dynamic Workflow runtime that combines deterministic TypeScript orchestration with replaceable Agent runtimes.

AI 与机器学习大语言模型
312
gavamedia
精选
gavamedia GitHub avatar

deltafin

Deltafin is a research project that runs the 2.8-trillion-parameter Mixture-of-Experts model Kimi K3 on a single Apple Silicon Mac (e.g., M1 Max with 64 GB) at about 16 seconds per token, using exact, reproducible inference with local or streaming expert loading.

AI 与机器学习大语言模型
304
7-e1even
精选
7-e1even GitHub avatar

learn-agent

A collection of notes on building coding agents, derived from the production development of the desktop agent Reina, with each mechanism simplified into a zero-dependency, single-file Node.js demo.

AI 与机器学习大语言模型
218