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
+3 -2
View File
@@ -6,8 +6,9 @@ const pool = new Pool({
async function run() {
try {
await pool.query('ALTER TABLE dispensing_records ADD COLUMN IF NOT EXISTS prescription_id VARCHAR(50)');
console.log('Successfully added prescription_id column.');
await pool.query('ALTER TABLE stock_movements ADD COLUMN IF NOT EXISTS reason_code VARCHAR(100)');
await pool.query('ALTER TABLE stock_movements ADD COLUMN IF NOT EXISTS notes TEXT');
console.log('Successfully added columns.');
} catch (err) {
console.error('Error:', err);
} finally {