Skip to content

[Breaking] Add TradeId and remove raw Uuid from execution API #9

@j-b-layerv

Description

@j-b-layerv

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

  • Add TradeId type (constructor(s), parse, display, serde).
  • Replace ID field in Trade model and constructor signature.
  • Update ID generation usage in src/price_level/level.rs.
  • Update all tests touching execution IDs.
  • Update docs/examples using raw UUID for trades.

Technical Details

Candidate files:

Breaking Changes

  • Execution model ID field/type changes to TradeId.
  • Constructor and serialization contract changes accordingly.

Acceptance Criteria

  • No raw Uuid appears in public execution model API.
  • TradeId supports roundtrip parse/display/serde.
  • Full suite passes (fmt, clippy -D warnings, test, release build).

Out of Scope

  • Introducing Price/Quantity/TimestampMs wrappers for all APIs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions