Hide prices until admin sends the invoice, enforce status transitions, add customer/admin SMS+in-app notifications, schedule cash invoice reminders, and ship updated dist/prisma-client/deploy-bundle for git-pull deploys. Co-authored-by: Cursor <cursoragent@cursor.com>
161 lines
5.9 KiB
TypeScript
161 lines
5.9 KiB
TypeScript
import { PrismaService } from '../prisma/prisma.service';
|
|
import { OrdersService } from '../orders/orders.service';
|
|
export declare class DashboardService {
|
|
private readonly prisma;
|
|
private readonly ordersService;
|
|
constructor(prisma: PrismaService, ordersService: OrdersService);
|
|
getDashboard(): Promise<{
|
|
stats: {
|
|
newOrders: number;
|
|
pendingReview: number;
|
|
pendingCheck: number;
|
|
finalApproval: number;
|
|
todaySales: number;
|
|
todaySalesGrowth: number;
|
|
monthSales: number;
|
|
};
|
|
recentOrders: {
|
|
id: string;
|
|
orderNumber: string;
|
|
userId: string;
|
|
companyId: string;
|
|
companyName: string;
|
|
settlementType: import("@prisma/client").$Enums.SettlementType | null;
|
|
settlementMethod: import("@prisma/client").$Enums.SettlementType | null;
|
|
checkMode: import("@prisma/client").$Enums.CheckRegistrationMode | undefined;
|
|
status: import("@prisma/client").$Enums.OrderStatus;
|
|
adminStatus: string;
|
|
allowedTransitions: import("@prisma/client").$Enums.OrderStatus[];
|
|
totalMeterage: number;
|
|
meterage: number;
|
|
totalAmount: number | null;
|
|
shippingCost: number | null;
|
|
totalDiscount: number | null;
|
|
finalAmount: number | null;
|
|
pricesVisible: boolean;
|
|
notes: string | undefined;
|
|
checkRassDays: number | undefined;
|
|
checkRassDate: string | undefined;
|
|
cashInvoiceExpiresAt: string | undefined;
|
|
createdAt: string;
|
|
updatedAt: string;
|
|
customerName: string;
|
|
customerPhone: string;
|
|
customerNationalId: string | undefined;
|
|
customerType: import("@prisma/client").$Enums.CustomerType;
|
|
items: {
|
|
id: string;
|
|
productId: string | undefined;
|
|
catalogCode: string;
|
|
productName: string;
|
|
productCode: string | undefined;
|
|
color: string;
|
|
requestedMeterage: number;
|
|
confirmedMeterage: number | null;
|
|
unitPrice: number | null;
|
|
supplyPrice: number | null;
|
|
unitDiscount: number | null;
|
|
discount: number | null;
|
|
lineTotal: number | null;
|
|
totalAmount: number | null;
|
|
notes: string | undefined;
|
|
}[];
|
|
checks: {
|
|
id: string;
|
|
orderId: string;
|
|
row: number;
|
|
amount: number;
|
|
dueDate: string;
|
|
sayadId: string | undefined;
|
|
checkNumber: string | undefined;
|
|
ownerNationalId: string | undefined;
|
|
ownerFirstName: string | undefined;
|
|
ownerLastName: string | undefined;
|
|
bankName: string;
|
|
branchName: string | undefined;
|
|
frontImage: string | undefined;
|
|
backImage: string | undefined;
|
|
notes: string | undefined;
|
|
mode: import("@prisma/client").$Enums.CheckRegistrationMode;
|
|
status: import("@prisma/client").$Enums.CheckStatus;
|
|
createdAt: string;
|
|
updatedAt: string;
|
|
}[];
|
|
cashReceipt: {
|
|
id: string;
|
|
amount: number;
|
|
paidAmount: number | null;
|
|
transferDate: string | null;
|
|
transferTime: string | undefined;
|
|
trackingNumber: string | undefined;
|
|
trackingCode: string | undefined;
|
|
destinationAccountId: string | undefined;
|
|
receiptImage: string | undefined;
|
|
notes: string | undefined;
|
|
expiresAt: string | undefined;
|
|
status: import("@prisma/client").$Enums.CashPaymentStatus;
|
|
submittedAt: string | undefined;
|
|
createdAt: string;
|
|
} | undefined;
|
|
shipment: {
|
|
id: string;
|
|
orderId: string;
|
|
carrier: string;
|
|
trackingNumber: string;
|
|
meterage: number;
|
|
status: import("@prisma/client").$Enums.ShipmentStatus;
|
|
shippedAt: string | null;
|
|
deliveredAt: string | null;
|
|
} | undefined;
|
|
statusHistory: {
|
|
id: string;
|
|
fromStatus: import("@prisma/client").$Enums.OrderStatus | null;
|
|
toStatus: import("@prisma/client").$Enums.OrderStatus;
|
|
changedBy: string;
|
|
note: string | undefined;
|
|
reason: string | undefined;
|
|
changedAt: string;
|
|
}[];
|
|
}[];
|
|
salesChartData: number[];
|
|
chartAxisLabels: string[];
|
|
checkDeadlines: {
|
|
id: string;
|
|
label: string;
|
|
tone: "warning" | "danger" | "neutral";
|
|
count: number;
|
|
amount: number;
|
|
}[];
|
|
notifications: {
|
|
id: string;
|
|
title: string;
|
|
body: string;
|
|
tone: import("@prisma/client").$Enums.NotificationTone | null;
|
|
link: string | null;
|
|
isRead: boolean;
|
|
sentAt: string;
|
|
}[];
|
|
messages: {
|
|
id: string;
|
|
senderName: string;
|
|
subject: string;
|
|
preview: string;
|
|
isRead: boolean;
|
|
sentAt: string;
|
|
}[];
|
|
}>;
|
|
getReports(): Promise<{
|
|
reportSalesByCompany: {
|
|
companyName: string;
|
|
orderCount: number;
|
|
totalAmount: number;
|
|
meterage: number;
|
|
}[];
|
|
reportOrdersByStatus: {
|
|
status: string;
|
|
count: number;
|
|
}[];
|
|
}>;
|
|
private buildCheckDeadlines;
|
|
}
|