v4.0.14概览和日报
CI / verify (pull_request) Waiting to run

This commit is contained in:
2026-09-02 21:11:58 +08:00
parent e5fe8b903a
commit 68a4b7f984
41 changed files with 3815 additions and 1098 deletions
+1
View File
@@ -30,6 +30,7 @@ export * from './fulfillment-provider';
export * from './system-config';
export * from './wecom-bot';
export * from './wecom-message-push';
export * from './wecom-report';
export * from './llm-config';
export * from './knowledge-base';
export * from './legal';
+35
View File
@@ -68,3 +68,38 @@ export interface DeployTriggerResult {
started?: boolean;
message: string;
}
export const DASHBOARD_GRANULARITIES = ['day', 'week', 'month', 'quarter', 'year'] as const;
export type DashboardGranularity = (typeof DASHBOARD_GRANULARITIES)[number];
export type DashboardDateRange = { from: string; to: string };
export type DashboardLineHref =
| 'users'
| 'partners'
| 'stores'
| 'orders'
| 'redeems';
export type DashboardLineUnit = 'count' | 'amount';
export type DashboardLineSeries = {
id: string;
name: string;
values: number[];
};
export type DashboardLineChart = {
key: string;
title: string;
unit: DashboardLineUnit;
href: DashboardLineHref;
series: DashboardLineSeries[];
};
export type DashboardAnalytics = {
granularity: DashboardGranularity;
range: DashboardDateRange;
periods: Array<{ key: string; label: string }>;
charts: DashboardLineChart[];
};
+79
View File
@@ -0,0 +1,79 @@
export const WECOM_REPORT_KINDS = ['daily', 'weekly', 'monthly'] as const;
export type WecomReportKind = (typeof WECOM_REPORT_KINDS)[number];
export const WECOM_REPORT_KIND_LABELS: Record<WecomReportKind, string> = {
daily: '日报',
weekly: '周报',
monthly: '月报',
};
export const WECOM_REPORT_WEEKDAY_OPTIONS: Array<{ value: number; label: string }> = [
{ value: 1, label: '周一' },
{ value: 2, label: '周二' },
{ value: 3, label: '周三' },
{ value: 4, label: '周四' },
{ value: 5, label: '周五' },
{ value: 6, label: '周六' },
{ value: 7, label: '周日' },
];
export type WecomReportStatsDto = {
usersTotal: number;
usersIncrement: number;
partnersTotal: number;
partnersIncrement: number;
storesTotal: number;
storesIncrement: number;
ordersTotal: number;
ordersIncrement: number;
orderAmountTotal: number;
orderAmountIncrement: number;
redeemsTotal: number;
redeemsIncrement: number;
redeemAmountTotal: number;
redeemAmountIncrement: number;
};
export type WecomReportPushDto = {
id: string;
kind: WecomReportKind;
name: string;
webhookUrl: string;
webhookUrlMasked: string;
enabled: boolean;
mentionWecomUserId: string | null;
sendHour: number;
sendMinute: number;
sendWeekday: number;
sendMonthDay: number;
lastSentPeriod: string | null;
lastSentAt: string | null;
createdAt: string;
updatedAt: string;
};
export type UpdateWecomReportPushRequest = {
name?: string;
webhookUrl?: string;
enabled?: boolean;
mentionWecomUserId?: string | null;
sendHour?: number;
sendMinute?: number;
sendWeekday?: number;
sendMonthDay?: number;
};
export type WecomReportPreviewDto = {
kind: WecomReportKind;
periodKey: string;
title: string;
rangeLabel: string;
markdown: string;
stats: WecomReportStatsDto;
};
export type WecomReportSendResultDto = {
ok: boolean;
message: string;
periodKey: string;
};