diff --git a/api/src/email.ts b/api/src/email.ts index a2ebd35..23625f6 100644 --- a/api/src/email.ts +++ b/api/src/email.ts @@ -205,10 +205,10 @@ export async function sendOrderConfirmationEmail(params: OrderConfirmationParams -
+ ${(order_type === "compliance" || order_type === "compliance_batch") ? `
FCC compliance fees are tax deductible as ordinary business expenses under IRC § 162. A formal receipt will be sent separately. -
+ ` : ""}Questions? Reply to this email or reach us at - support@performancewest.net + info@performancewest.net or call 1-888-411-0383.
`; @@ -243,7 +243,7 @@ export async function sendOrderConfirmationEmail(params: OrderConfirmationParams `What happens next:`, ...nextSteps.map((s, i) => `${i + 1}. ${s}`), ``, - `Questions? Email support@performancewest.net or call 1-888-411-0383.`, + `Questions? Email info@performancewest.net or call 1-888-411-0383.`, ``, `Performance West Inc.`, ].join("\n"), diff --git a/api/src/routes/checkout.ts b/api/src/routes/checkout.ts index d11f4e0..913d67b 100644 --- a/api/src/routes/checkout.ts +++ b/api/src/routes/checkout.ts @@ -989,16 +989,19 @@ router.post("/api/v1/checkout/create-session", async (req, res) => { formation: "formation_orders", bundle: "bundle_orders", compliance: "compliance_orders", + compliance_batch: "compliance_orders", }; const table = tableMap[order_type]; if (table) { + // For batch orders, update by batch_id; otherwise by order_number + const whereCol = order_type === "compliance_batch" ? "batch_id" : "order_number"; await pool.query( `UPDATE ${table} SET stripe_session_id = $1, payment_method = $2, surcharge_pct = $3, surcharge_cents = $4 - WHERE order_number = $5`, + WHERE ${whereCol} = $5`, [session.id, payment_method, surcharge_pct, surcharge_cents, order_id], ); } diff --git a/api/src/routes/compliance-orders.ts b/api/src/routes/compliance-orders.ts index 0ed73af..80f0722 100644 --- a/api/src/routes/compliance-orders.ts +++ b/api/src/routes/compliance-orders.ts @@ -925,6 +925,13 @@ router.post("/api/v1/compliance-orders/batch", async (req, res) => { return; } + // At least one paid service required + const hasPaidService = services.some(s => COMPLIANCE_SERVICES[s].price_cents > 0); + if (!hasPaidService) { + res.status(400).json({ error: "At least one paid service is required." }); + return; + } + // Split services into discountable vs non-discountable (e.g., RA services) const discountableServices = services.filter(s => COMPLIANCE_SERVICES[s].discountable); const nonDiscountableServices = services.filter(s => !COMPLIANCE_SERVICES[s].discountable); @@ -965,13 +972,24 @@ router.post("/api/v1/compliance-orders/batch", async (req, res) => { try { const orders: Record