feat(promo): promo metric event logs and HQ timeline charts (v3.4.13)

Add log_promo_event for scan/attribution/register/order with IP; admin metrics APIs and ECharts on promo detail page.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-06 00:06:52 +08:00
parent 8df0a2bea7
commit 53e0db6a98
15 changed files with 785 additions and 25 deletions
@@ -6,6 +6,8 @@ import { PromoCodeService } from './promo-code.service';
import {
CreatePromoCodeDto,
PromoCodeListQueryDto,
PromoMetricEventsQueryDto,
PromoMetricTimelineQueryDto,
UpdatePromoCodeDto,
UpdatePromoCodeStatusDto,
} from './dto/promo-code.dto';
@@ -39,6 +41,16 @@ export class AdminPromoCodeController {
return this.service.stats(BigInt(id));
}
@Get(':id/metrics/timeline')
metricsTimeline(@Param('id') id: string, @Query() query: PromoMetricTimelineQueryDto) {
return this.service.getMetricsTimeline(BigInt(id), query);
}
@Get(':id/metrics/events')
metricsEvents(@Param('id') id: string, @Query() query: PromoMetricEventsQueryDto) {
return this.service.listMetricEvents(BigInt(id), query);
}
@Get(':id/qrcode')
qrcode(@Param('id') id: string) {
return this.service.getQrcodeUrl(BigInt(id));