#!/usr/bin/env python3
"""Illustrative constant-headcount GBP expense model; no provider quote or legal gate."""
import json, math

def compare(n=5, months=24, usd_per_gbp=1.25, eor_usd=599, fixed=1200,
            payroll_per_head=35, client_entity_hours=8, client_eor_hours=2,
            hourly_cost=50, setup=6000, transition=3000, overlap_months=1):
    values=locals().copy()
    if any(not isinstance(v,(int,float)) or not math.isfinite(v) or v<0 for v in values.values()):
        raise ValueError("Inputs must be finite, non-negative numbers; unknown is not zero.")
    if usd_per_gbp<=0 or months<=0 or n<1 or int(n)!=n:
        raise ValueError("Positive exchange rate/horizon and whole employees required.")
    external=n*eor_usd/usd_per_gbp
    eor_month=external+client_eor_hours*hourly_cost
    entity_month=fixed+n*payroll_per_head+client_entity_hours*hourly_cost
    oneoff=setup+transition+overlap_months*external # Additional post-cutover service/notice fee; excludes salary and pre-cutover EOR months.
    saving=eor_month-entity_month
    return dict(inputs=values,eor_month=eor_month,entity_month=entity_month,
                oneoff=oneoff,eor_horizon=eor_month*months,
                entity_horizon=entity_month*months+oneoff,
                entity_saving=eor_month*months-entity_month*months-oneoff,
                recovery_months=oneoff/saving if saving>0 else None,
                meaning="Planning expense only. Confirm scope, cash, legal route and employer readiness separately.")

def cases():
    return {"base":compare(),"short_horizon":compare(months=12),
            "higher_operation":compare(fixed=1500),"three_employees":compare(n=3)}

if __name__=="__main__": print(json.dumps(cases(),indent=2))
