Show DOT# or FRN in Telegram order notifications

Reads dot_number or frn from intake_data and includes in the
notification. DOT orders show DOT#, FCC orders show FRN.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
justin 2026-05-29 15:55:41 -05:00
parent 9579d74d7d
commit da00817174

View file

@ -1282,9 +1282,17 @@ export async function handlePaymentComplete(
const discountLine = discountCents > 0
? `Discount: -$${(discountCents / 100).toFixed(2)} (${order.discount_code || "promo"})\n`
: "";
// Show DOT# or FRN/CORES ID depending on service type
const intake = (typeof order.intake_data === "object" && order.intake_data) || {};
const dotNumber = (intake as any).dot_number || "";
const frn = (intake as any).frn || "";
const idLine = dotNumber ? `DOT#: ${dotNumber}\n`
: frn ? `FRN: ${frn}\n`
: "";
const msg = `💰 NEW ORDER\n\n`
+ `Customer: ${customerName}\n`
+ `Email: ${customerEmail}\n`
+ idLine
+ `Service: ${serviceName}\n`
+ `Total: $${totalDollars}\n`
+ discountLine