kba / utils /ledgerLogger.js
ShieldX's picture
Upload 24 files
e14bacb verified
raw
history blame contribute delete
412 Bytes
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;