#!/usr/bin/env python3
"""hc51: daftar akun Repliz + jumlah jadwal pending per akun (dari dump)."""
import json, sys, collections
sys.path.insert(0, "/home/mantapman/.hermes/profiles/atun/workspace")
from repliz_client import ReplizClient, ACC

c = ReplizClient()
d = c.get("/public/account?page=1&limit=100")
accts = d.get("docs") or d.get("data") or []
print("akun:", len(accts))
for a in accts:
    print("  %-26s %-10s %-28s %s" % (a.get("_id"), a.get("platform") or a.get("type"), a.get("name"), a.get("username")))

docs = json.load(open("/tmp/repliz_all_20260930.json"))
pend = collections.Counter(x.get("accountId") for x in docs if (x.get("status") or "") == "pending")
print("\n--- pending per akun (dump) ---")
for a in accts:
    n = pend.get(a.get("_id"), 0)
    if n:
        print("  %-26s %-28s %d" % (a.get("_id"), a.get("name"), n))
print("\nACC.STUDIOSOFT_* :", ACC.STUDIOSOFT_THREADS, ACC.STUDIOSOFT_IG, ACC.STUDIOSOFT_FB, ACC.STUDIOSOFT_LINKEDIN)
