#!/usr/bin/env python3
"""hc51: periksa jadwal batch 6abb59c* (album/reel) — akun mana saja & isinya."""
import json, collections
docs = json.load(open("/tmp/repliz_all_20260930.json"))
b = [d for d in docs if (d.get("_id") or "").startswith("6abb59c")]
print("total batch 6abb59c*:", len(b))
cnt = collections.Counter((d.get("accountId"), d.get("type"), d.get("account", {}).get("name") if isinstance(d.get("account"), dict) else None) for d in b)
for k, v in sorted(cnt.items(), key=lambda x: -x[1]):
    print("  %-30s %-8s %-25s %d" % (k[0], k[1], k[2], v))
print()
print("--- semua jadwal pending semua akun (>= 2026-09-30) ---")
rows = sorted(((d.get("scheduleAt") or "")[:16], d.get("type"), (d.get("account") or {}).get("name") if isinstance(d.get("account"), dict) else d.get("accountId"), (d.get("title") or "")[:50], d.get("_id"))
              for d in docs if (d.get("status") or "") == "pending" and (d.get("scheduleAt") or "") >= "2026-09-30")
for r in rows:
    print("  ", r)
print("total pending >=30 Sep:", len(rows))
