The Transaction Processing Service is a backend application built with Nest.js and TypeScript. It allows you to process transactions, create payables, and provides a means for clients to check their balances.
The service is designed to meet the following requirements:
-
Transaction Processing:
- Receive transaction information, including the transaction value, description, payment method (debit_card or credit_card), card details, and cardholder information.
- Return a list of created transactions, displaying only the last 4 digits of the card number for security.
-
Payables Creation:
- For debit card transactions:
- Create payables with a status of "paid" indicating that the client has received the amount.
- Set the payment date (payment_date) as the transaction creation date (D+0).
- For credit card transactions:
- Create payables with a status of "waiting_funds" indicating that the client will receive the money in the future.
- Set the payment date (payment_date) as the transaction creation date + 30 days (D+30).
- Deduct a processing fee (fee) from the transaction amount:
- 3% fee for debit card transactions.
- 5% fee for credit card transactions.
- For debit card transactions:
-
Balance Inquiry:
- Provide a method for clients to check their balance, displaying:
- Available balance (disponível): The total amount received (payables with status "paid").
- Waiting funds (a receber): The total amount yet to be received (payables with status "waiting_funds").
- Provide a method for clients to check their balance, displaying:
- Nest.js
- TypeScript
- Prisma
- MongoDB
- MongoDB Atlas
To run the service locally, follow these steps:
-
Clone the repository to your local machine.
-
Install the project dependencies:
npm install
-
Start the application:
npm run start
-
The service will be accessible at http://localhost:3000.