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
+2 -1
View File
@@ -33,7 +33,7 @@ async function main() {
let sqlOutput = '-- AUTO-GENERATED MYSQL TRIGGER DUMP\n'
sqlOutput += '-- Generated at: ' + new Date().toISOString() + '\n\n'
for (const trg of triggers) {
for (const [index, trg] of triggers.entries()) {
const name = trg.Trigger
console.log(`📥 Extracting trigger: ${name}`)
@@ -42,6 +42,7 @@ async function main() {
const createStatement = rows[0]['SQL Original Statement']
sqlOutput += `-- ------------------------------------------\n`
sqlOutput += `-- index: ${index + 1}\n`
sqlOutput += `-- Trigger: ${name}\n`
sqlOutput += `-- Event: ${trg.Event}\n`
sqlOutput += `-- Table: ${trg.Table}\n`