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
+29
View File
@@ -0,0 +1,29 @@
import { pool } from '../src/db/pool';
async function updateManufacturers() {
const mfrs = [
'Cipla Ltd',
'Sun Pharma',
"Dr. Reddy's Laboratories",
'Lupin Ltd',
'Abbott Healthcare',
'Mankind Pharma',
'Alkem Laboratories',
'Torrent Pharma',
'Zydus Healthcare',
'GlaxoSmithKline'
];
const res = await pool.query('SELECT id FROM products');
console.log('Total products in DB:', res.rows.length);
for (let i = 0; i < res.rows.length; i++) {
const mfr = mfrs[i % mfrs.length];
await pool.query('UPDATE products SET manufacturer = $1 WHERE id = $2', [mfr, res.rows[i].id]);
}
console.log('Successfully updated manufacturer for all products in database!');
await pool.end();
}
updateManufacturers().catch(console.error);