"""Create minimal seed files for SQLMesh staging models that require landing data."""
import gzip
import json
from pathlib import Path

seed = {
    "date": "1970-01-01",
    "captured_at_utc": "1970-01-01T00:00:00Z",
    "venue_count": 0,
    "venues_errored": 0,
    "venues": [],
}
morning = Path("data/landing/playtomic/1970/01/availability_1970-01-01.json.gz")
recheck = Path("data/landing/playtomic/1970/01/availability_1970-01-01_recheck_00.json.gz")
morning.parent.mkdir(parents=True, exist_ok=True)
for p in [morning, recheck]:
    if not p.exists():
        with gzip.open(p, "wt") as f:
            json.dump(seed, f)
        print("created", p)
    else:
        print("exists ", p)
