feat: operational resource procurement facility

Implement RESOURCE-WP-0005: entity register, V0.1 terms parameters,
entity association on inventory and planning records, transfer-price
and credit-state arithmetic, monthly settlement, and entity views on
the portfolio report. Live close emits nothing until delivered cost
is known. Handoffs are FIN-WP-0006 and RAILIANCE-WP-0017.
This commit is contained in:
tegwick 2026-08-14 13:15:02 +02:00
parent 325a505980
commit f8d1c542d5
37 changed files with 1316 additions and 28 deletions

View file

@ -4,6 +4,7 @@ from datetime import date
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parents[1] / "tools"))
from entities import REQUIRED_ENTITY_IDS
from portfolio_report import (
build,
cost_section,
@ -158,6 +159,17 @@ class LivePortfolioTest(unittest.TestCase):
def test_report_is_deterministic_for_a_fixed_date(self):
self.assertEqual(self.report, build(ROOT, TODAY))
def test_every_financial_entity_is_listed_and_unattributed_cost_is_named(self):
ids = [row["financial_entity_id"] for row in self.report["entities"]["entities"]]
self.assertEqual(list(REQUIRED_ENTITY_IDS), ids)
self.assertIsNone(self.report["entities"]["known_monthly_spend_eur"])
unattributed = {row["resource_id"] for row in self.report["entities"]["unattributed_resources"]}
self.assertIn("resource:hosteurope:railiance01", unattributed)
coulomb = next(row for row in self.report["entities"]["entities"] if row["financial_entity_id"] == "entity:coulomb")
self.assertIn("resource:tenant:coulomb:coulomb-social", coulomb["dedicated_resources"])
self.assertTrue(coulomb["shared_shares"])
self.assertIsNone(coulomb["consumption_mode"])
class DeliveredEvidenceTest(unittest.TestCase):
"""RAILIANCE-WP-0016 delivered apps-pg evidence; partial delivery must not