/**
 * 악성채권 추심관리 목록 페이지
 *
 * 경로: /accounting/bad-debt-collection
 * API:
 *   - GET /api/v1/bad-debts - 악성채권 목록
 *   - GET /api/v1/bad-debts/summary - 통계 정보
 */

import { BadDebtCollection } from '@/components/accounting/BadDebtCollection';
import { getBadDebts, getBadDebtSummary } from '@/components/accounting/BadDebtCollection/actions';

export default async function BadDebtCollectionPage() {
  // 서버에서 데이터 병렬 조회
  const [badDebts, summary] = await Promise.all([
    getBadDebts({ size: 100 }),
    getBadDebtSummary(),
  ]);

  console.log('[BadDebtPage] Data count:', badDebts.length);
  console.log('[BadDebtPage] Summary:', summary);

  return (
    <BadDebtCollection
      initialData={badDebts}
      initialSummary={summary}
    />
  );
}
