鱼皮AI导航
鱼皮AI导航
  • 主页
  • 社区
  • AI工具
  • AI知识库
  • AI提示词
  • MCP
  • Skills
  • AI学习资源
  • AI资讯
  • GitHub开源
登录/注册

domain-fintech

面向金融交易场景,确保资金计算的绝对精度与不可篡改的审计追踪能力,通过专用十进制类型避免浮点误差,以事件溯源和不可变值对象保障交易一致性,并强制货币单位校验与确定性执行。

区块链
访问 GitHub
文档Skills.MD
name
domain-fintech
description
Use when building fintech apps. Keywords: fintech, trading, decimal, currency, financial, money, transaction, ledger, payment, exchange rate, precision, rounding, accounting, 金融, 交易系统, 货币, 支付
user-invocablefalse

FinTech Domain

Layer 3: Domain Constraints

Domain Constraints → Design Implications

Domain RuleDesign ConstraintRust Implication
Audit trailImmutable recordsArc, no mutation
PrecisionNo floating pointrust_decimal
ConsistencyTransaction boundariesClear ownership
ComplianceComplete loggingStructured tracing
ReproducibilityDeterministic executionNo race conditions

Critical Constraints

Financial Precision

▼
text
复制代码
RULE: Never use f64 for money WHY: Floating point loses precision RUST: Use rust_decimal::Decimal

Audit Requirements

▼
text
复制代码
RULE: All transactions must be immutable and traceable WHY: Regulatory compliance, dispute resolution RUST: Arc<T> for sharing, event sourcing pattern

Consistency

▼
text
复制代码
RULE: Money can't disappear or appear WHY: Double-entry accounting principles RUST: Transaction types with validated totals

Trace Down ↓

From constraints to design (Layer 2):

▼
text
复制代码
"Need immutable transaction records" ↓ m09-domain: Model as Value Objects ↓ m01-ownership: Use Arc for shared immutable data "Need precise decimal math" ↓ m05-type-driven: Newtype for Currency/Amount ↓ rust_decimal: Use Decimal type "Need transaction boundaries" ↓ m12-lifecycle: RAII for transaction scope ↓ m09-domain: Aggregate boundaries

Key Crates

PurposeCrate
Decimal mathrust_decimal
Date/timechrono, time
UUIDuuid
Serializationserde
Validationvalidator

Design Patterns

PatternPurposeImplementation
Currency newtypeType safetystruct Amount(Decimal);
TransactionAtomic operationsEvent sourcing
Audit logTraceabilityStructured logging with trace IDs
LedgerDouble-entryDebit/credit balance

Code Pattern: Currency Type

▼
rust
复制代码
use rust_decimal::Decimal; #[derive(Clone, Debug, PartialEq)] pub struct Amount { value: Decimal, currency: Currency, } impl Amount { pub fn new(value: Decimal, currency: Currency) -> Self { Self { value, currency } } pub fn add(&self, other: &Amount) -> Result<Amount, CurrencyMismatch> { if self.currency != other.currency { return Err(CurrencyMismatch); } Ok(Amount::new(self.value + other.value, self.currency)) } }

Common Mistakes

MistakeDomain ViolationFix
Using f64Precision lossrust_decimal
Mutable transactionAudit trail brokenImmutable + events
String for amountNo validationValidated newtype
Silent overflowMoney disappearsChecked arithmetic

Trace to Layer 1

ConstraintLayer 2 PatternLayer 1 Implementation
Immutable recordsEvent sourcingArc, Clone
Transaction scopeAggregateOwned children
PrecisionValue Objectrust_decimal newtype
Thread-safe sharingShared immutableArc (not Rc)

Related Skills

WhenSee
Value Object designm09-domain
Ownership for immutablem01-ownership
Arc for sharingm02-resource
Error handlingm13-domain-error
区块链

快捷安装

复制到终端去安装 Skill

npxskillsaddZhangHanDong/rust-skills--skill"domain-fintech"
站长:程序员鱼皮 老鱼简历 商务合作 增值电信业务经营许可证
2026 鱼皮AI导航 | 沪ICP备19026706号-6
站长:程序员鱼皮 老鱼简历 商务合作 增值电信业务经营许可证
2026 鱼皮AI导航 | 沪ICP备19026706号-6
🔥热门工具
朱雀AI检测朱雀AI检测
朱雀AI检测助手朱雀AI检测助手
LovartLovart
老鱼简历老鱼简历
WritePass官网WritePass官网
面多多面多多
CursorCursor
星月写作星月写作
朱雀AI检测助手朱雀AI检测助手
零感AI零感AI
Skills 推荐
property-based-testing
通过生成随机输入验证代码在各类边界条件下的行为一致性,适用于序列化、解析、归一化及纯函数等场景,能有效发现隐含缺陷并提升测试覆盖率,尤其适合需要高可靠性的算法与智能合约验证。
compliance-checker
能够对基础设施配置进行合规性评估,检查是否符合 SOC2、HIPAA 和 PCI DSS 等行业标准,识别潜在的安全风险与违规项,并生成改进建议报告,适用于安全审计与合规审查场景。
orchestration
作为系统的核心协调中枢,负责将用户复杂需求拆解为并行任务流,动态调度不同能力的智能体协同工作,自动管理任务依赖与执行状态,并在后台静默完成多线程探索、分析与实现,最终整合结果交付完整解决方案。
skill-adapter
对基础设施配置进行多标准合规性评估,覆盖 SOC2、HIPAA 和 PCI DSS 等主流框架,自动识别配置偏差与安全风险,并生成可操作的整改建议报告,支撑持续合规治理与审计准备。
contract-test-creator
自动生成符合行业规范的契约测试代码与配置,提供从框架搭建到单元测试、集成测试及模拟对象编写的全流程支持,适用于需要实现高质量自动化测试验证的开发场景。