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
@@ -0,0 +1,21 @@
/*
Warnings:
- You are about to drop the column `totalPrice` on the `Order_Items` table. All the data in the column will be lost.
- You are about to drop the column `totalPrice` on the `Purchase_Receipt_Items` table. All the data in the column will be lost.
- You are about to drop the column `totalPrice` on the `Sales_Invoice_Items` table. All the data in the column will be lost.
- Added the required column `totalAmount` to the `Order_Items` table without a default value. This is not possible if the table is not empty.
- Added the required column `totalAmount` to the `Purchase_Receipt_Items` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE `Order_Items` DROP COLUMN `totalPrice`,
ADD COLUMN `totalAmount` DECIMAL(15, 2) NOT NULL;
-- AlterTable
ALTER TABLE `Purchase_Receipt_Items` DROP COLUMN `totalPrice`,
ADD COLUMN `totalAmount` DECIMAL(15, 2) NOT NULL;
-- AlterTable
ALTER TABLE `Sales_Invoice_Items` DROP COLUMN `totalPrice`,
ADD COLUMN `totalAmount` DECIMAL(15, 2) NOT NULL DEFAULT 0.00;