Skip to content

5ylar/scg-nexter-assignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SCG Nexter assignment

Deploy on local docker

docker build -t scg-nexter-assignment . --build-arg CMD=assignment-server
docker run --rm -p 8080:8080 scg-nexter-assignment

API Specs

  • [Search] Multiple search from datasets

Example request

curl --location --request POST 'http://localhost:8080/search/multiple' \
--header 'Content-Type: application/json' \
--data-raw '{
    "keys": [
        "x",
        "X"
    ],
    "dataset": [
        "x",
        "X"
    ],
    "caseSensitive": false
}'

Example success response

HTTP Status 200

    [
        { "key":"x", "positions":[0,1] },
        { "key":"X", "positions":[0,1] }
    ]

 

  • [Cashier] Get currently money in cashier

Example request

curl --location --request GET 'http://localhost:8080/cashier/money'

Example success response

HTTP Status 200

{
    "0.25":50,
    "1":20,
    "10":20,
    "100":15,
    "1000":10,
    "20":30,
    "5":20,
    "50":20,
    "500":20
}

 

  • [Cashier] Add money to cashier

Example request

curl --location --request POST 'http://localhost:8080/cashier/money' \
--header 'Content-Type: application/json' \
--data-raw '{
    "value": 500,
    "amount": 2
}'

Example success response

HTTP Status 200
No content

 

  • [Cashier] Change money

Example request

curl --location --request POST 'http://localhost:8080/cashier/change' \
--header 'Content-Type: application/json' \
--data-raw '{
    "price": 300.50,
    "moneyForBuy": {
        "100.00": 4
    }
}'

Example success response

HTTP Status 200

{
    "0.25": 2,
    "1": 4,
    "20": 2,
    "5": 1,
    "50": 1
}

About

An interview assignment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published