You are on page 1of 4

Aplikasi e-wallet enigma

Database My SQL

Ketentuan :
1. Point penilaian : - Applikasi Run Well : 40 %
- Unit Testing : 30 % (code coverage minimum 70 %)
- Method, Swagger, Dockerfile etc : 30 %

2. waktu pengerjaan 07:00 - 13:00


3. Penilaian dilakukan secara langsung oleh trainer dan co-trainer

1. Account
No Method Url Description

1 GET /account/{accountNumber} Get account by account number


field status 0 (Active)
result Http 2000: field status 1 (Not Active)
{
“id” : 1, If not found:
“account” : “234343”, {
“name” : “Aldy”, "timestamp": "2020-03-06T13:20:20.456+0000",
“balance” : 300000.0, "status": 404,
“point” : 1000.0
"message": "accout 234343 Not Found",
“status” : 0
} "path": "/account/234343"
}

2 GET /account/search?name=Aldy Get account by name

result : If not found:


{ {
“id” : 1, "timestamp": "2020-03-06T13:20:20.456+0000",
“account” : “234343”, "status": 404,
“name” : “Aldy”,
"message": "name Aldy Not Found",
“balance” : 300000.0,
“point” : 1000.0 "path": "/account/search?name=Aldy"
“status” : 0 }
}

3 POST /account Create Account

Body if Error
{
{ "timestamp": "2020-03-06T13:20:20.456+0000",
“account” : “234343”, "status": 400,
“name” : “Bara”,
"message": "Name Mandatory",
“balance” : 300000.0
} "path": "/account"
}
account : mandatory with length 6 Numeric
name : mandatory with length minimum 5 {
balance : mandatory with minimum 1.000.000 "timestamp": "2020-03-06T13:20:20.456+0000",
"status": 400,
"message": "insufience balance",
"path": "/account"
}

4 PUT /account/balance Update Balance


If not found :
{ {
“account” : “234343”, "timestamp": "2020-03-06T13:20:20.456+0000",
“balance” : 300000.0 "status": 404,
}
"message": "account 234343 Not Found",
account : mandatory with length 6 Numeric "path": "/account/balance"
balance : mandatory with minimum 10.000 }

{
"timestamp": "2020-03-06T13:20:20.456+0000",
"status": 400,
"message": "Insufience balance",
"path": "/account/balance"
}

if account not active (status = 1)


{
"timestamp": "2020-03-06T13:20:20.456+0000",
"status": 400,
"message": "account not active",
"path": "/account/balance"
}

5 PUT /account/status Update Balance


If not found :
{ {
“account” : “234343”, "timestamp": "2020-03-06T13:20:20.456+0000",
“status” : 1 "status": 404,
}
"message": "account 234343 Not Found",
1d : mandatory "path": "/account/balance"
status : mandatory with value 0 or 1 }

if status not equals 0 or 1


{
"timestamp": "2020-03-06T13:20:20.456+0000",
"status": 400,
"message": "Status not deviine",
"path": "/account/balance"
}

if account not active (status = 1)


{
"timestamp": "2020-03-06T13:20:20.456+0000",
"status": 400,
"message": "account not active",
"path": "/account/balance"
}

Transaction
1. Add Balance
2. Transfer
3. Point To Balance
4. Beli Pulsa
No Method Url Description

1 Get /trancaction/search?account={accountNumber}? Get List of Transaction on specified date an account


date={ddmmyyyy}
[ type :
{ 1. balance
“transactionId” : 1, 2. transfer
“transactionDate” : “10-10-2020”, 3. point
“type” : “balance”, 4. pulsa
“from” : “857465”,
“to” : “”,
“amount” : 300000.0,
“description” : “add balance”,
},
{
“transactionId” : 2,
“transactionDate” : “10-10-2020”,
“type” : “transfer”,
“from” : “857465”,
“to” : “876453”,
“amount” : 300000.0,
“description” : “buat jajan”,
},
{
“transactionId” : 3,
“transactionDate” : “10-10-2020”,
“type” : “point”,
“from” : “857465”,
“to” : “857465”,
“amount” : 300000.0,
“description” : “point to balance”,
},
{
“transactionId” : 4,
“transactionDate” : “10-10-2020”,
“type” : “point”,
“from” : “857465”,
“to” : “”,
“amount” : 10000.0,
“description” : “081288009115”,
}
]
2 POST /transaction/balance Add balance to specified account

Add Balance if account not found :


{
"account" : "857465", {
"ammount" : 3000000.0 "timestamp": "2020-03-06T13:20:20.456+0000",
} "status": 404,
"message": "Accoount 857465 not found",
"path": "/transaction/balance"
}

if success add balance :


{
"timestamp": "2020-03-06T13:20:20.456+0000",
"status": 200,
"message": "add balance success",
"path": "/transaction/balance"
}

3 POST /transaction/transfer Transfer from one account to another account

transfer if account not found :


{ {
"account" : "857465", "timestamp": "2020-03-06T13:20:20.456+0000",
"to" : "984587", "status": 404,
"amount" : 3000000.0,
"message": "Accoount 857465 not found",
“description” : “Buat jajan”
} "path": "/transaction/transfer"
}

if amount not sufficient


{
"timestamp": "2020-03-06T13:20:20.456+0000",
"status": 400,
"message": "Accoount 857465 not have sufficient
money",
"path": "/transaction/transfer"
}

if success transfer :
{
"timestamp": "2020-03-06T13:20:20.456+0000",
"status": 200,
"message": "tranfer from 857465 to 984587
success",
"path": "/transaction/transfer"
}

4 POST Transfer/point Transfer point to balance


{ if account not found :
"account" : "857465" {
} "timestamp": "2020-03-06T13:20:20.456+0000",
"status": 404,
"message": "Accoount 857465 not found",
"path": "/transaction/transfer"
}

if success transfer :
{
"timestamp": "2020-03-06T13:20:20.456+0000",
"status": 200,
"message": "tranfer point from 857465 success",
"path": "/transaction/point"
}

5 POST /transaction/pulsa

Buy Pulsa if account not found :


{ {
"account" : "857465", "timestamp": "2020-03-06T13:20:20.456+0000",
"amount" : 3000000.0, "status": 404,
“hp” : “081288009115”
"message": "Accoount 857465 not found",
}
"path": "/transaction/transfer"
}
if amount not sufficient
{
"timestamp": "2020-03-06T13:20:20.456+0000",
"status": 400,
"message": "Accoount 857465 not have sufficient
money",
"path": "/transaction/transfer"
}

if success :
Point calculation :
if amount > 10.000 then point 10% of amount
if point > 10.000 then point is 10.000

{
"timestamp": "2020-03-06T13:20:20.456+0000",
"status": 200,
"message": "pulsa to 081288009115 success ,
you got 9.000 point",
"path": "/transaction/pulsa"
}

You might also like