generated from coulomb/repo-seed
Replace infrastructure costs with actual domain invoice data
Start ledger January 2025. Record coulomb.social (3.75 EUR/mo) and coulomb.pro (3.00 EUR/mo) as per-domain expense rows. Remove Bubble and placeholder overhead. Add infrastructure reference catalogs; virtual server records pending invoice data.
This commit is contained in:
@@ -24,32 +24,31 @@ def test_active_members_counts_only_active_status() -> None:
|
||||
assert active_members(members) == 1
|
||||
|
||||
|
||||
def test_infrastructure_aggregated_from_expense_records() -> None:
|
||||
def test_infrastructure_aggregated_from_domain_expense_records() -> None:
|
||||
expenses = load_expense_records(DATA_DIR)
|
||||
fx = load_fx_rates(DATA_DIR)
|
||||
totals = aggregate_infrastructure_by_period(expenses, fx)
|
||||
|
||||
assert totals["2025-03"] == Decimal("69.44")
|
||||
assert totals["2026-06"] == Decimal("69.44")
|
||||
# Bubble $32 @ 0.92 = 29.44 + 15 domains + 25 overhead
|
||||
bubble_eur = Decimal("32.00") * Decimal("0.92")
|
||||
assert bubble_eur == Decimal("29.44")
|
||||
assert totals["2025-01"] == Decimal("6.75")
|
||||
assert totals["2026-06"] == Decimal("6.75")
|
||||
|
||||
|
||||
def test_monthly_ledger_computes_processing_from_payment_records() -> None:
|
||||
def test_monthly_ledger_starts_january_2025() -> None:
|
||||
ledger = load_monthly_ledger(DATA_DIR)
|
||||
june = next(row for row in ledger if row.period == "2026-06")
|
||||
march = next(row for row in ledger if row.period == "2025-03")
|
||||
assert ledger[0].period == "2025-01"
|
||||
assert len(ledger) == 18
|
||||
|
||||
assert march.infrastructure_cost == Decimal("69.44")
|
||||
march = next(row for row in ledger if row.period == "2025-03")
|
||||
june = next(row for row in ledger if row.period == "2026-06")
|
||||
|
||||
assert march.infrastructure_cost == Decimal("6.75")
|
||||
assert march.payment_processing_cost == Decimal("0.00")
|
||||
assert march.gross_revenue == Decimal("0.00")
|
||||
assert june.infrastructure_cost == Decimal("69.44")
|
||||
assert june.infrastructure_cost == Decimal("6.75")
|
||||
assert june.payment_processing_cost == Decimal("0.38")
|
||||
assert june.gross_revenue == Decimal("8.99")
|
||||
|
||||
|
||||
def test_build_snapshot_june_2026_uses_ledger_not_hand_totals() -> None:
|
||||
def test_build_snapshot_june_2026_domain_only_infrastructure() -> None:
|
||||
product = load_product(DATA_DIR)
|
||||
models = load_pricing_models(DATA_DIR)
|
||||
members = load_membership(DATA_DIR)
|
||||
@@ -58,28 +57,28 @@ def test_build_snapshot_june_2026_uses_ledger_not_hand_totals() -> None:
|
||||
|
||||
snapshot = build_snapshot("2026-06", product, models, members, payments, ledger)
|
||||
|
||||
assert snapshot.monthly_infrastructure_cost == Decimal("69.44")
|
||||
assert snapshot.monthly_infrastructure_cost == Decimal("6.75")
|
||||
assert snapshot.monthly_payment_processing_cost == Decimal("0.38")
|
||||
assert snapshot.monthly_total_platform_cost == Decimal("69.82")
|
||||
assert snapshot.period_net_liquidity == Decimal("-60.83")
|
||||
assert snapshot.gross_margin == Decimal("-60.83")
|
||||
assert snapshot.monthly_total_platform_cost == Decimal("7.13")
|
||||
assert snapshot.period_net_liquidity == Decimal("1.86")
|
||||
assert snapshot.liquidity_status == "generating"
|
||||
|
||||
|
||||
def test_liquidity_summary_aggregates_ledgers_deterministically() -> None:
|
||||
def test_liquidity_summary_with_actual_domain_costs() -> None:
|
||||
budget = load_budget(DATA_DIR)
|
||||
payments = load_payment_records(DATA_DIR)
|
||||
ledger = load_monthly_ledger(DATA_DIR)
|
||||
|
||||
summary = build_liquidity_summary(budget, payments, ledger, "2026-06")
|
||||
|
||||
assert summary.cumulative_infrastructure_cost == Decimal("1111.04")
|
||||
assert summary.cumulative_infrastructure_cost == Decimal("121.50")
|
||||
assert summary.cumulative_payment_processing_cost == Decimal("3.04")
|
||||
assert summary.cumulative_total_platform_cost == Decimal("1114.08")
|
||||
assert summary.cumulative_total_platform_cost == Decimal("124.54")
|
||||
assert summary.cumulative_member_payments == Decimal("68.88")
|
||||
assert summary.cumulative_net_liquidity == Decimal("-1042.16")
|
||||
assert summary.remaining_budget == Decimal("-42.16")
|
||||
assert summary.cumulative_net_liquidity == Decimal("-52.62")
|
||||
assert summary.remaining_budget == Decimal("947.38")
|
||||
assert summary.liquidity_status == "burning"
|
||||
assert summary.months_tracked == 16
|
||||
assert summary.months_tracked == 18
|
||||
|
||||
|
||||
def test_build_monthly_ledger_matches_loader() -> None:
|
||||
@@ -99,5 +98,6 @@ def test_dashboard_notes_expense_record_source() -> None:
|
||||
|
||||
report = generate_dashboard(DATA_DIR, "2026-06")
|
||||
assert "expense and payment record ledgers" in report
|
||||
assert "1111.04" in report
|
||||
assert "-42.16" in report
|
||||
assert "121.50" in report
|
||||
assert "947.38" in report
|
||||
assert "coulomb.social" not in report # dashboard shows aggregates, not domain names
|
||||
Reference in New Issue
Block a user