feat: add core backend modules, inventory services, and patch scripts for AI Pharmacy API

This commit is contained in:
2026-09-15 11:15:15 +05:30
parent 22a03043ea
commit 1f9378d96c
41 changed files with 1413 additions and 130 deletions
+23
View File
@@ -0,0 +1,23 @@
const { pool } = require('./src/db/pool');
async function deleteInventory() {
const client = await pool.connect();
try {
await client.query('BEGIN');
await client.query('DELETE FROM inventory_adjustments;');
await client.query('DELETE FROM stock_movements;');
await client.query('DELETE FROM batches;');
await client.query('COMMIT');
console.log("Successfully deleted all inventory data (batches, stock_movements, inventory_adjustments).");
} catch (err) {
await client.query('ROLLBACK');
console.error("Error deleting data:", err);
} finally {
client.release();
process.exit();
}
}
deleteInventory();