application.dtos.sync_dtos¶
src.application.dtos.sync_dtos
¶
Data Sync DTOs (Data Transfer Objects).
Response/result dataclasses for sync command handlers. These carry sync operation results from handlers back to the presentation layer.
DTOs
- SyncAccountsResult: Result from SyncAccounts command
- SyncTransactionsResult: Result from SyncTransactions command
- SyncHoldingsResult: Result from SyncHoldings command
- BalanceChange: Tracks balance changes for portfolio events
Reference
- docs/architecture/cqrs.md (DTOs section)
Classes¶
BalanceChange
dataclass
¶
Tracks balance change for a single account during sync.
Used to emit AccountBalanceUpdated events after sync completes.
Attributes:
| Name | Type | Description |
|---|---|---|
account_id |
UUID
|
Account whose balance changed. |
previous |
Decimal
|
Balance before sync. |
current |
Decimal
|
Balance after sync. |
currency |
str
|
Currency code. |
Source code in src/application/dtos/sync_dtos.py
SyncAccountsResult
dataclass
¶
Result of account sync operation.
Attributes:
| Name | Type | Description |
|---|---|---|
created |
int
|
Number of new accounts created. |
updated |
int
|
Number of existing accounts updated. |
unchanged |
int
|
Number of accounts unchanged. |
errors |
int
|
Number of accounts that failed to sync. |
message |
str
|
Human-readable summary. |
balance_changes |
list[BalanceChange]
|
List of balance changes for portfolio events. |
Source code in src/application/dtos/sync_dtos.py
SyncTransactionsResult
dataclass
¶
Result of transaction sync operation.
Attributes:
| Name | Type | Description |
|---|---|---|
created |
int
|
Number of new transactions created. |
updated |
int
|
Number of existing transactions updated. |
unchanged |
int
|
Number of transactions unchanged. |
errors |
int
|
Number of transactions that failed to sync. |
accounts_synced |
int
|
Number of accounts processed. |
message |
str
|
Human-readable summary. |
Source code in src/application/dtos/sync_dtos.py
SyncHoldingsResult
dataclass
¶
Result of holdings sync operation.
Attributes:
| Name | Type | Description |
|---|---|---|
created |
int
|
Number of new holdings created. |
updated |
int
|
Number of existing holdings updated. |
unchanged |
int
|
Number of holdings unchanged. |
deactivated |
int
|
Number of holdings deactivated (no longer in provider). |
errors |
int
|
Number of holdings that failed to sync. |
message |
str
|
Human-readable summary. |