Add page-view analytics, product counters, SSL expiry, and business renewal.
Auto-count storefront page views with 6-month event retention and lifetime counters, track product visit/cart/sale stats, persist SSL cert expiry with daily probes, and support owner titles plus annual contract renewal. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
6cd0b009ef
commit
92601ae729
@@ -92,6 +92,8 @@ export class CartService {
|
||||
data: { quantity: newQuantity },
|
||||
});
|
||||
|
||||
await this.bumpProductCartAdd(variant.storeItem.productId, quantity);
|
||||
|
||||
const refreshed = await this.loadCart(cart.id);
|
||||
return {
|
||||
message: 'Cart item quantity updated',
|
||||
@@ -107,6 +109,8 @@ export class CartService {
|
||||
},
|
||||
});
|
||||
|
||||
await this.bumpProductCartAdd(variant.storeItem.productId, quantity);
|
||||
|
||||
const refreshed = await this.loadCart(cart.id);
|
||||
return {
|
||||
message: 'Item added to cart',
|
||||
@@ -307,6 +311,14 @@ export class CartService {
|
||||
});
|
||||
}
|
||||
|
||||
private async bumpProductCartAdd(productId: bigint, quantity: number) {
|
||||
if (!Number.isFinite(quantity) || quantity <= 0) return;
|
||||
await this.prisma.product.update({
|
||||
where: { id: productId },
|
||||
data: { cartAddCount: { increment: quantity } },
|
||||
});
|
||||
}
|
||||
|
||||
private async loadPurchasableVariant(
|
||||
businessId: bigint,
|
||||
storeItemVariantId: bigint,
|
||||
|
||||
Reference in New Issue
Block a user