File size: 412 Bytes
e14bacb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
const AllTransaction = require('../models/AllTransaction');
const logTransaction = async (userId, type, amount, currency, description) => {
try {
const entry = new AllTransaction({
user_id: userId,
type,
amount,
currency,
description
});
await entry.save();
} catch (err) {
console.error("Ledger Logging Failed:", err);
}
};
module.exports = logTransaction;
|