Skip to content

Commit a9bb083

Browse files
MiguelMiguel
authored andcommitted
modify readme instructions
1 parent 0acbe78 commit a9bb083

1 file changed

Lines changed: 25 additions & 65 deletions

File tree

README.md

Lines changed: 25 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,42 @@
1-
# Yape Code Challenge :rocket:
1+
## 🚀 Instrucciones para levantar el entorno
22

3-
Our code challenge will let you marvel us with your Jedi coding skills :smile:.
3+
### 1. Crear archivo .env en la raiz
44

5-
Don't forget that the proper way to submit your work is to fork the repo and create a PR :wink: ... have fun !!
5+
POSTGRES_HOST=localhost
6+
POSTGRES_PORT=5432
7+
POSTGRES_USER=postgres
8+
POSTGRES_PASSWORD=postgres
9+
POSTGRES_DB=postgres
610

7-
- [Problem](#problem)
8-
- [Tech Stack](#tech_stack)
9-
- [Send us your challenge](#send_us_your_challenge)
11+
### 2. Instalar las dependencias
1012

11-
# Problem
13+
npm install
1214

13-
Every time a financial transaction is created it must be validated by our anti-fraud microservice and then the same service sends a message back to update the transaction status.
14-
For now, we have only three transaction statuses:
15+
# o
1516

16-
<ol>
17-
<li>pending</li>
18-
<li>approved</li>
19-
<li>rejected</li>
20-
</ol>
17+
yarn install
2118

22-
Every transaction with a value greater than 1000 should be rejected.
19+
### 3. Levantar los servicios de base de datos, zookeeper y kafka
2320

24-
```mermaid
25-
flowchart LR
26-
Transaction -- Save Transaction with pending Status --> transactionDatabase[(Database)]
27-
Transaction --Send transaction Created event--> Anti-Fraud
28-
Anti-Fraud -- Send transaction Status Approved event--> Transaction
29-
Anti-Fraud -- Send transaction Status Rejected event--> Transaction
30-
Transaction -- Update transaction Status event--> transactionDatabase[(Database)]
31-
```
21+
docker-compose up -d
3222

33-
# Tech Stack
23+
### 4. Correr la aplicacion
3424

35-
<ol>
36-
<li>Node. You can use any framework you want (i.e. Nestjs with an ORM like TypeOrm or Prisma) </li>
37-
<li>Any database</li>
38-
<li>Kafka</li>
39-
</ol>
25+
npm run local
4026

41-
We do provide a `Dockerfile` to help you get started with a dev environment.
27+
# o
4228

43-
You must have two resources:
29+
yarn local
4430

45-
1. Resource to create a transaction that must containt:
31+
### 5. Probar los servicios usando los siguientes curl
4632

47-
```json
48-
{
49-
"accountExternalIdDebit": "Guid",
50-
"accountExternalIdCredit": "Guid",
33+
curl --location 'localhost:3000/transaction' \
34+
--header 'Content-Type: application/json' \
35+
--data '{
36+
"accountExternalIdDebit": "5429d629-c239-45fa-8235-1a386258c536",
37+
"accountExternalIdCredit": "d6cd54da-8ce3-4f79-abda-bd5be9b19e68",
5138
"tranferTypeId": 1,
5239
"value": 120
53-
}
54-
```
40+
}'
5541

56-
2. Resource to retrieve a transaction
57-
58-
```json
59-
{
60-
"transactionExternalId": "Guid",
61-
"transactionType": {
62-
"name": ""
63-
},
64-
"transactionStatus": {
65-
"name": ""
66-
},
67-
"value": 120,
68-
"createdAt": "Date"
69-
}
70-
```
71-
72-
## Optional
73-
74-
You can use any approach to store transaction data but you should consider that we may deal with high volume scenarios where we have a huge amount of writes and reads for the same data at the same time. How would you tackle this requirement?
75-
76-
You can use Graphql;
77-
78-
# Send us your challenge
79-
80-
When you finish your challenge, after forking a repository, you **must** open a pull request to our repository. There are no limitations to the implementation, you can follow the programming paradigm, modularization, and style that you feel is the most appropriate solution.
81-
82-
If you have any questions, please let us know.
42+
curl --location 'localhost:3000/transaction/5429d629-c239-45fa-8235-1a386258c536'

0 commit comments

Comments
 (0)