Question
Given the class and data below; Using javascript and mongoose, Implement CRUD actions in your transactionmanager that perform the actions in the database. class Transaction
Given the class and data below;
Using javascript and mongoose, Implement CRUD actions in your transactionmanager that perform the actions in the database.
class Transaction {
constructor(id, date, description, category, amount){
this.id = id; this.date = date;
this.description = description;
this.category = category;
this.amount = amount; }
}
const getTransactions = () => {
const transactions = [];
transactions.push( new Transaction(1, "01/15/23", "jewelry sales", "credit", 350 ));
transactions.push( new Transaction(2, "01/17/23", "old antique sales", "credit", 2000 ));
transactions.push( new Transaction(3, "01/18/23", "product sales", "credit", 4550 ));
transactions.push( new Transaction(4, "01/20/23", "gift", "credit", 170 ));
return transactions; };
module.exports = {
getTransactions
};
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started