2 KiB
2 KiB
| domain | last_rule_review_commit | last_rule_updated_at |
|---|---|---|
| domain-model | no-commit-yet | 2026-05-24 |
domain-model
목적 / 책임
ALT의 핵심 business vocabulary를 Go 타입으로 표현한다. market, instrument, price, bar, backtest run 같은 개념을 transport나 storage와 분리된 형태로 유지한다.
포함 경로
packages/domain/- shared Go domain model modulepackages/domain/market/- market, venue, currency, instrument, OHLCV bar typespackages/domain/backtest/- backtest run spec, run state, result types
제외 경로
packages/contracts/- external protobuf schema representationservices/api/- socket transport and API boundaryservices/worker/- execution and scheduled job boundary
주요 구성 요소
market.Instrument- tradable instrument identity and provider symbol mappingmarket.Bar- timeframe OHLCV market data pointbacktest.RunSpec- strategy, market, timeframe, period inputs for a runbacktest.Run- backtest lifecycle statebacktest.Result- backtest financial summary
유지할 패턴
- Domain type names should stay concise and market-neutral unless a market-specific rule is unavoidable.
- Decimal values are represented as strings through
market.Decimal; avoid float types for prices and quantities. - Keep package dependencies inward: domain packages should not import API, worker, CLI, Flutter, protobuf generated code, database drivers, or proto-socket.
다른 도메인과의 경계
- contracts: domain-model owns internal Go vocabulary; contracts owns protobuf wire schema and compatibility.
- worker: domain-model defines the shapes; worker executes imports, normalization, and backtests.
- api: domain-model may be mapped to responses, but API transport details stay outside this module.
금지 사항
- Do not add persistence annotations, socket parser logic, or environment configuration here.
- Do not introduce generated protobuf code into this package.
- Do not use
float32orfloat64for money, price, or quantity values.