Skip to content

Latest commit

 

History

History
168 lines (117 loc) · 8.04 KB

File metadata and controls

168 lines (117 loc) · 8.04 KB

Changelog

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

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

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

[1.4.0]

Added

  • create_payment now also returns the Payment's id, ik, amount, mode, and currency, so its payment can be passed to <PaymentSession> in @fragment-dev/payment-elements as-is.
  • get_ledger_account_lines can filter by external_tx_ids on LedgerLinesFilterSet, returning only the Ledger Lines linked to those external transactions. Only supported for linked Ledger Accounts.

Changed

  • PaymentStatus now uses accepted instead of approved: PaymentStatus.approved is now PaymentStatus.accepted. Payments are experimental, so this API may change in a future release.

[1.3.0]

Added

  • instantiateLedgerAccount creates a Ledger Account from a template in the Ledger's Schema before any Ledger Entry is posted to it, creating any missing templated ancestors. Pass a ledger, a path, and optional parameters.
  • getPayment reads one Payment by ik and ledgerIk. It returns the Payment's amount, currency, status, type, typeVersion, mode, parameters and created.
  • listPayments pages through a Ledger's Payments with first, after and before, and filters on created and status via PaymentsFilterSet.
  • Scenes can simulate Payments. SceneInput takes a payments list of ScenePaymentInput, and a SceneEventInput with event_type of payment references one by ik to post a lifecycle transition.
  • PaymentStatus has a new approved state.
  • CurrencyCode has a new SLE member.

Changed

  • createPayment now returns a CreatePaymentResult wrapping payment, instead of returning the Payment directly.
  • typeVersion is now required on createPayment. It previously defaulted to the latest active version.
  • SchemaPaymentAccountingInput now keys its Ledger Entries by initiated and settled, instead of needs_payment_method_to_processing and processing_to_settled.

[1.2.0]

Added

  • createPayment creates a Payment on a Ledger. Pass an ik, a ledgerIk, and a Payment type, along with optional typeVersion and parameters. It returns the Payment's clientSecret and status. Payments are experimental, so this API may change in a future release.

Changed

  • typeVersion on LedgerEntryInput is now supported and defaults to 1. It was previously reserved for an upcoming feature.
  • PaymentStatus now uses needs_payment_method instead of requires_confirmation.
  • SchemaPaymentEntryStatus is now named SchemaPaymentTypeStatus, and SchemaPaymentEntryInput now takes needs_payment_method_to_processing instead of needs_confirmation_to_processing.

[1.1.1]

Added

  • Ledger Line tags can now be updated using updateLedgerEntry

[1.1.0]

Added

  • AddLedgerEntries posts a batch of Ledger Entries atomically.
  • Strongly-typed batch payloads. Codegen now emits a typed_entries module with one model per Ledger Entry type, derived from the per-entry-type addLedgerEntry operations in the codegen input directory. Because a batch mutation takes one list of one input type, GraphQL cannot type each entry's parameters field individually; these models do. They can be passed to add_ledger_entries directly, mixed with raw AddLedgerEntryInput values. Model names always carry the entry type version, defaulting to V1.

[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.

Removed

  • GetLedgerAccountBalanceWithChildRollup has been removed.

Upgrade Guide

  1. Upgrade your schema to use the total balance consistency feature:

    1. Add the path to your schema JSON or the JSON itself to the top of the prompt below and give it to your LLM of choice. It'll make some small changes to your consistency configs and conditions.
    2. Deploy the new schema
 Fragment schema JSON path or full schema: <YOUR_SCHEMA_OR_PATH>                                           
                                                                                                                                                                                                                        
  Above is a Fragment schema JSON file or the path to it. Transform it to use total balances by following   
  the rules below, then validate the result. If a file path is provided, edit the file in place — do not
  create a copy or temporary file.  
                                                                                                            
  Rules                                                           

  1. Entry conditions

  Replace ownBalance with totalBalance in all entry conditions.

  2. Default consistency config                                                                             
   
  In the schema's defaultConsistencyConfig, replace ownBalanceUpdates with totalBalanceUpdates.             
                                                                  
  3. Ledger account consistency config

  For each ledger account (not groups — groups keep ownBalanceUpdates unchanged), determine the new         
  consistency value using these three questions:
                                                                                                            
  - (A) Is this account a leaf on any entry line? Check whether any entry in the schema references this
  account as a line target.
  - (B) Is this account strongly consistent? Either it has an explicit ownBalanceUpdates: "strong", or it
  inherits "strong" from defaultConsistencyConfig.                                                          
  - (C) Does this account have an entry condition? Check whether any entry condition references this
  account.                                                                                                  
                                                                  
  Then apply:

  - (A) Yes + (B) Yes           → totalBalanceUpdates: "strong"
  - (C) Yes                      → totalBalanceUpdates: "strong"
  - (A) No  + (B) Yes + (C) No  → totalBalanceUpdates: "eventual"
  - (B) No  + (C) No            → totalBalanceUpdates: "eventual"

  In short: an account gets totalBalanceUpdates: "strong" if it is either a leaf on an entry line and was   
  already strongly consistent, or has an entry condition. Everything else becomes "eventual".
                                                                                                            
  4. Groups are excluded                                          

  Do not change ownBalanceUpdates on groups. This migration only applies to ledger accounts.

  Pre-Validation                                                                                            
   
  Validate the transformed schema before returning it:                                                      
                                                                  
  - If the input was a file path, run: fragment verify-schema --path <path-to-schema> --verbose
  - If the input was pasted schema JSON, write it to a temporary file and run: fragment verify-schema --path
   <temp-file> --verbose                                                                                    
  - If you don't have access to a shell, skip this step.
  1. Upgrade your Fragment SDK to the latest version:

    1. GetLedgerAccountBalance now returns total balance (self + children) instead of ownBalance.
      1. Change $ownBalanceConsistencyMode to $balanceConsistencyMode
    2. Use GetLedgerAccountBalance instead of GetLedgerAccountBalanceWithChildRollup.