# @platform-modules/billing

## 0.1.2

### Patch Changes

- 1fd8651: Make the D1 atomicity capability truthful and stop advertising an interactive transaction the driver does not have.

  `@platform-modules/db` — `createD1Client` no longer exposes a `transaction` member or `TransactionIdentity`, and is no longer assignable to `TransactionalDatabase`. Cloudflare D1 has no interactive transaction callback API, so the previous shape was a false claim that failed at runtime with `Failed query: begin`; D1 gets a typed atomic batch seam over exactly one real `binding.batch(...)` call instead. Genuinely transactional adapters (Postgres) keep the callback-minted transaction, exact identity semantics and rollback.

  The transaction handle splits in two: `Transaction<S>` is now the dialect-neutral mutation handle (`execute()` only), while the Postgres query-builder surface (`select`/`insert`/`update`/`delete`) lives on `PostgresTransaction<S>`. Callers that use query builders inside a transaction must type against `PostgresTransaction<S>`.

  `withTransactionIdentity` becomes public API. It was marked internal, yet every package's real-Postgres harness needs it to produce a value satisfying `TransactionalDatabase`, and three packages had resorted to importing it through a relative path into `db/src` — which breaks the moment these packages are consumed as published `dist`. Consumers that build their own driver client now have a supported way to brand it.

  Every downstream consumer is migrated: transaction parameters re-annotated, PG test harnesses branded through the public helper or rebuilt on the first-party adapters, and `PgliteTransactionalDatabase` now declares the `$client` the driver actually attaches.

  Two latent defects surfaced and are fixed, both the same shape — code reading one result shape through a cast that hid the mismatch from the compiler:

  - `@platform-modules/content` — `taxonomy.ts` read `result.rows` behind an `as { rows?: unknown[] }` cast, so `isInSubtree` always returned false and the depth-cap query never matched. `moveTerm` would accept a parent inside its own subtree (creating a cycle) and allow a subtree past the depth cap, raising no error.
  - `@platform-modules/affiliate` — `maturity-sweep.ts` cast every `execute()` result to `{ rows }`. Its opening probe short-circuits the sweep when empty, so on a handle returning the other shape the sweep silently promoted nothing and moved no money.

  Both now normalize both shapes rather than casting to one: `execute()` yields a plain row array inside a platform-wrapped transaction and the driver's `{ rows }` envelope on an unwrapped handle, and consuming code must tolerate either.

  Breaking at the seam, released as minor: these packages are pre-1.0.0 and stay 0.x until the deliberate public release.
- Updated dependencies [1fd8651]
- Updated dependencies [801cad3]
  - @platform-modules/db@0.4.0
  - @platform-modules/ledger@0.2.2
  - @platform-modules/jobs@0.0.4
  - @platform-modules/tax@0.1.2

## 0.1.1

### Patch Changes

- Updated dependencies [df32439]
  - @platform-modules/db@0.3.0
  - @platform-modules/jobs@0.0.3
  - @platform-modules/ledger@0.2.1
  - @platform-modules/tax@0.1.1

## 0.1.0

### Minor Changes

- 560a46a: Remove the deprecated Sumit payment adapter and align billing with its Stripe-only contract.

  Removing a provider adapter breaks the public contract. Under 0.x that is a minor bump, not a patch.

  This release also returns `@platform-modules/billing` to the 0.x line every other
  `@platform-modules/*` package sits on. The 1.0.0 published from #78 was minted by the
  sibling-as-peer version cascade — since corrected, siblings are now regular `workspace:^`
  dependencies — not by a deliberate stable release. Every in-repo consumer resolves billing through
  the `workspace:` protocol, so the reset carries no cascade.

## 1.0.1

### Patch Changes

- Updated dependencies [82fa39c]
  - @platform-modules/ledger@0.2.0

## 1.0.0

### Major Changes

- 2626769: Add the `./subscriptions` subpath for recurring subscription providers and webhook settlement ingestion, and extend `ProviderEvent` to carry subscription settlement metadata.

### Patch Changes

- b4ea296: Add a PayPal billing adapter with subscription lifecycle and webhook verification.
- Updated dependencies [a20f6f7]
  - @platform-modules/tax@0.1.0

## 0.0.3

### Patch Changes

- Updated dependencies [1c03aba]
- Updated dependencies [70435a5]
  - @platform-modules/ledger@0.1.0

## 0.0.2

### Patch Changes

- Updated dependencies [f895518]
  - @platform-modules/db@0.2.0
  - @platform-modules/jobs@0.0.2
  - @platform-modules/ledger@0.0.2
  - @platform-modules/tax@0.0.2

## 0.0.1

### Patch Changes

- d72b1ba: Initial publish — first versioned release.
- Updated dependencies [d72b1ba]
  - @platform-modules/db@0.0.1
  - @platform-modules/jobs@0.0.1
  - @platform-modules/ledger@0.0.1
  - @platform-modules/tax@0.0.1
