feat: implement dispensing module with transaction-safe stock management, FEFO allocation, and H1 compliance reporting

This commit is contained in:
2026-08-19 11:05:04 +05:30
parent fd77985cf9
commit ea49fe800f
32 changed files with 1150 additions and 53 deletions
+14
View File
@@ -0,0 +1,14 @@
const { Pool } = require('pg');
const pool = new Pool({ connectionString: 'postgres://postgres:csh%402018@localhost:5432/ai_pharmacy' });
async function run() {
try {
await pool.query("UPDATE stock_movements SET reason_code = 'system_recovery', notes = 'Recovered past adjustment' WHERE movement_type = 'adjustment' AND notes IS NULL");
console.log('Successfully updated old adjustments!');
} catch(err) {
console.error(err);
} finally {
pool.end();
}
}
run();