This project has the objective to implement a transaction authorizer
The input line must contain either aaccount object or a transaction object
Account:
{
"account": {
"active-card": "Boolean",
"available-limit": "Number"
}
}
Transaction:
{
"transaction": {
"merchant": "String",
"ammount": "Number",
"time": "FormatedDateTime*"
}
}
FormatedDateTime*: YYYY-MM-ddTHH:mm:ss:SSSz
ex:
{"account": {"active-card": true, "available-limit": 100}}
{"transaction": {"merchant": "Burger King", "amount": 20, "time": "2019-02-13T10:00:00.000Z"}}
{"transaction": {"merchant": "Habbib's", "amount": 90, "time": "2019-02-13T11:00:00.000Z"}}
ex:
{"account":{"active-card":true,"available-limit":100},"violations":[]}
{"account":{"active-card":true,"available-limit":80},"violations":[]}
{"account":{"active-card":true,"available-limit":80},"violations":["insufficient-limit"]}
mvn package
java -jar target/nuchallenge.jar < input/operations
docker build -t nuchallenge .
cat input/operations | docker container run -i nuchallenge
[input/operations] options above could be any file path