Fix cumulative platform cost Stripe double-counting

Split infrastructure vs payment-processing costs. Liquidity burn now
uses infrastructure cash out only (€1,155.20 cumulative) because Stripe
fees are already deducted from net member payments. Total platform cost
(€1,158.24) remains visible for gross-margin economics.
This commit is contained in:
2026-06-22 01:51:53 +02:00
parent fe2174f37a
commit ea2c2c6403
8 changed files with 143 additions and 97 deletions

View File

@@ -46,10 +46,15 @@ class CostEntry:
@dataclass(frozen=True)
class MonthlyPlatformCost:
period: str
platform_cost: Decimal
infrastructure_cost: Decimal
payment_processing_cost: Decimal
active_members: int
gross_revenue: Decimal
@property
def total_platform_cost(self) -> Decimal:
return self.infrastructure_cost + self.payment_processing_cost
@dataclass(frozen=True)
class Budget:
@@ -85,7 +90,9 @@ class EconomicsSnapshot:
currency: str
active_members: int
monthly_revenue: Decimal
monthly_platform_cost: Decimal
monthly_infrastructure_cost: Decimal
monthly_payment_processing_cost: Decimal
monthly_total_platform_cost: Decimal
cost_per_member: Decimal
gross_margin: Decimal
gross_margin_pct: Decimal
@@ -101,7 +108,9 @@ class LiquiditySummary:
through_period: str
initial_budget: Decimal
cumulative_member_payments: Decimal
cumulative_platform_cost: Decimal
cumulative_infrastructure_cost: Decimal
cumulative_payment_processing_cost: Decimal
cumulative_total_platform_cost: Decimal
cumulative_net_liquidity: Decimal
remaining_budget: Decimal
liquidity_status: LiquidityStatus