#!/usr/bin/env python3
"""Lihat jadwal uky ke depan (semua status) untuk cek lane bank/album/fotografi."""
import json
from datetime import datetime, timedelta, timezone

WIB = timezone(timedelta(hours=7))
docs = json.load(open("/tmp/all_schedules.json"))
UKY = "6a334e89c5ff4ce3a3225a48"
rows = []
for d in docs:
    if d.get("accountId") != UKY:
        continue
    sa = d.get("scheduleAt") or ""
    try:
        dt = datetime.fromisoformat(sa.replace("Z", "+00:00")).astimezone(WIB)
    except Exception:
        continue
    if dt >= datetime(2026, 10, 19, tzinfo=WIB):
        rows.append((dt, d))
for dt, d in sorted(rows, key=lambda x: x[0]):
    print(f"{dt:%Y-%m-%d %H:%M} {d.get('status'):8s} {d.get('type'):6s} topic={d.get('topic')!r} :: {(d.get('title') or '')[:60]}")
print("total", len(rows))
