192 lines
5.8 KiB
TypeScript
192 lines
5.8 KiB
TypeScript
import { PrismaService } from '../prisma/prisma.service';
|
|
import { CompleteReminderDto, CreateMeetingDto, CreateReminderDto } from './dto/agent.dto';
|
|
export declare class AgentService {
|
|
private readonly prisma;
|
|
constructor(prisma: PrismaService);
|
|
private requireAgent;
|
|
getProfile(agentId: string): Promise<{
|
|
id: string;
|
|
firstName: string;
|
|
lastName: string;
|
|
code: string;
|
|
levelLabel: string;
|
|
nextLevelLabel: string;
|
|
pointsToNext: number;
|
|
levelProgress: number;
|
|
phone: string;
|
|
customersCount: number;
|
|
ordersCount: number;
|
|
salesVolumeToman: number;
|
|
profitToman: number;
|
|
periodLabel: string;
|
|
}>;
|
|
listMyCustomers(agentId: string, q?: string, status?: string): Promise<{
|
|
id: string;
|
|
name: string;
|
|
contactName: string;
|
|
phone: string;
|
|
status: string;
|
|
avatarLetter: string;
|
|
avatarColor: string;
|
|
totalPurchaseToman: number;
|
|
orderCount: number;
|
|
averageOrderToman: number;
|
|
levelLabel: string;
|
|
firstPurchaseDate: string;
|
|
agentCode: string | undefined;
|
|
agentName: string | undefined;
|
|
}[]>;
|
|
getCustomerDetail(agentId: string, customerId: string): Promise<{
|
|
customer: {
|
|
id: string;
|
|
name: string;
|
|
contactName: string;
|
|
phone: string;
|
|
status: string;
|
|
avatarLetter: string;
|
|
avatarColor: string;
|
|
totalPurchaseToman: number;
|
|
orderCount: number;
|
|
averageOrderToman: number;
|
|
levelLabel: string;
|
|
firstPurchaseDate: string;
|
|
agentCode: string | null | undefined;
|
|
agentName: string | undefined;
|
|
};
|
|
orders: {
|
|
id: string;
|
|
customerId: string;
|
|
title: string;
|
|
amountToman: number;
|
|
statusLabel: import("@prisma/client").$Enums.OrderStatus;
|
|
statusTone: "info";
|
|
date: string;
|
|
}[];
|
|
meetings: {
|
|
id: string;
|
|
customerId: string;
|
|
type: import("@prisma/client").$Enums.InteractionType;
|
|
title: string;
|
|
description: string;
|
|
date: string;
|
|
time: string | undefined;
|
|
}[];
|
|
}>;
|
|
createMeeting(agentId: string, dto: CreateMeetingDto): Promise<{
|
|
meeting: {
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
customerId: string;
|
|
agentId: string;
|
|
type: import("@prisma/client").$Enums.InteractionType;
|
|
title: string;
|
|
description: string | null;
|
|
subject: string | null;
|
|
content: string | null;
|
|
date: string;
|
|
time: string | null;
|
|
};
|
|
reminder: {
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
customerId: string;
|
|
title: string;
|
|
description: string | null;
|
|
date: string;
|
|
time: string;
|
|
note: string | null;
|
|
interactionType: import("@prisma/client").$Enums.InteractionType;
|
|
completed: boolean;
|
|
completedAt: Date | null;
|
|
ownerId: string;
|
|
} | null;
|
|
}>;
|
|
listReminders(agentId: string, filter?: string): Promise<{
|
|
id: string;
|
|
customerId: string;
|
|
title: string;
|
|
description: string;
|
|
time: string;
|
|
date: string;
|
|
interactionType: import("@prisma/client").$Enums.InteractionType;
|
|
completed: boolean;
|
|
note: string | undefined;
|
|
customerName: string;
|
|
contactName: string;
|
|
avatarLetter: string;
|
|
avatarColor: string;
|
|
}[]>;
|
|
getReminder(agentId: string, reminderId: string): Promise<{
|
|
reminder: {
|
|
id: string;
|
|
customerId: string;
|
|
title: string;
|
|
description: string;
|
|
time: string;
|
|
date: string;
|
|
interactionType: import("@prisma/client").$Enums.InteractionType;
|
|
completed: boolean;
|
|
note: string | undefined;
|
|
};
|
|
customer: {
|
|
id: string;
|
|
name: string;
|
|
contactName: string;
|
|
phone: string;
|
|
avatarLetter: string;
|
|
avatarColor: string;
|
|
};
|
|
history: {
|
|
id: string;
|
|
type: import("@prisma/client").$Enums.InteractionType;
|
|
title: string;
|
|
description: string;
|
|
date: string;
|
|
}[];
|
|
}>;
|
|
createReminder(agentId: string, dto: CreateReminderDto): Promise<{
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
customerId: string;
|
|
title: string;
|
|
description: string | null;
|
|
date: string;
|
|
time: string;
|
|
note: string | null;
|
|
interactionType: import("@prisma/client").$Enums.InteractionType;
|
|
completed: boolean;
|
|
completedAt: Date | null;
|
|
ownerId: string;
|
|
}>;
|
|
completeReminder(agentId: string, reminderId: string, dto: CompleteReminderDto): Promise<{
|
|
id: string;
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
customerId: string;
|
|
title: string;
|
|
description: string | null;
|
|
date: string;
|
|
time: string;
|
|
note: string | null;
|
|
interactionType: import("@prisma/client").$Enums.InteractionType;
|
|
completed: boolean;
|
|
completedAt: Date | null;
|
|
ownerId: string;
|
|
}>;
|
|
listCategories(): Promise<{
|
|
usage: {
|
|
id: string;
|
|
title: string;
|
|
subtitle: string;
|
|
}[];
|
|
seasons: {
|
|
id: string;
|
|
title: string;
|
|
description: string;
|
|
}[];
|
|
}>;
|
|
}
|