Description
Introduce a dedicated TradeId newtype and replace raw Uuid usage in execution models with domain-safe identifiers.
Depends on
Problem
The execution domain currently exposes raw Uuid in public APIs, which weakens type safety and allows accidental mixups with other IDs.
Scope
- Add
TradeId as first-class identifier type.
- Replace
transaction_id: Uuid with trade_id: TradeId in Trade.
- Update parser/formatter/serde behavior.
- Update matching flow to generate/propagate
TradeId.
Tasks
Technical Details
Candidate files:
Breaking Changes
- Execution model ID field/type changes to
TradeId.
- Constructor and serialization contract changes accordingly.
Acceptance Criteria
Out of Scope
- Introducing
Price/Quantity/TimestampMs wrappers for all APIs.
Description
Introduce a dedicated
TradeIdnewtype and replace rawUuidusage in execution models with domain-safe identifiers.Depends on
Problem
The execution domain currently exposes raw
Uuidin public APIs, which weakens type safety and allows accidental mixups with other IDs.Scope
TradeIdas first-class identifier type.transaction_id: Uuidwithtrade_id: TradeIdinTrade.TradeId.Tasks
TradeIdtype (constructor(s), parse, display, serde).Trademodel and constructor signature.src/price_level/level.rs.Technical Details
Candidate files:
src/execution/transaction.rs(after [Breaking] Rename execution domain: Transaction -> Trade #8:trade.rsif renamed)src/utils/uuid.rs(if adaptation needed)src/price_level/level.rssrc/execution/tests/*Breaking Changes
TradeId.Acceptance Criteria
Uuidappears in public execution model API.TradeIdsupports roundtrip parse/display/serde.fmt,clippy -D warnings,test,release build).Out of Scope
Price/Quantity/TimestampMswrappers for all APIs.