Add simple report builder with metrics, dimensions, and user/team filters.
This commit is contained in:
@@ -3069,6 +3069,114 @@ export interface ReportsViewFilters {
|
||||
period: string;
|
||||
from?: string;
|
||||
to?: string;
|
||||
/** dashboard | builder */
|
||||
mode?: string;
|
||||
builder?: {
|
||||
metric?: string;
|
||||
dimension?: string;
|
||||
userId?: string;
|
||||
teamId?: string;
|
||||
};
|
||||
}
|
||||
|
||||
/** متریکهای گزارشساز ساده */
|
||||
export type ReportsBuilderMetric =
|
||||
| "won_amount"
|
||||
| "won_count"
|
||||
| "lost_count"
|
||||
| "open_count"
|
||||
| "open_amount"
|
||||
| "activities_done"
|
||||
| "people_created"
|
||||
| "invoice_amount"
|
||||
| "invoice_count";
|
||||
|
||||
export const REPORTS_BUILDER_METRICS: ReportsBuilderMetric[] = [
|
||||
"won_amount",
|
||||
"won_count",
|
||||
"lost_count",
|
||||
"open_count",
|
||||
"open_amount",
|
||||
"activities_done",
|
||||
"people_created",
|
||||
"invoice_amount",
|
||||
"invoice_count",
|
||||
];
|
||||
|
||||
export const REPORTS_BUILDER_METRIC_LABELS: Record<
|
||||
ReportsBuilderMetric,
|
||||
string
|
||||
> = {
|
||||
won_amount: "مبلغ معاملات برنده",
|
||||
won_count: "تعداد معاملات برنده",
|
||||
lost_count: "تعداد معاملات باخته",
|
||||
open_count: "تعداد معاملات باز",
|
||||
open_amount: "مبلغ معاملات باز",
|
||||
activities_done: "فعالیت انجامشده",
|
||||
people_created: "مشتریان جدید",
|
||||
invoice_amount: "مبلغ فاکتور",
|
||||
invoice_count: "تعداد فاکتور",
|
||||
};
|
||||
|
||||
/** ابعاد گروهبندی گزارشساز */
|
||||
export type ReportsBuilderDimension =
|
||||
| "none"
|
||||
| "owner"
|
||||
| "team"
|
||||
| "source"
|
||||
| "stage"
|
||||
| "month"
|
||||
| "status";
|
||||
|
||||
export const REPORTS_BUILDER_DIMENSIONS: ReportsBuilderDimension[] = [
|
||||
"none",
|
||||
"owner",
|
||||
"team",
|
||||
"source",
|
||||
"stage",
|
||||
"month",
|
||||
"status",
|
||||
];
|
||||
|
||||
export const REPORTS_BUILDER_DIMENSION_LABELS: Record<
|
||||
ReportsBuilderDimension,
|
||||
string
|
||||
> = {
|
||||
none: "بدون گروهبندی (جمع کل)",
|
||||
owner: "کاربر / مسئول",
|
||||
team: "تیم",
|
||||
source: "منبع",
|
||||
stage: "مرحله کاریز",
|
||||
month: "ماه",
|
||||
status: "وضعیت معامله",
|
||||
};
|
||||
|
||||
export interface ReportsBuilderQuery {
|
||||
metric: ReportsBuilderMetric;
|
||||
dimension: ReportsBuilderDimension;
|
||||
from?: string;
|
||||
to?: string;
|
||||
userId?: string;
|
||||
teamId?: string;
|
||||
}
|
||||
|
||||
export interface ReportsBuilderRowDto {
|
||||
key: string;
|
||||
label: string;
|
||||
value: number;
|
||||
}
|
||||
|
||||
export interface ReportsBuilderResultDto {
|
||||
metric: ReportsBuilderMetric;
|
||||
metricLabel: string;
|
||||
dimension: ReportsBuilderDimension;
|
||||
dimensionLabel: string;
|
||||
from: string;
|
||||
to: string;
|
||||
currency: string;
|
||||
format: "money" | "number";
|
||||
total: number;
|
||||
rows: ReportsBuilderRowDto[];
|
||||
}
|
||||
|
||||
export interface SavedViewDto {
|
||||
|
||||
Reference in New Issue
Block a user