-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-task.txt
More file actions
38 lines (27 loc) · 1.5 KB
/
test-task.txt
File metadata and controls
38 lines (27 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
The main goal of this test task is a develop the application for processing the incoming requests from the 3d-party providers.
The application must have an HTTP URL to receive incoming POST requests.
To receive the incoming POST requests the application must have an HTTP URL endpoint.
Technologies: Golang + Postgres.
Requirements:
1. Processing and saving incoming requests.
Imagine that we have a user with the account balance.
Example of the POST request:
POST /your_url HTTP/1.1
Source-Type: client
Content-Length: 34
Host: 127.0.0.1
Content-Type: application/json
{"state": "win", "amount": "10.15", "transactionId": "some generated identificator"}
Header "Source-Type" could be in 3 types (game, server, payment). This type probably can be extended in the future.
Possible states(win, lost):
1. Win requests must increase the user balance
2. Lost requests must decrease user balance.
Each request (with the same transaction id) must be processed only once.
The decision regarding database architecture and table structure is made to you.
You should know that account balance can't be in a negative value.
The application must be competitive ability.
2. Post-processing
Every N minutes 10 latest odd records must be canceled and balance should be corrected by the application.
Canceled records shouldn't be processed twice.
3. The application should be prepared for running via docker containers.
Please, be informed that application without description about how to run and test it won't be accepted and reviewed.