diff --git a/api/src/routes/portal.ts b/api/src/routes/portal.ts index 5caa058..a3343a1 100644 --- a/api/src/routes/portal.ts +++ b/api/src/routes/portal.ts @@ -18,7 +18,7 @@ router.use(requireCustomerAuth); router.get("/me", async (req: Request, res: Response) => { const { customerId } = req.customer!; try { - const [custR, ordersR, addrR, dirR] = await Promise.all([ + const [custR, ordersR, complianceR, addrR, dirR] = await Promise.all([ // Customer info pool.query<{ id: number; email: string; name: string; company: string; phone: string }>( `SELECT id, email, name, company, phone FROM customers WHERE id = $1`, @@ -41,6 +41,18 @@ router.get("/me", async (req: Request, res: Response) => { LIMIT 20`, [customerId, req.customer!.email] ), + // Compliance orders (DOT + FCC) + pool.query( + `SELECT order_number, batch_id, service_slug, service_name, + service_fee_cents, discount_cents, discount_code, + surcharge_cents, payment_status, payment_method, + created_at, paid_at + FROM compliance_orders + WHERE customer_email = $1 + ORDER BY created_at DESC + LIMIT 50`, + [req.customer!.email] + ), // Saved addresses pool.query<{ id: number; label: string; street: string; street2: string; @@ -77,6 +89,7 @@ router.get("/me", async (req: Request, res: Response) => { res.json({ customer, orders: ordersR.rows, + compliance_orders: complianceR.rows, addresses: addrR.rows, directors: dirR.rows.map((d) => ({ id: d.id, diff --git a/site/public/portal/dashboard/index.html b/site/public/portal/dashboard/index.html new file mode 100644 index 0000000..3315167 --- /dev/null +++ b/site/public/portal/dashboard/index.html @@ -0,0 +1,406 @@ + + + + + + +My Account | Performance West Inc. + + + + + + + + + + + + + +
+
+ +
+
+ + +
+
+
+

Loading your account...

+
+
+ + + + + + + + + + + + + + + + + + +