"use client";

import { PaymentListPage } from "@/modules/payment/components/PaymentListPage";
import { paymentApi } from "@/modules/payment/services/payment-api";

export const PaymentLedger = function PaymentLedgerPage() {
  return (
    <PaymentListPage
      title="دفتر کل"
      description="ثبت‌های دفتر کل مرتبط با تراکنش‌های پرداخت."
      resourceKey="ledger"
      fetcher={(tenantId) => paymentApi.ledger.list(tenantId)}
      filterKey="direction"
      columns={[
        { key: "id", header: "شناسه" },
        { key: "amount_minor", header: "مبلغ (ریال)" },
        { key: "direction", header: "جهت" },
        { key: "status", header: "وضعیت", type: "status" },
        { key: "payment_transaction_id", header: "تراکنش" },
        { key: "created_at", header: "تاریخ", type: "datetime" },
      ]}
    />
  );
};

export default PaymentLedger;
