Redesign sales goals and forecast with typed targets and live progress.
Match desktop/mobile mockups and compute current amounts, status, and KPIs from real CRM data. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1097,15 +1097,31 @@ export interface CreatePaymentRequest {
|
||||
installmentId?: string | null;
|
||||
}
|
||||
|
||||
export type SalesGoalType =
|
||||
| "sales"
|
||||
| "customer"
|
||||
| "revenue"
|
||||
| "deal"
|
||||
| "activity"
|
||||
| "quality";
|
||||
|
||||
export type SalesGoalStatus = "in_progress" | "completed" | "needs_attention";
|
||||
|
||||
export interface SalesGoalDto {
|
||||
id: string;
|
||||
title: string;
|
||||
type: SalesGoalType | string;
|
||||
periodStart: string;
|
||||
periodEnd: string;
|
||||
targetAmount: number;
|
||||
forecastAmount: number | null;
|
||||
probability: number | null;
|
||||
currency: string;
|
||||
notes: string | null;
|
||||
user: UserSummaryDto | null;
|
||||
currentAmount: number;
|
||||
progressPercent: number;
|
||||
status: SalesGoalStatus;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
@@ -1115,6 +1131,10 @@ export interface CreateSalesGoalRequest {
|
||||
periodStart: string;
|
||||
periodEnd: string;
|
||||
targetAmount: number;
|
||||
type?: SalesGoalType | string;
|
||||
forecastAmount?: number | null;
|
||||
/** 0-100 */
|
||||
probability?: number | null;
|
||||
currency?: string;
|
||||
notes?: string;
|
||||
/** فقط مالک/مدیر؛ در غیر این صورت هدف برای خود کاربر */
|
||||
@@ -1126,11 +1146,24 @@ export interface UpdateSalesGoalRequest {
|
||||
periodStart?: string;
|
||||
periodEnd?: string;
|
||||
targetAmount?: number;
|
||||
type?: SalesGoalType | string;
|
||||
forecastAmount?: number | null;
|
||||
/** 0-100 */
|
||||
probability?: number | null;
|
||||
currency?: string;
|
||||
notes?: string | null;
|
||||
userId?: string | null;
|
||||
}
|
||||
|
||||
export interface SalesForecastKpiDto {
|
||||
key: "sales" | "customer" | "deal" | "forecast";
|
||||
label: string;
|
||||
current: number;
|
||||
target: number;
|
||||
percent: number;
|
||||
unit: "money" | "count";
|
||||
}
|
||||
|
||||
export interface SalesForecastDto {
|
||||
periodStart: string;
|
||||
periodEnd: string;
|
||||
@@ -1141,12 +1174,16 @@ export interface SalesForecastDto {
|
||||
wonAmount: number;
|
||||
/** معاملات باز فعلی */
|
||||
openPipelineAmount: number;
|
||||
/** پیشبینی ساده: تحقق + ۴۰٪ کاریز باز */
|
||||
/** پیشبینی: تحقق + کاریز باز × میانگین احتمال */
|
||||
forecastAmount: number;
|
||||
progressPercent: number | null;
|
||||
openDealsCount: number;
|
||||
wonDealsCount: number;
|
||||
goals: SalesGoalDto[];
|
||||
kpis: SalesForecastKpiDto[];
|
||||
newCustomersCount: number;
|
||||
/** معاملات ایجادشده در بازه */
|
||||
newDealsCount: number;
|
||||
}
|
||||
|
||||
export type TicketStatus =
|
||||
|
||||
Reference in New Issue
Block a user