feat(statistics): implement top alert stocks, top last sales, top supplier debts, and top selling products endpoints with SQL queries

This commit is contained in:
2026-01-04 13:45:26 +03:30
parent eb6e0e7a0d
commit a2db2daa70
72 changed files with 11934 additions and 2559 deletions
@@ -23,8 +23,8 @@ export class SupplierInvoicesService {
select: {
id: true,
count: true,
fee: true,
total: true,
unitPrice: true,
totalAmount: true,
product: {
select: {
id: true,
@@ -149,6 +149,8 @@ export class SupplierInvoicesService {
async createPayment(invoiceId: number, data: CreateReceiptPaymentDto) {
const { bankAccountId, ...rest } = data
console.log(data)
const payment = await this.prisma.purchaseReceiptPayments.create({
data: {
...rest,