Neylanio/Gostack_Challenge2-NodeJS ? reverse-engineered prompt

Reverse engineered prompt

Build me a small Node.js API for tracking transactions, like a simple cash balance app.

I need three routes. GET /transactions should return every transaction saved so far, plus a balance summary with income, outcome, and total. POST /transactions should let me create a new transaction with a title, value, and type, where type is either income or outcome. Each transaction should get its own id automatically. If someone tries to create an outcome transaction that would make the total balance go negative, return a 400 error with a helpful message. PUT /transactions/:id should update an existing transaction using the same fields.

Keep it in TypeScript, and make sure it works with the tests in the project. I want clean, simple code that follows the challenge rules, and if you need to check any current library docs online, go ahead.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab