# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.2.1] - 2026-06-01

### Changed
- License is now MIT only (was "MIT OR Apache-2.0"); ship a single `LICENSE` file.
- Docs: overhauled the README for accuracy against 0.2.0 (Option-typed examples,
  current section/enum coverage, version `0.2`), trimmed `CLAUDE.md` to essentials,
  and improved crates.io metadata (description, keywords, categories) for discoverability.

## [0.2.0] - 2026-05-31

### Changed (breaking)
- **All attribute-derived fields are now `Option<T>`.** Every IB FLEX attribute
  is optional in real output, so fields that were previously required (e.g.
  `Trade::{symbol, conid, currency, asset_category}`, `Position` price/quantity
  fields, `CorporateAction::report_date`, and statement headers like
  `account_id`/`from_date`/`to_date`) are now `Option`. Previously, a statement
  that omitted any one of these failed to parse **entirely**; now a missing
  attribute is just `None`. Update call sites (`statement.account_id` →
  `statement.account_id.as_deref()`, etc.).

### Fixed
- **Trade price was always dropped on real statements**: `Trade::price` mapped a
  `price` attribute IB never emits; it now maps `tradePrice` (with `price` kept
  as an alias). Fixes the originally reported FX trade-cancel/correction case.
- **Hard parse failures on real data**: numeric attributes with thousands
  separators (`"2,345,678.99"`) and null sentinels (`-`, `--`, `N/A`) no longer
  fail the whole parse; booleans accept `Yes`/`No`; date fields tolerate a
  trailing time component.
- `Trade::ibOrderID` was mapped to the non-existent `orderID` attribute (always
  `None`); now mapped correctly with `orderID` kept as an alias.

### Added
- Full ibflex attribute coverage (~1,200 real attributes) across all activity
  element types — the parser now captures the complete data IB emits rather
  than a hand-picked subset.
- `AssetCategory::OptionsOnFutures` (`FSFOP`) and `OptionsFuturesStyle`
  (`FSOPT`); `OrderType` accepts the Flex `STPLMT`/`TRAILLMT` spellings;
  `TransferType` gains `INTERCOMPANY`/`OTC` and an `ACAT` alias.
- `<Lot>`, `<Order>`, `<SymbolSummary>` and `<AssetSummary>` rows inside
  `<Trades>` are now captured (`TradesWrapper::{lots, orders, symbol_summaries,
  asset_summaries}`) instead of discarded.
- New element types previously parsed-and-dropped: `NetStockPosition`,
  `TransactionTax`, `CFDCharge`, `SLBOpenContract`, `StockGrantActivity`.
- `Order`/`SymbolSummary`/`AssetSummary` now carry their real trade-shaped
  schema.

### Changed
- `Trade::initial_investment` is now `Option<String>` (was `Option<Decimal>`):
  IB emits non-numeric values here on some asset classes, which previously
  failed the parse.

## [0.1.9] - 2026-05-28

### Fixed
- update Flex Web Service endpoint (#12) ([#12](https://github.com/clifton/ib-flex/pull/12))
## [0.1.8] - 2026-05-28

### Changed
- Minor improvements and maintenance
## [0.1.7] - 2026-01-26

### Added
- add comprehensive daily analysis example (#10) ([#10](https://github.com/clifton/ib-flex/pull/10))

### Changed
- update edge case summary
## [0.1.6] - 2026-01-15

### Added
- Enhanced type safety and derivative field consolidation for options and futures ([#9](https://github.com/clifton/ib-flex/pull/9))
## [0.1.5] - 2026-01-14

### Fixed
- remove Cargo.lock from release script git operations
## [0.1.4] - 2026-01-14

### Changed
- Minor improvements and maintenance
## [0.1.3] - 2026-01-14

### Changed
- Minor improvements and maintenance
## [0.1.2] - 2026-01-14

### Added
- Robust release script for changelog generation and version bumping

## [0.1.1] - 2026-01-14

### Added
- Daily portfolio parsing support ([#7](https://github.com/clifton/ib-flex/pull/7))
- Comprehensive v0.2.0 extended FLEX support ([#3](https://github.com/clifton/ib-flex/pull/3))
- Comprehensive reliability testing suite ([#4](https://github.com/clifton/ib-flex/pull/4))
- FLEX Web Service API client (optional `flex-service` feature) ([#5](https://github.com/clifton/ib-flex/pull/5))
- Trade Confirmation parsing, version detection, type detection ([#6](https://github.com/clifton/ib-flex/pull/6))

### Fixed
- Handle interleaved Trades elements with enum-based parsing ([#8](https://github.com/clifton/ib-flex/pull/8))

## [0.1.0] - 2026-01-14

Initial release.

### Added
- Parse Activity FLEX XML statements
- Parse Trade Confirmation FLEX statements
- Support for all major asset classes (stocks, options, futures, FX)
- Type-safe parsing with rust_decimal and chrono
- Comprehensive error handling
- Documentation and examples
