Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Changelog

All notable changes to `fragment-python` will be documented in this file.

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

Releases prior to `1.0.0` were published before this changelog was added and
are not documented here.

## [1.0.0]

### Changed

- `GetLedgerAccountBalance` now returns total `balance` (self + children)
instead of `ownBalance`.
- `ListLedgerAccountBalances` and `ListMultiCurrencyLedgerAccountBalances`
now accept `consistencyMode` on `childBalance`, `childBalances`,
`balance`, and `balances` fields.

### Removed

- `GetLedgerAccountBalanceWithChildRollup` has been removed.

### How to Upgrade

1. Upgrade your schema to use total balance consistency.
2. Edit your schema JSON. Change `ownBalanceUpdates` to
`totalBalanceUpdates` in the ledger account consistency config.
3. Change `ownBalance` to `totalBalance` in entry conditions.
4. Ensure the schema has only one of `ownBalanceUpdates` or
`totalBalanceUpdates`.
5. Deploy the new schema.
6. You can now set `consistencyConfig.totalBalanceUpdates: strong` on any
account in the tree, and its balance will be strongly consistent.
7. Upgrade `fragment-python` to the latest version.
8. Change `$ownBalanceConsistencyMode` to `$balanceConsistencyMode`.
9. Use `GetLedgerAccountBalance` instead of
`GetLedgerAccountBalanceWithChildRollup`.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

[Fragment](https://fragment.dev/) is the Ledger API for engineers that move money. Stop wrangling payment tables, debugging balance errors, and hacking together data pipelines. Start shipping the features that make a difference.

See [CHANGELOG.md](CHANGELOG.md) for release notes and upgrade guidance.

## Installation

Using `pip`:
Expand Down
18 changes: 12 additions & 6 deletions fragment/sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,14 @@
ExternalTxSource,
Granularity,
IncreaseEnv,
LedgerAccountClearingStatus,
LedgerAccountTypes,
LedgerDataMigrationStatus,
LedgerLinesConsistencyMode,
LedgerMigrationStatus,
LedgerTypes,
LinkType,
PostLinesAs,
ReadBalanceConsistencyMode,
SceneEventType,
SchemaConsistencyMode,
Expand Down Expand Up @@ -143,10 +145,6 @@
GetLedgerAccountBalance,
GetLedgerAccountBalanceLedgerAccount,
)
from .get_ledger_account_balance_with_child_rollup import (
GetLedgerAccountBalanceWithChildRollup,
GetLedgerAccountBalanceWithChildRollupLedgerAccount,
)
from .get_ledger_account_lines import (
GetLedgerAccountLines,
GetLedgerAccountLinesLedgerAccount,
Expand Down Expand Up @@ -180,10 +178,13 @@
ExternalAccountMatchInput,
GroupBalanceAccountFilter,
GroupFilter,
GroupInput,
GroupMatchInput,
GroupNotFilter,
GroupReconciliationParametersInput,
Int96ConditionInput,
Int96Filter,
LedgerAccountClearingStatusFilter,
LedgerAccountConditionInput,
LedgerAccountConsistencyConfigInput,
LedgerAccountDataMigrationsFilterSet,
Expand Down Expand Up @@ -230,6 +231,7 @@
SchemaLedgerEntryTagInput,
SchemaLedgerLineInput,
SchemaMatchInput,
SchemaRepeatedConfigInput,
SchemaTxMatchInput,
StringFilter,
StringMatchFilter,
Expand Down Expand Up @@ -497,8 +499,6 @@
"GetLedger",
"GetLedgerAccountBalance",
"GetLedgerAccountBalanceLedgerAccount",
"GetLedgerAccountBalanceWithChildRollup",
"GetLedgerAccountBalanceWithChildRollupLedgerAccount",
"GetLedgerAccountLines",
"GetLedgerAccountLinesLedgerAccount",
"GetLedgerAccountLinesLedgerAccountLines",
Expand All @@ -518,11 +518,15 @@
"Granularity",
"GroupBalanceAccountFilter",
"GroupFilter",
"GroupInput",
"GroupMatchInput",
"GroupNotFilter",
"GroupReconciliationParametersInput",
"IncreaseEnv",
"Int96ConditionInput",
"Int96Filter",
"LedgerAccountClearingStatus",
"LedgerAccountClearingStatusFilter",
"LedgerAccountConditionInput",
"LedgerAccountConsistencyConfigInput",
"LedgerAccountDataMigrationsFilterSet",
Expand Down Expand Up @@ -612,6 +616,7 @@
"MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntryLines",
"MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntryLinesNodes",
"MigrateLedgerEntryMigrateLedgerEntryMigrateLedgerEntryResultReversingLedgerEntryLinesNodesAccount",
"PostLinesAs",
"ReadBalanceConsistencyMode",
"ReconcileTx",
"ReconcileTxReconcileTxBadRequestError",
Expand Down Expand Up @@ -661,6 +666,7 @@
"SchemaLedgerEntryTagInput",
"SchemaLedgerLineInput",
"SchemaMatchInput",
"SchemaRepeatedConfigInput",
"SchemaTxMatchInput",
"StoreSchema",
"StoreSchemaStoreSchemaBadRequestError",
Expand Down
6 changes: 3 additions & 3 deletions fragment/sdk/add_ledger_entry.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated by fragment (with the help of ariadne-codegen)
# Source: queries/

from typing import Any, List, Literal, Optional, Union
from typing import Any, Literal, Optional, Union

from pydantic import Field

Expand All @@ -20,11 +20,11 @@ class AddLedgerEntryAddLedgerEntryAddLedgerEntryResult(BaseModel):
typename__: Literal["AddLedgerEntryResult"] = Field(alias="__typename")
is_ik_replay: bool = Field(alias="isIkReplay")
entry: "AddLedgerEntryAddLedgerEntryAddLedgerEntryResultEntry"
lines: List["AddLedgerEntryAddLedgerEntryAddLedgerEntryResultLines"]
lines: list["AddLedgerEntryAddLedgerEntryAddLedgerEntryResultLines"]


class AddLedgerEntryAddLedgerEntryAddLedgerEntryResultEntry(BaseModel):
type: Optional[Any]
type_: Optional[Any] = Field(alias="type")
id: str
ik: str
posted: Any
Expand Down
6 changes: 3 additions & 3 deletions fragment/sdk/add_ledger_entry_runtime.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated by fragment (with the help of ariadne-codegen)
# Source: queries/

from typing import Any, List, Literal, Optional, Union
from typing import Any, Literal, Optional, Union

from pydantic import Field

Expand All @@ -20,11 +20,11 @@ class AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResult(BaseModel):
typename__: Literal["AddLedgerEntryResult"] = Field(alias="__typename")
is_ik_replay: bool = Field(alias="isIkReplay")
entry: "AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultEntry"
lines: List["AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultLines"]
lines: list["AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultLines"]


class AddLedgerEntryRuntimeAddLedgerEntryAddLedgerEntryResultEntry(BaseModel):
type: Optional[Any]
type_: Optional[Any] = Field(alias="type")
id: str
ik: str
posted: Any
Expand Down
Loading
Loading