fix(E2E): add missing API mocks for invoices stats and portal billing #349

Merged
groombook-engineer[bot] merged 30 commits from fix/gro-693-e2e-fixes into dev 2026-05-04 15:05:40 +00:00
2 changed files with 4 additions and 4 deletions
Showing only changes of commit 81c2e43a1a - Show all commits
+3 -3
View File
@@ -495,9 +495,9 @@ invoicesRouter.get("/stats/summary", async (c) => {
.where(eq(invoices.status, "pending"));
const [refundsResult] = await db
.select({ total: sql<number>`coalesce(sum(tip_cents), 0)` })
.from(invoices)
.where(and(eq(invoices.status, "paid"), sql`${invoices.paidAt} >= ${startOfMonth}`));
.select({ total: sql<number>`coalesce(sum(amount_cents), 0)` })
.from(refunds)
.where(sql`${refunds.createdAt} >= ${startOfMonth}`);
const methodBreakdown = await db
.select({
+1 -1
View File
@@ -169,7 +169,7 @@ export async function getPaymentIntentDetails(
const stripe = getStripeClient();
if (!stripe) return null;
const pi = await stripe.paymentIntents.retrieve(paymentIntentId);
const pi = await stripe.paymentIntents.retrieve(paymentIntentId, { expand: ["payment_method"] });
const cardLast4 = pi.payment_method
? (pi.payment_method as Stripe.PaymentMethod).card?.last4 ?? null
: null;