@@ -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';
|
||||
|
||||
@@ -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[];
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
Reference in New Issue
Block a user