SQLite schema + ledger operations in gitea_saas/billing_core.py (+ db.py, schema.sql). balance = credits + refunds - debits - active holds, never negative; every mutation idempotent via UNIQUE idempotency_key; holds expire (default 30 min) and auto-release on the next read/query. All ops return (ok, details) with structured errors; never raise. Thread-safe via single lock + WAL. 26 hermetic pytest tests (no network/Stripe/Gitea).
9 lines
228 B
TOML
9 lines
228 B
TOML
[project]
|
|
name = "gitea-saas-core"
|
|
version = "0.1.0"
|
|
description = "Shared billing core (clients/ledger/holds, idempotent, fail-closed) for gitea-saas"
|
|
requires-python = ">=3.10"
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests"]
|