Merge pull request #3 from rbkmoney/ft/add-docs

Add use case
This commit is contained in:
Kostya 2020-07-17 18:40:33 +03:00 committed by GitHub
commit 4a1f514ffd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 56 additions and 5 deletions

View File

@ -14,7 +14,9 @@ When analyzing the results, it enriches the data from the storage location servi
### Run
```docker-compose up -d```
1. ```docker-compose up -d```
2. [Simple use case](docs/simple_use_case_1.md)
### Service live at:

View File

@ -148,7 +148,7 @@ services:
- 8991:8022
fraudbusters:
image: rbkmoney/fraudbusters:deea70133e6de41b6a46194b210ae7c3b313a1a8
image: rbkmoney/fraudbusters:9e5546d61d510adb69726c1f6cb3c7a6cc1574f5
hostname: fraudbusters
container_name: fraudbusters
environment:
@ -156,7 +156,6 @@ services:
geo.ip.service.url: "http://columbus:8022/repo"
wb.list.service.url: "http://wblist:8022/v1/wb_list"
clickhouse.db.url: "jdbc:clickhouse://clickhouse:8123/default"
spring.profiles.active: "full-prod"
logging.config: "tmp/logback-test.xml"
clickhouse.db.user: ''
clickhouse.db.password: ''
@ -185,7 +184,7 @@ services:
restart: unless-stopped
fb-management:
image: rbkmoney/fraudbusters-management:8022324b0f39d9da43db1911f5b7565617315a77
image: rbkmoney/fraudbusters-management:4f7a141ac8e1cd4b69841448dfa6be5416f5f7bb
hostname: fb-management
container_name: fb-management
environment:
@ -197,7 +196,7 @@ services:
spring.datasource.url: "jdbc:postgresql://postgres-fb:5432/wblist"
logging.config: "./tmp/logback-test.xml"
management.metrics.binders.jvm.enabled: 'false'
service.validate.payment.url: 'http://fraudbusters:8022/fraud_payment/v1/'
service.payment.url: 'http://fraudbusters:8022/fraud_payment/v1/'
depends_on:
- fraudbusters
- broker

50
docs/simple_use_case_1.md Normal file
View File

@ -0,0 +1,50 @@
## Simple use case
![alt text](../images/fraudbusters_sequence_diagram.png)
1. Check all containers is running
2. Open swagger api http://localhost:8080/fb-management/v1/swagger-ui.html
3. Create new template:
Template:
```
rule:inWhiteList("email")->accept; // Check in white list by email, accept if exist
rule:count("card_token",1444)>=9->decline; // Check count
```
JSON template command:
```
{
"id": "test",
"template": "rule:inWhiteList(\"email\")->accept;rule:count(\"card_token\",1444)>=9->decline;"
}
```
http://localhost:8080/fb-management/v1/swagger-ui.html#/payment-template-command-resource/insertTemplateUsingPOST_1
![alt text](../images/template.jpg)
4. Create reference for party and shop:
JSON template command:
```
[
{
"id": "testRef",
"isDefault": false,
"isGlobal": false,
"partyId": "partyTest",
"shopId": "shopTest",
"templateId": "test"
}
]
```
http://localhost:8080/fb-management/v1/swagger-ui.html#/payment-template-command-resource/insertReferenceUsingPOST_1
![alt text](../images/reference.jpg)
5. Use simple example test https://github.com/rbkmoney/fraudbusters-examples for emulate user
6. Open grafana admin/admin by url http://localhost:3000/d/EAj2Hjwix/antifraud-prod?orgId=1&from=now%2Fy&to=now%2Fy&var-partyId=.&var-shopId=.&var-resultStatus=.&var-email=.&var-maskedPan=.*&var-invoiceId=.&var-bankCountry=.&var-cardToken=4J8vmnlYPwzYzia74fny81&var-fingerprint=.
![alt text](../images/result-grafana.jpg)

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

BIN
images/reference.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

BIN
images/result-grafana.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

BIN
images/template.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB