Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | 2x 2x 2x | import { ReconciliationHubView } from "../types";
import { CARD_BRANDS } from "../cardBrands";
export type RowKind = "count" | "amount";
export const ACTIVITY_ROWS: { label: string; suffix: string; kind: RowKind }[] = [
{ label: "# of Purchases", suffix: "PurchaseCount", kind: "count" },
{ label: "Purchases (USD)", suffix: "PurchaseAmount", kind: "amount" },
{ label: "# of Refunds", suffix: "RefundCount", kind: "count" },
{ label: "Refund (USD)", suffix: "RefundAmount", kind: "amount" },
{ label: "# of Chargebacks", suffix: "ChargebackCount", kind: "count" },
{ label: "Chargeback (USD)", suffix: "ChargebackAmount", kind: "amount" },
{ label: "# of Chargeback Refunds", suffix: "PreChargebackRefundCount", kind: "count" },
{ label: "Chargeback Refunds (USD)", suffix: "PreChargebackRefundAmount", kind: "amount" },
];
// Per-brand fee field suffix + top-level total field. `brandSuffixes` (when
// present) are summed per brand; `processor` has no per-brand column in the
// view (total only), and "Total Fees Paid" sums interchange+scheme+network.
export const FEE_ROWS: {
label: string;
description?: string;
brandSuffixes: string[] | null;
totalField: keyof ReconciliationHubView;
/** The summary "Total Fees Paid" row: rendered with extra emphasis. */
isTotal?: boolean;
}[] = [
{
label: "Interchange",
description: "Paid to the bank that issued the card (~72% of cost)",
brandSuffixes: ["InterchangeFees"],
totalField: "interchangeFees",
},
{
label: "Scheme fees",
description: "Paid to card network",
brandSuffixes: ["AssessmentFees"],
totalField: "schemeFees",
},
{
label: "Processor fees",
description: "paid to Worldpay (~17%)",
brandSuffixes: null,
totalField: "processorFees",
},
{
label: "Network fees",
brandSuffixes: ["NetworkFees"],
totalField: "networkFees",
},
{
label: "Total Fees Paid",
brandSuffixes: ["InterchangeFees", "AssessmentFees", "NetworkFees"],
totalField: "processorCost",
isTotal: true,
},
];
// Total number of columns including the leading "Cost Type" label column.
export const COLUMN_COUNT = CARD_BRANDS.length + 3; // label + brands + Total + Fees BPS
|