import { h } from "@stencil/core";
import { convertToLocal } from "../../utils/utils";
import { getAlternateTableCellPart, tableHeadCell } from "../../styles/parts";
export const defaultColumnsKeys = 'created_at,type,id,amount,balance';
export const paymentTransactionTableColumns = {
    created_at: () => (h("th", { part: tableHeadCell, scope: "col", title: "The date and time each transaction was made" }, "Processed On")),
    type: () => (h("th", { part: tableHeadCell, scope: "col", title: "The type of each transaction" }, "Type")),
    id: () => (h("th", { part: tableHeadCell, scope: "col", title: "The unique identifier of each transaction" }, "ID")),
    amount: () => (h("th", { part: tableHeadCell, scope: "col", title: "The dollar amount of each transaction", class: "text-end" }, "Amount")),
    balance: () => (h("th", { part: tableHeadCell, scope: "col", title: "The running total amount of this payment that belongs to you", class: "text-end" }, "Balance")),
    currency: () => (h("th", { part: tableHeadCell, scope: "col", title: "The currency of each transaction" }, "Currency")),
    financial_transaction_id: () => (h("th", { part: tableHeadCell, scope: "col", title: "The unique identifier of the financial transaction associated with the payment balance transaction" }, "Financial Transaction ID")),
    payment_id: () => (h("th", { part: tableHeadCell, scope: "col", title: "The unique identifier of the payment associated with the payment balance transaction" }, "Payment ID")),
    payment_balance_txn_type: () => (h("th", { part: tableHeadCell, scope: "col", title: "The type of the payment balance transaction" }, "Transaction Type")),
    source_id: () => (h("th", { part: tableHeadCell, scope: "col", title: "The unique identifier of the source object associated with the payment balance transaction" }, "Source ID")),
    source_type: () => (h("th", { part: tableHeadCell, scope: "col", title: "The type of the source object associated with the payment balance transaction" }, "Source Type")),
};
export const paymentTransactionTypes = {
    ach_return: "ACH Return",
    ach_return_fee: "ACH Return Fee",
    dispute: "Dispute",
    dispute_fee: "Dispute Fee",
    dispute_fee_refund: "Dispute Fee Refund",
    dispute_refund: "Dispute Refund",
    payment: "Payment",
    payment_fee: "Fee",
    platform_fee: "Platform Fee",
    platform_fee_return: "Platform Fee Return",
    processing_fee: "Processing Fee",
    processing_fee_return: "Processing Fee Return",
    refund: "Refund",
    fee_refund: "Fee Refund",
    application_fee_returned: "Application Fee Returned",
    refund_failure: "Refund Failure",
    void: "Void",
};
export const paymentTransactionTableCells = {
    created_at: (balanceTransaction, index) => (h("td", { part: getAlternateTableCellPart(index) }, h("div", { class: "fw-bold" }, convertToLocal(balanceTransaction.created_at, { showDisplayDate: true })), h("div", { class: "fw-bold" }, convertToLocal(balanceTransaction.created_at, { showTime: true })))),
    type: (balanceTransaction, index) => (h("td", { part: getAlternateTableCellPart(index) }, paymentTransactionTypes[balanceTransaction.payment_balance_txn_type])),
    id: (balanceTransaction, index) => (h("td", { part: getAlternateTableCellPart(index) }, balanceTransaction.id)),
    amount: (balanceTransaction, index) => (h("td", { part: getAlternateTableCellPart(index), class: "text-end" }, balanceTransaction.formattedPaymentAmount(balanceTransaction.amount))),
    balance: (balanceTransaction, index) => (h("td", { part: getAlternateTableCellPart(index), class: "text-end" }, balanceTransaction.formattedPaymentAmount(balanceTransaction.balance))),
    currency: (balanceTransaction, index) => (h("td", { part: getAlternateTableCellPart(index) }, balanceTransaction.currency)),
    financial_transaction_id: (balanceTransaction, index) => (h("td", { part: getAlternateTableCellPart(index) }, balanceTransaction.financial_transaction_id)),
    payment_id: (balanceTransaction, index) => (h("td", { part: getAlternateTableCellPart(index) }, balanceTransaction.payment_id)),
    payment_balance_txn_type: (balanceTransaction, index) => (h("td", { part: getAlternateTableCellPart(index) }, balanceTransaction.payment_balance_txn_type)),
    source_id: (balanceTransaction, index) => (h("td", { part: getAlternateTableCellPart(index) }, balanceTransaction.source_id)),
    source_type: (balanceTransaction, index) => (h("td", { part: getAlternateTableCellPart(index) }, balanceTransaction.source_type)),
};
